From: David Carlton Date: Fri, 27 Jun 2003 21:50:37 +0000 (+0000) Subject: 2003-06-27 David Carlton X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3abe3bc90be798445086f45d9c3723165cc6c893;p=thirdparty%2Fbinutils-gdb.git 2003-06-27 David Carlton * Merge with mainline; tag is carlton_dictionary-20030627-merge. --- diff --git a/COPYING.NEWLIB b/COPYING.NEWLIB index 145e2f026bf..08a9b3a50eb 100644 --- a/COPYING.NEWLIB +++ b/COPYING.NEWLIB @@ -542,7 +542,7 @@ duplicated in all such forms. This file is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -(21) Free Software Foundation LGPL License (i[3456]86-*-linux* targets only) +(21) Free Software Foundation LGPL License (*-linux* targets only) Copyright (C) 1990-1999, 2000, 2001 Free Software Foundation, Inc. @@ -621,7 +621,30 @@ of the software without specific, written prior permission. Hewlett-Packard Company makes no representations about the suitability of this software for any purpose. -(25) Red Hat Incorporated +(25) Henry Spencer (only *-linux targets) + +Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. +This software is not subject to any license of the American Telephone +and Telegraph Company or of the Regents of the University of California. + +Permission is granted to anyone to use this software for any purpose on +any computer system, and to alter it and redistribute it, subject +to the following restrictions: + +1. The author is not responsible for the consequences of use of this + software, no matter how awful, even if they arise from flaws in it. + +2. The origin of this software must not be misrepresented, either by + explicit claim or by omission. Since few users ever read sources, + credits must appear in the documentation. + +3. Altered versions must be plainly marked as such, and must not be + misrepresented as being the original software. Since few users + ever read sources, credits must appear in the documentation. + +4. This notice may not be removed or altered. + +(26) Red Hat Incorporated Unless otherwise stated in each remaining newlib file, the remaining files in the newlib subdirectory default to the following copyright. diff --git a/ChangeLog b/ChangeLog index b5255a001aa..2aceb5d2159 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,115 @@ +2003-06-26 Nathanael Nerode + + * configure.in: Rename 'target_libs' to 'target_libraries'. + Remove useless reference to 'target_libs'. + * configure: Regenerate. + +2003-06-23 Keith Seitz + + * Makefile.tpl: Add maybe-configure-itcl to configure-gdb. + * Makefile.in: Regenerate. + +2003-06-23 Nathanael Nerode + + * Makefile.def: Introduce flags_to_pass. + * Makefile.tpl: Generate BASE_FLAGS_TO_PASS using it. + * Makefile.in: Regenerate. + +2003-06-23 Hans-Peter Nilsson + + * configure.in (noconfigdirs) : Disable target-newlib + and target-libgloss. + : Disable gdb. + : Disable libf2c and ${libgcj}. + * configure: Regenerate. + +2003-06-17 Benjamin Kosnik + + * configure.in: Update testsuite_flags to new location. + * configure. Regenerate. + +2003-06-18 Nathanael Nerode + + * Makefile.tpl: Remove BUILD_CC stuff. + * Makefile.in: Regenerate. + +2003-06-14 H.J. Lu + + * config.guess: Update to 2003-06-12 version. + * config.sub: Update to 2003-06-13 version. + +2003-06-12 Thiemo Seufer + + * MAINTAINERS: Add myself as MIPS co-maintainer. + +2003-06-12 H.J. Lu + + * config.guess: Update to 2003-06-06 version. + * config.sub: Update to 2003-06-06 version. + +2003-06-11 Rainer Orth + + * configure.in: Don't pass --with-stabs for mips*-sgi-irix6*o32. + * configure. Regenerate. + +2003-06-10 Nathanael Nerode + + * configure.in: Disable serial configure by default. + * configure: Regenerate. + * Makefile.tpl: Abolish .NOTPARALLEL. + * Makefile.in: Regenerate. + + * Makefile.tpl: Replace {build,host,target}_canonical by + {build,host,target}. + * Makefile.in: Regenerate. + + * Makefile.tpl: Fix stupid pasto. + * Makefile.in: Regenerate. + +2003-06-09 Nathanael Nerode + + * Makefile.tpl: Remove bogus conditional. + * Makefile.in: Regenerate. + +2003-06-03 Nathanael Nerode + + * Makefile.tpl: Make 'recursive targets' using autogen rather + than shell loop. Remove duplicate 'clean' targets and false + comments. + * Makefile.def: Add systematic dependencies to 'recursive' targets. + Add systematic method of specifying missing targets in subdirs. + Add copyright boilerplate. + * Makefile.in: Regenerate. + * configure.in: Add 'recursive targets' to maybe list. + * configure: Regenerate. + + * Makefile.tpl: Rename [+target+] to [+make_target+]. + * Makefile.def: Rename 'target' to 'make_target'. + +2003-05-30 Nick Clifton + + * README-maintainer-mode: Update URL for locating blessed config + tools. + +2003-05-29 Robert Millan + + * ltconfig: Import this patch and modify for use with current + version of ltconfig: + + 2003-05-21 Bruno Haible + + * libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER): Add support for + GNU/FreeBSD. + +2003-05-28 DJ Delorie + + * Makefile.tpl: Make maybe-check-gcc .PHONY. + * Makefile.in: Regenerate. + +2003-05-28 Jeff Johnston + + * COPYING.NEWLIB: Add license info for newlib/libc/sys/linux/stdlib. + 2003-05-21 DJ Delorie * Makefile.tpl (configure-target-libiberty): Depend only on gcc, not diff --git a/Makefile.in b/Makefile.in index 7511bc057af..9137641c2ca 100644 --- a/Makefile.in +++ b/Makefile.in @@ -26,20 +26,11 @@ VPATH=@srcdir@ build_alias=@build_alias@ -build_cpu=@build_cpu@ -build_vendor=@build_vendor@ -build_os=@build_os@ -build_canonical=@build_cpu@-@build_vendor@-@build_os@ +build=@build@ host_alias=@host_alias@ -host_cpu=@host_cpu@ -host_vendor=@host_vendor@ -host_os=@host_os@ -host_canonical=@host_cpu@-@host_vendor@-@host_os@ +host=@host@ target_alias=@target_alias@ -target_cpu=@target_cpu@ -target_vendor=@target_vendor@ -target_os=@target_os@ -target_canonical=@target_cpu@-@target_vendor@-@target_os@ +target=@target@ program_transform_name = @program_transform_name@ @@ -159,7 +150,6 @@ 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@ @@ -263,7 +253,7 @@ USUAL_AR_FOR_TARGET = ` \ if [ -f $$r/binutils/ar ] ; then \ echo $$r/binutils/ar ; \ else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + if [ '$(host)' = '$(target)' ] ; then \ echo $(AR); \ else \ echo ar | sed '$(program_transform_name)' ; \ @@ -277,7 +267,7 @@ USUAL_AS_FOR_TARGET = ` \ elif [ -f $$r/gcc/xgcc ]; then \ $(CC_FOR_TARGET) -print-prog-name=as ; \ else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + if [ '$(host)' = '$(target)' ] ; then \ echo $(AS); \ else \ echo as | sed '$(program_transform_name)' ; \ @@ -310,7 +300,7 @@ USUAL_DLLTOOL_FOR_TARGET = ` \ if [ -f $$r/binutils/dlltool ] ; then \ echo $$r/binutils/dlltool ; \ else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + if [ '$(host)' = '$(target)' ] ; then \ echo $(DLLTOOL); \ else \ echo dlltool | sed '$(program_transform_name)' ; \ @@ -326,7 +316,7 @@ USUAL_LD_FOR_TARGET = ` \ elif [ -f $$r/gcc/xgcc ]; then \ $(CC_FOR_TARGET) -print-prog-name=ld ; \ else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + if [ '$(host)' = '$(target)' ] ; then \ echo $(LD); \ else \ echo ld | sed '$(program_transform_name)' ; \ @@ -342,7 +332,7 @@ USUAL_NM_FOR_TARGET = ` \ elif [ -f $$r/gcc/xgcc ]; then \ $(CC_FOR_TARGET) -print-prog-name=nm ; \ else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + if [ '$(host)' = '$(target)' ] ; then \ echo $(NM); \ else \ echo nm | sed '$(program_transform_name)' ; \ @@ -354,7 +344,7 @@ USUAL_RANLIB_FOR_TARGET = ` \ if [ -f $$r/binutils/ranlib ] ; then \ echo $$r/binutils/ranlib ; \ else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + if [ '$(host)' = '$(target)' ] ; then \ if [ x'$(RANLIB)' != x ]; then \ echo $(RANLIB); \ else \ @@ -370,7 +360,7 @@ USUAL_WINDRES_FOR_TARGET = ` \ if [ -f $$r/binutils/windres ] ; then \ echo $$r/binutils/windres ; \ else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + if [ '$(host)' = '$(target)' ] ; then \ echo $(WINDRES); \ else \ echo windres | sed '$(program_transform_name)' ; \ @@ -396,47 +386,10 @@ all: all.normal ### # Flags to pass down to all sub-makes. -# Please keep these in alphabetical order. BASE_FLAGS_TO_PASS = \ - "AR_FLAGS=$(AR_FLAGS)" \ - "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ - "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ - "BISON=$(BISON)" \ - "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ - "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ - "CFLAGS=$(CFLAGS)" \ - "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ - "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \ - "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ - "CXXFLAGS=$(CXXFLAGS)" \ - "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \ - "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \ "DESTDIR=$(DESTDIR)" \ - "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \ - "INSTALL=$(INSTALL)" \ - "INSTALL_DATA=$(INSTALL_DATA)" \ - "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ - "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ - "LDFLAGS=$(LDFLAGS)" \ - "LEX=$(LEX)" \ - "LD_FOR_TARGET=$(LD_FOR_TARGET)" \ - "LIBCFLAGS=$(LIBCFLAGS)" \ - "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ - "LIBCXXFLAGS=$(LIBCXXFLAGS)" \ - "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \ - "M4=$(M4)" \ - "MAKE=$(MAKE)" \ - "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ - "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ - "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ "RPATH_ENVVAR=$(RPATH_ENVVAR)" \ - "SHELL=$(SHELL)" \ - "EXPECT=$(EXPECT)" \ - "RUNTEST=$(RUNTEST)" \ - "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ "TARGET_SUBDIR=$(TARGET_SUBDIR)" \ - "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \ - "YACC=$(YACC)" \ "bindir=$(bindir)" \ "datadir=$(datadir)" \ "exec_prefix=$(exec_prefix)" \ @@ -459,7 +412,43 @@ BASE_FLAGS_TO_PASS = \ "gxx_include_dir=$(gxx_include_dir)" \ "gcc_version=$(gcc_version)" \ "gcc_version_trigger=$(gcc_version_trigger)" \ - "target_alias=$(target_alias)" + "target_alias=$(target_alias)" \ + "BISON=$(BISON)" \ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ + "EXPECT=$(EXPECT)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ + "LEX=$(LEX)" \ + "M4=$(M4)" \ + "MAKE=$(MAKE)" \ + "RUNTEST=$(RUNTEST)" \ + "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ + "SHELL=$(SHELL)" \ + "YACC=$(YACC)" \ + "AR_FLAGS=$(AR_FLAGS)" \ + "CFLAGS=$(CFLAGS)" \ + "CXXFLAGS=$(CXXFLAGS)" \ + "LDFLAGS=$(LDFLAGS)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "LIBCXXFLAGS=$(LIBCXXFLAGS)" \ + "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ + "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ + "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ + "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ + "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \ + "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \ + "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \ + "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \ + "LD_FOR_TARGET=$(LD_FOR_TARGET)" \ + "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ + "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \ + "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ + "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ + "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \ + "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" # For any flags above that may contain shell code that varies from one # target library to another. When doing recursive invocations of the @@ -472,7 +461,6 @@ RECURSE_FLAGS = \ # Flags to pass down to most sub-makes, in which we're building with # the host environment. -# If any variables are added here, they must be added to do-*, below. EXTRA_HOST_FLAGS = \ 'AR=$(AR)' \ 'AS=$(AS)' \ @@ -501,7 +489,6 @@ X11_FLAGS_TO_PASS = \ # Flags to pass down to makes which are built with the target environment. # The double $ decreases the length of the command line; the variables # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. -# If any variables are added here, they must be added to do-*, below. EXTRA_TARGET_FLAGS = \ 'AR=$$(AR_FOR_TARGET)' \ 'AS=$$(AS_FOR_TARGET)' \ @@ -523,7 +510,7 @@ TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) # unfortunately needs the native compiler and the target ar and # ranlib. # If any variables are added here, they must be added to do-*, below. -# The HOST_* variables are a special case, which are used for the gcc +# The BUILD_* variables are a special case, which are used for the gcc # cross-building scheme. EXTRA_GCC_FLAGS = \ 'AR=$(AR)' \ @@ -531,7 +518,6 @@ EXTRA_GCC_FLAGS = \ 'CC=$(CC)' \ 'CXX=$(CXX)' \ 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ - 'BUILD_CC=$(CC_FOR_BUILD)' \ 'BUILD_PREFIX=$(BUILD_PREFIX)' \ 'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \ 'NM=$(NM)' \ @@ -636,612 +622,16613 @@ configure-target: \ maybe-configure-target-qthreads \ maybe-configure-target-rda -# This is a list of the targets for which we can do a clean-{target}. -CLEAN_MODULES = \ - clean-ash \ - clean-autoconf \ - clean-automake \ - clean-bash \ - clean-bfd \ - clean-opcodes \ - clean-binutils \ - clean-bison \ - clean-byacc \ - clean-bzip2 \ - clean-dejagnu \ - clean-diff \ - clean-dosutils \ - clean-etc \ - clean-fastjar \ - clean-fileutils \ - clean-findutils \ - clean-find \ - clean-flex \ - clean-gas \ - clean-gawk \ - clean-gettext \ - clean-gnuserv \ - clean-gprof \ - clean-gzip \ - clean-hello \ - clean-indent \ - clean-intl \ - clean-tcl \ - clean-itcl \ - clean-ld \ - clean-libgui \ - clean-libiberty \ - clean-libtool \ - clean-m4 \ - clean-make \ - clean-mmalloc \ - clean-patch \ - clean-perl \ - clean-prms \ - clean-rcs \ - clean-readline \ - clean-release \ - clean-recode \ - clean-sed \ - clean-send-pr \ - clean-shellutils \ - clean-sid \ - clean-sim \ - clean-tar \ - clean-texinfo \ - clean-textutils \ - clean-time \ - clean-uudecode \ - clean-wdiff \ - clean-zip \ - clean-zlib \ - clean-utils - -# All of the target modules that can be cleaned -CLEAN_TARGET_MODULES = \ - clean-target-libstdc++-v3 \ - clean-target-newlib \ - clean-target-libf2c \ - clean-target-libobjc \ - clean-target-winsup \ - clean-target-libgloss \ - clean-target-libiberty \ - clean-target-gperf \ - clean-target-examples \ - clean-target-libffi \ - clean-target-libjava \ - clean-target-zlib \ - clean-target-boehm-gc \ - clean-target-qthreads \ - clean-target-rda - -# All of the x11 modules that can be cleaned -CLEAN_X11_MODULES = \ - clean-gdb \ - clean-expect \ - clean-guile \ - clean-tk \ - clean-tix +# The target built for a native build. +.PHONY: all.normal +all.normal: @all_build_modules@ all-host all-target + +.PHONY: all-host +all-host: maybe-all-gcc \ + maybe-all-ash \ + maybe-all-autoconf \ + maybe-all-automake \ + maybe-all-bash \ + maybe-all-bfd \ + maybe-all-opcodes \ + maybe-all-binutils \ + maybe-all-bison \ + maybe-all-byacc \ + maybe-all-bzip2 \ + maybe-all-dejagnu \ + maybe-all-diff \ + maybe-all-dosutils \ + maybe-all-etc \ + maybe-all-fastjar \ + maybe-all-fileutils \ + maybe-all-findutils \ + maybe-all-find \ + maybe-all-flex \ + maybe-all-gas \ + maybe-all-gawk \ + maybe-all-gettext \ + maybe-all-gnuserv \ + maybe-all-gprof \ + maybe-all-gzip \ + maybe-all-hello \ + maybe-all-indent \ + maybe-all-intl \ + maybe-all-tcl \ + maybe-all-itcl \ + maybe-all-ld \ + maybe-all-libgui \ + maybe-all-libiberty \ + maybe-all-libtool \ + maybe-all-m4 \ + maybe-all-make \ + maybe-all-mmalloc \ + maybe-all-patch \ + maybe-all-perl \ + maybe-all-prms \ + maybe-all-rcs \ + maybe-all-readline \ + maybe-all-release \ + maybe-all-recode \ + maybe-all-sed \ + maybe-all-send-pr \ + maybe-all-shellutils \ + maybe-all-sid \ + maybe-all-sim \ + maybe-all-tar \ + maybe-all-texinfo \ + maybe-all-textutils \ + maybe-all-time \ + maybe-all-uudecode \ + maybe-all-wdiff \ + maybe-all-zip \ + maybe-all-zlib \ + maybe-all-gdb \ + maybe-all-expect \ + maybe-all-guile \ + maybe-all-tk \ + maybe-all-tix \ + maybe-all-libtermcap \ + maybe-all-utils +.PHONY: all-target +all-target: \ + maybe-all-target-libstdc++-v3 \ + maybe-all-target-newlib \ + maybe-all-target-libf2c \ + maybe-all-target-libobjc \ + maybe-all-target-libtermcap \ + maybe-all-target-winsup \ + maybe-all-target-libgloss \ + maybe-all-target-libiberty \ + maybe-all-target-gperf \ + maybe-all-target-examples \ + maybe-all-target-libffi \ + maybe-all-target-libjava \ + maybe-all-target-zlib \ + maybe-all-target-boehm-gc \ + maybe-all-target-qthreads \ + maybe-all-target-rda + +# Do a target for all the subdirectories. A ``make do-X'' will do a +# ``make X'' in all subdirectories (because, in general, there is a +# dependency (below) of X upon do-X, a ``make X'' will also do this, +# but it may do additional work as well). + +.PHONY: do-info +do-info: info-host info-target + +.PHONY: info-host +info-host: maybe-info-gcc \ + maybe-info-ash \ + maybe-info-autoconf \ + maybe-info-automake \ + maybe-info-bash \ + maybe-info-bfd \ + maybe-info-opcodes \ + maybe-info-binutils \ + maybe-info-bison \ + maybe-info-byacc \ + maybe-info-bzip2 \ + maybe-info-dejagnu \ + maybe-info-diff \ + maybe-info-dosutils \ + maybe-info-etc \ + maybe-info-fastjar \ + maybe-info-fileutils \ + maybe-info-findutils \ + maybe-info-find \ + maybe-info-flex \ + maybe-info-gas \ + maybe-info-gawk \ + maybe-info-gettext \ + maybe-info-gnuserv \ + maybe-info-gprof \ + maybe-info-gzip \ + maybe-info-hello \ + maybe-info-indent \ + maybe-info-intl \ + maybe-info-tcl \ + maybe-info-itcl \ + maybe-info-ld \ + maybe-info-libgui \ + maybe-info-libiberty \ + maybe-info-libtool \ + maybe-info-m4 \ + maybe-info-make \ + maybe-info-mmalloc \ + maybe-info-patch \ + maybe-info-perl \ + maybe-info-prms \ + maybe-info-rcs \ + maybe-info-readline \ + maybe-info-release \ + maybe-info-recode \ + maybe-info-sed \ + maybe-info-send-pr \ + maybe-info-shellutils \ + maybe-info-sid \ + maybe-info-sim \ + maybe-info-tar \ + maybe-info-texinfo \ + maybe-info-textutils \ + maybe-info-time \ + maybe-info-uudecode \ + maybe-info-wdiff \ + maybe-info-zip \ + maybe-info-zlib \ + maybe-info-gdb \ + maybe-info-expect \ + maybe-info-guile \ + maybe-info-tk \ + maybe-info-tix \ + maybe-info-libtermcap \ + maybe-info-utils + +.PHONY: info-target +info-target: \ + maybe-info-target-libstdc++-v3 \ + maybe-info-target-newlib \ + maybe-info-target-libf2c \ + maybe-info-target-libobjc \ + maybe-info-target-libtermcap \ + maybe-info-target-winsup \ + maybe-info-target-libgloss \ + maybe-info-target-libiberty \ + maybe-info-target-gperf \ + maybe-info-target-examples \ + maybe-info-target-libffi \ + maybe-info-target-libjava \ + maybe-info-target-zlib \ + maybe-info-target-boehm-gc \ + maybe-info-target-qthreads \ + maybe-info-target-rda + +# GCC, the eternal special case +.PHONY: maybe-info-gcc info-gcc +maybe-info-gcc: +info-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-info-ash info-ash +maybe-info-ash: + +info-ash: \ + configure-ash + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-autoconf info-autoconf +maybe-info-autoconf: + +info-autoconf: \ + configure-autoconf + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-automake info-automake +maybe-info-automake: + +info-automake: \ + configure-automake + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-bash info-bash +maybe-info-bash: + +info-bash: \ + configure-bash + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-bfd info-bfd +maybe-info-bfd: + +info-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-opcodes info-opcodes +maybe-info-opcodes: + +info-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-binutils info-binutils +maybe-info-binutils: + +info-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-bison info-bison +maybe-info-bison: + +info-bison: \ + configure-bison + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-byacc info-byacc +maybe-info-byacc: + +info-byacc: \ + configure-byacc + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-bzip2 info-bzip2 +maybe-info-bzip2: + +info-bzip2: \ + configure-bzip2 + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-dejagnu info-dejagnu +maybe-info-dejagnu: + +info-dejagnu: \ + configure-dejagnu + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-diff info-diff +maybe-info-diff: + +info-diff: \ + configure-diff + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-dosutils info-dosutils +maybe-info-dosutils: + +info-dosutils: \ + configure-dosutils + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-etc info-etc +maybe-info-etc: + +info-etc: \ + configure-etc + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-fastjar info-fastjar +maybe-info-fastjar: + +info-fastjar: \ + configure-fastjar + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-fileutils info-fileutils +maybe-info-fileutils: + +info-fileutils: \ + configure-fileutils + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-findutils info-findutils +maybe-info-findutils: + +info-findutils: \ + configure-findutils + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-find info-find +maybe-info-find: + +info-find: \ + configure-find + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-flex info-flex +maybe-info-flex: + +info-flex: \ + configure-flex + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gas info-gas +maybe-info-gas: + +info-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gawk info-gawk +maybe-info-gawk: + +info-gawk: \ + configure-gawk + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gettext info-gettext +maybe-info-gettext: + +info-gettext: \ + configure-gettext + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gnuserv info-gnuserv +maybe-info-gnuserv: + +info-gnuserv: \ + configure-gnuserv + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gprof info-gprof +maybe-info-gprof: + +info-gprof: \ + configure-gprof + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gzip info-gzip +maybe-info-gzip: + +info-gzip: \ + configure-gzip + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-hello info-hello +maybe-info-hello: + +info-hello: \ + configure-hello + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-indent info-indent +maybe-info-indent: + +info-indent: \ + configure-indent + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-intl info-intl +maybe-info-intl: + +info-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-tcl info-tcl +maybe-info-tcl: + +info-tcl: \ + configure-tcl + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-itcl info-itcl +maybe-info-itcl: + +info-itcl: \ + configure-itcl + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-ld info-ld +maybe-info-ld: + +info-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-libgui info-libgui +maybe-info-libgui: + +info-libgui: \ + configure-libgui + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-libiberty info-libiberty +maybe-info-libiberty: + +info-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-libtool info-libtool +maybe-info-libtool: + +info-libtool: \ + configure-libtool + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-m4 info-m4 +maybe-info-m4: + +info-m4: \ + configure-m4 + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-make info-make +maybe-info-make: + +info-make: \ + configure-make + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-mmalloc info-mmalloc +maybe-info-mmalloc: + +info-mmalloc: \ + configure-mmalloc + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-patch info-patch +maybe-info-patch: + +info-patch: \ + configure-patch + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-perl info-perl +maybe-info-perl: + +info-perl: \ + configure-perl + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-prms info-prms +maybe-info-prms: + +info-prms: \ + configure-prms + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-rcs info-rcs +maybe-info-rcs: + +info-rcs: \ + configure-rcs + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-readline info-readline +maybe-info-readline: + +info-readline: \ + configure-readline + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-release info-release +maybe-info-release: + +info-release: \ + configure-release + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-recode info-recode +maybe-info-recode: + +info-recode: \ + configure-recode + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-sed info-sed +maybe-info-sed: + +info-sed: \ + configure-sed + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-send-pr info-send-pr +maybe-info-send-pr: + +info-send-pr: \ + configure-send-pr + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-shellutils info-shellutils +maybe-info-shellutils: + +info-shellutils: \ + configure-shellutils + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-sid info-sid +maybe-info-sid: + +info-sid: \ + configure-sid + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-sim info-sim +maybe-info-sim: + +info-sim: \ + configure-sim + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-tar info-tar +maybe-info-tar: + +info-tar: \ + configure-tar + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-texinfo info-texinfo +maybe-info-texinfo: + +info-texinfo: \ + configure-texinfo + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-textutils info-textutils +maybe-info-textutils: + +info-textutils: \ + configure-textutils + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-time info-time +maybe-info-time: + +info-time: \ + configure-time + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-uudecode info-uudecode +maybe-info-uudecode: + +info-uudecode: \ + configure-uudecode + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-wdiff info-wdiff +maybe-info-wdiff: + +info-wdiff: \ + configure-wdiff + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-zip info-zip +maybe-info-zip: + +info-zip: \ + configure-zip + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-zlib info-zlib +maybe-info-zlib: + +info-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gdb info-gdb +maybe-info-gdb: + +info-gdb: \ + configure-gdb + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-expect info-expect +maybe-info-expect: + +info-expect: \ + configure-expect + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-guile info-guile +maybe-info-guile: + +info-guile: \ + configure-guile + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-tk info-tk +maybe-info-tk: + +info-tk: \ + configure-tk + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-tix info-tix +maybe-info-tix: + +info-tix: \ + configure-tix + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-libtermcap info-libtermcap +maybe-info-libtermcap: + +info-libtermcap: \ + configure-libtermcap + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libtermcap" ; \ + (cd libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-utils info-utils +maybe-info-utils: + +info-utils: \ + configure-utils + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-info-target-libstdc++-v3 info-target-libstdc++-v3 +maybe-info-target-libstdc++-v3: + +info-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-newlib info-target-newlib +maybe-info-target-newlib: + +info-target-newlib: \ + configure-target-newlib + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libf2c info-target-libf2c +maybe-info-target-libf2c: + +info-target-libf2c: \ + configure-target-libf2c + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libobjc info-target-libobjc +maybe-info-target-libobjc: + +info-target-libobjc: \ + configure-target-libobjc + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libtermcap info-target-libtermcap +maybe-info-target-libtermcap: + +info-target-libtermcap: \ + configure-target-libtermcap + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-winsup info-target-winsup +maybe-info-target-winsup: + +info-target-winsup: \ + configure-target-winsup + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libgloss info-target-libgloss +maybe-info-target-libgloss: + +info-target-libgloss: \ + configure-target-libgloss + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libiberty info-target-libiberty +maybe-info-target-libiberty: + +info-target-libiberty: \ + configure-target-libiberty + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-gperf info-target-gperf +maybe-info-target-gperf: + +info-target-gperf: \ + configure-target-gperf + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-examples info-target-examples +maybe-info-target-examples: + +info-target-examples: \ + configure-target-examples + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libffi info-target-libffi +maybe-info-target-libffi: + +info-target-libffi: \ + configure-target-libffi + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libjava info-target-libjava +maybe-info-target-libjava: + +info-target-libjava: \ + configure-target-libjava + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-zlib info-target-zlib +maybe-info-target-zlib: + +info-target-zlib: \ + configure-target-zlib + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-boehm-gc info-target-boehm-gc +maybe-info-target-boehm-gc: + +info-target-boehm-gc: \ + configure-target-boehm-gc + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-qthreads info-target-qthreads +maybe-info-target-qthreads: + +info-target-qthreads: \ + configure-target-qthreads + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-rda info-target-rda +maybe-info-target-rda: + +info-target-rda: \ + configure-target-rda + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + + +.PHONY: do-dvi +do-dvi: dvi-host dvi-target + +.PHONY: dvi-host +dvi-host: maybe-dvi-gcc \ + maybe-dvi-ash \ + maybe-dvi-autoconf \ + maybe-dvi-automake \ + maybe-dvi-bash \ + maybe-dvi-bfd \ + maybe-dvi-opcodes \ + maybe-dvi-binutils \ + maybe-dvi-bison \ + maybe-dvi-byacc \ + maybe-dvi-bzip2 \ + maybe-dvi-dejagnu \ + maybe-dvi-diff \ + maybe-dvi-dosutils \ + maybe-dvi-etc \ + maybe-dvi-fastjar \ + maybe-dvi-fileutils \ + maybe-dvi-findutils \ + maybe-dvi-find \ + maybe-dvi-flex \ + maybe-dvi-gas \ + maybe-dvi-gawk \ + maybe-dvi-gettext \ + maybe-dvi-gnuserv \ + maybe-dvi-gprof \ + maybe-dvi-gzip \ + maybe-dvi-hello \ + maybe-dvi-indent \ + maybe-dvi-intl \ + maybe-dvi-tcl \ + maybe-dvi-itcl \ + maybe-dvi-ld \ + maybe-dvi-libgui \ + maybe-dvi-libiberty \ + maybe-dvi-libtool \ + maybe-dvi-m4 \ + maybe-dvi-make \ + maybe-dvi-mmalloc \ + maybe-dvi-patch \ + maybe-dvi-perl \ + maybe-dvi-prms \ + maybe-dvi-rcs \ + maybe-dvi-readline \ + maybe-dvi-release \ + maybe-dvi-recode \ + maybe-dvi-sed \ + maybe-dvi-send-pr \ + maybe-dvi-shellutils \ + maybe-dvi-sid \ + maybe-dvi-sim \ + maybe-dvi-tar \ + maybe-dvi-texinfo \ + maybe-dvi-textutils \ + maybe-dvi-time \ + maybe-dvi-uudecode \ + maybe-dvi-wdiff \ + maybe-dvi-zip \ + maybe-dvi-zlib \ + maybe-dvi-gdb \ + maybe-dvi-expect \ + maybe-dvi-guile \ + maybe-dvi-tk \ + maybe-dvi-tix \ + maybe-dvi-libtermcap \ + maybe-dvi-utils + +.PHONY: dvi-target +dvi-target: \ + maybe-dvi-target-libstdc++-v3 \ + maybe-dvi-target-newlib \ + maybe-dvi-target-libf2c \ + maybe-dvi-target-libobjc \ + maybe-dvi-target-libtermcap \ + maybe-dvi-target-winsup \ + maybe-dvi-target-libgloss \ + maybe-dvi-target-libiberty \ + maybe-dvi-target-gperf \ + maybe-dvi-target-examples \ + maybe-dvi-target-libffi \ + maybe-dvi-target-libjava \ + maybe-dvi-target-zlib \ + maybe-dvi-target-boehm-gc \ + maybe-dvi-target-qthreads \ + maybe-dvi-target-rda + +# GCC, the eternal special case +.PHONY: maybe-dvi-gcc dvi-gcc +maybe-dvi-gcc: +dvi-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-dvi-ash dvi-ash +maybe-dvi-ash: + +dvi-ash: \ + configure-ash + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-autoconf dvi-autoconf +maybe-dvi-autoconf: + +dvi-autoconf: \ + configure-autoconf + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-automake dvi-automake +maybe-dvi-automake: + +dvi-automake: \ + configure-automake + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-bash dvi-bash +maybe-dvi-bash: + +dvi-bash: \ + configure-bash + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-bfd dvi-bfd +maybe-dvi-bfd: + +dvi-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-opcodes dvi-opcodes +maybe-dvi-opcodes: + +dvi-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-binutils dvi-binutils +maybe-dvi-binutils: + +dvi-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-bison dvi-bison +maybe-dvi-bison: + +dvi-bison: \ + configure-bison + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-byacc dvi-byacc +maybe-dvi-byacc: + +dvi-byacc: \ + configure-byacc + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-bzip2 dvi-bzip2 +maybe-dvi-bzip2: + +dvi-bzip2: \ + configure-bzip2 + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-dejagnu dvi-dejagnu +maybe-dvi-dejagnu: + +dvi-dejagnu: \ + configure-dejagnu + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-diff dvi-diff +maybe-dvi-diff: + +dvi-diff: \ + configure-diff + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-dosutils dvi-dosutils +maybe-dvi-dosutils: + +dvi-dosutils: \ + configure-dosutils + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-etc dvi-etc +maybe-dvi-etc: + +dvi-etc: \ + configure-etc + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-fastjar dvi-fastjar +maybe-dvi-fastjar: + +dvi-fastjar: \ + configure-fastjar + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-fileutils dvi-fileutils +maybe-dvi-fileutils: + +dvi-fileutils: \ + configure-fileutils + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-findutils dvi-findutils +maybe-dvi-findutils: + +dvi-findutils: \ + configure-findutils + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-find dvi-find +maybe-dvi-find: + +dvi-find: \ + configure-find + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-flex dvi-flex +maybe-dvi-flex: + +dvi-flex: \ + configure-flex + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gas dvi-gas +maybe-dvi-gas: + +dvi-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gawk dvi-gawk +maybe-dvi-gawk: + +dvi-gawk: \ + configure-gawk + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gettext dvi-gettext +maybe-dvi-gettext: + +dvi-gettext: \ + configure-gettext + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gnuserv dvi-gnuserv +maybe-dvi-gnuserv: + +dvi-gnuserv: \ + configure-gnuserv + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gprof dvi-gprof +maybe-dvi-gprof: + +dvi-gprof: \ + configure-gprof + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gzip dvi-gzip +maybe-dvi-gzip: + +dvi-gzip: \ + configure-gzip + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-hello dvi-hello +maybe-dvi-hello: + +dvi-hello: \ + configure-hello + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-indent dvi-indent +maybe-dvi-indent: + +dvi-indent: \ + configure-indent + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-intl dvi-intl +maybe-dvi-intl: + +dvi-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-tcl dvi-tcl +maybe-dvi-tcl: + +dvi-tcl: \ + configure-tcl + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-itcl dvi-itcl +maybe-dvi-itcl: + +dvi-itcl: \ + configure-itcl + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-ld dvi-ld +maybe-dvi-ld: + +dvi-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-libgui dvi-libgui +maybe-dvi-libgui: + +dvi-libgui: \ + configure-libgui + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-libiberty dvi-libiberty +maybe-dvi-libiberty: + +dvi-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-libtool dvi-libtool +maybe-dvi-libtool: + +dvi-libtool: \ + configure-libtool + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-m4 dvi-m4 +maybe-dvi-m4: + +dvi-m4: \ + configure-m4 + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-make dvi-make +maybe-dvi-make: + +dvi-make: \ + configure-make + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-mmalloc dvi-mmalloc +maybe-dvi-mmalloc: + +dvi-mmalloc: \ + configure-mmalloc + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-patch dvi-patch +maybe-dvi-patch: + +dvi-patch: \ + configure-patch + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-perl dvi-perl +maybe-dvi-perl: + +dvi-perl: \ + configure-perl + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-prms dvi-prms +maybe-dvi-prms: + +dvi-prms: \ + configure-prms + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-rcs dvi-rcs +maybe-dvi-rcs: + +dvi-rcs: \ + configure-rcs + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-readline dvi-readline +maybe-dvi-readline: + +dvi-readline: \ + configure-readline + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-release dvi-release +maybe-dvi-release: + +dvi-release: \ + configure-release + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-recode dvi-recode +maybe-dvi-recode: + +dvi-recode: \ + configure-recode + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-sed dvi-sed +maybe-dvi-sed: + +dvi-sed: \ + configure-sed + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-send-pr dvi-send-pr +maybe-dvi-send-pr: + +dvi-send-pr: \ + configure-send-pr + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-shellutils dvi-shellutils +maybe-dvi-shellutils: + +dvi-shellutils: \ + configure-shellutils + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-sid dvi-sid +maybe-dvi-sid: + +dvi-sid: \ + configure-sid + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-sim dvi-sim +maybe-dvi-sim: + +dvi-sim: \ + configure-sim + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-tar dvi-tar +maybe-dvi-tar: + +dvi-tar: \ + configure-tar + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-texinfo dvi-texinfo +maybe-dvi-texinfo: + +dvi-texinfo: \ + configure-texinfo + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-textutils dvi-textutils +maybe-dvi-textutils: + +dvi-textutils: \ + configure-textutils + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-time dvi-time +maybe-dvi-time: + +dvi-time: \ + configure-time + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-uudecode dvi-uudecode +maybe-dvi-uudecode: + +dvi-uudecode: \ + configure-uudecode + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-wdiff dvi-wdiff +maybe-dvi-wdiff: + +dvi-wdiff: \ + configure-wdiff + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-zip dvi-zip +maybe-dvi-zip: + +dvi-zip: \ + configure-zip + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-zlib dvi-zlib +maybe-dvi-zlib: + +dvi-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gdb dvi-gdb +maybe-dvi-gdb: + +dvi-gdb: \ + configure-gdb + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-expect dvi-expect +maybe-dvi-expect: + +dvi-expect: \ + configure-expect + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-guile dvi-guile +maybe-dvi-guile: + +dvi-guile: \ + configure-guile + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-tk dvi-tk +maybe-dvi-tk: + +dvi-tk: \ + configure-tk + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-tix dvi-tix +maybe-dvi-tix: + +dvi-tix: \ + configure-tix + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-libtermcap dvi-libtermcap +maybe-dvi-libtermcap: + +dvi-libtermcap: \ + configure-libtermcap + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libtermcap" ; \ + (cd libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-utils dvi-utils +maybe-dvi-utils: + +dvi-utils: \ + configure-utils + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-dvi-target-libstdc++-v3 dvi-target-libstdc++-v3 +maybe-dvi-target-libstdc++-v3: + +dvi-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-newlib dvi-target-newlib +maybe-dvi-target-newlib: + +dvi-target-newlib: \ + configure-target-newlib + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libf2c dvi-target-libf2c +maybe-dvi-target-libf2c: + +dvi-target-libf2c: \ + configure-target-libf2c + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libobjc dvi-target-libobjc +maybe-dvi-target-libobjc: + +dvi-target-libobjc: \ + configure-target-libobjc + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libtermcap dvi-target-libtermcap +maybe-dvi-target-libtermcap: + +dvi-target-libtermcap: \ + configure-target-libtermcap + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-winsup dvi-target-winsup +maybe-dvi-target-winsup: + +dvi-target-winsup: \ + configure-target-winsup + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libgloss dvi-target-libgloss +maybe-dvi-target-libgloss: + +dvi-target-libgloss: \ + configure-target-libgloss + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libiberty dvi-target-libiberty +maybe-dvi-target-libiberty: + +dvi-target-libiberty: \ + configure-target-libiberty + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-gperf dvi-target-gperf +maybe-dvi-target-gperf: + +dvi-target-gperf: \ + configure-target-gperf + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-examples dvi-target-examples +maybe-dvi-target-examples: + +dvi-target-examples: \ + configure-target-examples + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libffi dvi-target-libffi +maybe-dvi-target-libffi: + +dvi-target-libffi: \ + configure-target-libffi + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libjava dvi-target-libjava +maybe-dvi-target-libjava: + +dvi-target-libjava: \ + configure-target-libjava + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-zlib dvi-target-zlib +maybe-dvi-target-zlib: + +dvi-target-zlib: \ + configure-target-zlib + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-boehm-gc dvi-target-boehm-gc +maybe-dvi-target-boehm-gc: + +dvi-target-boehm-gc: \ + configure-target-boehm-gc + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-qthreads dvi-target-qthreads +maybe-dvi-target-qthreads: + +dvi-target-qthreads: \ + configure-target-qthreads + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-rda dvi-target-rda +maybe-dvi-target-rda: + +dvi-target-rda: \ + configure-target-rda + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + + +.PHONY: do-TAGS +do-TAGS: TAGS-host TAGS-target + +.PHONY: TAGS-host +TAGS-host: maybe-TAGS-gcc \ + maybe-TAGS-ash \ + maybe-TAGS-autoconf \ + maybe-TAGS-automake \ + maybe-TAGS-bash \ + maybe-TAGS-bfd \ + maybe-TAGS-opcodes \ + maybe-TAGS-binutils \ + maybe-TAGS-bison \ + maybe-TAGS-byacc \ + maybe-TAGS-bzip2 \ + maybe-TAGS-dejagnu \ + maybe-TAGS-diff \ + maybe-TAGS-dosutils \ + maybe-TAGS-etc \ + maybe-TAGS-fastjar \ + maybe-TAGS-fileutils \ + maybe-TAGS-findutils \ + maybe-TAGS-find \ + maybe-TAGS-flex \ + maybe-TAGS-gas \ + maybe-TAGS-gawk \ + maybe-TAGS-gettext \ + maybe-TAGS-gnuserv \ + maybe-TAGS-gprof \ + maybe-TAGS-gzip \ + maybe-TAGS-hello \ + maybe-TAGS-indent \ + maybe-TAGS-intl \ + maybe-TAGS-tcl \ + maybe-TAGS-itcl \ + maybe-TAGS-ld \ + maybe-TAGS-libgui \ + maybe-TAGS-libiberty \ + maybe-TAGS-libtool \ + maybe-TAGS-m4 \ + maybe-TAGS-make \ + maybe-TAGS-mmalloc \ + maybe-TAGS-patch \ + maybe-TAGS-perl \ + maybe-TAGS-prms \ + maybe-TAGS-rcs \ + maybe-TAGS-readline \ + maybe-TAGS-release \ + maybe-TAGS-recode \ + maybe-TAGS-sed \ + maybe-TAGS-send-pr \ + maybe-TAGS-shellutils \ + maybe-TAGS-sid \ + maybe-TAGS-sim \ + maybe-TAGS-tar \ + maybe-TAGS-texinfo \ + maybe-TAGS-textutils \ + maybe-TAGS-time \ + maybe-TAGS-uudecode \ + maybe-TAGS-wdiff \ + maybe-TAGS-zip \ + maybe-TAGS-zlib \ + maybe-TAGS-gdb \ + maybe-TAGS-expect \ + maybe-TAGS-guile \ + maybe-TAGS-tk \ + maybe-TAGS-tix \ + maybe-TAGS-libtermcap \ + maybe-TAGS-utils + +.PHONY: TAGS-target +TAGS-target: \ + maybe-TAGS-target-libstdc++-v3 \ + maybe-TAGS-target-newlib \ + maybe-TAGS-target-libf2c \ + maybe-TAGS-target-libobjc \ + maybe-TAGS-target-libtermcap \ + maybe-TAGS-target-winsup \ + maybe-TAGS-target-libgloss \ + maybe-TAGS-target-libiberty \ + maybe-TAGS-target-gperf \ + maybe-TAGS-target-examples \ + maybe-TAGS-target-libffi \ + maybe-TAGS-target-libjava \ + maybe-TAGS-target-zlib \ + maybe-TAGS-target-boehm-gc \ + maybe-TAGS-target-qthreads \ + maybe-TAGS-target-rda + +# GCC, the eternal special case +.PHONY: maybe-TAGS-gcc TAGS-gcc +maybe-TAGS-gcc: +TAGS-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-TAGS-ash TAGS-ash +maybe-TAGS-ash: + +TAGS-ash: \ + configure-ash + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-autoconf TAGS-autoconf +maybe-TAGS-autoconf: + +TAGS-autoconf: \ + configure-autoconf + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-automake TAGS-automake +maybe-TAGS-automake: + +TAGS-automake: \ + configure-automake + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-bash TAGS-bash +maybe-TAGS-bash: + +TAGS-bash: \ + configure-bash + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-bfd TAGS-bfd +maybe-TAGS-bfd: + +TAGS-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-opcodes TAGS-opcodes +maybe-TAGS-opcodes: + +TAGS-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-binutils TAGS-binutils +maybe-TAGS-binutils: + +TAGS-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-bison TAGS-bison +maybe-TAGS-bison: + +TAGS-bison: \ + configure-bison + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-byacc TAGS-byacc +maybe-TAGS-byacc: + +TAGS-byacc: \ + configure-byacc + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-bzip2 TAGS-bzip2 +maybe-TAGS-bzip2: + +TAGS-bzip2: \ + configure-bzip2 + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-dejagnu TAGS-dejagnu +maybe-TAGS-dejagnu: + +TAGS-dejagnu: \ + configure-dejagnu + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-diff TAGS-diff +maybe-TAGS-diff: + +TAGS-diff: \ + configure-diff + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-dosutils TAGS-dosutils +maybe-TAGS-dosutils: + +TAGS-dosutils: \ + configure-dosutils + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-etc TAGS-etc +maybe-TAGS-etc: + +TAGS-etc: \ + configure-etc + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-fastjar TAGS-fastjar +maybe-TAGS-fastjar: + +TAGS-fastjar: \ + configure-fastjar + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-fileutils TAGS-fileutils +maybe-TAGS-fileutils: + +TAGS-fileutils: \ + configure-fileutils + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-findutils TAGS-findutils +maybe-TAGS-findutils: + +TAGS-findutils: \ + configure-findutils + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-find TAGS-find +maybe-TAGS-find: + +TAGS-find: \ + configure-find + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-flex TAGS-flex +maybe-TAGS-flex: + +TAGS-flex: \ + configure-flex + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gas TAGS-gas +maybe-TAGS-gas: + +TAGS-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gawk TAGS-gawk +maybe-TAGS-gawk: + +TAGS-gawk: \ + configure-gawk + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gettext TAGS-gettext +maybe-TAGS-gettext: + +TAGS-gettext: \ + configure-gettext + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gnuserv TAGS-gnuserv +maybe-TAGS-gnuserv: + +TAGS-gnuserv: \ + configure-gnuserv + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gprof TAGS-gprof +maybe-TAGS-gprof: + +TAGS-gprof: \ + configure-gprof + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gzip TAGS-gzip +maybe-TAGS-gzip: + +TAGS-gzip: \ + configure-gzip + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-hello TAGS-hello +maybe-TAGS-hello: + +TAGS-hello: \ + configure-hello + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-indent TAGS-indent +maybe-TAGS-indent: + +TAGS-indent: \ + configure-indent + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-intl TAGS-intl +maybe-TAGS-intl: + +TAGS-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-tcl TAGS-tcl +maybe-TAGS-tcl: + +TAGS-tcl: \ + configure-tcl + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-itcl TAGS-itcl +maybe-TAGS-itcl: + +TAGS-itcl: \ + configure-itcl + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-ld TAGS-ld +maybe-TAGS-ld: + +TAGS-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-libgui TAGS-libgui +maybe-TAGS-libgui: + +TAGS-libgui: \ + configure-libgui + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-libiberty TAGS-libiberty +maybe-TAGS-libiberty: + +TAGS-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-libtool TAGS-libtool +maybe-TAGS-libtool: + +TAGS-libtool: \ + configure-libtool + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-m4 TAGS-m4 +maybe-TAGS-m4: + +TAGS-m4: \ + configure-m4 + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-make TAGS-make +maybe-TAGS-make: + +TAGS-make: \ + configure-make + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-mmalloc TAGS-mmalloc +maybe-TAGS-mmalloc: + +TAGS-mmalloc: \ + configure-mmalloc + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-patch TAGS-patch +maybe-TAGS-patch: + +TAGS-patch: \ + configure-patch + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-perl TAGS-perl +maybe-TAGS-perl: + +TAGS-perl: \ + configure-perl + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-prms TAGS-prms +maybe-TAGS-prms: + +TAGS-prms: \ + configure-prms + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-rcs TAGS-rcs +maybe-TAGS-rcs: + +TAGS-rcs: \ + configure-rcs + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-readline TAGS-readline +maybe-TAGS-readline: + +TAGS-readline: \ + configure-readline + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-release TAGS-release +maybe-TAGS-release: + +TAGS-release: \ + configure-release + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-recode TAGS-recode +maybe-TAGS-recode: + +TAGS-recode: \ + configure-recode + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-sed TAGS-sed +maybe-TAGS-sed: + +TAGS-sed: \ + configure-sed + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-send-pr TAGS-send-pr +maybe-TAGS-send-pr: + +TAGS-send-pr: \ + configure-send-pr + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-shellutils TAGS-shellutils +maybe-TAGS-shellutils: + +TAGS-shellutils: \ + configure-shellutils + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-sid TAGS-sid +maybe-TAGS-sid: + +TAGS-sid: \ + configure-sid + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-sim TAGS-sim +maybe-TAGS-sim: + +TAGS-sim: \ + configure-sim + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-tar TAGS-tar +maybe-TAGS-tar: + +TAGS-tar: \ + configure-tar + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-texinfo TAGS-texinfo +maybe-TAGS-texinfo: + +TAGS-texinfo: \ + configure-texinfo + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-textutils TAGS-textutils +maybe-TAGS-textutils: + +TAGS-textutils: \ + configure-textutils + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-time TAGS-time +maybe-TAGS-time: + +TAGS-time: \ + configure-time + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-uudecode TAGS-uudecode +maybe-TAGS-uudecode: + +TAGS-uudecode: \ + configure-uudecode + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-wdiff TAGS-wdiff +maybe-TAGS-wdiff: + +TAGS-wdiff: \ + configure-wdiff + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-zip TAGS-zip +maybe-TAGS-zip: + +TAGS-zip: \ + configure-zip + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-zlib TAGS-zlib +maybe-TAGS-zlib: + +TAGS-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gdb TAGS-gdb +maybe-TAGS-gdb: + +TAGS-gdb: \ + configure-gdb + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-expect TAGS-expect +maybe-TAGS-expect: + +TAGS-expect: \ + configure-expect + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-guile TAGS-guile +maybe-TAGS-guile: + +TAGS-guile: \ + configure-guile + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-tk TAGS-tk +maybe-TAGS-tk: + +TAGS-tk: \ + configure-tk + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-tix TAGS-tix +maybe-TAGS-tix: + +TAGS-tix: \ + configure-tix + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-libtermcap TAGS-libtermcap +maybe-TAGS-libtermcap: + +TAGS-libtermcap: \ + configure-libtermcap + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libtermcap" ; \ + (cd libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-utils TAGS-utils +maybe-TAGS-utils: + +TAGS-utils: \ + configure-utils + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-TAGS-target-libstdc++-v3 TAGS-target-libstdc++-v3 +maybe-TAGS-target-libstdc++-v3: + +TAGS-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-newlib TAGS-target-newlib +maybe-TAGS-target-newlib: + +TAGS-target-newlib: \ + configure-target-newlib + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libf2c TAGS-target-libf2c +maybe-TAGS-target-libf2c: + +TAGS-target-libf2c: \ + configure-target-libf2c + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libobjc TAGS-target-libobjc +maybe-TAGS-target-libobjc: + +TAGS-target-libobjc: \ + configure-target-libobjc + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libtermcap TAGS-target-libtermcap +maybe-TAGS-target-libtermcap: + +TAGS-target-libtermcap: \ + configure-target-libtermcap + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-winsup TAGS-target-winsup +maybe-TAGS-target-winsup: + +TAGS-target-winsup: \ + configure-target-winsup + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libgloss TAGS-target-libgloss +maybe-TAGS-target-libgloss: + +TAGS-target-libgloss: \ + configure-target-libgloss + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libiberty TAGS-target-libiberty +maybe-TAGS-target-libiberty: + +TAGS-target-libiberty: \ + configure-target-libiberty + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-gperf TAGS-target-gperf +maybe-TAGS-target-gperf: + +TAGS-target-gperf: \ + configure-target-gperf + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-examples TAGS-target-examples +maybe-TAGS-target-examples: + +TAGS-target-examples: \ + configure-target-examples + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libffi TAGS-target-libffi +maybe-TAGS-target-libffi: + +TAGS-target-libffi: \ + configure-target-libffi + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libjava TAGS-target-libjava +maybe-TAGS-target-libjava: + +TAGS-target-libjava: \ + configure-target-libjava + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-zlib TAGS-target-zlib +maybe-TAGS-target-zlib: + +TAGS-target-zlib: \ + configure-target-zlib + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-boehm-gc TAGS-target-boehm-gc +maybe-TAGS-target-boehm-gc: + +TAGS-target-boehm-gc: \ + configure-target-boehm-gc + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-qthreads TAGS-target-qthreads +maybe-TAGS-target-qthreads: + +TAGS-target-qthreads: \ + configure-target-qthreads + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-rda TAGS-target-rda +maybe-TAGS-target-rda: + +TAGS-target-rda: \ + configure-target-rda + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + + +.PHONY: do-install-info +do-install-info: install-info-host install-info-target + +.PHONY: install-info-host +install-info-host: maybe-install-info-gcc \ + maybe-install-info-ash \ + maybe-install-info-autoconf \ + maybe-install-info-automake \ + maybe-install-info-bash \ + maybe-install-info-bfd \ + maybe-install-info-opcodes \ + maybe-install-info-binutils \ + maybe-install-info-bison \ + maybe-install-info-byacc \ + maybe-install-info-bzip2 \ + maybe-install-info-dejagnu \ + maybe-install-info-diff \ + maybe-install-info-dosutils \ + maybe-install-info-etc \ + maybe-install-info-fastjar \ + maybe-install-info-fileutils \ + maybe-install-info-findutils \ + maybe-install-info-find \ + maybe-install-info-flex \ + maybe-install-info-gas \ + maybe-install-info-gawk \ + maybe-install-info-gettext \ + maybe-install-info-gnuserv \ + maybe-install-info-gprof \ + maybe-install-info-gzip \ + maybe-install-info-hello \ + maybe-install-info-indent \ + maybe-install-info-intl \ + maybe-install-info-tcl \ + maybe-install-info-itcl \ + maybe-install-info-ld \ + maybe-install-info-libgui \ + maybe-install-info-libiberty \ + maybe-install-info-libtool \ + maybe-install-info-m4 \ + maybe-install-info-make \ + maybe-install-info-mmalloc \ + maybe-install-info-patch \ + maybe-install-info-perl \ + maybe-install-info-prms \ + maybe-install-info-rcs \ + maybe-install-info-readline \ + maybe-install-info-release \ + maybe-install-info-recode \ + maybe-install-info-sed \ + maybe-install-info-send-pr \ + maybe-install-info-shellutils \ + maybe-install-info-sid \ + maybe-install-info-sim \ + maybe-install-info-tar \ + maybe-install-info-texinfo \ + maybe-install-info-textutils \ + maybe-install-info-time \ + maybe-install-info-uudecode \ + maybe-install-info-wdiff \ + maybe-install-info-zip \ + maybe-install-info-zlib \ + maybe-install-info-gdb \ + maybe-install-info-expect \ + maybe-install-info-guile \ + maybe-install-info-tk \ + maybe-install-info-tix \ + maybe-install-info-libtermcap \ + maybe-install-info-utils + +.PHONY: install-info-target +install-info-target: \ + maybe-install-info-target-libstdc++-v3 \ + maybe-install-info-target-newlib \ + maybe-install-info-target-libf2c \ + maybe-install-info-target-libobjc \ + maybe-install-info-target-libtermcap \ + maybe-install-info-target-winsup \ + maybe-install-info-target-libgloss \ + maybe-install-info-target-libiberty \ + maybe-install-info-target-gperf \ + maybe-install-info-target-examples \ + maybe-install-info-target-libffi \ + maybe-install-info-target-libjava \ + maybe-install-info-target-zlib \ + maybe-install-info-target-boehm-gc \ + maybe-install-info-target-qthreads \ + maybe-install-info-target-rda + +# GCC, the eternal special case +.PHONY: maybe-install-info-gcc install-info-gcc +maybe-install-info-gcc: +install-info-gcc: \ + configure-gcc \ + info-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-install-info-ash install-info-ash +maybe-install-info-ash: + +install-info-ash: \ + configure-ash \ + info-ash + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-autoconf install-info-autoconf +maybe-install-info-autoconf: + +install-info-autoconf: \ + configure-autoconf \ + info-autoconf + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-automake install-info-automake +maybe-install-info-automake: + +install-info-automake: \ + configure-automake \ + info-automake + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-bash install-info-bash +maybe-install-info-bash: + +install-info-bash: \ + configure-bash \ + info-bash + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-bfd install-info-bfd +maybe-install-info-bfd: + +install-info-bfd: \ + configure-bfd \ + info-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-opcodes install-info-opcodes +maybe-install-info-opcodes: + +install-info-opcodes: \ + configure-opcodes \ + info-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-binutils install-info-binutils +maybe-install-info-binutils: + +install-info-binutils: \ + configure-binutils \ + info-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-bison install-info-bison +maybe-install-info-bison: + +install-info-bison: \ + configure-bison \ + info-bison + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-byacc install-info-byacc +maybe-install-info-byacc: + +install-info-byacc: \ + configure-byacc \ + info-byacc + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-bzip2 install-info-bzip2 +maybe-install-info-bzip2: + +install-info-bzip2: \ + configure-bzip2 \ + info-bzip2 + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-dejagnu install-info-dejagnu +maybe-install-info-dejagnu: + +install-info-dejagnu: \ + configure-dejagnu \ + info-dejagnu + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-diff install-info-diff +maybe-install-info-diff: + +install-info-diff: \ + configure-diff \ + info-diff + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-dosutils install-info-dosutils +maybe-install-info-dosutils: + +install-info-dosutils: \ + configure-dosutils \ + info-dosutils + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-etc install-info-etc +maybe-install-info-etc: + +install-info-etc: \ + configure-etc \ + info-etc + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-fastjar install-info-fastjar +maybe-install-info-fastjar: + +install-info-fastjar: \ + configure-fastjar \ + info-fastjar + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-fileutils install-info-fileutils +maybe-install-info-fileutils: + +install-info-fileutils: \ + configure-fileutils \ + info-fileutils + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-findutils install-info-findutils +maybe-install-info-findutils: + +install-info-findutils: \ + configure-findutils \ + info-findutils + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-find install-info-find +maybe-install-info-find: + +install-info-find: \ + configure-find \ + info-find + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-flex install-info-flex +maybe-install-info-flex: + +install-info-flex: \ + configure-flex \ + info-flex + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gas install-info-gas +maybe-install-info-gas: + +install-info-gas: \ + configure-gas \ + info-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gawk install-info-gawk +maybe-install-info-gawk: + +install-info-gawk: \ + configure-gawk \ + info-gawk + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gettext install-info-gettext +maybe-install-info-gettext: + +install-info-gettext: \ + configure-gettext \ + info-gettext + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gnuserv install-info-gnuserv +maybe-install-info-gnuserv: + +install-info-gnuserv: \ + configure-gnuserv \ + info-gnuserv + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gprof install-info-gprof +maybe-install-info-gprof: + +install-info-gprof: \ + configure-gprof \ + info-gprof + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gzip install-info-gzip +maybe-install-info-gzip: + +install-info-gzip: \ + configure-gzip \ + info-gzip + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-hello install-info-hello +maybe-install-info-hello: + +install-info-hello: \ + configure-hello \ + info-hello + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-indent install-info-indent +maybe-install-info-indent: + +install-info-indent: \ + configure-indent \ + info-indent + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-intl install-info-intl +maybe-install-info-intl: + +install-info-intl: \ + configure-intl \ + info-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-tcl install-info-tcl +maybe-install-info-tcl: + +install-info-tcl: \ + configure-tcl \ + info-tcl + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-itcl install-info-itcl +maybe-install-info-itcl: + +install-info-itcl: \ + configure-itcl \ + info-itcl + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-ld install-info-ld +maybe-install-info-ld: + +install-info-ld: \ + configure-ld \ + info-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-libgui install-info-libgui +maybe-install-info-libgui: + +install-info-libgui: \ + configure-libgui \ + info-libgui + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-libiberty install-info-libiberty +maybe-install-info-libiberty: + +install-info-libiberty: \ + configure-libiberty \ + info-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-libtool install-info-libtool +maybe-install-info-libtool: + +install-info-libtool: \ + configure-libtool \ + info-libtool + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-m4 install-info-m4 +maybe-install-info-m4: + +install-info-m4: \ + configure-m4 \ + info-m4 + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-make install-info-make +maybe-install-info-make: + +install-info-make: \ + configure-make \ + info-make + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-mmalloc install-info-mmalloc +maybe-install-info-mmalloc: + +install-info-mmalloc: \ + configure-mmalloc \ + info-mmalloc + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-patch install-info-patch +maybe-install-info-patch: + +install-info-patch: \ + configure-patch \ + info-patch + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-perl install-info-perl +maybe-install-info-perl: + +install-info-perl: \ + configure-perl \ + info-perl + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-prms install-info-prms +maybe-install-info-prms: + +install-info-prms: \ + configure-prms \ + info-prms + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-rcs install-info-rcs +maybe-install-info-rcs: + +install-info-rcs: \ + configure-rcs \ + info-rcs + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-readline install-info-readline +maybe-install-info-readline: + +install-info-readline: \ + configure-readline \ + info-readline + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-release install-info-release +maybe-install-info-release: + +install-info-release: \ + configure-release \ + info-release + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-recode install-info-recode +maybe-install-info-recode: + +install-info-recode: \ + configure-recode \ + info-recode + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-sed install-info-sed +maybe-install-info-sed: + +install-info-sed: \ + configure-sed \ + info-sed + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-send-pr install-info-send-pr +maybe-install-info-send-pr: + +install-info-send-pr: \ + configure-send-pr \ + info-send-pr + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-shellutils install-info-shellutils +maybe-install-info-shellutils: + +install-info-shellutils: \ + configure-shellutils \ + info-shellutils + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-sid install-info-sid +maybe-install-info-sid: + +install-info-sid: \ + configure-sid \ + info-sid + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-sim install-info-sim +maybe-install-info-sim: + +install-info-sim: \ + configure-sim \ + info-sim + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-tar install-info-tar +maybe-install-info-tar: + +install-info-tar: \ + configure-tar \ + info-tar + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-texinfo install-info-texinfo +maybe-install-info-texinfo: + +install-info-texinfo: \ + configure-texinfo \ + info-texinfo + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-textutils install-info-textutils +maybe-install-info-textutils: + +install-info-textutils: \ + configure-textutils \ + info-textutils + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-time install-info-time +maybe-install-info-time: + +install-info-time: \ + configure-time \ + info-time + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-uudecode install-info-uudecode +maybe-install-info-uudecode: + +install-info-uudecode: \ + configure-uudecode \ + info-uudecode + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-wdiff install-info-wdiff +maybe-install-info-wdiff: + +install-info-wdiff: \ + configure-wdiff \ + info-wdiff + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-zip install-info-zip +maybe-install-info-zip: + +install-info-zip: \ + configure-zip \ + info-zip + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-zlib install-info-zlib +maybe-install-info-zlib: + +install-info-zlib: \ + configure-zlib \ + info-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gdb install-info-gdb +maybe-install-info-gdb: + +install-info-gdb: \ + configure-gdb \ + info-gdb + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-expect install-info-expect +maybe-install-info-expect: + +install-info-expect: \ + configure-expect \ + info-expect + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-guile install-info-guile +maybe-install-info-guile: + +install-info-guile: \ + configure-guile \ + info-guile + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-tk install-info-tk +maybe-install-info-tk: + +install-info-tk: \ + configure-tk \ + info-tk + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-tix install-info-tix +maybe-install-info-tix: + +install-info-tix: \ + configure-tix \ + info-tix + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-libtermcap install-info-libtermcap +maybe-install-info-libtermcap: + +install-info-libtermcap: \ + configure-libtermcap \ + info-libtermcap + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libtermcap" ; \ + (cd libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-utils install-info-utils +maybe-install-info-utils: + +install-info-utils: \ + configure-utils \ + info-utils + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-install-info-target-libstdc++-v3 install-info-target-libstdc++-v3 +maybe-install-info-target-libstdc++-v3: + +install-info-target-libstdc++-v3: \ + configure-target-libstdc++-v3 \ + info-target-libstdc++-v3 + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-newlib install-info-target-newlib +maybe-install-info-target-newlib: + +install-info-target-newlib: \ + configure-target-newlib \ + info-target-newlib + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libf2c install-info-target-libf2c +maybe-install-info-target-libf2c: + +install-info-target-libf2c: \ + configure-target-libf2c \ + info-target-libf2c + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libobjc install-info-target-libobjc +maybe-install-info-target-libobjc: + +install-info-target-libobjc: \ + configure-target-libobjc \ + info-target-libobjc + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libtermcap install-info-target-libtermcap +maybe-install-info-target-libtermcap: + +install-info-target-libtermcap: \ + configure-target-libtermcap \ + info-target-libtermcap + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-winsup install-info-target-winsup +maybe-install-info-target-winsup: + +install-info-target-winsup: \ + configure-target-winsup \ + info-target-winsup + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libgloss install-info-target-libgloss +maybe-install-info-target-libgloss: + +install-info-target-libgloss: \ + configure-target-libgloss \ + info-target-libgloss + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libiberty install-info-target-libiberty +maybe-install-info-target-libiberty: + +install-info-target-libiberty: \ + configure-target-libiberty \ + info-target-libiberty + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-gperf install-info-target-gperf +maybe-install-info-target-gperf: + +install-info-target-gperf: \ + configure-target-gperf \ + info-target-gperf + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-examples install-info-target-examples +maybe-install-info-target-examples: + +install-info-target-examples: \ + configure-target-examples \ + info-target-examples + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libffi install-info-target-libffi +maybe-install-info-target-libffi: + +install-info-target-libffi: \ + configure-target-libffi \ + info-target-libffi + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libjava install-info-target-libjava +maybe-install-info-target-libjava: + +install-info-target-libjava: \ + configure-target-libjava \ + info-target-libjava + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-zlib install-info-target-zlib +maybe-install-info-target-zlib: + +install-info-target-zlib: \ + configure-target-zlib \ + info-target-zlib + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-boehm-gc install-info-target-boehm-gc +maybe-install-info-target-boehm-gc: + +install-info-target-boehm-gc: \ + configure-target-boehm-gc \ + info-target-boehm-gc + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-qthreads install-info-target-qthreads +maybe-install-info-target-qthreads: + +install-info-target-qthreads: \ + configure-target-qthreads \ + info-target-qthreads + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-rda install-info-target-rda +maybe-install-info-target-rda: + +install-info-target-rda: \ + configure-target-rda \ + info-target-rda + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + + +.PHONY: do-installcheck +do-installcheck: installcheck-host installcheck-target + +.PHONY: installcheck-host +installcheck-host: maybe-installcheck-gcc \ + maybe-installcheck-ash \ + maybe-installcheck-autoconf \ + maybe-installcheck-automake \ + maybe-installcheck-bash \ + maybe-installcheck-bfd \ + maybe-installcheck-opcodes \ + maybe-installcheck-binutils \ + maybe-installcheck-bison \ + maybe-installcheck-byacc \ + maybe-installcheck-bzip2 \ + maybe-installcheck-dejagnu \ + maybe-installcheck-diff \ + maybe-installcheck-dosutils \ + maybe-installcheck-etc \ + maybe-installcheck-fastjar \ + maybe-installcheck-fileutils \ + maybe-installcheck-findutils \ + maybe-installcheck-find \ + maybe-installcheck-flex \ + maybe-installcheck-gas \ + maybe-installcheck-gawk \ + maybe-installcheck-gettext \ + maybe-installcheck-gnuserv \ + maybe-installcheck-gprof \ + maybe-installcheck-gzip \ + maybe-installcheck-hello \ + maybe-installcheck-indent \ + maybe-installcheck-intl \ + maybe-installcheck-tcl \ + maybe-installcheck-itcl \ + maybe-installcheck-ld \ + maybe-installcheck-libgui \ + maybe-installcheck-libiberty \ + maybe-installcheck-libtool \ + maybe-installcheck-m4 \ + maybe-installcheck-make \ + maybe-installcheck-mmalloc \ + maybe-installcheck-patch \ + maybe-installcheck-perl \ + maybe-installcheck-prms \ + maybe-installcheck-rcs \ + maybe-installcheck-readline \ + maybe-installcheck-release \ + maybe-installcheck-recode \ + maybe-installcheck-sed \ + maybe-installcheck-send-pr \ + maybe-installcheck-shellutils \ + maybe-installcheck-sid \ + maybe-installcheck-sim \ + maybe-installcheck-tar \ + maybe-installcheck-texinfo \ + maybe-installcheck-textutils \ + maybe-installcheck-time \ + maybe-installcheck-uudecode \ + maybe-installcheck-wdiff \ + maybe-installcheck-zip \ + maybe-installcheck-zlib \ + maybe-installcheck-gdb \ + maybe-installcheck-expect \ + maybe-installcheck-guile \ + maybe-installcheck-tk \ + maybe-installcheck-tix \ + maybe-installcheck-libtermcap \ + maybe-installcheck-utils + +.PHONY: installcheck-target +installcheck-target: \ + maybe-installcheck-target-libstdc++-v3 \ + maybe-installcheck-target-newlib \ + maybe-installcheck-target-libf2c \ + maybe-installcheck-target-libobjc \ + maybe-installcheck-target-libtermcap \ + maybe-installcheck-target-winsup \ + maybe-installcheck-target-libgloss \ + maybe-installcheck-target-libiberty \ + maybe-installcheck-target-gperf \ + maybe-installcheck-target-examples \ + maybe-installcheck-target-libffi \ + maybe-installcheck-target-libjava \ + maybe-installcheck-target-zlib \ + maybe-installcheck-target-boehm-gc \ + maybe-installcheck-target-qthreads \ + maybe-installcheck-target-rda + +# GCC, the eternal special case +.PHONY: maybe-installcheck-gcc installcheck-gcc +maybe-installcheck-gcc: +installcheck-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-installcheck-ash installcheck-ash +maybe-installcheck-ash: + +installcheck-ash: \ + configure-ash + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-autoconf installcheck-autoconf +maybe-installcheck-autoconf: + +installcheck-autoconf: \ + configure-autoconf + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-automake installcheck-automake +maybe-installcheck-automake: + +installcheck-automake: \ + configure-automake + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-bash installcheck-bash +maybe-installcheck-bash: + +installcheck-bash: \ + configure-bash + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-bfd installcheck-bfd +maybe-installcheck-bfd: + +installcheck-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-opcodes installcheck-opcodes +maybe-installcheck-opcodes: + +installcheck-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-binutils installcheck-binutils +maybe-installcheck-binutils: + +installcheck-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-bison installcheck-bison +maybe-installcheck-bison: + +installcheck-bison: \ + configure-bison + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-byacc installcheck-byacc +maybe-installcheck-byacc: + +installcheck-byacc: \ + configure-byacc + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-bzip2 installcheck-bzip2 +maybe-installcheck-bzip2: + +installcheck-bzip2: \ + configure-bzip2 + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-dejagnu installcheck-dejagnu +maybe-installcheck-dejagnu: + +installcheck-dejagnu: \ + configure-dejagnu + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-diff installcheck-diff +maybe-installcheck-diff: + +installcheck-diff: \ + configure-diff + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-dosutils installcheck-dosutils +maybe-installcheck-dosutils: + +installcheck-dosutils: \ + configure-dosutils + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-etc installcheck-etc +maybe-installcheck-etc: + +installcheck-etc: \ + configure-etc + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-fastjar installcheck-fastjar +maybe-installcheck-fastjar: + +installcheck-fastjar: \ + configure-fastjar + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-fileutils installcheck-fileutils +maybe-installcheck-fileutils: + +installcheck-fileutils: \ + configure-fileutils + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-findutils installcheck-findutils +maybe-installcheck-findutils: + +installcheck-findutils: \ + configure-findutils + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-find installcheck-find +maybe-installcheck-find: + +installcheck-find: \ + configure-find + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-flex installcheck-flex +maybe-installcheck-flex: + +installcheck-flex: \ + configure-flex + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gas installcheck-gas +maybe-installcheck-gas: + +installcheck-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gawk installcheck-gawk +maybe-installcheck-gawk: + +installcheck-gawk: \ + configure-gawk + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gettext installcheck-gettext +maybe-installcheck-gettext: + +installcheck-gettext: \ + configure-gettext + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gnuserv installcheck-gnuserv +maybe-installcheck-gnuserv: + +installcheck-gnuserv: \ + configure-gnuserv + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gprof installcheck-gprof +maybe-installcheck-gprof: + +installcheck-gprof: \ + configure-gprof + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gzip installcheck-gzip +maybe-installcheck-gzip: + +installcheck-gzip: \ + configure-gzip + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-hello installcheck-hello +maybe-installcheck-hello: + +installcheck-hello: \ + configure-hello + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-indent installcheck-indent +maybe-installcheck-indent: + +installcheck-indent: \ + configure-indent + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-intl installcheck-intl +maybe-installcheck-intl: + +installcheck-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-tcl installcheck-tcl +maybe-installcheck-tcl: + +installcheck-tcl: \ + configure-tcl + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-itcl installcheck-itcl +maybe-installcheck-itcl: + +installcheck-itcl: \ + configure-itcl + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-ld installcheck-ld +maybe-installcheck-ld: + +installcheck-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-libgui installcheck-libgui +maybe-installcheck-libgui: + +installcheck-libgui: \ + configure-libgui + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-libiberty installcheck-libiberty +maybe-installcheck-libiberty: + +installcheck-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-libtool installcheck-libtool +maybe-installcheck-libtool: + +installcheck-libtool: \ + configure-libtool + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-m4 installcheck-m4 +maybe-installcheck-m4: + +installcheck-m4: \ + configure-m4 + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-make installcheck-make +maybe-installcheck-make: + +installcheck-make: \ + configure-make + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-mmalloc installcheck-mmalloc +maybe-installcheck-mmalloc: + +installcheck-mmalloc: \ + configure-mmalloc + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-patch installcheck-patch +maybe-installcheck-patch: + +installcheck-patch: \ + configure-patch + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-perl installcheck-perl +maybe-installcheck-perl: + +installcheck-perl: \ + configure-perl + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-prms installcheck-prms +maybe-installcheck-prms: + +installcheck-prms: \ + configure-prms + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-rcs installcheck-rcs +maybe-installcheck-rcs: + +installcheck-rcs: \ + configure-rcs + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-readline installcheck-readline +maybe-installcheck-readline: + +installcheck-readline: \ + configure-readline + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-release installcheck-release +maybe-installcheck-release: + +installcheck-release: \ + configure-release + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-recode installcheck-recode +maybe-installcheck-recode: + +installcheck-recode: \ + configure-recode + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-sed installcheck-sed +maybe-installcheck-sed: + +installcheck-sed: \ + configure-sed + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-send-pr installcheck-send-pr +maybe-installcheck-send-pr: + +installcheck-send-pr: \ + configure-send-pr + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-shellutils installcheck-shellutils +maybe-installcheck-shellutils: + +installcheck-shellutils: \ + configure-shellutils + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-sid installcheck-sid +maybe-installcheck-sid: + +installcheck-sid: \ + configure-sid + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-sim installcheck-sim +maybe-installcheck-sim: + +installcheck-sim: \ + configure-sim + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-tar installcheck-tar +maybe-installcheck-tar: + +installcheck-tar: \ + configure-tar + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-texinfo installcheck-texinfo +maybe-installcheck-texinfo: + +installcheck-texinfo: \ + configure-texinfo + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-textutils installcheck-textutils +maybe-installcheck-textutils: + +installcheck-textutils: \ + configure-textutils + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-time installcheck-time +maybe-installcheck-time: + +installcheck-time: \ + configure-time + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-uudecode installcheck-uudecode +maybe-installcheck-uudecode: + +installcheck-uudecode: \ + configure-uudecode + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-wdiff installcheck-wdiff +maybe-installcheck-wdiff: + +installcheck-wdiff: \ + configure-wdiff + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-zip installcheck-zip +maybe-installcheck-zip: + +installcheck-zip: \ + configure-zip + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-zlib installcheck-zlib +maybe-installcheck-zlib: + +installcheck-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gdb installcheck-gdb +maybe-installcheck-gdb: + +installcheck-gdb: \ + configure-gdb + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-expect installcheck-expect +maybe-installcheck-expect: + +installcheck-expect: \ + configure-expect + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-guile installcheck-guile +maybe-installcheck-guile: + +installcheck-guile: \ + configure-guile + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-tk installcheck-tk +maybe-installcheck-tk: + +installcheck-tk: \ + configure-tk + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-tix installcheck-tix +maybe-installcheck-tix: + +installcheck-tix: \ + configure-tix + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-libtermcap installcheck-libtermcap +maybe-installcheck-libtermcap: + +installcheck-libtermcap: \ + configure-libtermcap + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libtermcap" ; \ + (cd libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-utils installcheck-utils +maybe-installcheck-utils: + +installcheck-utils: \ + configure-utils + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-installcheck-target-libstdc++-v3 installcheck-target-libstdc++-v3 +maybe-installcheck-target-libstdc++-v3: + +installcheck-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-newlib installcheck-target-newlib +maybe-installcheck-target-newlib: + +installcheck-target-newlib: \ + configure-target-newlib + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libf2c installcheck-target-libf2c +maybe-installcheck-target-libf2c: + +installcheck-target-libf2c: \ + configure-target-libf2c + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libobjc installcheck-target-libobjc +maybe-installcheck-target-libobjc: + +installcheck-target-libobjc: \ + configure-target-libobjc + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libtermcap installcheck-target-libtermcap +maybe-installcheck-target-libtermcap: + +installcheck-target-libtermcap: \ + configure-target-libtermcap + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-winsup installcheck-target-winsup +maybe-installcheck-target-winsup: + +installcheck-target-winsup: \ + configure-target-winsup + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libgloss installcheck-target-libgloss +maybe-installcheck-target-libgloss: + +installcheck-target-libgloss: \ + configure-target-libgloss + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libiberty installcheck-target-libiberty +maybe-installcheck-target-libiberty: + +installcheck-target-libiberty: \ + configure-target-libiberty + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-gperf installcheck-target-gperf +maybe-installcheck-target-gperf: + +installcheck-target-gperf: \ + configure-target-gperf + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-examples installcheck-target-examples +maybe-installcheck-target-examples: + +installcheck-target-examples: \ + configure-target-examples + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libffi installcheck-target-libffi +maybe-installcheck-target-libffi: + +installcheck-target-libffi: \ + configure-target-libffi + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libjava installcheck-target-libjava +maybe-installcheck-target-libjava: + +installcheck-target-libjava: \ + configure-target-libjava + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-zlib installcheck-target-zlib +maybe-installcheck-target-zlib: + +installcheck-target-zlib: \ + configure-target-zlib + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-boehm-gc installcheck-target-boehm-gc +maybe-installcheck-target-boehm-gc: + +installcheck-target-boehm-gc: \ + configure-target-boehm-gc + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-qthreads installcheck-target-qthreads +maybe-installcheck-target-qthreads: + +installcheck-target-qthreads: \ + configure-target-qthreads + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-rda installcheck-target-rda +maybe-installcheck-target-rda: + +installcheck-target-rda: \ + configure-target-rda + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + + +.PHONY: do-mostlyclean +do-mostlyclean: mostlyclean-host mostlyclean-target + +.PHONY: mostlyclean-host +mostlyclean-host: maybe-mostlyclean-gcc \ + maybe-mostlyclean-ash \ + maybe-mostlyclean-autoconf \ + maybe-mostlyclean-automake \ + maybe-mostlyclean-bash \ + maybe-mostlyclean-bfd \ + maybe-mostlyclean-opcodes \ + maybe-mostlyclean-binutils \ + maybe-mostlyclean-bison \ + maybe-mostlyclean-byacc \ + maybe-mostlyclean-bzip2 \ + maybe-mostlyclean-dejagnu \ + maybe-mostlyclean-diff \ + maybe-mostlyclean-dosutils \ + maybe-mostlyclean-etc \ + maybe-mostlyclean-fastjar \ + maybe-mostlyclean-fileutils \ + maybe-mostlyclean-findutils \ + maybe-mostlyclean-find \ + maybe-mostlyclean-flex \ + maybe-mostlyclean-gas \ + maybe-mostlyclean-gawk \ + maybe-mostlyclean-gettext \ + maybe-mostlyclean-gnuserv \ + maybe-mostlyclean-gprof \ + maybe-mostlyclean-gzip \ + maybe-mostlyclean-hello \ + maybe-mostlyclean-indent \ + maybe-mostlyclean-intl \ + maybe-mostlyclean-tcl \ + maybe-mostlyclean-itcl \ + maybe-mostlyclean-ld \ + maybe-mostlyclean-libgui \ + maybe-mostlyclean-libiberty \ + maybe-mostlyclean-libtool \ + maybe-mostlyclean-m4 \ + maybe-mostlyclean-make \ + maybe-mostlyclean-mmalloc \ + maybe-mostlyclean-patch \ + maybe-mostlyclean-perl \ + maybe-mostlyclean-prms \ + maybe-mostlyclean-rcs \ + maybe-mostlyclean-readline \ + maybe-mostlyclean-release \ + maybe-mostlyclean-recode \ + maybe-mostlyclean-sed \ + maybe-mostlyclean-send-pr \ + maybe-mostlyclean-shellutils \ + maybe-mostlyclean-sid \ + maybe-mostlyclean-sim \ + maybe-mostlyclean-tar \ + maybe-mostlyclean-texinfo \ + maybe-mostlyclean-textutils \ + maybe-mostlyclean-time \ + maybe-mostlyclean-uudecode \ + maybe-mostlyclean-wdiff \ + maybe-mostlyclean-zip \ + maybe-mostlyclean-zlib \ + maybe-mostlyclean-gdb \ + maybe-mostlyclean-expect \ + maybe-mostlyclean-guile \ + maybe-mostlyclean-tk \ + maybe-mostlyclean-tix \ + maybe-mostlyclean-libtermcap \ + maybe-mostlyclean-utils + +.PHONY: mostlyclean-target +mostlyclean-target: \ + maybe-mostlyclean-target-libstdc++-v3 \ + maybe-mostlyclean-target-newlib \ + maybe-mostlyclean-target-libf2c \ + maybe-mostlyclean-target-libobjc \ + maybe-mostlyclean-target-libtermcap \ + maybe-mostlyclean-target-winsup \ + maybe-mostlyclean-target-libgloss \ + maybe-mostlyclean-target-libiberty \ + maybe-mostlyclean-target-gperf \ + maybe-mostlyclean-target-examples \ + maybe-mostlyclean-target-libffi \ + maybe-mostlyclean-target-libjava \ + maybe-mostlyclean-target-zlib \ + maybe-mostlyclean-target-boehm-gc \ + maybe-mostlyclean-target-qthreads \ + maybe-mostlyclean-target-rda + +# GCC, the eternal special case +.PHONY: maybe-mostlyclean-gcc mostlyclean-gcc +maybe-mostlyclean-gcc: +mostlyclean-gcc: + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-mostlyclean-ash mostlyclean-ash +maybe-mostlyclean-ash: + +mostlyclean-ash: + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-autoconf mostlyclean-autoconf +maybe-mostlyclean-autoconf: + +mostlyclean-autoconf: + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-automake mostlyclean-automake +maybe-mostlyclean-automake: + +mostlyclean-automake: + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-bash mostlyclean-bash +maybe-mostlyclean-bash: + +mostlyclean-bash: + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-bfd mostlyclean-bfd +maybe-mostlyclean-bfd: + +mostlyclean-bfd: + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-opcodes mostlyclean-opcodes +maybe-mostlyclean-opcodes: + +mostlyclean-opcodes: + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-binutils mostlyclean-binutils +maybe-mostlyclean-binutils: + +mostlyclean-binutils: + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-bison mostlyclean-bison +maybe-mostlyclean-bison: + +mostlyclean-bison: + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-byacc mostlyclean-byacc +maybe-mostlyclean-byacc: + +mostlyclean-byacc: + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-bzip2 mostlyclean-bzip2 +maybe-mostlyclean-bzip2: + +mostlyclean-bzip2: + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-dejagnu mostlyclean-dejagnu +maybe-mostlyclean-dejagnu: + +mostlyclean-dejagnu: + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-diff mostlyclean-diff +maybe-mostlyclean-diff: + +mostlyclean-diff: + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-dosutils mostlyclean-dosutils +maybe-mostlyclean-dosutils: + +mostlyclean-dosutils: + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-etc mostlyclean-etc +maybe-mostlyclean-etc: + +mostlyclean-etc: + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-fastjar mostlyclean-fastjar +maybe-mostlyclean-fastjar: + +mostlyclean-fastjar: + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-fileutils mostlyclean-fileutils +maybe-mostlyclean-fileutils: + +mostlyclean-fileutils: + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-findutils mostlyclean-findutils +maybe-mostlyclean-findutils: + +mostlyclean-findutils: + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-find mostlyclean-find +maybe-mostlyclean-find: + +mostlyclean-find: + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-flex mostlyclean-flex +maybe-mostlyclean-flex: + +mostlyclean-flex: + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gas mostlyclean-gas +maybe-mostlyclean-gas: + +mostlyclean-gas: + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gawk mostlyclean-gawk +maybe-mostlyclean-gawk: + +mostlyclean-gawk: + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gettext mostlyclean-gettext +maybe-mostlyclean-gettext: + +mostlyclean-gettext: + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gnuserv mostlyclean-gnuserv +maybe-mostlyclean-gnuserv: + +mostlyclean-gnuserv: + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gprof mostlyclean-gprof +maybe-mostlyclean-gprof: + +mostlyclean-gprof: + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gzip mostlyclean-gzip +maybe-mostlyclean-gzip: + +mostlyclean-gzip: + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-hello mostlyclean-hello +maybe-mostlyclean-hello: + +mostlyclean-hello: + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-indent mostlyclean-indent +maybe-mostlyclean-indent: + +mostlyclean-indent: + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-intl mostlyclean-intl +maybe-mostlyclean-intl: + +mostlyclean-intl: + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-tcl mostlyclean-tcl +maybe-mostlyclean-tcl: + +# tcl doesn't support mostlyclean. +mostlyclean-tcl: + + +.PHONY: maybe-mostlyclean-itcl mostlyclean-itcl +maybe-mostlyclean-itcl: + +mostlyclean-itcl: + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-ld mostlyclean-ld +maybe-mostlyclean-ld: + +mostlyclean-ld: + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-libgui mostlyclean-libgui +maybe-mostlyclean-libgui: + +mostlyclean-libgui: + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-libiberty mostlyclean-libiberty +maybe-mostlyclean-libiberty: + +mostlyclean-libiberty: + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-libtool mostlyclean-libtool +maybe-mostlyclean-libtool: + +mostlyclean-libtool: + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-m4 mostlyclean-m4 +maybe-mostlyclean-m4: + +mostlyclean-m4: + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-make mostlyclean-make +maybe-mostlyclean-make: + +mostlyclean-make: + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-mmalloc mostlyclean-mmalloc +maybe-mostlyclean-mmalloc: + +mostlyclean-mmalloc: + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-patch mostlyclean-patch +maybe-mostlyclean-patch: + +mostlyclean-patch: + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-perl mostlyclean-perl +maybe-mostlyclean-perl: + +mostlyclean-perl: + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-prms mostlyclean-prms +maybe-mostlyclean-prms: + +mostlyclean-prms: + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-rcs mostlyclean-rcs +maybe-mostlyclean-rcs: + +mostlyclean-rcs: + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-readline mostlyclean-readline +maybe-mostlyclean-readline: + +mostlyclean-readline: + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-release mostlyclean-release +maybe-mostlyclean-release: + +mostlyclean-release: + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-recode mostlyclean-recode +maybe-mostlyclean-recode: + +mostlyclean-recode: + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-sed mostlyclean-sed +maybe-mostlyclean-sed: + +mostlyclean-sed: + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-send-pr mostlyclean-send-pr +maybe-mostlyclean-send-pr: + +mostlyclean-send-pr: + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-shellutils mostlyclean-shellutils +maybe-mostlyclean-shellutils: + +mostlyclean-shellutils: + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-sid mostlyclean-sid +maybe-mostlyclean-sid: + +mostlyclean-sid: + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-sim mostlyclean-sim +maybe-mostlyclean-sim: + +mostlyclean-sim: + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-tar mostlyclean-tar +maybe-mostlyclean-tar: + +mostlyclean-tar: + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-texinfo mostlyclean-texinfo +maybe-mostlyclean-texinfo: + +mostlyclean-texinfo: + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-textutils mostlyclean-textutils +maybe-mostlyclean-textutils: + +mostlyclean-textutils: + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-time mostlyclean-time +maybe-mostlyclean-time: + +mostlyclean-time: + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-uudecode mostlyclean-uudecode +maybe-mostlyclean-uudecode: + +mostlyclean-uudecode: + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-wdiff mostlyclean-wdiff +maybe-mostlyclean-wdiff: + +mostlyclean-wdiff: + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-zip mostlyclean-zip +maybe-mostlyclean-zip: + +mostlyclean-zip: + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-zlib mostlyclean-zlib +maybe-mostlyclean-zlib: + +mostlyclean-zlib: + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gdb mostlyclean-gdb +maybe-mostlyclean-gdb: + +mostlyclean-gdb: + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-expect mostlyclean-expect +maybe-mostlyclean-expect: + +mostlyclean-expect: + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-guile mostlyclean-guile +maybe-mostlyclean-guile: + +mostlyclean-guile: + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-tk mostlyclean-tk +maybe-mostlyclean-tk: + +mostlyclean-tk: + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-tix mostlyclean-tix +maybe-mostlyclean-tix: + +mostlyclean-tix: + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-libtermcap mostlyclean-libtermcap +maybe-mostlyclean-libtermcap: + +# libtermcap doesn't support mostlyclean. +mostlyclean-libtermcap: + + +.PHONY: maybe-mostlyclean-utils mostlyclean-utils +maybe-mostlyclean-utils: + +mostlyclean-utils: + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-mostlyclean-target-libstdc++-v3 mostlyclean-target-libstdc++-v3 +maybe-mostlyclean-target-libstdc++-v3: + +mostlyclean-target-libstdc++-v3: + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-newlib mostlyclean-target-newlib +maybe-mostlyclean-target-newlib: + +mostlyclean-target-newlib: + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libf2c mostlyclean-target-libf2c +maybe-mostlyclean-target-libf2c: + +mostlyclean-target-libf2c: + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libobjc mostlyclean-target-libobjc +maybe-mostlyclean-target-libobjc: + +mostlyclean-target-libobjc: + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libtermcap mostlyclean-target-libtermcap +maybe-mostlyclean-target-libtermcap: + +# libtermcap doesn't support mostlyclean. +mostlyclean-target-libtermcap: + + +.PHONY: maybe-mostlyclean-target-winsup mostlyclean-target-winsup +maybe-mostlyclean-target-winsup: + +mostlyclean-target-winsup: + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libgloss mostlyclean-target-libgloss +maybe-mostlyclean-target-libgloss: + +mostlyclean-target-libgloss: + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libiberty mostlyclean-target-libiberty +maybe-mostlyclean-target-libiberty: + +mostlyclean-target-libiberty: + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-gperf mostlyclean-target-gperf +maybe-mostlyclean-target-gperf: + +mostlyclean-target-gperf: + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-examples mostlyclean-target-examples +maybe-mostlyclean-target-examples: + +mostlyclean-target-examples: + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libffi mostlyclean-target-libffi +maybe-mostlyclean-target-libffi: + +mostlyclean-target-libffi: + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libjava mostlyclean-target-libjava +maybe-mostlyclean-target-libjava: + +mostlyclean-target-libjava: + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-zlib mostlyclean-target-zlib +maybe-mostlyclean-target-zlib: + +mostlyclean-target-zlib: + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-boehm-gc mostlyclean-target-boehm-gc +maybe-mostlyclean-target-boehm-gc: + +mostlyclean-target-boehm-gc: + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-qthreads mostlyclean-target-qthreads +maybe-mostlyclean-target-qthreads: + +mostlyclean-target-qthreads: + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-rda mostlyclean-target-rda +maybe-mostlyclean-target-rda: + +mostlyclean-target-rda: + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + + +.PHONY: do-clean +do-clean: clean-host clean-target + +.PHONY: clean-host +clean-host: maybe-clean-gcc \ + maybe-clean-ash \ + maybe-clean-autoconf \ + maybe-clean-automake \ + maybe-clean-bash \ + maybe-clean-bfd \ + maybe-clean-opcodes \ + maybe-clean-binutils \ + maybe-clean-bison \ + maybe-clean-byacc \ + maybe-clean-bzip2 \ + maybe-clean-dejagnu \ + maybe-clean-diff \ + maybe-clean-dosutils \ + maybe-clean-etc \ + maybe-clean-fastjar \ + maybe-clean-fileutils \ + maybe-clean-findutils \ + maybe-clean-find \ + maybe-clean-flex \ + maybe-clean-gas \ + maybe-clean-gawk \ + maybe-clean-gettext \ + maybe-clean-gnuserv \ + maybe-clean-gprof \ + maybe-clean-gzip \ + maybe-clean-hello \ + maybe-clean-indent \ + maybe-clean-intl \ + maybe-clean-tcl \ + maybe-clean-itcl \ + maybe-clean-ld \ + maybe-clean-libgui \ + maybe-clean-libiberty \ + maybe-clean-libtool \ + maybe-clean-m4 \ + maybe-clean-make \ + maybe-clean-mmalloc \ + maybe-clean-patch \ + maybe-clean-perl \ + maybe-clean-prms \ + maybe-clean-rcs \ + maybe-clean-readline \ + maybe-clean-release \ + maybe-clean-recode \ + maybe-clean-sed \ + maybe-clean-send-pr \ + maybe-clean-shellutils \ + maybe-clean-sid \ + maybe-clean-sim \ + maybe-clean-tar \ + maybe-clean-texinfo \ + maybe-clean-textutils \ + maybe-clean-time \ + maybe-clean-uudecode \ + maybe-clean-wdiff \ + maybe-clean-zip \ + maybe-clean-zlib \ + maybe-clean-gdb \ + maybe-clean-expect \ + maybe-clean-guile \ + maybe-clean-tk \ + maybe-clean-tix \ + maybe-clean-libtermcap \ + maybe-clean-utils + +.PHONY: clean-target +clean-target: \ + maybe-clean-target-libstdc++-v3 \ + maybe-clean-target-newlib \ + maybe-clean-target-libf2c \ + maybe-clean-target-libobjc \ + maybe-clean-target-libtermcap \ + maybe-clean-target-winsup \ + maybe-clean-target-libgloss \ + maybe-clean-target-libiberty \ + maybe-clean-target-gperf \ + maybe-clean-target-examples \ + maybe-clean-target-libffi \ + maybe-clean-target-libjava \ + maybe-clean-target-zlib \ + maybe-clean-target-boehm-gc \ + maybe-clean-target-qthreads \ + maybe-clean-target-rda + +# GCC, the eternal special case +.PHONY: maybe-clean-gcc clean-gcc +maybe-clean-gcc: +clean-gcc: + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-clean-ash clean-ash +maybe-clean-ash: + +clean-ash: + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-autoconf clean-autoconf +maybe-clean-autoconf: + +clean-autoconf: + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-automake clean-automake +maybe-clean-automake: + +clean-automake: + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-bash clean-bash +maybe-clean-bash: + +clean-bash: + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-bfd clean-bfd +maybe-clean-bfd: + +clean-bfd: + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-opcodes clean-opcodes +maybe-clean-opcodes: + +clean-opcodes: + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-binutils clean-binutils +maybe-clean-binutils: + +clean-binutils: + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-bison clean-bison +maybe-clean-bison: + +clean-bison: + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-byacc clean-byacc +maybe-clean-byacc: + +clean-byacc: + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-bzip2 clean-bzip2 +maybe-clean-bzip2: + +clean-bzip2: + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-dejagnu clean-dejagnu +maybe-clean-dejagnu: + +clean-dejagnu: + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-diff clean-diff +maybe-clean-diff: + +clean-diff: + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-dosutils clean-dosutils +maybe-clean-dosutils: + +clean-dosutils: + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-etc clean-etc +maybe-clean-etc: + +clean-etc: + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-fastjar clean-fastjar +maybe-clean-fastjar: + +clean-fastjar: + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-fileutils clean-fileutils +maybe-clean-fileutils: + +clean-fileutils: + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-findutils clean-findutils +maybe-clean-findutils: + +clean-findutils: + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-find clean-find +maybe-clean-find: + +clean-find: + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-flex clean-flex +maybe-clean-flex: + +clean-flex: + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gas clean-gas +maybe-clean-gas: + +clean-gas: + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gawk clean-gawk +maybe-clean-gawk: + +clean-gawk: + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gettext clean-gettext +maybe-clean-gettext: + +clean-gettext: + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gnuserv clean-gnuserv +maybe-clean-gnuserv: + +clean-gnuserv: + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gprof clean-gprof +maybe-clean-gprof: + +clean-gprof: + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gzip clean-gzip +maybe-clean-gzip: + +clean-gzip: + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-hello clean-hello +maybe-clean-hello: + +clean-hello: + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-indent clean-indent +maybe-clean-indent: + +clean-indent: + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-intl clean-intl +maybe-clean-intl: + +clean-intl: + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-tcl clean-tcl +maybe-clean-tcl: + +clean-tcl: + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-itcl clean-itcl +maybe-clean-itcl: + +clean-itcl: + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-ld clean-ld +maybe-clean-ld: + +clean-ld: + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-libgui clean-libgui +maybe-clean-libgui: + +clean-libgui: + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-libiberty clean-libiberty +maybe-clean-libiberty: + +clean-libiberty: + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-libtool clean-libtool +maybe-clean-libtool: + +clean-libtool: + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-m4 clean-m4 +maybe-clean-m4: + +clean-m4: + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-make clean-make +maybe-clean-make: + +clean-make: + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-mmalloc clean-mmalloc +maybe-clean-mmalloc: + +clean-mmalloc: + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-patch clean-patch +maybe-clean-patch: + +clean-patch: + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-perl clean-perl +maybe-clean-perl: + +clean-perl: + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-prms clean-prms +maybe-clean-prms: + +clean-prms: + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-rcs clean-rcs +maybe-clean-rcs: + +clean-rcs: + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-readline clean-readline +maybe-clean-readline: + +clean-readline: + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-release clean-release +maybe-clean-release: + +clean-release: + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-recode clean-recode +maybe-clean-recode: + +clean-recode: + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-sed clean-sed +maybe-clean-sed: + +clean-sed: + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-send-pr clean-send-pr +maybe-clean-send-pr: + +clean-send-pr: + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-shellutils clean-shellutils +maybe-clean-shellutils: + +clean-shellutils: + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-sid clean-sid +maybe-clean-sid: + +clean-sid: + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-sim clean-sim +maybe-clean-sim: + +clean-sim: + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-tar clean-tar +maybe-clean-tar: + +clean-tar: + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-texinfo clean-texinfo +maybe-clean-texinfo: + +clean-texinfo: + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-textutils clean-textutils +maybe-clean-textutils: + +clean-textutils: + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-time clean-time +maybe-clean-time: + +clean-time: + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-uudecode clean-uudecode +maybe-clean-uudecode: + +clean-uudecode: + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-wdiff clean-wdiff +maybe-clean-wdiff: + +clean-wdiff: + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-zip clean-zip +maybe-clean-zip: + +clean-zip: + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-zlib clean-zlib +maybe-clean-zlib: + +clean-zlib: + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gdb clean-gdb +maybe-clean-gdb: + +clean-gdb: + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-expect clean-expect +maybe-clean-expect: + +clean-expect: + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-guile clean-guile +maybe-clean-guile: + +clean-guile: + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-tk clean-tk +maybe-clean-tk: + +clean-tk: + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-tix clean-tix +maybe-clean-tix: + +clean-tix: + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-libtermcap clean-libtermcap +maybe-clean-libtermcap: + +# libtermcap doesn't support clean. +clean-libtermcap: + + +.PHONY: maybe-clean-utils clean-utils +maybe-clean-utils: + +clean-utils: + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-clean-target-libstdc++-v3 clean-target-libstdc++-v3 +maybe-clean-target-libstdc++-v3: + +clean-target-libstdc++-v3: + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-newlib clean-target-newlib +maybe-clean-target-newlib: + +clean-target-newlib: + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libf2c clean-target-libf2c +maybe-clean-target-libf2c: + +clean-target-libf2c: + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libobjc clean-target-libobjc +maybe-clean-target-libobjc: + +clean-target-libobjc: + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libtermcap clean-target-libtermcap +maybe-clean-target-libtermcap: + +# libtermcap doesn't support clean. +clean-target-libtermcap: + + +.PHONY: maybe-clean-target-winsup clean-target-winsup +maybe-clean-target-winsup: + +clean-target-winsup: + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libgloss clean-target-libgloss +maybe-clean-target-libgloss: + +clean-target-libgloss: + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libiberty clean-target-libiberty +maybe-clean-target-libiberty: + +clean-target-libiberty: + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-gperf clean-target-gperf +maybe-clean-target-gperf: + +clean-target-gperf: + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-examples clean-target-examples +maybe-clean-target-examples: + +clean-target-examples: + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libffi clean-target-libffi +maybe-clean-target-libffi: + +clean-target-libffi: + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libjava clean-target-libjava +maybe-clean-target-libjava: + +clean-target-libjava: + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-zlib clean-target-zlib +maybe-clean-target-zlib: + +clean-target-zlib: + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-boehm-gc clean-target-boehm-gc +maybe-clean-target-boehm-gc: + +clean-target-boehm-gc: + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-qthreads clean-target-qthreads +maybe-clean-target-qthreads: + +clean-target-qthreads: + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-rda clean-target-rda +maybe-clean-target-rda: + +clean-target-rda: + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + + +.PHONY: do-distclean +do-distclean: distclean-host distclean-target + +.PHONY: distclean-host +distclean-host: maybe-distclean-gcc \ + maybe-distclean-ash \ + maybe-distclean-autoconf \ + maybe-distclean-automake \ + maybe-distclean-bash \ + maybe-distclean-bfd \ + maybe-distclean-opcodes \ + maybe-distclean-binutils \ + maybe-distclean-bison \ + maybe-distclean-byacc \ + maybe-distclean-bzip2 \ + maybe-distclean-dejagnu \ + maybe-distclean-diff \ + maybe-distclean-dosutils \ + maybe-distclean-etc \ + maybe-distclean-fastjar \ + maybe-distclean-fileutils \ + maybe-distclean-findutils \ + maybe-distclean-find \ + maybe-distclean-flex \ + maybe-distclean-gas \ + maybe-distclean-gawk \ + maybe-distclean-gettext \ + maybe-distclean-gnuserv \ + maybe-distclean-gprof \ + maybe-distclean-gzip \ + maybe-distclean-hello \ + maybe-distclean-indent \ + maybe-distclean-intl \ + maybe-distclean-tcl \ + maybe-distclean-itcl \ + maybe-distclean-ld \ + maybe-distclean-libgui \ + maybe-distclean-libiberty \ + maybe-distclean-libtool \ + maybe-distclean-m4 \ + maybe-distclean-make \ + maybe-distclean-mmalloc \ + maybe-distclean-patch \ + maybe-distclean-perl \ + maybe-distclean-prms \ + maybe-distclean-rcs \ + maybe-distclean-readline \ + maybe-distclean-release \ + maybe-distclean-recode \ + maybe-distclean-sed \ + maybe-distclean-send-pr \ + maybe-distclean-shellutils \ + maybe-distclean-sid \ + maybe-distclean-sim \ + maybe-distclean-tar \ + maybe-distclean-texinfo \ + maybe-distclean-textutils \ + maybe-distclean-time \ + maybe-distclean-uudecode \ + maybe-distclean-wdiff \ + maybe-distclean-zip \ + maybe-distclean-zlib \ + maybe-distclean-gdb \ + maybe-distclean-expect \ + maybe-distclean-guile \ + maybe-distclean-tk \ + maybe-distclean-tix \ + maybe-distclean-libtermcap \ + maybe-distclean-utils + +.PHONY: distclean-target +distclean-target: \ + maybe-distclean-target-libstdc++-v3 \ + maybe-distclean-target-newlib \ + maybe-distclean-target-libf2c \ + maybe-distclean-target-libobjc \ + maybe-distclean-target-libtermcap \ + maybe-distclean-target-winsup \ + maybe-distclean-target-libgloss \ + maybe-distclean-target-libiberty \ + maybe-distclean-target-gperf \ + maybe-distclean-target-examples \ + maybe-distclean-target-libffi \ + maybe-distclean-target-libjava \ + maybe-distclean-target-zlib \ + maybe-distclean-target-boehm-gc \ + maybe-distclean-target-qthreads \ + maybe-distclean-target-rda + +# GCC, the eternal special case +.PHONY: maybe-distclean-gcc distclean-gcc +maybe-distclean-gcc: +distclean-gcc: + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-distclean-ash distclean-ash +maybe-distclean-ash: + +distclean-ash: + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-autoconf distclean-autoconf +maybe-distclean-autoconf: + +distclean-autoconf: + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-automake distclean-automake +maybe-distclean-automake: + +distclean-automake: + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-bash distclean-bash +maybe-distclean-bash: + +distclean-bash: + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-bfd distclean-bfd +maybe-distclean-bfd: + +distclean-bfd: + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-opcodes distclean-opcodes +maybe-distclean-opcodes: + +distclean-opcodes: + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-binutils distclean-binutils +maybe-distclean-binutils: + +distclean-binutils: + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-bison distclean-bison +maybe-distclean-bison: + +distclean-bison: + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-byacc distclean-byacc +maybe-distclean-byacc: + +distclean-byacc: + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-bzip2 distclean-bzip2 +maybe-distclean-bzip2: + +distclean-bzip2: + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-dejagnu distclean-dejagnu +maybe-distclean-dejagnu: + +distclean-dejagnu: + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-diff distclean-diff +maybe-distclean-diff: + +distclean-diff: + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-dosutils distclean-dosutils +maybe-distclean-dosutils: + +distclean-dosutils: + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-etc distclean-etc +maybe-distclean-etc: + +distclean-etc: + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-fastjar distclean-fastjar +maybe-distclean-fastjar: + +distclean-fastjar: + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-fileutils distclean-fileutils +maybe-distclean-fileutils: + +distclean-fileutils: + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-findutils distclean-findutils +maybe-distclean-findutils: + +distclean-findutils: + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-find distclean-find +maybe-distclean-find: + +distclean-find: + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-flex distclean-flex +maybe-distclean-flex: + +distclean-flex: + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gas distclean-gas +maybe-distclean-gas: + +distclean-gas: + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gawk distclean-gawk +maybe-distclean-gawk: + +distclean-gawk: + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gettext distclean-gettext +maybe-distclean-gettext: + +distclean-gettext: + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gnuserv distclean-gnuserv +maybe-distclean-gnuserv: + +distclean-gnuserv: + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gprof distclean-gprof +maybe-distclean-gprof: + +distclean-gprof: + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gzip distclean-gzip +maybe-distclean-gzip: + +distclean-gzip: + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-hello distclean-hello +maybe-distclean-hello: + +distclean-hello: + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-indent distclean-indent +maybe-distclean-indent: + +distclean-indent: + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-intl distclean-intl +maybe-distclean-intl: + +distclean-intl: + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-tcl distclean-tcl +maybe-distclean-tcl: + +distclean-tcl: + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-itcl distclean-itcl +maybe-distclean-itcl: + +distclean-itcl: + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-ld distclean-ld +maybe-distclean-ld: + +distclean-ld: + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-libgui distclean-libgui +maybe-distclean-libgui: + +distclean-libgui: + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-libiberty distclean-libiberty +maybe-distclean-libiberty: + +distclean-libiberty: + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-libtool distclean-libtool +maybe-distclean-libtool: + +distclean-libtool: + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-m4 distclean-m4 +maybe-distclean-m4: + +distclean-m4: + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-make distclean-make +maybe-distclean-make: + +distclean-make: + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-mmalloc distclean-mmalloc +maybe-distclean-mmalloc: + +distclean-mmalloc: + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-patch distclean-patch +maybe-distclean-patch: + +distclean-patch: + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-perl distclean-perl +maybe-distclean-perl: + +distclean-perl: + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-prms distclean-prms +maybe-distclean-prms: + +distclean-prms: + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-rcs distclean-rcs +maybe-distclean-rcs: + +distclean-rcs: + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-readline distclean-readline +maybe-distclean-readline: + +distclean-readline: + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-release distclean-release +maybe-distclean-release: + +distclean-release: + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-recode distclean-recode +maybe-distclean-recode: + +distclean-recode: + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-sed distclean-sed +maybe-distclean-sed: + +distclean-sed: + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-send-pr distclean-send-pr +maybe-distclean-send-pr: + +distclean-send-pr: + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-shellutils distclean-shellutils +maybe-distclean-shellutils: + +distclean-shellutils: + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-sid distclean-sid +maybe-distclean-sid: + +distclean-sid: + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-sim distclean-sim +maybe-distclean-sim: + +distclean-sim: + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-tar distclean-tar +maybe-distclean-tar: + +distclean-tar: + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-texinfo distclean-texinfo +maybe-distclean-texinfo: + +distclean-texinfo: + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-textutils distclean-textutils +maybe-distclean-textutils: + +distclean-textutils: + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-time distclean-time +maybe-distclean-time: + +distclean-time: + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-uudecode distclean-uudecode +maybe-distclean-uudecode: + +distclean-uudecode: + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-wdiff distclean-wdiff +maybe-distclean-wdiff: + +distclean-wdiff: + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-zip distclean-zip +maybe-distclean-zip: + +distclean-zip: + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-zlib distclean-zlib +maybe-distclean-zlib: + +distclean-zlib: + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gdb distclean-gdb +maybe-distclean-gdb: + +distclean-gdb: + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-expect distclean-expect +maybe-distclean-expect: + +distclean-expect: + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-guile distclean-guile +maybe-distclean-guile: + +distclean-guile: + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-tk distclean-tk +maybe-distclean-tk: + +distclean-tk: + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-tix distclean-tix +maybe-distclean-tix: + +distclean-tix: + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-libtermcap distclean-libtermcap +maybe-distclean-libtermcap: + +# libtermcap doesn't support distclean. +distclean-libtermcap: + + +.PHONY: maybe-distclean-utils distclean-utils +maybe-distclean-utils: + +distclean-utils: + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-distclean-target-libstdc++-v3 distclean-target-libstdc++-v3 +maybe-distclean-target-libstdc++-v3: + +distclean-target-libstdc++-v3: + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-newlib distclean-target-newlib +maybe-distclean-target-newlib: + +distclean-target-newlib: + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libf2c distclean-target-libf2c +maybe-distclean-target-libf2c: + +distclean-target-libf2c: + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libobjc distclean-target-libobjc +maybe-distclean-target-libobjc: + +distclean-target-libobjc: + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libtermcap distclean-target-libtermcap +maybe-distclean-target-libtermcap: + +# libtermcap doesn't support distclean. +distclean-target-libtermcap: + + +.PHONY: maybe-distclean-target-winsup distclean-target-winsup +maybe-distclean-target-winsup: + +distclean-target-winsup: + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libgloss distclean-target-libgloss +maybe-distclean-target-libgloss: + +distclean-target-libgloss: + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libiberty distclean-target-libiberty +maybe-distclean-target-libiberty: + +distclean-target-libiberty: + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-gperf distclean-target-gperf +maybe-distclean-target-gperf: + +distclean-target-gperf: + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-examples distclean-target-examples +maybe-distclean-target-examples: + +distclean-target-examples: + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libffi distclean-target-libffi +maybe-distclean-target-libffi: + +distclean-target-libffi: + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libjava distclean-target-libjava +maybe-distclean-target-libjava: + +distclean-target-libjava: + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-zlib distclean-target-zlib +maybe-distclean-target-zlib: + +distclean-target-zlib: + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-boehm-gc distclean-target-boehm-gc +maybe-distclean-target-boehm-gc: + +distclean-target-boehm-gc: + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-qthreads distclean-target-qthreads +maybe-distclean-target-qthreads: + +distclean-target-qthreads: + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-rda distclean-target-rda +maybe-distclean-target-rda: + +distclean-target-rda: + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + + +.PHONY: do-maintainer-clean +do-maintainer-clean: maintainer-clean-host maintainer-clean-target + +.PHONY: maintainer-clean-host +maintainer-clean-host: maybe-maintainer-clean-gcc \ + maybe-maintainer-clean-ash \ + maybe-maintainer-clean-autoconf \ + maybe-maintainer-clean-automake \ + maybe-maintainer-clean-bash \ + maybe-maintainer-clean-bfd \ + maybe-maintainer-clean-opcodes \ + maybe-maintainer-clean-binutils \ + maybe-maintainer-clean-bison \ + maybe-maintainer-clean-byacc \ + maybe-maintainer-clean-bzip2 \ + maybe-maintainer-clean-dejagnu \ + maybe-maintainer-clean-diff \ + maybe-maintainer-clean-dosutils \ + maybe-maintainer-clean-etc \ + maybe-maintainer-clean-fastjar \ + maybe-maintainer-clean-fileutils \ + maybe-maintainer-clean-findutils \ + maybe-maintainer-clean-find \ + maybe-maintainer-clean-flex \ + maybe-maintainer-clean-gas \ + maybe-maintainer-clean-gawk \ + maybe-maintainer-clean-gettext \ + maybe-maintainer-clean-gnuserv \ + maybe-maintainer-clean-gprof \ + maybe-maintainer-clean-gzip \ + maybe-maintainer-clean-hello \ + maybe-maintainer-clean-indent \ + maybe-maintainer-clean-intl \ + maybe-maintainer-clean-tcl \ + maybe-maintainer-clean-itcl \ + maybe-maintainer-clean-ld \ + maybe-maintainer-clean-libgui \ + maybe-maintainer-clean-libiberty \ + maybe-maintainer-clean-libtool \ + maybe-maintainer-clean-m4 \ + maybe-maintainer-clean-make \ + maybe-maintainer-clean-mmalloc \ + maybe-maintainer-clean-patch \ + maybe-maintainer-clean-perl \ + maybe-maintainer-clean-prms \ + maybe-maintainer-clean-rcs \ + maybe-maintainer-clean-readline \ + maybe-maintainer-clean-release \ + maybe-maintainer-clean-recode \ + maybe-maintainer-clean-sed \ + maybe-maintainer-clean-send-pr \ + maybe-maintainer-clean-shellutils \ + maybe-maintainer-clean-sid \ + maybe-maintainer-clean-sim \ + maybe-maintainer-clean-tar \ + maybe-maintainer-clean-texinfo \ + maybe-maintainer-clean-textutils \ + maybe-maintainer-clean-time \ + maybe-maintainer-clean-uudecode \ + maybe-maintainer-clean-wdiff \ + maybe-maintainer-clean-zip \ + maybe-maintainer-clean-zlib \ + maybe-maintainer-clean-gdb \ + maybe-maintainer-clean-expect \ + maybe-maintainer-clean-guile \ + maybe-maintainer-clean-tk \ + maybe-maintainer-clean-tix \ + maybe-maintainer-clean-libtermcap \ + maybe-maintainer-clean-utils + +.PHONY: maintainer-clean-target +maintainer-clean-target: \ + maybe-maintainer-clean-target-libstdc++-v3 \ + maybe-maintainer-clean-target-newlib \ + maybe-maintainer-clean-target-libf2c \ + maybe-maintainer-clean-target-libobjc \ + maybe-maintainer-clean-target-libtermcap \ + maybe-maintainer-clean-target-winsup \ + maybe-maintainer-clean-target-libgloss \ + maybe-maintainer-clean-target-libiberty \ + maybe-maintainer-clean-target-gperf \ + maybe-maintainer-clean-target-examples \ + maybe-maintainer-clean-target-libffi \ + maybe-maintainer-clean-target-libjava \ + maybe-maintainer-clean-target-zlib \ + maybe-maintainer-clean-target-boehm-gc \ + maybe-maintainer-clean-target-qthreads \ + maybe-maintainer-clean-target-rda + +# GCC, the eternal special case +.PHONY: maybe-maintainer-clean-gcc maintainer-clean-gcc +maybe-maintainer-clean-gcc: +maintainer-clean-gcc: + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-maintainer-clean-ash maintainer-clean-ash +maybe-maintainer-clean-ash: + +maintainer-clean-ash: + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-autoconf maintainer-clean-autoconf +maybe-maintainer-clean-autoconf: + +maintainer-clean-autoconf: + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-automake maintainer-clean-automake +maybe-maintainer-clean-automake: + +maintainer-clean-automake: + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-bash maintainer-clean-bash +maybe-maintainer-clean-bash: + +maintainer-clean-bash: + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-bfd maintainer-clean-bfd +maybe-maintainer-clean-bfd: + +maintainer-clean-bfd: + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-opcodes maintainer-clean-opcodes +maybe-maintainer-clean-opcodes: + +maintainer-clean-opcodes: + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-binutils maintainer-clean-binutils +maybe-maintainer-clean-binutils: + +maintainer-clean-binutils: + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-bison maintainer-clean-bison +maybe-maintainer-clean-bison: + +maintainer-clean-bison: + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-byacc maintainer-clean-byacc +maybe-maintainer-clean-byacc: + +maintainer-clean-byacc: + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-bzip2 maintainer-clean-bzip2 +maybe-maintainer-clean-bzip2: + +maintainer-clean-bzip2: + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-dejagnu maintainer-clean-dejagnu +maybe-maintainer-clean-dejagnu: + +maintainer-clean-dejagnu: + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-diff maintainer-clean-diff +maybe-maintainer-clean-diff: + +maintainer-clean-diff: + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-dosutils maintainer-clean-dosutils +maybe-maintainer-clean-dosutils: + +maintainer-clean-dosutils: + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-etc maintainer-clean-etc +maybe-maintainer-clean-etc: + +maintainer-clean-etc: + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-fastjar maintainer-clean-fastjar +maybe-maintainer-clean-fastjar: + +maintainer-clean-fastjar: + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-fileutils maintainer-clean-fileutils +maybe-maintainer-clean-fileutils: + +maintainer-clean-fileutils: + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-findutils maintainer-clean-findutils +maybe-maintainer-clean-findutils: + +maintainer-clean-findutils: + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-find maintainer-clean-find +maybe-maintainer-clean-find: + +maintainer-clean-find: + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-flex maintainer-clean-flex +maybe-maintainer-clean-flex: + +maintainer-clean-flex: + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gas maintainer-clean-gas +maybe-maintainer-clean-gas: + +maintainer-clean-gas: + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gawk maintainer-clean-gawk +maybe-maintainer-clean-gawk: + +maintainer-clean-gawk: + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gettext maintainer-clean-gettext +maybe-maintainer-clean-gettext: + +maintainer-clean-gettext: + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gnuserv maintainer-clean-gnuserv +maybe-maintainer-clean-gnuserv: + +maintainer-clean-gnuserv: + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gprof maintainer-clean-gprof +maybe-maintainer-clean-gprof: + +maintainer-clean-gprof: + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gzip maintainer-clean-gzip +maybe-maintainer-clean-gzip: + +maintainer-clean-gzip: + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-hello maintainer-clean-hello +maybe-maintainer-clean-hello: + +maintainer-clean-hello: + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-indent maintainer-clean-indent +maybe-maintainer-clean-indent: + +maintainer-clean-indent: + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-intl maintainer-clean-intl +maybe-maintainer-clean-intl: + +maintainer-clean-intl: + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-tcl maintainer-clean-tcl +maybe-maintainer-clean-tcl: + +maintainer-clean-tcl: + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-itcl maintainer-clean-itcl +maybe-maintainer-clean-itcl: + +maintainer-clean-itcl: + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-ld maintainer-clean-ld +maybe-maintainer-clean-ld: + +maintainer-clean-ld: + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-libgui maintainer-clean-libgui +maybe-maintainer-clean-libgui: + +maintainer-clean-libgui: + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-libiberty maintainer-clean-libiberty +maybe-maintainer-clean-libiberty: + +maintainer-clean-libiberty: + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-libtool maintainer-clean-libtool +maybe-maintainer-clean-libtool: + +maintainer-clean-libtool: + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-m4 maintainer-clean-m4 +maybe-maintainer-clean-m4: + +maintainer-clean-m4: + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-make maintainer-clean-make +maybe-maintainer-clean-make: + +maintainer-clean-make: + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-mmalloc maintainer-clean-mmalloc +maybe-maintainer-clean-mmalloc: + +maintainer-clean-mmalloc: + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-patch maintainer-clean-patch +maybe-maintainer-clean-patch: + +maintainer-clean-patch: + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-perl maintainer-clean-perl +maybe-maintainer-clean-perl: + +maintainer-clean-perl: + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-prms maintainer-clean-prms +maybe-maintainer-clean-prms: + +maintainer-clean-prms: + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-rcs maintainer-clean-rcs +maybe-maintainer-clean-rcs: + +maintainer-clean-rcs: + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-readline maintainer-clean-readline +maybe-maintainer-clean-readline: + +maintainer-clean-readline: + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-release maintainer-clean-release +maybe-maintainer-clean-release: + +maintainer-clean-release: + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-recode maintainer-clean-recode +maybe-maintainer-clean-recode: + +maintainer-clean-recode: + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-sed maintainer-clean-sed +maybe-maintainer-clean-sed: + +maintainer-clean-sed: + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-send-pr maintainer-clean-send-pr +maybe-maintainer-clean-send-pr: + +maintainer-clean-send-pr: + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-shellutils maintainer-clean-shellutils +maybe-maintainer-clean-shellutils: + +maintainer-clean-shellutils: + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-sid maintainer-clean-sid +maybe-maintainer-clean-sid: + +maintainer-clean-sid: + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-sim maintainer-clean-sim +maybe-maintainer-clean-sim: + +maintainer-clean-sim: + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-tar maintainer-clean-tar +maybe-maintainer-clean-tar: + +maintainer-clean-tar: + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-texinfo maintainer-clean-texinfo +maybe-maintainer-clean-texinfo: + +maintainer-clean-texinfo: + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-textutils maintainer-clean-textutils +maybe-maintainer-clean-textutils: + +maintainer-clean-textutils: + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-time maintainer-clean-time +maybe-maintainer-clean-time: + +maintainer-clean-time: + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-uudecode maintainer-clean-uudecode +maybe-maintainer-clean-uudecode: + +maintainer-clean-uudecode: + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-wdiff maintainer-clean-wdiff +maybe-maintainer-clean-wdiff: + +maintainer-clean-wdiff: + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-zip maintainer-clean-zip +maybe-maintainer-clean-zip: + +maintainer-clean-zip: + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-zlib maintainer-clean-zlib +maybe-maintainer-clean-zlib: + +maintainer-clean-zlib: + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gdb maintainer-clean-gdb +maybe-maintainer-clean-gdb: + +maintainer-clean-gdb: + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-expect maintainer-clean-expect +maybe-maintainer-clean-expect: + +maintainer-clean-expect: + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-guile maintainer-clean-guile +maybe-maintainer-clean-guile: + +maintainer-clean-guile: + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-tk maintainer-clean-tk +maybe-maintainer-clean-tk: + +maintainer-clean-tk: + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-tix maintainer-clean-tix +maybe-maintainer-clean-tix: + +maintainer-clean-tix: + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-libtermcap maintainer-clean-libtermcap +maybe-maintainer-clean-libtermcap: + +# libtermcap doesn't support maintainer-clean. +maintainer-clean-libtermcap: + + +.PHONY: maybe-maintainer-clean-utils maintainer-clean-utils +maybe-maintainer-clean-utils: + +maintainer-clean-utils: + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-maintainer-clean-target-libstdc++-v3 maintainer-clean-target-libstdc++-v3 +maybe-maintainer-clean-target-libstdc++-v3: + +maintainer-clean-target-libstdc++-v3: + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-newlib maintainer-clean-target-newlib +maybe-maintainer-clean-target-newlib: + +maintainer-clean-target-newlib: + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-libf2c maintainer-clean-target-libf2c +maybe-maintainer-clean-target-libf2c: + +maintainer-clean-target-libf2c: + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-libobjc maintainer-clean-target-libobjc +maybe-maintainer-clean-target-libobjc: + +maintainer-clean-target-libobjc: + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-libtermcap maintainer-clean-target-libtermcap +maybe-maintainer-clean-target-libtermcap: + +# libtermcap doesn't support maintainer-clean. +maintainer-clean-target-libtermcap: + + +.PHONY: maybe-maintainer-clean-target-winsup maintainer-clean-target-winsup +maybe-maintainer-clean-target-winsup: + +maintainer-clean-target-winsup: + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-libgloss maintainer-clean-target-libgloss +maybe-maintainer-clean-target-libgloss: + +maintainer-clean-target-libgloss: + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + -# The target built for a native build. -.PHONY: all.normal -all.normal: @all_build_modules@ all-host all-target +.PHONY: maybe-maintainer-clean-target-libiberty maintainer-clean-target-libiberty +maybe-maintainer-clean-target-libiberty: -.PHONY: all-host -all-host: maybe-all-gcc \ - maybe-all-ash \ - maybe-all-autoconf \ - maybe-all-automake \ - maybe-all-bash \ - maybe-all-bfd \ - maybe-all-opcodes \ - maybe-all-binutils \ - maybe-all-bison \ - maybe-all-byacc \ - maybe-all-bzip2 \ - maybe-all-dejagnu \ - maybe-all-diff \ - maybe-all-dosutils \ - maybe-all-etc \ - maybe-all-fastjar \ - maybe-all-fileutils \ - maybe-all-findutils \ - maybe-all-find \ - maybe-all-flex \ - maybe-all-gas \ - maybe-all-gawk \ - maybe-all-gettext \ - maybe-all-gnuserv \ - maybe-all-gprof \ - maybe-all-gzip \ - maybe-all-hello \ - maybe-all-indent \ - maybe-all-intl \ - maybe-all-tcl \ - maybe-all-itcl \ - maybe-all-ld \ - maybe-all-libgui \ - maybe-all-libiberty \ - maybe-all-libtool \ - maybe-all-m4 \ - maybe-all-make \ - maybe-all-mmalloc \ - maybe-all-patch \ - maybe-all-perl \ - maybe-all-prms \ - maybe-all-rcs \ - maybe-all-readline \ - maybe-all-release \ - maybe-all-recode \ - maybe-all-sed \ - maybe-all-send-pr \ - maybe-all-shellutils \ - maybe-all-sid \ - maybe-all-sim \ - maybe-all-tar \ - maybe-all-texinfo \ - maybe-all-textutils \ - maybe-all-time \ - maybe-all-uudecode \ - maybe-all-wdiff \ - maybe-all-zip \ - maybe-all-zlib \ - maybe-all-gdb \ - maybe-all-expect \ - maybe-all-guile \ - maybe-all-tk \ - maybe-all-tix \ - maybe-all-libtermcap \ - maybe-all-utils -.PHONY: all-target -all-target: \ - maybe-all-target-libstdc++-v3 \ - maybe-all-target-newlib \ - maybe-all-target-libf2c \ - maybe-all-target-libobjc \ - maybe-all-target-libtermcap \ - maybe-all-target-winsup \ - maybe-all-target-libgloss \ - maybe-all-target-libiberty \ - maybe-all-target-gperf \ - maybe-all-target-examples \ - maybe-all-target-libffi \ - maybe-all-target-libjava \ - maybe-all-target-zlib \ - maybe-all-target-boehm-gc \ - maybe-all-target-qthreads \ - maybe-all-target-rda +maintainer-clean-target-libiberty: + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 -# Do a target for all the subdirectories. A ``make do-X'' will do a -# ``make X'' in all subdirectories (because, in general, there is a -# dependency (below) of X upon do-X, a ``make X'' will also do this, -# but it may do additional work as well). -# This target ensures that $(BASE_FLAGS_TO_PASS) appears only once, -# because it is so large that it can easily overflow the command line -# length limit on some systems. -.PHONY: do-clean -do-clean: - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(SUBDIRS) -dummy-; do \ - if [ -f ./$$i/Makefile ]; then \ - case $$i in \ - gcc) \ - for flag in $(EXTRA_GCC_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - *) \ - for flag in $(EXTRA_HOST_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - esac ; \ - (cd ./$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - clean) \ - || exit 1; \ - else true; fi; \ - done - # Break into two pieces - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(TARGET_CONFIGDIRS) -dummy-; do \ - if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - clean) \ - || exit 1; \ - else true; fi; \ - done +.PHONY: maybe-maintainer-clean-target-gperf maintainer-clean-target-gperf +maybe-maintainer-clean-target-gperf: -.PHONY: do-distclean -do-distclean: - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(SUBDIRS) -dummy-; do \ - if [ -f ./$$i/Makefile ]; then \ - case $$i in \ - gcc) \ - for flag in $(EXTRA_GCC_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - *) \ - for flag in $(EXTRA_HOST_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - esac ; \ - (cd ./$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - distclean) \ - || exit 1; \ - else true; fi; \ - done - # Break into two pieces - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(TARGET_CONFIGDIRS) -dummy-; do \ - if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - distclean) \ - || exit 1; \ - else true; fi; \ - done +maintainer-clean-target-gperf: + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 -.PHONY: do-dvi -do-dvi: - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(SUBDIRS) -dummy-; do \ - if [ -f ./$$i/Makefile ]; then \ - case $$i in \ - gcc) \ - for flag in $(EXTRA_GCC_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - *) \ - for flag in $(EXTRA_HOST_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - esac ; \ - (cd ./$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - dvi) \ - || exit 1; \ - else true; fi; \ - done - # Break into two pieces - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(TARGET_CONFIGDIRS) -dummy-; do \ - if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - dvi) \ - || exit 1; \ - else true; fi; \ - done -.PHONY: do-info -do-info: - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(SUBDIRS) -dummy-; do \ - if [ -f ./$$i/Makefile ]; then \ - case $$i in \ - gcc) \ - for flag in $(EXTRA_GCC_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - *) \ - for flag in $(EXTRA_HOST_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - esac ; \ - (cd ./$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - info) \ - || exit 1; \ - else true; fi; \ - done - # Break into two pieces - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(TARGET_CONFIGDIRS) -dummy-; do \ - if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - info) \ - || exit 1; \ - else true; fi; \ - done +.PHONY: maybe-maintainer-clean-target-examples maintainer-clean-target-examples +maybe-maintainer-clean-target-examples: -.PHONY: do-install-info -do-install-info: - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(SUBDIRS) -dummy-; do \ - if [ -f ./$$i/Makefile ]; then \ - case $$i in \ - gcc) \ - for flag in $(EXTRA_GCC_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - *) \ - for flag in $(EXTRA_HOST_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - esac ; \ - (cd ./$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - install-info) \ - || exit 1; \ - else true; fi; \ - done - # Break into two pieces - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(TARGET_CONFIGDIRS) -dummy-; do \ - if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - install-info) \ - || exit 1; \ - else true; fi; \ - done +maintainer-clean-target-examples: + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 -.PHONY: do-installcheck -do-installcheck: - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(SUBDIRS) -dummy-; do \ - if [ -f ./$$i/Makefile ]; then \ - case $$i in \ - gcc) \ - for flag in $(EXTRA_GCC_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - *) \ - for flag in $(EXTRA_HOST_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - esac ; \ - (cd ./$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - installcheck) \ - || exit 1; \ - else true; fi; \ - done - # Break into two pieces - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(TARGET_CONFIGDIRS) -dummy-; do \ - if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - installcheck) \ - || exit 1; \ - else true; fi; \ - done -.PHONY: do-mostlyclean -do-mostlyclean: - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(SUBDIRS) -dummy-; do \ - if [ -f ./$$i/Makefile ]; then \ - case $$i in \ - gcc) \ - for flag in $(EXTRA_GCC_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - *) \ - for flag in $(EXTRA_HOST_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - esac ; \ - (cd ./$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - mostlyclean) \ - || exit 1; \ - else true; fi; \ - done - # Break into two pieces - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(TARGET_CONFIGDIRS) -dummy-; do \ - if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - mostlyclean) \ - || exit 1; \ - else true; fi; \ - done +.PHONY: maybe-maintainer-clean-target-libffi maintainer-clean-target-libffi +maybe-maintainer-clean-target-libffi: -.PHONY: do-maintainer-clean -do-maintainer-clean: - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(SUBDIRS) -dummy-; do \ - if [ -f ./$$i/Makefile ]; then \ - case $$i in \ - gcc) \ - for flag in $(EXTRA_GCC_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - *) \ - for flag in $(EXTRA_HOST_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - esac ; \ - (cd ./$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - maintainer-clean) \ - || exit 1; \ - else true; fi; \ - done - # Break into two pieces - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(TARGET_CONFIGDIRS) -dummy-; do \ - if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - maintainer-clean) \ - || exit 1; \ - else true; fi; \ - done +maintainer-clean-target-libffi: + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-libjava maintainer-clean-target-libjava +maybe-maintainer-clean-target-libjava: + +maintainer-clean-target-libjava: + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-zlib maintainer-clean-target-zlib +maybe-maintainer-clean-target-zlib: + +maintainer-clean-target-zlib: + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-boehm-gc maintainer-clean-target-boehm-gc +maybe-maintainer-clean-target-boehm-gc: + +maintainer-clean-target-boehm-gc: + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-qthreads maintainer-clean-target-qthreads +maybe-maintainer-clean-target-qthreads: + +maintainer-clean-target-qthreads: + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-rda maintainer-clean-target-rda +maybe-maintainer-clean-target-rda: + +maintainer-clean-target-rda: + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 -.PHONY: do-TAGS -do-TAGS: - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(SUBDIRS) -dummy-; do \ - if [ -f ./$$i/Makefile ]; then \ - case $$i in \ - gcc) \ - for flag in $(EXTRA_GCC_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - *) \ - for flag in $(EXTRA_HOST_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - esac ; \ - (cd ./$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - TAGS) \ - || exit 1; \ - else true; fi; \ - done - # Break into two pieces - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(TARGET_CONFIGDIRS) -dummy-; do \ - if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/$$i && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - TAGS) \ - || exit 1; \ - else true; fi; \ - done @@ -1291,33 +17278,8 @@ maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean maintainer-clean: local-distclean realclean: maintainer-clean -# This rule is used to clean specific modules. -.PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc -$(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc: - @dir=`echo $@ | sed -e 's/clean-//'`; \ - if [ -f ./$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $${dir} && $(MAKE) $(FLAGS_TO_PASS) clean); \ - else \ - true; \ - fi - -.PHONY: $(CLEAN_TARGET_MODULES) -$(CLEAN_TARGET_MODULES): - @dir=`echo $@ | sed -e 's/clean-target-//'`; \ - rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \ - if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/$${dir} && $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \ - else \ - true; \ - fi - -clean-target: $(CLEAN_TARGET_MODULES) clean-target-libgcc +# Extra dependency for clean-target, owing to the mixed nature of gcc +clean-target: clean-target-libgcc clean-target-libgcc: test ! -d gcc/libgcc || \ (cd gcc/libgcc && find . -type d -print) | \ @@ -1328,7 +17290,7 @@ clean-target-libgcc: .PHONY: check do-check check: - $(MAKE) do-check NOTPARALLEL=parallel-ok + $(MAKE) do-check # Only include modules actually being configured and built. do-check: maybe-check-gcc \ @@ -1731,18 +17693,16 @@ configure-ash: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in ash; \ cd ash || exit 1; \ case $(srcdir) in \ @@ -1799,18 +17759,16 @@ configure-autoconf: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in autoconf; \ cd autoconf || exit 1; \ case $(srcdir) in \ @@ -1867,18 +17825,16 @@ configure-automake: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in automake; \ cd automake || exit 1; \ case $(srcdir) in \ @@ -1935,18 +17891,16 @@ configure-bash: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in bash; \ cd bash || exit 1; \ case $(srcdir) in \ @@ -2003,18 +17957,16 @@ configure-bfd: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in bfd; \ cd bfd || exit 1; \ case $(srcdir) in \ @@ -2071,18 +18023,16 @@ configure-opcodes: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in opcodes; \ cd opcodes || exit 1; \ case $(srcdir) in \ @@ -2139,18 +18089,16 @@ configure-binutils: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in binutils; \ cd binutils || exit 1; \ case $(srcdir) in \ @@ -2207,18 +18155,16 @@ configure-bison: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in bison; \ cd bison || exit 1; \ case $(srcdir) in \ @@ -2249,7 +18195,7 @@ maybe-check-bison: # This module is only tested in a native toolchain. check-bison: - @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + @if [ '$(host)' = '$(target)' ] ; then \ r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ @@ -2278,18 +18224,16 @@ configure-byacc: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in byacc; \ cd byacc || exit 1; \ case $(srcdir) in \ @@ -2320,7 +18264,7 @@ maybe-check-byacc: # This module is only tested in a native toolchain. check-byacc: - @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + @if [ '$(host)' = '$(target)' ] ; then \ r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ @@ -2349,18 +18293,16 @@ configure-bzip2: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in bzip2; \ cd bzip2 || exit 1; \ case $(srcdir) in \ @@ -2417,18 +18359,16 @@ configure-dejagnu: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in dejagnu; \ cd dejagnu || exit 1; \ case $(srcdir) in \ @@ -2485,18 +18425,16 @@ configure-diff: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in diff; \ cd diff || exit 1; \ case $(srcdir) in \ @@ -2553,18 +18491,16 @@ configure-dosutils: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in dosutils; \ cd dosutils || exit 1; \ case $(srcdir) in \ @@ -2617,18 +18553,16 @@ configure-etc: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in etc; \ cd etc || exit 1; \ case $(srcdir) in \ @@ -2685,18 +18619,16 @@ configure-fastjar: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in fastjar; \ cd fastjar || exit 1; \ case $(srcdir) in \ @@ -2727,7 +18659,7 @@ maybe-check-fastjar: # This module is only tested in a native toolchain. check-fastjar: - @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + @if [ '$(host)' = '$(target)' ] ; then \ r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ @@ -2756,18 +18688,16 @@ configure-fileutils: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in fileutils; \ cd fileutils || exit 1; \ case $(srcdir) in \ @@ -2824,18 +18754,16 @@ configure-findutils: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in findutils; \ cd findutils || exit 1; \ case $(srcdir) in \ @@ -2892,18 +18820,16 @@ configure-find: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in find; \ cd find || exit 1; \ case $(srcdir) in \ @@ -2960,18 +18886,16 @@ configure-flex: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in flex; \ cd flex || exit 1; \ case $(srcdir) in \ @@ -3002,7 +18926,7 @@ maybe-check-flex: # This module is only tested in a native toolchain. check-flex: - @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + @if [ '$(host)' = '$(target)' ] ; then \ r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ @@ -3031,18 +18955,16 @@ configure-gas: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in gas; \ cd gas || exit 1; \ case $(srcdir) in \ @@ -3099,18 +19021,16 @@ configure-gawk: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in gawk; \ cd gawk || exit 1; \ case $(srcdir) in \ @@ -3167,18 +19087,16 @@ configure-gettext: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in gettext; \ cd gettext || exit 1; \ case $(srcdir) in \ @@ -3235,18 +19153,16 @@ configure-gnuserv: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in gnuserv; \ cd gnuserv || exit 1; \ case $(srcdir) in \ @@ -3303,18 +19219,16 @@ configure-gprof: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in gprof; \ cd gprof || exit 1; \ case $(srcdir) in \ @@ -3371,18 +19285,16 @@ configure-gzip: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in gzip; \ cd gzip || exit 1; \ case $(srcdir) in \ @@ -3439,18 +19351,16 @@ configure-hello: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in hello; \ cd hello || exit 1; \ case $(srcdir) in \ @@ -3507,18 +19417,16 @@ configure-indent: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in indent; \ cd indent || exit 1; \ case $(srcdir) in \ @@ -3575,18 +19483,16 @@ configure-intl: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in intl; \ cd intl || exit 1; \ case $(srcdir) in \ @@ -3643,18 +19549,16 @@ configure-tcl: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in tcl; \ cd tcl || exit 1; \ case $(srcdir) in \ @@ -3711,18 +19615,16 @@ configure-itcl: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in itcl; \ cd itcl || exit 1; \ case $(srcdir) in \ @@ -3779,18 +19681,16 @@ configure-ld: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in ld; \ cd ld || exit 1; \ case $(srcdir) in \ @@ -3847,18 +19747,16 @@ configure-libgui: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in libgui; \ cd libgui || exit 1; \ case $(srcdir) in \ @@ -3915,18 +19813,16 @@ configure-libiberty: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in libiberty; \ cd libiberty || exit 1; \ case $(srcdir) in \ @@ -3983,18 +19879,16 @@ configure-libtool: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in libtool; \ cd libtool || exit 1; \ case $(srcdir) in \ @@ -4051,18 +19945,16 @@ configure-m4: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in m4; \ cd m4 || exit 1; \ case $(srcdir) in \ @@ -4119,18 +20011,16 @@ configure-make: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in make; \ cd make || exit 1; \ case $(srcdir) in \ @@ -4187,18 +20077,16 @@ configure-mmalloc: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in mmalloc; \ cd mmalloc || exit 1; \ case $(srcdir) in \ @@ -4251,18 +20139,16 @@ configure-patch: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in patch; \ cd patch || exit 1; \ case $(srcdir) in \ @@ -4319,18 +20205,16 @@ configure-perl: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in perl; \ cd perl || exit 1; \ case $(srcdir) in \ @@ -4387,18 +20271,16 @@ configure-prms: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in prms; \ cd prms || exit 1; \ case $(srcdir) in \ @@ -4455,18 +20337,16 @@ configure-rcs: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in rcs; \ cd rcs || exit 1; \ case $(srcdir) in \ @@ -4523,18 +20403,16 @@ configure-readline: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in readline; \ cd readline || exit 1; \ case $(srcdir) in \ @@ -4591,18 +20469,16 @@ configure-release: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in release; \ cd release || exit 1; \ case $(srcdir) in \ @@ -4651,18 +20527,16 @@ configure-recode: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in recode; \ cd recode || exit 1; \ case $(srcdir) in \ @@ -4719,18 +20593,16 @@ configure-sed: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in sed; \ cd sed || exit 1; \ case $(srcdir) in \ @@ -4787,18 +20659,16 @@ configure-send-pr: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in send-pr; \ cd send-pr || exit 1; \ case $(srcdir) in \ @@ -4855,18 +20725,16 @@ configure-shellutils: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in shellutils; \ cd shellutils || exit 1; \ case $(srcdir) in \ @@ -4923,18 +20791,16 @@ configure-sid: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in sid; \ cd sid || exit 1; \ case $(srcdir) in \ @@ -4991,18 +20857,16 @@ configure-sim: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in sim; \ cd sim || exit 1; \ case $(srcdir) in \ @@ -5059,18 +20923,16 @@ configure-tar: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in tar; \ cd tar || exit 1; \ case $(srcdir) in \ @@ -5127,18 +20989,16 @@ configure-texinfo: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in texinfo; \ cd texinfo || exit 1; \ case $(srcdir) in \ @@ -5191,18 +21051,16 @@ configure-textutils: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in textutils; \ cd textutils || exit 1; \ case $(srcdir) in \ @@ -5259,18 +21117,16 @@ configure-time: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in time; \ cd time || exit 1; \ case $(srcdir) in \ @@ -5327,18 +21183,16 @@ configure-uudecode: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in uudecode; \ cd uudecode || exit 1; \ case $(srcdir) in \ @@ -5395,18 +21249,16 @@ configure-wdiff: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in wdiff; \ cd wdiff || exit 1; \ case $(srcdir) in \ @@ -5463,18 +21315,16 @@ configure-zip: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in zip; \ cd zip || exit 1; \ case $(srcdir) in \ @@ -5505,7 +21355,7 @@ maybe-check-zip: # This module is only tested in a native toolchain. check-zip: - @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + @if [ '$(host)' = '$(target)' ] ; then \ r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ @@ -5534,18 +21384,16 @@ configure-zlib: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in zlib; \ cd zlib || exit 1; \ case $(srcdir) in \ @@ -5594,18 +21442,16 @@ configure-gdb: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in gdb; \ cd gdb || exit 1; \ case $(srcdir) in \ @@ -5662,18 +21508,16 @@ configure-expect: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in expect; \ cd expect || exit 1; \ case $(srcdir) in \ @@ -5730,18 +21574,16 @@ configure-guile: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in guile; \ cd guile || exit 1; \ case $(srcdir) in \ @@ -5798,18 +21640,16 @@ configure-tk: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in tk; \ cd tk || exit 1; \ case $(srcdir) in \ @@ -5866,18 +21706,16 @@ configure-tix: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in tix; \ cd tix || exit 1; \ case $(srcdir) in \ @@ -5934,18 +21772,16 @@ configure-libtermcap: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in libtermcap; \ cd libtermcap || exit 1; \ case $(srcdir) in \ @@ -5998,18 +21834,16 @@ configure-utils: CFLAGS="$(CFLAGS)"; export CFLAGS; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in utils; \ cd utils || exit 1; \ case $(srcdir) in \ @@ -7712,18 +23546,16 @@ configure-gcc: CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ - if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ - AR="$(AR)"; export AR; \ - AS="$(AS)"; export AS; \ - CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ - DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ - LD="$(LD)"; export LD; \ - NM="$(NM)"; export NM; \ - RANLIB="$(RANLIB)"; export RANLIB; \ - WINDRES="$(WINDRES)"; export WINDRES; \ - OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ - OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ - fi; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ echo Configuring in gcc; \ cd gcc || exit 1; \ case $(srcdir) in \ @@ -7802,6 +23634,23 @@ $(GCC_STRAP_TARGETS): all-bootstrap configure-gcc echo "Building runtime libraries"; \ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all +profiledbootstrap: all-bootstrap configure-gcc + @r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Bootstrapping the compiler"; \ + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build + @r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}` ; export s; \ + $(SET_LIB_PATH) \ + echo "Building runtime libraries and training compiler"; \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all + @r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + echo "Building feedback based compiler"; \ + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build + .PHONY: cross cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld @r=`${PWD}`; export r; \ @@ -7816,7 +23665,7 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \ LANGUAGES="c c++" all -.PHONY: check-gcc +.PHONY: check-gcc maybe-check-gcc maybe-check-gcc: check-gcc: @if [ -f ./gcc/Makefile ] ; then \ @@ -7841,7 +23690,7 @@ check-gcc-c++: .PHONY: check-c++ check-c++: - $(MAKE) check-target-libstdc++-v3 check-gcc-c++ NOTPARALLEL=parallel-ok + $(MAKE) check-target-libstdc++-v3 check-gcc-c++ .PHONY: install-gcc maybe-install-gcc maybe-install-gcc: @@ -7898,7 +23747,7 @@ all-bootstrap: maybe-all-libiberty maybe-all-texinfo maybe-all-bison maybe-all-b # Host modules specific to gdb. # GDB needs to know that the simulator is being built. -configure-gdb: maybe-configure-tcl maybe-configure-tk maybe-configure-sim +configure-gdb: maybe-configure-itcl maybe-configure-tcl maybe-configure-tk maybe-configure-sim GDB_TK = @GDB_TK@ all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK) install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui @@ -8038,12 +23887,6 @@ $(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4 # Special directives to GNU Make # ------------------------------ -# Tell GNU make 3.79 not to run the top level in parallel. This -# prevents contention for $builddir/$target/config.cache, as well -# as minimizing scatter in file system caches. -NOTPARALLEL = .NOTPARALLEL -$(NOTPARALLEL): - # Don't pass command-line variables to submakes. .NOEXPORT: MAKEOVERRIDES= diff --git a/README-maintainer-mode b/README-maintainer-mode index fbe508f0c6e..0115a1ee556 100644 --- a/README-maintainer-mode +++ b/README-maintainer-mode @@ -3,7 +3,7 @@ Note that if you configure with --enable-maintainer-mode, you will need special versions of automake, autoconf, libtool and gettext. You will -find the sources for these in ftp://sourceware.cygnus.com/pub/binutils. +find the sources for these in ftp://sources.redhat.com/pub/binutils. Note - "make distclean" does not work with maintainer mode enabled. The Makefiles in the some of the po/ subdirectories depend upon the diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 14f90db7c0f..44159e5a1c1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,594 @@ +2003-06-27 Nick Clifton + + * opncls.c (bfd_add_gnu_debuglink_section): Rename to + bfd_add_gnu_debuglink_section and only create the section, do not + fill in its contents. + (bfd_fill_in_gnu_debuglink_section): New function. Fill in the + contents of a .gnu-debuglink section. + * bfd-in2.h: Regenerate. + +2003-06-27 Thiemo Seufer + + * elfxx-mips.c: Revert .got alignment to 2**4. + +2003-06-27 Thiemo Seufer + + * elf32-mips.c: Fix addend for _gp_disp special symbol. + +2003-06-27 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove non-default + relocation header setup. + +2003-06-25 Alan Modra + + * elf32-ppc.c (ppc_elf_howto_table): Remove unnecessary cast. + (ppc_elf_reloc_type_lookup): Modify comment. + (ppc_elf_info_to_howto): Ditto. + (ppc_elf_relocate_section): Ditto. + (ppc_elf_check_relocs): Call ppc_elf_howto_init. + +2003-06-25 Alan Modra + + * aout-ns32k.c: Correct spelling of "relocatable". + * aoutx.h: Likewise. + * bfd-in.h: Likewise. + * bfd.c: Likewise. + * bout.c: Likewise. + * coff-a29k.c: Likewise. + * coff-alpha.c: Likewise. + * coff-arm.c: Likewise. + * coff-i386.c: Likewise. + * coff-i860.c: Likewise. + * coff-i960.c: Likewise. + * coff-m68k.c: Likewise. + * coff-m88k.c: Likewise. + * coff-mcore.c: Likewise. + * coff-mips.c: Likewise. + * coff-or32.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-tic80.c: Likewise. + * coff64-rs6000.c: Likewise. + * cofflink.c: Likewise. + * cpu-ns32k.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + * elf-bfd.h: Likewise. + * elf-eh-frame.c: Likewise. + * elf-hppa.h: Likewise. + * elf-m10200.c: Likewise. + * elf-m10300.c: Likewise. + * elf.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-avr.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-d10v.c: Likewise. + * elf32-dlx.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-frv.c: Likewise. + * elf32-h8300.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i860.c: Likewise. + * elf32-i960.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-iq2000.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-msp430.c: Likewise. + * elf32-openrisc.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-vax.c: Likewise. + * elf32-xstormy16.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mips.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfcode.h: Likewise. + * elflink.h: Likewise. + * elfn32-mips.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * i386linux.c: Likewise. + * ieee.c: Likewise. + * libcoff-in.h: Likewise. + * linker.c: Likewise. + * m68klinux.c: Likewise. + * pdp11.c: Likewise. + * pe-mips.c: Likewise. + * peXXigen.c: Likewise. + * reloc.c: Likewise. + * reloc16.c: Likewise. + * sparclinux.c: Likewise. + * sunos.c: Likewise. + * syms.c: Likewise. + * versados.c: Likewise. + * vms.c: Likewise. + * xcofflink.c: Likewise. + * bfd-in2.h: Regenerate. + * libcoff.h: Regenerate. + * libbfd.h: Regenerate. + +2003-06-24 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Report plt reloc against + local sym errors. + + * elf32-i386.c: Convert to C90 function definitions, remove unnecessary + prototypes and casts. Replace PTR with void *. Formatting. + * elf32-ppc.c: Likewise. Break long strings too. + (ppc_elf_relax_section): Use enum elf_ppc_reloc_type for r_type. + (ppc_elf_unhandled_reloc): Internationalize error message. + * elf32-ppc.h: Remove PARAMS. + +2003-06-23 Mark Mitchell + + * elf32-ppc.c (ppc_elf_begin_write_processing): Use bytes to count + APUinfo slots. + (ppc_elf_final_write_processing): Likewise. + +2003-06-23 H.J. Lu + + * elflink.h (elf_link_input_bfd): Check raw size when using + kept_section to preserve debug information discarded by + linkonce. + +2003-06-20 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_table): Add top_id. + (ppc64_elf_setup_section_lists): Set it. + (ppc64_elf_relocate_section): Check sym section id against top_id. + (ppc_build_one_stub): Comment on top_id. + +2003-06-20 Ralf Corsepius + + * config.bfd: Add tic4x-*-rtems*. + +2003-06-20 Alan Modra + + * elf64-ppc.c: Convert to C90 function definitions, remove unnecessary + prototypes and casts. Replace PTR with void *. Format copyright. + Mention ABI links. + (struct ppc_link_hash_table): Rename sgot, srelgot, splt, srelplt, + sdynbss, srelbss, sglink, sbrlt and srelbrlt to got, relgot .. relbrlt. + (ppc_type_of_stub): Make r_type an enum. + (ppc64_elf_size_stubs): Likewise. + * elf64-ppc.h: Remove PARAMS macro. + +2003-06-19 Alan Modra + + * elf64-ppc.c (ppc64_elf_link_hash_table_create): Reinstate init of + elf hash tab fields. + + * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Tidy prototype. + (ppc64_elf_info_to_howto): Likewise. + (ppc64_elf_build_stubs): Add "stats" param, and print statistics. + * elf64-ppc.h (ppc64_elf_build_stubs): Adjust prototype. + +2003-06-19 Alan Modra + + * elf64-sparc.c (sparc64_elf_relocate_section): Ignore R_SPARC_DISP32 + reloc overflow on discarded eh_frame entries. + +2003-06-19 Alan Modra + + * elf64-ppc.c (toc_adjusting_stub_needed): New function. + (ppc64_elf_next_input_section): Use it here to set has_gp_reloc. + Return error condition. + (ppc64_elf_size_stubs): Restrict toc adjusting stubs to sections + that have has_gp_reloc set. + (struct ppc_link_hash_table): Add stub_count. + (ppc_build_one_stub): Increment it. + (ppc64_elf_link_hash_table_create): zmalloc rather than clearing + individual fields. + * elf64-ppc.h (ppc64_elf_next_input_section): Update prototype. + +2003-06-18 Alan Modra + + * elflink.h (elf_gc_record_vtentry): Revert last change. Correct + size calculation from addend. Round size up. + +2003-06-18 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) : When linking a program, don't complain about a + symbol from a normal object or an undefined weak symbol. + +2003-06-18 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Accept a symbol on + R_PPC64_TOC relocs. + +2003-06-17 H.J. Lu + + * section.c (struct sec): Put back kept_section. + (STD_SECTION): Put back kept_section initialization. + * bfd-in2.h: Regenerate. + + * elflink.h (elf_link_input_bfd): Also check discarded linkonce + sections for relocateable output. Use kept_section to preserve + debug information discarded by linkonce. + +2003-06-17 Roland McGrath + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Support + segment-relative relocation between different segments. + +2003-06-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Do unaligned reloc + optimizations earlier. + + * elf64-ppc.c (struct ppc_link_hash_table): Reinstate top_index. + Restore previous input_list type. + (ppc64_elf_link_hash_table_create): Undo last change. + (ppc64_elf_setup_section_lists): Reinstate code setting up input lists + per output section, but don't bother with bfd_abs_section marker. + (ppc64_elf_next_input_section): Adjust for multiple input section + lists. + (group_sections): Likewise. + +2003-06-17 Jakub Jelinek + + * elf64-ppc.c (ppc64_elf_relocation_section): Ensure + *r_offset == r_addend for RELATIVE relocs against .got. + +2003-06-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Optimize unaligned relocs. + +2003-06-17 Nick Clifton + + * elflink.h (elf_gc_record_vtentry): Allocate an extra element + in the vtable_entries_used array to allow for the accessing + the largest element. + +2003-06-17 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_table): Remove top_index. Modify + input_list. + (ppc64_elf_link_hash_table_create): Init input_list here. + (ppc64_elf_setup_section_lists): Remove code setting up input lists + per output section. Set toc_off for abs and other standard sections. + (ppc64_elf_reinit_toc): Don't set elf_gp on input bfds lacking a toc. + (ppc64_elf_next_input_section): Adjust for single input section list. + Don't set toc_curr from input bfds that haven't set elf_gp. + (group_sections): Adjust for single input section list. + + * elf64-ppc.c (ppc64_elf_relocate_section): Correct pcrel section zero. + +2003-06-16 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing toctprel + tls, check that a TOC16_DS or TOC16_LO_DS reloc isn't pointing to a + dtprel entry. Ensure TLS_LD DTPMOD reloc has a zero addend. Write + got section for RELATIVE relocs. Fix wrong comment. Change condition + under which dynamic relocs update the section contents. + +2003-06-13 Robert Millan + + * config.bfd: Add i386-netbsd-gnu target. + +2003-06-12 Nick Clifton + + * opncls.c (calc_crc32): Rename to + bfd_calc_gnu_debuglink_crc32 and export. + (GNU_DEBUGLINK): Define and use to replace occurrences of + hard-coded ".gnu_debuglink" in the code. + (get_debug_link_info): Prevent aborts by replacing call to + xmalloc with a call to malloc. + (find_separate_debug_file): Prevent aborts by replacing calls + to xmalloc and xstrdup with calls to malloc and strdup. + (bfd_add_gnu_debuglink): New function. Add a .gnu_debuglink + section to a bfd. + * bfd-in2.h: Regenerate. + +2003-06-12 Federico G. Schwindt + + * config.bfd (i[3-7]86-*-openbsd[0-2].* | i[3-7]86-*-openbsd3.[0-3]): + New target (was i[3-7]86-*-openbsd* before). + (i[3-7]86-*-openbsd*): Change to use bfd_elf32_i386_vec. + (vax-*-openbsd*): New target. + +2003-06-11 Thiemo Seufer + + * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME): Use .MIPS.options + for n32, too. + (MIPS_ELF_STUB_SECTION_NAME): Use .MIPS.stubs for n32, too. + (mips_elf_rel_dyn_section): Use appropriate section alignment. + (mips_elf_create_got_section): Likewise. + (_bfd_mips_elf_create_dynamic_sections): Likewise. + +2003-06-11 Thiemo Seufer + + * elf32-mips.c (mips_elf_generic_reloc): New Function. + (elf_mips_howto_table_rel): Use it. + (gprel32_with_gp): Move prototype. + (mips_elf_hi16_reloc): Check for ! BSF_LOCAL instead of zero addend. + Use mips_elf_generic_reloc. + (mips_elf_got16_reloc): Check for ! BSF_LOCAL instead of zero addend. + Code cleanup. + (_bfd_mips_elf32_gprel16_reloc): Check for ! BSF_LOCAL instead of + zero addend. + (mips_elf_gprel32_reloc): Likewise. Use the same GP assignment logic + as in the other *_gprel*_reloc functions. + (gprel32_with_gp): Handle partial_inplace properly. + (mips32_64bit_reloc): Use mips_elf_generic_reloc. + (mips16_gprel_reloc): Check for ! BSF_LOCAL instead of zero addend. + Do addend handling directly instead of calling + _bfd_mips_elf_gprel16_with_gp. Handle partial_inplace properly. + * elf64-mips.c (mips_elf64_hi16_reloc): Check for ! BSF_LOCAL instead + of zero addend. Handle partial_inplace properly. + (mips_elf64_got16_reloc): Check for ! BSF_LOCAL instead of zero + addend. + (mips_elf64_gprel16_reloc): Likewise. + (mips_elf64_literal_reloc): Likewise. + (mips_elf64_gprel32_reloc): Likewise. Use the same GP assignment + logic as in the other *_gprel*_reloc functions. Handle + partial_inplace properly. + (mips_elf64_shift6_reloc): Check for ! BSF_LOCAL instead of zero + addend. Handle partial_inplace properly. + (mips16_gprel_reloc): Likewise. Do addend handling directly instead + of calling _bfd_mips_elf_gprel16_with_gp. + * elfn32-mips.c (mips_elf_got16_reloc): Check for BSF_LOCAL. + (mips_elf_gprel32_reloc): Check for ! BSF_LOCAL instead + of zero addend. + (mips_elf_shift6_reloc): Handle partial_inplace properly. + (mips16_gprel_reloc): Likewise. Do addend handling directly instead + of calling _bfd_mips_elf_gprel16_with_gp. + * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp): Handle + partial_inplace properly. Fix wrong addend handling. Fix overflow + check. + (_bfd_mips_elf_sign_extend): Renamed from mips_elf_sign_extend and + exported. + (mips_elf_calculate_relocation): Use _bfd_mips_elf_sign_extend. + (_bfd_mips_elf_relocate_section): Likewise. + (mips_elf_create_dynamic_relocation): Update sec_info_type access. + * elfxx-mips.h (_bfd_mips_relax_section): Fix prototype declaration. + (_bfd_mips_elf_sign_extend): New prototype. + +2003-06-11 Federico G. Schwindt + + * config.bfd (sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1]): + New target (was sparc-*-openbsd* before). + (sparc-*-openbsd*): Change to use bfd_elf32_sparc_vec. + + * configure.in (vax-*-openbsd*): Set COREFILE to netbsd-core.lo. + * configure: Regenerate. + +2003-06-11 H.J. Lu + + * po/Make-in (DESTDIR): New. + (install-data-yes): Support $(DESTDIR). + (uninstall): Likewise. + +2003-06-11 Alan Modra + + * Makefile.am (config.status): Depend on version.h. + Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2003-06-10 Alan Modra + Gary Hade + + * elf64-ppc.c (ppc64_elf_relocate_section <*_DS>): Special case lq. + +2003-06-10 Richard Sandiford + + * archures.c (bfd_mach_h8300sxn): New architecture. + * bfd-in2.h: Regenerate. + * cpu-h8300.c (h8300_scan): Check for 'sxn'. + (h8300sxn_info_struct): New. + (h8300sx_info_struct): Link to it. + * elf32-h8300.c (elf32_h8_mach): Add h8300sxn case. + (elf32_h8_final_write_processing): Likewise. + +2003-06-08 Alan Modra + + * elf64-ppc.c: Move TARGET_LITTLE_SYM and other macros used by + elfxx-target.h so that we can use elf_backend_got_header_size. + (ELF_MACHINE_ALT1, ELF_MACHINE_ALT2): Delete. + (GLINK_CALL_STUB_SIZE): Modify. Define new glink call stub and + associated macros. + (ppc64_elf_howto_raw ): Correct + dst_mask. + (enum ppc_stub_type): Add ppc_stub_long_branch_r2off and + ppc_stub_plt_branch_r2off. + (struct ppc_stub_hash_entry): Reorganize. + (struct ppc_link_hash_table): Add no_multi_toc, multi_toc_needed, + toc_curr, toc_off and emit_stub_syms. + (ppc64_elf_link_hash_table_create): Init them. + (ppc_stub_name): Correct string size. + (ppc64_elf_check_relocs): Set has_gp_reloc on GOT and TOC relocs. + (ppc64_elf_size_dynamic_sections): Set no_multi_toc if GOT entries + used. + (ppc_type_of_stub): Tweak root.type test. + (build_plt_stub): Remove glink code. Adjust for insn macro changes. + (ppc_size_one_stub): Handle ppc_stub_long_branch_r2off and + ppc_stub_plt_branch_r2off. + (ppc_build_one_stub): Likewise. Fix var shadowing. Correct addis,addi + range test. Use toc_off to calculte r2 values. Handle emit_stub_syms. + (ppc64_elf_setup_section_lists): Remove htab creator flavour test. + Initialize elf_gp and toc_curr. + (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): New functions. + (ppc64_elf_next_input_section): Set toc_off. + (group_sections): Ensure groups have the same TOC. + (ppc64_elf_size_stubs): Check whether we need a TOC adjusting stub. + (ppc64_elf_build_stubs): Add emit_stub_syms param, and stash in htab. + Build new glink stub. + (ppc64_elf_relocate_section): Handle multiple TOCs. Fix comments. + (ppc64_elf_finish_dynamic_sections): Adjust DT_PPC64_GLINK. + * elf64-ppc.h (ppc64_elf_build_stubs): Update prototype. + (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): Declare. + * section.c (struct sec): Rename flag12 to has_gp_reloc. + (STD_SECTION): Update. + * ecoff.c (bfd_debug_section): Update comment. + * bfd-in2.h: Regenerate. + +2003-06-05 Daniel Jacobowitz + + * elfcode.h (elf_slurp_reloc_table_from_section): Don't dereference + NULL function pointers. + +2003-06-05 Daniel Jacobowitz + + * simple.c (bfd_simple_get_relocated_section_contents): Call + _bfd_generic_link_add_symbols instead of bfd_link_add_symbols. + +2003-06-04 Svein E. Seldal + + * coff-tic54x.c: Removed the ticoff0_bad_format_hook() and + ticoff1_bad_format_hook() functions. Removed the coff0 and coff1 + swaptables. + * coff-tic4x.c: Ditto + * coffcode.h: Added extra arguments to CREATE_BIG_COFF_TARGET_VEC + and CREATE_LITTLE_COFF_TARGET_VEC. Created the macro + CREATE_BIGHDR_COFF_TARGET_VEC. Created the ticoff0_bad_format_hook(), + ticoff1_bad_format_hook() functions. Created the coff0 and coff1 + swap tables. + * coff-tic4x.c: Adopted new CREATE_xxx_COFF_TARGET_VEC macros. + * coff-a29k.c: Append COFF_SWAP_TABLE argument + * coff-apollo.c: Ditto + * coff-arm.c: Ditto + * coff-h8300.c: Ditto + * coff-h8500.c: Ditto + * coff-i960.c: Ditto + * coff-m68k.c: Ditto + * coff-m88k.c: Ditto + * coff-mcore.c: Ditto + * coff-sh.c: Ditto + * coff-sparc.c: Ditto + * coff-tic80.c: Ditto + * coff-we32k.c: Ditto + * coff-z8k.c: Ditto + * coff-w65.c: Ditto + +2003-06-04 Svein E. Seldal + + * coff-tic4x.c (ticoff0_swap_table, ticoff1_swap_table): Fixed + initialization bug + +2003-06-03 Jakub Jelinek + + * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_STACK. + (bfd_section_from_phdr): Likewise. + (map_sections_to_segments): Create PT_GNU_STACK segment header. + (get_program_header_size): Count with PT_GNU_STACK. + * elf-bfd.h (struct elf_obj_tdata): Add stack_flags. + * elflink.h (bfd_elfNN_size_dynamic_sections): Set stack_flags. + +2003-06-03 H.J. Lu + + * elflink.h (elf_link_input_bfd): Call linker error_handler + for discarded definitions. + +2003-06-03 Elias Athanasopoulos + + * syms.c (decode_section_type): Return 'n' if section flags are + SEC_HAS_CONTENTS && SEC_READONLY. + +2003-06-03 Nick Clifton + + * elf32-v850.c (v850_elf_howto_t): Rename R_V850_32to + R_V850_ABS32. Add entry for R_V850_REL32. + (v850_elf_reloc_map): Likewise. + (v850_elf_check_relocs): Likewise. + (v850_elf_perform_relocation): Likewise. + (v850_elf_final_link_relocate): Likewise. Include computation + to make R_V850_REl32 pc-relative. + +2003-06-03 Kaz Kojima + + * elf32-sh.c (sh_elf_size_dynamic_sections): Create .interp section + and DT_DEBUG dynamic tag even for position independent executables. + * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewize. + +2003-06-02 Daniel Jacobowitz + + * config.bfd: Move obsolete entries out of the range of the + targmatch sed script. + +2003-06-02 Daniel Jacobowitz + + * config.bfd (mips*-dec-bsd*, mips*-*-pe*): Mark as obsolete. + +2003-05-31 Jakub Jelinek + + * elf32-ppc.c (allocate_dynrelocs): Use single slot for first 8192 + plt entries, not just 8191. + +2003-05-30 Daniel Jacobowitz + + * elfxx-mips.c (_bfd_mips_elf_discard_info): Correct loop index. + Reported by Ken Faiczak . + +2003-05-30 Ulrich Drepper + Jakub Jelinek + + * elflink.h (elf_link_add_object_symbols): Use !info->executable + instead of info->shared where appropriate. + (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise. + * elflink.c (_bfd_elf_create_got_section): Likewise. + (_bfd_elf_link_create_dynamic_sections): Likewise. + (_bfd_elf_link_assign_sym_version): Likewise. + * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section + and DT_DEBUG dynamic tag even for position independent executables. + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. + * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise. + * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise. + * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise. + * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise. + * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise. + * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise. + * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise. + +2003-05-30 Kris Warkentin + + * elf.c (elfcore_grok_nto_status): Only set lwpid for the active or + signalled thread. + (elfcore_grok_nto_gregs): Only make .reg section for the active thread. + +2003-05-29 Nick Clifton + + * pef.c: Include "safe-ctype.h" instead of . + Tidy up formatting. + * Makefile.am: Add dependency on safe-ctype.h. + * Makefile.in: Regenerate. + +2003-05-29 Thiemo Seufer + + * elfxx-mips.c: Don't force symbols local unconditionally. + +2003-05-28 Alan Modra + + * elf32-hppa.c (elf32_hppa_relocate_section): Delete bogus + undefined_symbol call. + +2003-05-27 Richard Sandiford + + * elfxx-mips.c (mips_elf_hash_sort_data): Fix formattting. + (mips_elf_link_hash_table): Likewise. + 2003-05-22 Thiemo Seufer * elf64-mips.c (elf_mips_gnu_rel16_s2): Add internally used @@ -31,7 +622,7 @@ for X_STORMY16_REL_12 reloc. * elf.c (bfd_elf_get_needed_list): Use is_elf_hash_table to check - the type of the has table in the bfd_link_info structure. + the type of the hash table in the bfd_link_info structure. (bfd_elf_get_runpath_list): Likewise. 2003-05-19 Roland McGrath @@ -175,11 +766,11 @@ * elf32-sh.c (sh_elf_adjust_dynamic_symbol): For weak symbols, copy ELF_LINK_NON_GOT_REF from weakdef. - (allocate_dynrelocs): For undef weak syms with non-default + (allocate_dynrelocs): For undef weak syms with non-default visibility, a) don't allocate plt entries, b) don't allocate .got relocs, c) discard dyn rel space - (sh_elf_relocate_section): d) don't generate .got relocs, e) - don't generate dynamic relocs. + (sh_elf_relocate_section): d) don't generate .got relocs, e) + don't generate dynamic relocs. (sh_elf_copy_indirect_symbol): Don't copy ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted. @@ -911,7 +1502,7 @@ 2003-03-25 Stan Cox Nick Clifton - Contribute support for Intel's iWMMXt chip - an ARM variant: + Contribute support for Intel's iWMMXt chip - an ARM variant: * archures.c: Add bfd_mach_arm_iWMMXt. * reloc.c: Add BFD_RELOC_ARM_CP_OFF_IMM_S2. @@ -926,7 +1517,7 @@ * cpu-arm.c (processors): Add iWMMXt. (arch_inf): Likewise. * elf32-arm.h (arm_object_p): Handle note section. - (elf32_arm_merge_private_bfd_data): Allow iWMMXt object files to + (elf32_arm_merge_private_bfd_data): Allow iWMMXt object files to be linked with XScale ones. (elf32_arm_section_flags): New function: Set flags on note section. (elf32_arm_final_write_processing): Handle note section. @@ -1419,7 +2010,7 @@ 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_*. + (struct ppc_link_hash_entry): Expand comment, and renumber TLS_*. (get_tls_mask): Rename from get_tls_type. 2003-02-09 Alan Modra @@ -1770,13 +2361,11 @@ 2003-01-23 Nick Clifton * Add sh2e support: - 2002-04-02 Elena Zannoni - - * archures.c (bfd_mach_sh2e): Added. - * bfd-in2.h: Rebuilt. - * cpu-sh.c (arch_info_struct): Added SH2e. - * elf32-sh.c (sh_elf_set_mach_from_flags): Handle EF_SH2E. + * archures.c (bfd_mach_sh2e): Added. + * bfd-in2.h: Rebuilt. + * cpu-sh.c (arch_info_struct): Added SH2e. + * elf32-sh.c (sh_elf_set_mach_from_flags): Handle EF_SH2E. 2003-01-23 Alan Modra @@ -2144,7 +2733,7 @@ in a local var. Comment typo fixes. (h8300_bfd_link_add_symbols): Likewise. - * bfd/reloc.c (struct reloc_howto_struct): Revise src_mask and + * reloc.c (struct reloc_howto_struct): Revise src_mask and dst_mask comments. * bfd-in2.h: Regenerate. @@ -2691,7 +3280,7 @@ 2002-11-07 Michal Ludvig - * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, + * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, _bfd_dwarf2_find_nearest_line): Use bfd_simple_get_relocated_section_contents() instead of bfd_get_section_contents(). @@ -3249,7 +3838,7 @@ * Makefile.am: Add entries for elf32-sh64-lin.c and elf64-sh64-lin.c. Regenerate. * Makefile.in: Regenerate. - * config.bfd: Change sh64eb-*-linux* and sh64-*-linux* + * config.bfd: Change sh64eb-*-linux* and sh64-*-linux* to use sh64 vectors rather than sh vectors. * configure.in: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec, bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec. @@ -3675,7 +4264,7 @@ 2002-08-28 Catherine Moore - * elf32-v850.c (v850_elf_reloc_map): Add new relocs. + * elf32-v850.c (v850_elf_reloc_map): Add new relocs. (v850-elf-reloc): Don't resolve pc relative relocs. (v850_elf_ignore_reloc): New routine. (v850_elf_final_link_relocate): Handle new relocs. @@ -3895,9 +4484,9 @@ 2002-08-16 Stephen Clarke - * bfd/elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect + * elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect symbols when looking for section referred to by a relocation. - * bfd/elf64-sh.c (sh_elf64_gc_mark_hook): Likewise. + * elf64-sh.c (sh_elf64_gc_mark_hook): Likewise. 2002-08-15 Alan Modra @@ -4684,7 +5273,7 @@ 2002-07-04 Alan Modra - * section.c (_bfd_strip_section_from_output): Remove unnecessary + * section.c (_bfd_strip_section_from_output): Remove unnecessary link order code. Don't actually remove the output section here; Just set a flag for the linker to do so. * elflink.c (_bfd_elf_link_renumber_dynsyms): Test for removed @@ -4979,7 +5568,7 @@ * elf64-hppa.c (elf64_hppa_mark_milli_and_exported_functions): New function. - (allocate_global_data_dlt): Don't add millicode symbols to dynamic + (allocate_global_data_dlt): Don't add millicode symbols to dynamic symbol table. (allocate_global_data_opd, allocate_dynrel_entries): Likewise. (elf64_hppa_size_dynamic_sections): Revise to use @@ -5856,7 +6445,7 @@ 2002-05-18 Tom Rix - * coff64-rs6000.c (_bfd_xcoff64_swap_aux_out): Fix C_FILE auxent. + * coff64-rs6000.c (_bfd_xcoff64_swap_aux_out): Fix C_FILE auxent. 2002-05-17 Alan Modra @@ -6789,7 +7378,7 @@ * coff-rs6000.c (_bfd_xcoff_stat_arch_elt): Renamed from _bfd_xcoff_generic_stat_arch_elt. Fix format check. - * coff64-rs6000.c : Use _bfd_xcoff_stat_arch_elt. + * coff64-rs6000.c : Use _bfd_xcoff_stat_arch_elt. 2002-03-19 Tom Rix @@ -7056,7 +7645,7 @@ 2002-02-20 Peter Schauer - * osf-core.c (osf_core_vec): OSF/1 (Digital Unix) core files are + * osf-core.c (osf_core_vec): OSF/1 (Digital Unix) core files are little endian. 2002-02-19 Martin Schwidefsky @@ -7102,7 +7691,7 @@ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. * elf64-s390.c (elf_s390_relocate_section): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Likewise. - * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section): Handle _bfd_elf_section_offset returning -2 the same way as -1. @@ -7330,7 +7919,7 @@ datalabel_got_offset. (sh_elf_link_hash_newfunc): Initialize it. (sh_elf_relocate_section): Augment the scope of - seen_stt_datalabel. Introduce GOTPLT support. Extend GOTPC, PLT, + seen_stt_datalabel. Introduce GOTPLT support. Extend GOTPC, PLT, GOT and GOTOFF handling to new SHmedia relocation types. Support GOT_BIAS. (sh_elf_check_relocs): Likewise. @@ -7377,14 +7966,14 @@ match official numbers and names; moved unmaching ones to the range 0xf2-0xff. * elf32-sh64.c, elf64-sh64.c: Likewise. - 2001-03-12 DJ Delorie + 2001-03-12 DJ Delorie * elf32-sh.c (sh_elf_relax_section): Don't relax SHmedia sections. - 2001-03-12 DJ Delorie + 2001-03-12 DJ Delorie * elf32-sh64.c (shmedia_prepare_reloc): Validate relocs that must be aligned. * elf64-sh64.c (sh_elf64_relocate_section): Ditto. - 2001-01-14 Hans-Peter Nilsson + 2001-01-14 Hans-Peter Nilsson * elf32-sh64.c (bfd_elf32_bfd_copy_private_section_data): Define. (sh64_elf_fake_sections): Set type to SHT_SH5_CR_SORTED for a .cranges section with SEC_SORT_ENTRIES set. @@ -7395,9 +7984,9 @@ start address if called by linker. 2001-01-08 Ben Elliston * elf32-sh64.c (sh64_elf_final_write_processing): Activate - Hans-Peter Nilsson's set bit 0 patch from 2001-01-06. + Hans-Peter Nilsson's set bit 0 patch from 2001-01-06. * elf64-sh64.c (sh64_elf64_final_write_processing): Ditto. - 2001-01-06 Hans-Peter Nilsson + 2001-01-06 Hans-Peter Nilsson * elf64-sh64.c (sh_elf64_howto_table): No open brace at start of line. Add comments before all entries. : Correct and clarify describing @@ -7417,7 +8006,7 @@ clarify describing comment. Add comments before all entries. (sh_elf_relocate_section) : Do not honour STO_SH5_ISA32; instead call reloc_dangerous callback. - 2001-01-06 Hans-Peter Nilsson + 2001-01-06 Hans-Peter Nilsson Sort .cranges section in final link. Prepare to set bit 0 on entry address. * elf32-sh64.c (struct sh64_find_section_vma_data): New. @@ -7440,7 +8029,7 @@ * elf32-sh64.c (sh64_elf64_final_write_processing): New, (but temporarily disabled) setting bit 0 on entry address. (elf_backend_final_write_processing): Define. - 2001-01-05 Hans-Peter Nilsson + 2001-01-05 Hans-Peter Nilsson * elf32-sh.c (sh_elf_howto_table) : Adjust fields to be a proper relocation for PTA and PTB rather than a marker. : New case. * Makefile.am (elf32-sh64.lo): Add dependency on sh64-opc.h. * Makefile.in: Regenerate. - 2000-12-30 Hans-Peter Nilsson + 2000-12-30 Hans-Peter Nilsson * elf64-sh64.c (sh64_elf64_fake_sections): Set SHF_SH5_ISA32 for all code sections. (sh_elf64_set_mach_from_flags): Change from EF_SH64 to EF_SH5. @@ -7471,11 +8060,11 @@ (sh64_elf_copy_private_data): Add missing "return true". (sh64_elf_set_mach_from_flags): Change from EF_SH64 to EF_SH5. (sh_elf64_merge_private_data): Ditto. - 2000-12-19 Hans-Peter Nilsson + 2000-12-19 Hans-Peter Nilsson * elf64-sh64.c (sh64_elf64_fake_sections): New, copy of elf64-sh64.c:sh64_elf_fake_sections. (elf_backend_fake_sections): Define as sh64_elf64_fake_sections. - 2000-12-18 Hans-Peter Nilsson + 2000-12-18 Hans-Peter Nilsson * elf32-sh64.c (sh64_elf_copy_private_data_internal): Delete. (sh64_elf_final_write_processing): New. (elf_backend_final_write_processing): Define. @@ -7484,7 +8073,7 @@ sh64_elf_copy_private_data_internal, just copy e_flags field. (sh64_elf_merge_private_data): Do not call sh64_elf_copy_private_data_internal. - 2000-12-12 Hans-Peter Nilsson + 2000-12-12 Hans-Peter Nilsson Remove EF_SH64_ABI64, let ELF size make difference. Remove SH64-specific BFD section flag. * elf32-sh64.c (sh64_elf_fake_sections): Recognize section as @@ -7500,7 +8089,7 @@ * section.c (Section flags definitions): Don't define SEC_SH_ISA_SHMEDIA. (bfd-in2.h): Regenerate. - 2000-12-09 Hans-Peter Nilsson + 2000-12-09 Hans-Peter Nilsson Make DataLabel references work with partial linking. * elf32-sh64.c: Fix formatting. (sh64_elf_link_output_symbol_hook): New. @@ -7513,7 +8102,7 @@ sh64_elf64_link_output_symbol_hook. (sh64_elf64_add_symbol_hook): Make DataLabel symbol just global undefined if partial linking. Adjust sanity check. - 2000-12-07 Hans-Peter Nilsson + 2000-12-07 Hans-Peter Nilsson Implement semantics for inter-file DataLabel references. * elf64-sh64.c (DATALABEL_SUFFIX): Define. (sh64_elf64_add_symbol_hook): New. @@ -7529,13 +8118,13 @@ * elf32-sh.c (sh_elf_relocate_section): If passing an indirect symbol with st_type STT_DATALABEL on the way to a symbol with st_other STO_SH5_ISA32, do not bitor 1 to the relocation. - 2000-12-05 Hans-Peter Nilsson + 2000-12-05 Hans-Peter Nilsson Pass through STT_DATALABEL. * elf32-sh64.c (sh64_elf_get_symbol_type): New. (elf_backend_get_symbol_type): Define. * elf64-sh64.c (sh64_elf64_get_symbol_type): New. (elf_backend_get_symbol_type): Define. - 2000-11-30 Hans-Peter Nilsson + 2000-11-30 Hans-Peter Nilsson * elf32-sh64.c: Tweak comments. (sh64_elf_copy_private_data_internal): Add prototype. (bfd_elf32_bfd_set_private_flags): Define. @@ -7559,7 +8148,7 @@ * configure: Regenerate. * po/POTFILES.in: Regenerate. * po/bfd.pot: Regenerate. - 2000-11-29 Hans-Peter Nilsson + 2000-11-29 Hans-Peter Nilsson * elf32-sh64.c (sh64_elf_set_mach_from_flags): Do not recognize anything else but EF_SH64 and EF_SH64_ABI64. (sh64_elf_merge_private_data): Emit error for anything else but @@ -7569,7 +8158,7 @@ * configure.in: Add cofflink.lo to bfd_elf32_sh64_vec and bfd_elf32_sh64l_vec as a temporary measure. * configure: Regenerate. - 2000-11-27 Hans-Peter Nilsson + 2000-11-27 Hans-Peter Nilsson * cpu-sh.c (arch_info_struct): Include sh5 item unconditionalized. * config.bfd (sh64-*-elf*): Do not set targ_cflags. @@ -7587,7 +8176,7 @@ : Ditto. (sh_elf_set_mach_from_flags): Remove code refusing deleted EF_SH64_32BIT_ABI flag. - 2000-11-26 Hans-Peter Nilsson + 2000-11-26 Hans-Peter Nilsson * elf32-sh.c (sh_elf_howto_table) : Set pcrel_offset to true. @@ -7596,7 +8185,7 @@ : Ditto if h->other & STO_SH5_ISA32. * elf32-sh64.c (shmedia_prepare_reloc): Add rel->r_addend to relocation. - 2000-11-24 Hans-Peter Nilsson + 2000-11-24 Hans-Peter Nilsson * Makefile.am (BFD32_BACKENDS): Add elf32-sh64.lo. (BFD32_BACKENDS_CFILES): Add elf32-sh64.c. Regenerate dependencies. @@ -7819,7 +8408,7 @@ * peXXigen.c (pe_print_idata): Rearrange message to aid in translation. - (pe_print_pdata): Rearrange message to aid in translation. + (pe_print_pdata): Rearrange message to aid in translation. * libbfd.c (warn_deprecated): Rearrange error message to aid in translation. @@ -8316,7 +8905,7 @@ * ptrace-core.c (ptrace_unix_core_file_p): Likewise. * trad-core.c (trad_unix_core_file_p): Likewise. - * hppabsd-core.c (hppabsd_core_core_file_p): Clean up after errors + * hppabsd-core.c (hppabsd_core_core_file_p): Clean up after errors with bfd_release and bfd_section_list_clear. * hpux-core.c (hpux_core_core_file_p): Likewise. * irix-core.c (irix_core_core_file_p): Likewise. diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 5ecaa5b1600..6240f35c251 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -862,8 +862,9 @@ CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) -# We want to rerun configure if config.bfd or configure.host change. -config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host +# We want to rerun configure if config.bfd, configure.host or version.h change. +config.status: $(srcdir)/configure $(srcdir)/config.bfd \ + $(srcdir)/configure.host $(srcdir)/version.h $(SHELL) ./config.status --recheck # What appears below is generated by a hacked mkdep using gcc -MM. @@ -918,7 +919,7 @@ archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h cpu-arc.lo: cpu-arc.c $(INCDIR)/filenames.h -cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h +cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h @@ -1207,17 +1208,19 @@ elf32-m68k.lo: elf32-m68k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf32-target.h elf32-m68hc11.lo: elf32-m68hc11.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/m68hc11.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m68hc1x.h + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/m68hc11.h elf32-target.h elf32-m68hc12.lo: elf32-m68hc12.c $(INCDIR)/filenames.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/m68hc11.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/m68hc11.h \ - elf32-target.h elf32-m68hc1x.h + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/m68hc11.h elf32-target.h elf32-m68hc1x.lo: elf32-m68hc1x.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/m68hc11.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m68hc1x.h + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/m68hc11.h elf32-m88k.lo: elf32-m88k.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf32-target.h @@ -1301,9 +1304,11 @@ elf32-xstormy16.lo: elf32-xstormy16.c $(INCDIR)/filenames.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/xstormy16.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ elf32-target.h -elf32-xtensa.lo: elf32-xtensa.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/xtensa.h $(INCDIR)/xtensa-isa.h elf32-target.h +elf32-xtensa.lo: elf32-xtensa.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/xtensa.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h elf32-target.h elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ @@ -1413,8 +1418,8 @@ pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h libaout.h \ pdp11.lo: pdp11.c $(INCDIR)/filenames.h libaout.h $(INCDIR)/bfdlink.h \ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h $(INCDIR)/safe-ctype.h -pef.lo: pef.c pef.h pef-traceback.h $(INCDIR)/filenames.h \ - $(INCDIR)/libiberty.h +pef.lo: pef.c $(INCDIR)/safe-ctype.h pef.h pef-traceback.h \ + $(INCDIR)/filenames.h $(INCDIR)/libiberty.h pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index d8fc69f4f59..aca93712044 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 @@ -809,7 +809,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) @@ -1395,8 +1395,9 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h touch stmp-lcoff-h -# We want to rerun configure if config.bfd or configure.host change. -config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host +# We want to rerun configure if config.bfd, configure.host or version.h change. +config.status: $(srcdir)/configure $(srcdir)/config.bfd \ + $(srcdir)/configure.host $(srcdir)/version.h $(SHELL) ./config.status --recheck # What appears below is generated by a hacked mkdep using gcc -MM. @@ -1451,7 +1452,7 @@ archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h cpu-arc.lo: cpu-arc.c $(INCDIR)/filenames.h -cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h +cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h @@ -1740,17 +1741,19 @@ elf32-m68k.lo: elf32-m68k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf32-target.h elf32-m68hc11.lo: elf32-m68hc11.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/m68hc11.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m68hc1x.h + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/m68hc11.h elf32-target.h elf32-m68hc12.lo: elf32-m68hc12.c $(INCDIR)/filenames.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/m68hc11.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/m68hc11.h \ - elf32-target.h elf32-m68hc1x.h + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/m68hc11.h elf32-target.h elf32-m68hc1x.lo: elf32-m68hc1x.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/m68hc11.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m68hc1x.h + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/m68hc11.h elf32-m88k.lo: elf32-m88k.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf32-target.h @@ -1834,9 +1837,11 @@ elf32-xstormy16.lo: elf32-xstormy16.c $(INCDIR)/filenames.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/xstormy16.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ elf32-target.h -elf32-xtensa.lo: elf32-xtensa.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/xtensa.h $(INCDIR)/xtensa-isa.h elf32-target.h +elf32-xtensa.lo: elf32-xtensa.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/xtensa.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h elf32-target.h elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ @@ -1946,8 +1951,8 @@ pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h libaout.h \ pdp11.lo: pdp11.c $(INCDIR)/filenames.h libaout.h $(INCDIR)/bfdlink.h \ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h $(INCDIR)/safe-ctype.h -pef.lo: pef.c pef.h pef-traceback.h $(INCDIR)/filenames.h \ - $(INCDIR)/libiberty.h +pef.lo: pef.c $(INCDIR)/safe-ctype.h pef.h pef-traceback.h \ + $(INCDIR)/filenames.h $(INCDIR)/libiberty.h pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ diff --git a/bfd/aout-ns32k.c b/bfd/aout-ns32k.c index 0972b5db187..8092705ba11 100644 --- a/bfd/aout-ns32k.c +++ b/bfd/aout-ns32k.c @@ -65,7 +65,7 @@ MY(put_reloc) PARAMS ((bfd *, int, int, bfd_vma, reloc_howto_type *, struct reloc_std_external *)); /* The ns32k series is ah, unusual, when it comes to relocation. - There are three storage methods for relocateable objects. There + There are three storage methods for relocatable objects. There are displacements, immediate operands and ordinary twos complement data. Of these, only the last fits into the standard relocation scheme. Immediate operands are stored huffman encoded and diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 7f02d13e61d..674fc76316e 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -3749,7 +3749,7 @@ NAME(aout,final_link) (abfd, info, callback) includes_hash_initialized = TRUE; /* Figure out the largest section size. Also, if generating - relocateable output, count the relocs. */ + relocatable output, count the relocs. */ trsize = 0; drsize = 0; max_contents_size = 0; @@ -3759,7 +3759,7 @@ NAME(aout,final_link) (abfd, info, callback) { bfd_size_type sz; - if (info->relocateable) + if (info->relocatable) { if (bfd_get_flavour (sub) == bfd_target_aout_flavour) { @@ -3773,7 +3773,7 @@ NAME(aout,final_link) (abfd, info, callback) work out the number of relocs needed, and then multiply by the reloc size. */ (*_bfd_error_handler) - (_("%s: relocateable link from %s to %s not supported"), + (_("%s: relocatable link from %s to %s not supported"), bfd_get_filename (abfd), sub->xvec->name, abfd->xvec->name); bfd_set_error (bfd_error_invalid_operation); @@ -3803,7 +3803,7 @@ NAME(aout,final_link) (abfd, info, callback) } } - if (info->relocateable) + if (info->relocatable) { if (obj_textsec (abfd) != (asection *) NULL) trsize += (_bfd_count_link_order_relocs (obj_textsec (abfd) @@ -4786,9 +4786,9 @@ aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr, input_size)) return FALSE; - /* If we are producing relocateable output, the relocs were + /* If we are producing relocatable output, the relocs were modified, and we now write them out. */ - if (finfo->info->relocateable && rel_size > 0) + if (finfo->info->relocatable && rel_size > 0) { if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0) return FALSE; @@ -4850,7 +4850,7 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *, bfd_vma *)); bfd *output_bfd; - bfd_boolean relocateable; + bfd_boolean relocatable; struct external_nlist *syms; char *strings; struct aout_link_hash_entry **sym_hashes; @@ -4866,7 +4866,7 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, BFD_ASSERT (input_bfd->xvec->header_byteorder == output_bfd->xvec->header_byteorder); - relocateable = finfo->info->relocateable; + relocatable = finfo->info->relocatable; syms = obj_aout_external_syms (input_bfd); strings = obj_aout_external_strings (input_bfd); sym_hashes = obj_aout_sym_hashes (input_bfd); @@ -4935,9 +4935,9 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, } #endif - if (relocateable) + if (relocatable) { - /* We are generating a relocateable output file, and must + /* We are generating a relocatable output file, and must modify the reloc accordingly. */ if (r_extern) { @@ -5195,7 +5195,7 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *, bfd_vma *)); bfd *output_bfd; - bfd_boolean relocateable; + bfd_boolean relocatable; struct external_nlist *syms; char *strings; struct aout_link_hash_entry **sym_hashes; @@ -5211,7 +5211,7 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, BFD_ASSERT (input_bfd->xvec->header_byteorder == output_bfd->xvec->header_byteorder); - relocateable = finfo->info->relocateable; + relocatable = finfo->info->relocatable; syms = obj_aout_external_syms (input_bfd); strings = obj_aout_external_strings (input_bfd); sym_hashes = obj_aout_sym_hashes (input_bfd); @@ -5256,9 +5256,9 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, BFD_ASSERT (r_type < TABLE_SIZE (howto_table_ext)); - if (relocateable) + if (relocatable) { - /* We are generating a relocateable output file, and must + /* We are generating a relocatable output file, and must modify the reloc accordingly. */ if (r_extern || r_type == (unsigned int) RELOC_BASE10 diff --git a/bfd/archures.c b/bfd/archures.c index 250892ce532..6132f155df0 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -170,6 +170,7 @@ DESCRIPTION .#define bfd_mach_h8300hn 4 .#define bfd_mach_h8300sn 5 .#define bfd_mach_h8300sx 6 +.#define bfd_mach_h8300sxn 7 . bfd_arch_pdp11, {* DEC PDP-11 *} . bfd_arch_powerpc, {* PowerPC *} .#define bfd_mach_ppc 32 diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index fdf5f1c389e..977095e1966 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -619,7 +619,7 @@ extern bfd_boolean bfd_ecoff_debug_accumulate_other extern bfd_boolean bfd_ecoff_debug_externals PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, const struct ecoff_debug_swap *swap, - bfd_boolean relocateable, + bfd_boolean relocatable, bfd_boolean (*get_extr) (struct symbol_cache_entry *, struct ecoff_extr *), void (*set_index) (struct symbol_cache_entry *, diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 8df80a00aa4..c6815ccb07b 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1,7 +1,7 @@ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c" and "simple.c". Run "make headers" in your build bfd/ to regenerate. */ @@ -626,7 +626,7 @@ extern bfd_boolean bfd_ecoff_debug_accumulate_other extern bfd_boolean bfd_ecoff_debug_externals PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, const struct ecoff_debug_swap *swap, - bfd_boolean relocateable, + bfd_boolean relocatable, bfd_boolean (*get_extr) (struct symbol_cache_entry *, struct ecoff_extr *), void (*set_index) (struct symbol_cache_entry *, @@ -905,9 +905,18 @@ bfd_make_writable PARAMS ((bfd *abfd)); bfd_boolean bfd_make_readable PARAMS ((bfd *abfd)); +unsigned long +bfd_calc_gnu_debuglink_crc32 PARAMS ((unsigned long crc, const unsigned char *buf, bfd_size_type len)); + char * bfd_follow_gnu_debuglink PARAMS ((bfd *abfd, const char *dir)); +struct sec * +bfd_create_gnu_debuglink_section PARAMS ((bfd * abfd, const char * filename)); + +bfd_boolean +bfd_fill_in_gnu_debuglink_section PARAMS ((bfd * abfd, struct sec * sect, const char * filename)); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1308,8 +1317,10 @@ typedef struct sec /* Nonzero if this section needs the relax finalize pass. */ unsigned int need_finalize_relax:1; + /* Nonzero if this section has a gp reloc. */ + unsigned int has_gp_reloc:1; + /* Usused bits. */ - unsigned int flag12:1; unsigned int flag13:1; unsigned int flag14:1; unsigned int flag15:1; @@ -1400,6 +1411,10 @@ typedef struct sec /* Optional information about a COMDAT entry; NULL if not COMDAT. */ struct bfd_comdat_info *comdat; + /* Points to the kept section if this section is a link-once section, + and is discarded. */ + struct sec *kept_section; + /* When a section is being output, this value changes as more linenumbers are written out. */ file_ptr moving_line_filepos; @@ -1652,6 +1667,7 @@ enum bfd_architecture #define bfd_mach_h8300hn 4 #define bfd_mach_h8300sn 5 #define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 bfd_arch_pdp11, /* DEC PDP-11 */ bfd_arch_powerpc, /* PowerPC */ #define bfd_mach_ppc 32 @@ -1792,7 +1808,7 @@ enum bfd_architecture #define bfd_mach_msp43 43 #define bfd_mach_msp44 44 #define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 +#define bfd_mach_msp16 16 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_last @@ -3480,14 +3496,14 @@ instruction opcode. */ BFD_RELOC_XTENSA_OP1, BFD_RELOC_XTENSA_OP2, -/* Xtensa relocation to mark that the assembler expanded the +/* Xtensa relocation to mark that the assembler expanded the instructions from an original target. The expansion size is encoded in the reloc size. */ BFD_RELOC_XTENSA_ASM_EXPAND, -/* Xtensa relocation to mark that the linker should simplify -assembler-expanded instructions. This is commonly used -internally by the linker after analysis of a +/* Xtensa relocation to mark that the linker should simplify +assembler-expanded instructions. This is commonly used +internally by the linker after analysis of a BFD_RELOC_XTENSA_ASM_EXPAND. */ BFD_RELOC_XTENSA_ASM_SIMPLIFY, BFD_RELOC_UNUSED }; diff --git a/bfd/bfd.c b/bfd/bfd.c index 99c5ea668e8..e54bd89d6c2 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -1164,12 +1164,12 @@ DESCRIPTION bfd_byte * bfd_get_relocated_section_contents (abfd, link_info, link_order, data, - relocateable, symbols) + relocatable, symbols) bfd *abfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - bfd_boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { bfd *abfd2; @@ -1188,7 +1188,7 @@ bfd_get_relocated_section_contents (abfd, link_info, link_order, data, fn = abfd2->xvec->_bfd_get_relocated_section_contents; - return (*fn) (abfd, link_info, link_order, data, relocateable, symbols); + return (*fn) (abfd, link_info, link_order, data, relocatable, symbols); } /* Record information about an ELF program header. */ diff --git a/bfd/bout.c b/bfd/bout.c index b839929c38f..43537eb47f3 100644 --- a/bfd/bout.c +++ b/bfd/bout.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel 960 b.out binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -1298,12 +1298,12 @@ b_out_bfd_relax_section (abfd, i, link_info, again) static bfd_byte * b_out_bfd_get_relocated_section_contents (output_bfd, link_info, link_order, - data, relocateable, symbols) + data, relocatable, symbols) bfd *output_bfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - bfd_boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { /* Get enough memory to hold the stuff. */ @@ -1317,11 +1317,11 @@ b_out_bfd_get_relocated_section_contents (output_bfd, link_info, link_order, if (reloc_size < 0) goto error_return; - /* If producing relocateable output, don't bother to relax. */ - if (relocateable) + /* If producing relocatable output, don't bother to relax. */ + if (relocatable) return bfd_generic_get_relocated_section_contents (output_bfd, link_info, link_order, - data, relocateable, + data, relocatable, symbols); reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); diff --git a/bfd/coff-a29k.c b/bfd/coff-a29k.c index fd547315fea..444dbc2a775 100644 --- a/bfd/coff-a29k.c +++ b/bfd/coff-a29k.c @@ -1,5 +1,6 @@ /* BFD back-end for AMD 29000 COFF binaries. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, + 2002, 2003 Free Software Foundation, Inc. Contributed by David Wood at New York University 7/8/91. @@ -327,10 +328,10 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section, bfd_boolean hihalf; bfd_vma hihalf_val; - /* If we are performing a relocateable link, we don't need to do a + /* If we are performing a relocatable link, we don't need to do a thing. The caller will take care of adjusting the reloc addresses and symbol indices. */ - if (info->relocateable) + if (info->relocatable) return TRUE; hihalf = FALSE; @@ -580,4 +581,4 @@ coff_a29k_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) #include "coffcode.h" -CREATE_BIG_COFF_TARGET_VEC (a29kcoff_big_vec, "coff-a29k-big", 0, SEC_READONLY, '_', NULL) +CREATE_BIG_COFF_TARGET_VEC (a29kcoff_big_vec, "coff-a29k-big", 0, SEC_READONLY, '_', NULL, COFF_SWAP_TABLE) diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index 14e0ee15c5e..e9dd4169b22 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -1,5 +1,5 @@ /* BFD back-end for ALPHA Extended-Coff files. - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Modified from coff-mips.c by Steve Chamberlain and Ian Lance Taylor . @@ -53,7 +53,7 @@ static reloc_howto_type *alpha_bfd_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static bfd_byte *alpha_ecoff_get_relocated_section_contents PARAMS ((bfd *abfd, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *data, bfd_boolean relocateable, asymbol **symbols)); + bfd_byte *data, bfd_boolean relocatable, asymbol **symbols)); static bfd_vma alpha_convert_external_reloc PARAMS ((bfd *, struct bfd_link_info *, bfd *, struct external_reloc *, struct ecoff_link_hash_entry *)); @@ -753,12 +753,12 @@ alpha_adjust_reloc_out (abfd, rel, intern) static bfd_byte * alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, - data, relocateable, symbols) + data, relocatable, symbols) bfd *abfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - bfd_boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { bfd *input_bfd = link_order->u.indirect.section->owner; @@ -766,7 +766,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section); arelent **reloc_vector = NULL; long reloc_count; - bfd *output_bfd = relocateable ? abfd : (bfd *) NULL; + bfd *output_bfd = relocatable ? abfd : (bfd *) NULL; bfd_vma gp; bfd_boolean gp_undefined; bfd_vma stack[RELOC_STACKSIZE]; @@ -798,7 +798,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, gp = _bfd_get_gp_value (abfd); if (gp == 0) { - if (relocateable) + if (relocatable) { asection *sec; bfd_vma lo; @@ -858,7 +858,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, case ALPHA_R_SREL16: case ALPHA_R_SREL32: case ALPHA_R_SREL64: - if (relocateable + if (relocatable && ((*rel->sym_ptr_ptr)->flags & BSF_SECTION_SYM) == 0) { rel->address += input_section->output_offset; @@ -991,7 +991,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, asymbol *symbol; bfd_vma relocation; - if (relocateable) + if (relocatable) { rel->address += input_section->output_offset; break; @@ -1024,7 +1024,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, bfd_vma val; int offset, size; - if (relocateable) + if (relocatable) { rel->address += input_section->output_offset; break; @@ -1051,7 +1051,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, asymbol *symbol; bfd_vma relocation; - if (relocateable) + if (relocatable) { rel->address += input_section->output_offset; break; @@ -1084,7 +1084,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, asymbol *symbol; bfd_vma relocation; - if (relocateable) + if (relocatable) { rel->address += input_section->output_offset; break; @@ -1121,7 +1121,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, abort (); } - if (relocateable) + if (relocatable) { asection *os = input_section->output_section; @@ -1248,7 +1248,7 @@ alpha_bfd_reloc_type_lookup (abfd, code) } /* A helper routine for alpha_relocate_section which converts an - external reloc when generating relocateable output. Returns the + external reloc when generating relocatable output. Returns the relocation amount. */ static bfd_vma @@ -1262,7 +1262,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h) unsigned long r_symndx; bfd_vma relocation; - BFD_ASSERT (info->relocateable); + BFD_ASSERT (info->relocatable); if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) @@ -1443,7 +1443,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, lita_sec = symndx_to_section[RELOC_SECTION_LITA]; gp = _bfd_get_gp_value (output_bfd); - if (! info->relocateable && lita_sec != NULL) + if (! info->relocatable && lita_sec != NULL) { struct ecoff_section_tdata *lita_sec_data; @@ -1552,7 +1552,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, not otherwise used for anything. For some reason, the address of the relocation does not appear to include the section VMA, unlike the other relocation types. */ - if (info->relocateable) + if (info->relocatable) H_PUT_64 (input_bfd, input_section->output_offset + r_vaddr, ext_rel->r_vaddr); adjust_addrp = FALSE; @@ -1705,7 +1705,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, if (h == (struct ecoff_link_hash_entry *) NULL) abort (); - if (! info->relocateable) + if (! info->relocatable) { if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) @@ -1748,7 +1748,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, addend += r_vaddr; - if (info->relocateable) + if (info->relocatable) { /* Adjust r_vaddr by the addend. */ H_PUT_64 (input_bfd, addend, ext_rel->r_vaddr); @@ -1782,9 +1782,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, case ALPHA_R_OP_STORE: /* Store a value from the reloc stack into a bitfield. If - we are generating relocateable output, all we do is + we are generating relocatable output, all we do is adjust the address of the reloc. */ - if (! info->relocateable) + if (! info->relocatable) { bfd_vma mask; bfd_vma val; @@ -1850,9 +1850,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, abort (); } - if (info->relocateable) + if (info->relocatable) { - /* We are generating relocateable output, and must + /* We are generating relocatable output, and must convert the existing reloc. */ if (r_extern) { @@ -1975,7 +1975,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, } } - if (info->relocateable && adjust_addrp) + if (info->relocatable && adjust_addrp) { /* Change the address of the relocation. */ H_PUT_64 (input_bfd, diff --git a/bfd/coff-apollo.c b/bfd/coff-apollo.c index d7b921260bb..cf584538f6e 100644 --- a/bfd/coff-apollo.c +++ b/bfd/coff-apollo.c @@ -115,7 +115,7 @@ apollo_howto2rtype (internal) #endif #ifdef NAMES_HAVE_UNDERSCORE -CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, 0, 0, '_', NULL) +CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, 0, 0, '_', NULL, COFF_SWAP_TABLE) #else -CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, 0, 0, 0, NULL) +CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, 0, 0, 0, NULL, COFF_SWAP_TABLE) #endif diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c index f089a6c824d..98d7048a26c 100644 --- a/bfd/coff-arm.c +++ b/bfd/coff-arm.c @@ -1,6 +1,6 @@ /* BFD back-end for ARM COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -1247,13 +1247,13 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, return FALSE; /* The relocation_section function will skip pcrel_offset relocs - when doing a relocateable link. However, we want to convert + when doing a relocatable link. However, we want to convert ARM26 to ARM26D relocs if possible. We return a fake howto in this case without pcrel_offset set, and adjust the addend to compensate. */ if (rel->r_type == ARM_26 && h != NULL - && info->relocateable + && info->relocatable && (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) && (h->root.u.def.section->output_section @@ -1283,18 +1283,18 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, the next opcode's pc, so is off by one. */ #if 0 /* This appears to have been true for WINCE 2.0, but it is not true for WINCE 3.0. */ - if (howto->pc_relative && !info->relocateable) + if (howto->pc_relative && !info->relocatable) addend -= 8; #endif #endif - /* If we are doing a relocateable link, then we can just ignore + /* If we are doing a relocatable link, then we can just ignore a PC relative reloc that is pcrel_offset. It will already - have the correct value. If this is not a relocateable link, + have the correct value. If this is not a relocatable link, then we should ignore the symbol value. */ if (howto->pc_relative && howto->pcrel_offset) { - if (info->relocateable) + if (info->relocatable) continue; /* FIXME - it is not clear which targets need this next test and which do not. It is known that it is needed for the @@ -1341,7 +1341,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, stub generation to the final linker pass. If we fail to verify that the name is defined, we'll try to build stubs for an undefined name... */ - if (! info->relocateable + if (! info->relocatable && ( h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak)) { @@ -1595,7 +1595,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, + sec->output_offset); } - else if (! info->relocateable) + else if (! info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, @@ -1617,7 +1617,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, rstat = bfd_reloc_ok; #ifndef ARM_WINCE /* Only perform this fix during the final link, not a relocatable link. nickc@cygnus.com */ - else if (! info->relocateable + else if (! info->relocatable && howto->type == ARM_THUMB23) { /* This is pretty much a copy of what the default @@ -1743,7 +1743,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, Is this the best way to fix up thumb addresses? krk@cygnus.com Probably not, but it works, and if it works it don't need fixing! nickc@cygnus.com */ /* Only perform this fix during the final link, not a relocatable link. nickc@cygnus.com */ - if (! info->relocateable + if (! info->relocatable && (rel->r_type == ARM_32 || rel->r_type == ARM_RVA32)) { /* Determine if we need to set the bottom bit of a relocated address @@ -2023,7 +2023,7 @@ bfd_arm_get_bfd_for_interworking (abfd, info) /* If we are only performing a partial link do not bother getting a bfd to hold the glue. */ - if (info->relocateable) + if (info->relocatable) return TRUE; globals = coff_arm_hash_table (info); @@ -2078,7 +2078,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) /* If we are only performing a partial link do not bother to construct any glue. */ - if (info->relocateable) + if (info->relocatable) return TRUE; /* Here we have a bfd that is to be included on the link. We have a hook @@ -2198,7 +2198,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) #define coff_bfd_copy_private_bfd_data coff_arm_copy_private_bfd_data #define coff_bfd_link_hash_table_create coff_arm_link_hash_table_create -/* When doing a relocateable link, we want to convert ARM26 relocs +/* When doing a relocatable link, we want to convert ARM26 relocs into ARM26D relocs. */ static bfd_boolean @@ -2623,5 +2623,5 @@ coff_arm_final_link_postscript (abfd, pfinfo) extern const bfd_target TARGET_BIG_SYM ; /* Target vectors. */ -CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_BIG_SYM) -CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_LITTLE_SYM) +CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_BIG_SYM, COFF_SWAP_TABLE) +CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_LITTLE_SYM, COFF_SWAP_TABLE) diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c index ac091533553..9ef907b87df 100644 --- a/bfd/coff-h8300.c +++ b/bfd/coff-h8300.c @@ -1398,4 +1398,4 @@ h8300_bfd_link_add_symbols (abfd, info) bfd_coff_reloc16_get_relocated_section_contents #define coff_bfd_relax_section bfd_coff_reloc16_relax_section -CREATE_BIG_COFF_TARGET_VEC (h8300coff_vec, "coff-h8300", BFD_IS_RELAXABLE, 0, '_', NULL) +CREATE_BIG_COFF_TARGET_VEC (h8300coff_vec, "coff-h8300", BFD_IS_RELAXABLE, 0, '_', NULL, COFF_SWAP_TABLE) diff --git a/bfd/coff-h8500.c b/bfd/coff-h8500.c index 656bb48f37f..a94e4a30ec6 100644 --- a/bfd/coff-h8500.c +++ b/bfd/coff-h8500.c @@ -303,4 +303,4 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) bfd_coff_reloc16_get_relocated_section_contents #define coff_bfd_relax_section bfd_coff_reloc16_relax_section -CREATE_BIG_COFF_TARGET_VEC (h8500coff_vec, "coff-h8500", 0, 0, '_', NULL) +CREATE_BIG_COFF_TARGET_VEC (h8500coff_vec, "coff-h8500", 0, 0, '_', NULL, COFF_SWAP_TABLE) diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c index f083ae15a0f..a24344ad8c3 100644 --- a/bfd/coff-i386.c +++ b/bfd/coff-i386.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel 386 COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -56,7 +56,7 @@ static reloc_howto_type *coff_i386_reloc_type_lookup section for a reference to a common symbol is the value itself plus any desired offset. Ian Taylor, Cygnus Support. */ -/* If we are producing relocateable output, we need to do some +/* If we are producing relocatable output, we need to do some adjustments to the object file that are not done by the bfd_perform_relocation function. This function is called by every reloc type to make any required adjustments. */ @@ -103,7 +103,7 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, { /* For some reason bfd_perform_relocation always effectively ignores the addend for a COFF target when producing - relocateable output. This seems to be always wrong for 386 + relocatable output. This seems to be always wrong for 386 COFF, so we handle the addend here instead. */ #ifdef COFF_WITH_PE if (output_bfd == (bfd *) NULL) @@ -386,7 +386,7 @@ static reloc_howto_type howto_table[] = /* The PE relocate section routine. The only difference between this and the regular routine is that we don't want to do anything for a - relocateable link. */ + relocatable link. */ static bfd_boolean coff_pe_i386_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, @@ -405,7 +405,7 @@ coff_pe_i386_relocate_section (output_bfd, info, input_bfd, struct internal_syment *syms; asection **sections; { - if (info->relocateable) + if (info->relocatable) return TRUE; return _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, @@ -470,7 +470,7 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp) #ifndef COFF_WITH_PE /* If the output symbol is common (in which case this must be a - relocateable link), we need to add in the final size of the + relocatable link), we need to add in the final size of the common symbol. */ if (h != NULL && h->root.type == bfd_link_hash_common) *addendp += h->root.u.c.size; diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c index 767692dc61e..b862ff7f0c2 100644 --- a/bfd/coff-i860.c +++ b/bfd/coff-i860.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel 860 COFF files. - 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. Created mostly by substituting "860" for "386" in coff-i386.c Harry Dolan , October 1995 @@ -47,7 +47,7 @@ static const bfd_target * i3coff_object_p PARAMS ((bfd *)); section for a reference to a common symbol is the value itself plus any desired offset. Ian Taylor, Cygnus Support. */ -/* If we are producing relocateable output, we need to do some +/* If we are producing relocatable output, we need to do some adjustments to the object file that are not done by the bfd_perform_relocation function. This function is called by every reloc type to make any required adjustments. */ @@ -87,7 +87,7 @@ coff_i860_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, { /* For some reason bfd_perform_relocation always effectively ignores the addend for a COFF target when producing - relocateable output. This seems to be always wrong for 860 + relocatable output. This seems to be always wrong for 860 COFF, so we handle the addend here instead. */ diff = reloc_entry->addend; } @@ -348,7 +348,7 @@ coff_i860_rtype_to_howto (abfd, sec, rel, h, sym, addendp) } /* If the output symbol is common (in which case this must be a - relocateable link), we need to add in the final size of the + relocatable link), we need to add in the final size of the common symbol. */ if (h != NULL && h->root.type == bfd_link_hash_common) *addendp += h->root.u.c.size; diff --git a/bfd/coff-i960.c b/bfd/coff-i960.c index eee6718a5ef..3a04753dcd4 100644 --- a/bfd/coff-i960.c +++ b/bfd/coff-i960.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel 960 COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, - 2002 Free Software Foundation, Inc. + 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -180,12 +180,12 @@ optcall_callback (abfd, reloc_entry, symbol_in, data, same object file. It appears to simply discard such relocs, rather than adding their values into the object file. We handle this here by converting all relocs against defined symbols into relocs - against the section symbol, when generating a relocateable output + against the section symbol, when generating a relocatable output file. Note that this function is only called if we are not using the COFF specific backend linker. It only does something when doing a - relocateable link, which will almost certainly fail when not + relocatable link, which will almost certainly fail when not generating COFF i960 output, so this function is actually no longer useful. It was used before this target was converted to use the COFF specific backend linker. */ @@ -205,7 +205,7 @@ coff_i960_relocate (abfd, reloc_entry, symbol, data, input_section, if (output_bfd == NULL) { - /* Not generating relocateable output file. */ + /* Not generating relocatable output file. */ return bfd_reloc_continue; } @@ -328,7 +328,7 @@ coff_i960_start_final_link (abfd, info) asection *o; bfd_byte *esym; - if (! info->relocateable) + if (! info->relocatable) return TRUE; esym = (bfd_byte *) bfd_malloc (symesz); @@ -455,7 +455,7 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section, + sec->output_section->vma + sec->output_offset); } - else if (! info->relocateable) + else if (! info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, @@ -466,7 +466,7 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section, done = FALSE; - if (howto->type == R_OPTCALL && ! info->relocateable && symndx != -1) + if (howto->type == R_OPTCALL && ! info->relocatable && symndx != -1) { int class; @@ -617,7 +617,7 @@ coff_i960_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) extern const bfd_target icoff_big_vec; -CREATE_LITTLE_COFF_TARGET_VEC (icoff_little_vec, "coff-Intel-little", 0, 0, '_', & icoff_big_vec) +CREATE_LITTLE_COFF_TARGET_VEC (icoff_little_vec, "coff-Intel-little", 0, 0, '_', & icoff_big_vec, COFF_SWAP_TABLE) const bfd_target icoff_big_vec = { diff --git a/bfd/coff-m68k.c b/bfd/coff-m68k.c index c2c1c295c86..0947811687a 100644 --- a/bfd/coff-m68k.c +++ b/bfd/coff-m68k.c @@ -1,6 +1,6 @@ /* BFD back-end for Motorola 68000 COFF binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -250,7 +250,7 @@ m68kcoff_rtype_to_howto (abfd, sec, rel, h, sym, addendp) symbol is the value itself plus any desired offset. (taken from work done by Ian Taylor, Cygnus Support, for I386 COFF). */ -/* If we are producing relocateable output, we need to do some +/* If we are producing relocatable output, we need to do some adjustments to the object file that are not done by the bfd_perform_relocation function. This function is called by every reloc type to make any required adjustments. */ @@ -290,7 +290,7 @@ m68kcoff_common_addend_special_fn (abfd, reloc_entry, symbol, data, { /* For some reason bfd_perform_relocation always effectively ignores the addend for a COFF target when producing - relocateable output. This seems to be always wrong for 386 + relocatable output. This seems to be always wrong for 386 COFF, so we handle the addend here instead. */ diff = reloc_entry->addend; } @@ -409,7 +409,7 @@ m68kcoff_common_addend_rtype_to_howto (abfd, sec, rel, h, sym, addendp) } /* If the output symbol is common (in which case this must be a - relocateable link), we need to add in the final size of the + relocatable link), we need to add in the final size of the common symbol. */ if (h != NULL && h->root.type == bfd_link_hash_common) *addendp += h->root.u.c.size; @@ -445,7 +445,7 @@ bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) bfd_byte *p; bfd_size_type amt; - BFD_ASSERT (! info->relocateable); + BFD_ASSERT (! info->relocatable); *errmsg = NULL; @@ -532,7 +532,7 @@ bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) #endif #ifdef NAMES_HAVE_UNDERSCORE -CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, '_', NULL) +CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, '_', NULL, COFF_SWAP_TABLE) #else -CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, 0, NULL) +CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, 0, NULL, COFF_SWAP_TABLE) #endif diff --git a/bfd/coff-m88k.c b/bfd/coff-m88k.c index f2d7ecc353f..a8b2c55e319 100644 --- a/bfd/coff-m88k.c +++ b/bfd/coff-m88k.c @@ -1,6 +1,6 @@ /* BFD back-end for Motorola 88000 COFF "Binary Compatability Standard" files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000, - 2001, 2002 + 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -120,7 +120,7 @@ m88k_special_reloc (abfd, reloc_entry, symbol, data, (unsigned char *) data + addr); } - /* If we are not producing relocateable output, return an error if + /* If we are not producing relocatable output, return an error if the symbol is not defined. */ if (bfd_is_und_section (symbol->section) && output_bfd == (bfd *) NULL) return bfd_reloc_undefined; @@ -288,4 +288,4 @@ reloc_processing (relent, reloc, symbols, abfd, section) #undef coff_write_armap -CREATE_BIG_COFF_TARGET_VEC (m88kbcs_vec, "coff-m88kbcs", 0, 0, '_', NULL) +CREATE_BIG_COFF_TARGET_VEC (m88kbcs_vec, "coff-m88kbcs", 0, 0, '_', NULL, COFF_SWAP_TABLE) diff --git a/bfd/coff-mcore.c b/bfd/coff-mcore.c index 7847bb751b5..c4b073592ed 100644 --- a/bfd/coff-mcore.c +++ b/bfd/coff-mcore.c @@ -1,5 +1,5 @@ /* BFD back-end for Motorola MCore COFF/PE - 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. @@ -388,10 +388,10 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, bfd_boolean hihalf; bfd_vma hihalf_val; - /* If we are performing a relocateable link, we don't need to do a + /* If we are performing a relocatable link, we don't need to do a thing. The caller will take care of adjusting the reloc addresses and symbol indices. */ - if (info->relocateable) + if (info->relocatable) return TRUE; /* Check if we have the same endianess */ @@ -593,7 +593,7 @@ extern const bfd_target TARGET_LITTLE_SYM; /* The transfer vectors that lead the outside world to all of the above. */ CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED, (SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_READONLY | SEC_LINK_ONCE | SEC_LINK_DUPLICATES), - 0, & TARGET_LITTLE_SYM) + 0, & TARGET_LITTLE_SYM, COFF_SWAP_TABLE) CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED, (SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_READONLY | SEC_LINK_ONCE | SEC_LINK_DUPLICATES), - 0, & TARGET_BIG_SYM) + 0, & TARGET_BIG_SYM, COFF_SWAP_TABLE) diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c index 6bb1b9f3ab9..d6d82184234 100644 --- a/bfd/coff-mips.c +++ b/bfd/coff-mips.c @@ -1,6 +1,6 @@ /* BFD back-end for MIPS Extended-Coff files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -551,7 +551,7 @@ mips_adjust_reloc_out (abfd, rel, intern) } /* ECOFF relocs are either against external symbols, or against - sections. If we are producing relocateable output, and the reloc + sections. If we are producing relocatable output, and the reloc is against an external symbol, and nothing has given us any additional addend, the resulting reloc will also be against the same symbol. In such a case, we don't want to change anything @@ -559,7 +559,7 @@ mips_adjust_reloc_out (abfd, rel, intern) final link time. Rather than put special case code into bfd_perform_relocation, all the reloc types use this howto function. It just short circuits the reloc if producing - relocateable output against an external symbol. */ + relocatable output against an external symbol. */ static bfd_reloc_status_type mips_generic_reloc (abfd, @@ -758,7 +758,7 @@ mips_gprel_reloc (abfd, bfd *output_bfd; char **error_message; { - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_vma gp; bfd_vma relocation; unsigned long val; @@ -777,27 +777,27 @@ mips_gprel_reloc (abfd, } if (output_bfd != (bfd *) NULL) - relocateable = TRUE; + relocatable = TRUE; else { - relocateable = FALSE; + relocatable = FALSE; output_bfd = symbol->section->output_section->owner; } - if (bfd_is_und_section (symbol->section) && ! relocateable) + if (bfd_is_und_section (symbol->section) && ! relocatable) return bfd_reloc_undefined; /* We have to figure out the gp value, so that we can adjust the symbol value correctly. We look up the symbol _gp in the output BFD. If we can't find it, we're stuck. We cache it in the ECOFF target data. We don't need to adjust the symbol value for an - external symbol if we are producing relocateable output. */ + external symbol if we are producing relocatable output. */ gp = _bfd_get_gp_value (output_bfd); if (gp == 0 - && (! relocateable + && (! relocatable || (symbol->flags & BSF_SECTION_SYM) != 0)) { - if (relocateable) + if (relocatable) { /* Make up a value. */ gp = symbol->section->output_section->vma + 0x4000; @@ -861,16 +861,16 @@ mips_gprel_reloc (abfd, val -= 0x10000; /* Adjust val for the final section location and GP value. If we - are producing relocateable output, we don't want to do this for + are producing relocatable output, we don't want to do this for an external symbol. */ - if (! relocateable + if (! relocatable || (symbol->flags & BSF_SECTION_SYM) != 0) val += relocation - gp; insn = (insn &~ (unsigned) 0xffff) | (val & 0xffff); bfd_put_32 (abfd, (bfd_vma) insn, (bfd_byte *) data + reloc_entry->address); - if (relocateable) + if (relocatable) reloc_entry->address += input_section->output_offset; /* Make sure it fit in 16 bits. */ @@ -1046,7 +1046,7 @@ mips_rello_reloc (abfd, } /* bfd_perform_relocation does not handle pcrel_offset relocations - correctly when generating a relocateable file, so handle them + correctly when generating a relocatable file, so handle them directly here. */ if (output_bfd != (bfd *) NULL) { @@ -1413,7 +1413,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section, and the GP value of OUTPUT_BFD (which is in GP). */ addend = ecoff_data (input_bfd)->gp - gp; } - else if (! info->relocateable + else if (! info->relocatable || h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { @@ -1432,7 +1432,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section, /* This is a relocation against an undefined or common symbol. The current addend in the instruction is simply the desired offset into the symbol (normally - zero). We are generating relocateable output, and we + zero). We are generating relocatable output, and we aren't going to define this symbol, so we just leave the instruction alone. */ addend = 0; @@ -1446,7 +1446,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section, if (offsets != NULL && offsets[i] != 0) { - BFD_ASSERT (! info->relocateable); + BFD_ASSERT (! info->relocatable); BFD_ASSERT (int_rel.r_type == MIPS_R_PCREL16 || int_rel.r_type == MIPS_R_RELHI || int_rel.r_type == MIPS_R_RELLO); @@ -1524,9 +1524,9 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section, } } - if (info->relocateable) + if (info->relocatable) { - /* We are generating relocateable output, and must convert + /* We are generating relocatable output, and must convert the existing reloc. */ if (int_rel.r_extern) { @@ -2348,7 +2348,7 @@ bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) bfd_byte *p; bfd_size_type amt; - BFD_ASSERT (! info->relocateable); + BFD_ASSERT (! info->relocatable); *errmsg = NULL; diff --git a/bfd/coff-or32.c b/bfd/coff-or32.c index 6bec813e13f..b21cdf3f4ad 100644 --- a/bfd/coff-or32.c +++ b/bfd/coff-or32.c @@ -1,5 +1,5 @@ /* BFD back-end for OpenRISC 1000 COFF binaries. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. Contributed by Ivan Guzvinec This file is part of BFD, the Binary File Descriptor library. @@ -360,10 +360,10 @@ coff_or32_relocate_section (output_bfd, info, input_bfd, input_section, bfd_boolean hihalf; bfd_vma hihalf_val; - /* If we are performing a relocateable link, we don't need to do a + /* If we are performing a relocatable link, we don't need to do a thing. The caller will take care of adjusting the reloc addresses and symbol indices. */ - if (info->relocateable) + if (info->relocatable) return TRUE; hihalf = FALSE; diff --git a/bfd/coff-ppc.c b/bfd/coff-ppc.c index 067f2b65878..cf54942314b 100644 --- a/bfd/coff-ppc.c +++ b/bfd/coff-ppc.c @@ -1088,10 +1088,10 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma relocation; reloc_howto_type *howto = 0; - /* If we are performing a relocateable link, we don't need to do a + /* If we are performing a relocatable link, we don't need to do a thing. The caller will take care of adjusting the reloc addresses and symbol indices. */ - if (info->relocateable) + if (info->relocatable) return TRUE; hihalf = FALSE; @@ -2325,7 +2325,7 @@ ppc_bfd_coff_final_link (abfd, info) || info->strip == strip_some) o->lineno_count += sec->lineno_count; - if (info->relocateable) + if (info->relocatable) o->reloc_count += sec->reloc_count; if (sec->_raw_size > max_contents_size) @@ -2335,7 +2335,7 @@ ppc_bfd_coff_final_link (abfd, info) if (sec->reloc_count > max_reloc_count) max_reloc_count = sec->reloc_count; } - else if (info->relocateable + else if (info->relocatable && (p->type == bfd_section_reloc_link_order || p->type == bfd_symbol_reloc_link_order)) ++o->reloc_count; @@ -2350,9 +2350,9 @@ ppc_bfd_coff_final_link (abfd, info) } } - /* If doing a relocateable link, allocate space for the pointers we + /* If doing a relocatable link, allocate space for the pointers we need to keep. */ - if (info->relocateable) + if (info->relocatable) { unsigned int i; @@ -2401,9 +2401,9 @@ ppc_bfd_coff_final_link (abfd, info) Because of this problem, we also keep the relocs in memory until the end of the link. This wastes memory, - but only when doing a relocateable link, which is not the + but only when doing a relocatable link, which is not the common case. */ - BFD_ASSERT (info->relocateable); + BFD_ASSERT (info->relocatable); amt = o->reloc_count; amt *= sizeof (struct internal_reloc); finfo.section_info[o->target_index].relocs = @@ -2455,7 +2455,7 @@ ppc_bfd_coff_final_link (abfd, info) finfo.linenos = (bfd_byte *) bfd_malloc (amt); finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size); finfo.external_relocs = (bfd_byte *) bfd_malloc (max_reloc_count * relsz); - if (! info->relocateable) + if (! info->relocatable) { amt = max_reloc_count * sizeof (struct internal_reloc); finfo.internal_relocs = (struct internal_reloc *) bfd_malloc (amt); @@ -2467,7 +2467,7 @@ ppc_bfd_coff_final_link (abfd, info) || (finfo.linenos == NULL && max_lineno_count > 0) || (finfo.contents == NULL && max_contents_size > 0) || (finfo.external_relocs == NULL && max_reloc_count > 0) - || (! info->relocateable + || (! info->relocatable && finfo.internal_relocs == NULL && max_reloc_count > 0)) goto error_return; @@ -2602,7 +2602,7 @@ ppc_bfd_coff_final_link (abfd, info) finfo.outsyms = NULL; } - if (info->relocateable) + if (info->relocatable) { /* Now that we have written out all the global symbols, we know the symbol indices to use for relocs against them, and we can diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 87b80b6a894..8ba305c7740 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -1,5 +1,5 @@ /* BFD back-end for IBM RS/6000 "XCOFF" files. - Copyright 1990-1999, 2000, 2001, 2002 + Copyright 1990-1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. FIXME: Can someone provide a transliteration of this name into ASCII? Using the following chars caused a compiler warning on HIUX (so I replaced @@ -3426,7 +3426,7 @@ xcoff_ppc_relocate_section (output_bfd, info, input_bfd, } else if ((0 == (h->flags & (XCOFF_DEF_DYNAMIC | XCOFF_IMPORT))) - && ! info->relocateable) + && ! info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c index bcf059d299e..6b1468effab 100644 --- a/bfd/coff-sh.c +++ b/bfd/coff-sh.c @@ -706,7 +706,7 @@ sh_relax_section (abfd, sec, link_info, again) *again = FALSE; - if (link_info->relocateable + if (link_info->relocatable || (sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0) return TRUE; @@ -2969,7 +2969,7 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents, + sec->output_section->vma + sec->output_offset); } - else if (! info->relocateable) + else if (! info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, @@ -3024,12 +3024,12 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents, static bfd_byte * sh_coff_get_relocated_section_contents (output_bfd, link_info, link_order, - data, relocateable, symbols) + data, relocatable, symbols) bfd *output_bfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - bfd_boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { asection *input_section = link_order->u.indirect.section; @@ -3040,12 +3040,12 @@ sh_coff_get_relocated_section_contents (output_bfd, link_info, link_order, /* We only need to handle the case of relaxing, or of having a particular set of section contents, specially. */ - if (relocateable + if (relocatable || coff_section_data (input_bfd, input_section) == NULL || coff_section_data (input_bfd, input_section)->contents == NULL) return bfd_generic_get_relocated_section_contents (output_bfd, link_info, link_order, data, - relocateable, + relocatable, symbols); memcpy (data, coff_section_data (input_bfd, input_section)->contents, @@ -3132,7 +3132,7 @@ sh_coff_get_relocated_section_contents (output_bfd, link_info, link_order, /* The target vectors. */ #ifndef TARGET_SHL_SYM -CREATE_BIG_COFF_TARGET_VEC (shcoff_vec, "coff-sh", BFD_IS_RELAXABLE, 0, '_', NULL) +CREATE_BIG_COFF_TARGET_VEC (shcoff_vec, "coff-sh", BFD_IS_RELAXABLE, 0, '_', NULL, COFF_SWAP_TABLE) #endif #ifdef TARGET_SHL_SYM @@ -3147,10 +3147,10 @@ CREATE_BIG_COFF_TARGET_VEC (shcoff_vec, "coff-sh", BFD_IS_RELAXABLE, 0, '_', NUL #ifdef COFF_WITH_PE CREATE_LITTLE_COFF_TARGET_VEC (TARGET_SYM, TARGET_SHL_NAME, BFD_IS_RELAXABLE, - SEC_CODE | SEC_DATA, '_', NULL); + SEC_CODE | SEC_DATA, '_', NULL, COFF_SWAP_TABLE); #else CREATE_LITTLE_COFF_TARGET_VEC (TARGET_SYM, TARGET_SHL_NAME, BFD_IS_RELAXABLE, - 0, '_', NULL) + 0, '_', NULL, COFF_SWAP_TABLE) #endif #ifndef TARGET_SHL_SYM diff --git a/bfd/coff-sparc.c b/bfd/coff-sparc.c index 4053a6d5f4b..acfa6d4924a 100644 --- a/bfd/coff-sparc.c +++ b/bfd/coff-sparc.c @@ -216,4 +216,4 @@ rtype2howto (cache_ptr, dst) #define TARGET_NAME "coff-sparc" #endif -CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, '_', NULL) +CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, '_', NULL, COFF_SWAP_TABLE) diff --git a/bfd/coff-tic4x.c b/bfd/coff-tic4x.c index 5c8de41995c..708e6264caa 100644 --- a/bfd/coff-tic4x.c +++ b/bfd/coff-tic4x.c @@ -32,10 +32,6 @@ #undef F_LSYMS #define F_LSYMS F_LSYMS_TICOFF -static bfd_boolean ticoff0_bad_format_hook - PARAMS ((bfd *, PTR )); -static bfd_boolean ticoff1_bad_format_hook - PARAMS ((bfd *, PTR )); static bfd_boolean ticoff_bfd_is_local_label_name PARAMS ((bfd *, const char *)); static bfd_reloc_status_type tic4x_relocation @@ -50,32 +46,6 @@ static void tic4x_reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection * )); -static bfd_boolean -ticoff0_bad_format_hook (abfd, filehdr) - bfd *abfd ATTRIBUTE_UNUSED; - PTR filehdr; -{ - struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; - - if (COFF0_BADMAG (*internal_f)) - return FALSE; - - return TRUE; -} - -static bfd_boolean -ticoff1_bad_format_hook (abfd, filehdr) - bfd *abfd ATTRIBUTE_UNUSED; - PTR filehdr; -{ - struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; - - if (COFF1_BADMAG (*internal_f)) - return FALSE; - - return TRUE; -} - /* Replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local labels. */ static bfd_boolean @@ -281,353 +251,20 @@ tic4x_reloc_processing (relent, reloc, symbols, abfd, section) } -static const bfd_coff_backend_data ticoff0_swap_table = -{ - coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, - coff_SWAP_aux_out, coff_SWAP_sym_out, - coff_SWAP_lineno_out, coff_SWAP_reloc_out, - coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out, - coff_SWAP_scnhdr_out, - FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN, -#ifdef COFF_LONG_FILENAMES - TRUE, -#else - FALSE, -#endif -#ifdef COFF_LONG_SECTION_NAMES - TRUE, -#else - FALSE, -#endif -#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS - TRUE, -#else - FALSE, -#endif -#ifdef COFF_DEBUG_STRING_WIDE_PREFIX - 4, -#else - 2, -#endif - COFF_DEFAULT_SECTION_ALIGNMENT_POWER, - coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, - coff_SWAP_reloc_in, ticoff0_bad_format_hook, coff_set_arch_mach_hook, - coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, - coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook, - coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate, - coff_classify_symbol, coff_compute_section_file_positions, - coff_start_final_link, coff_relocate_section, coff_rtype_to_howto, - coff_adjust_symndx, coff_link_add_one_symbol, - coff_link_output_has_begun, coff_final_link_postscript -}; - -/* COFF1 differs in section header size. */ -static const bfd_coff_backend_data ticoff1_swap_table = -{ - coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, - coff_SWAP_aux_out, coff_SWAP_sym_out, - coff_SWAP_lineno_out, coff_SWAP_reloc_out, - coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out, - coff_SWAP_scnhdr_out, - FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN, -#ifdef COFF_LONG_FILENAMES - TRUE, -#else - FALSE, -#endif -#ifdef COFF_LONG_SECTION_NAMES - TRUE, -#else - FALSE, -#endif -#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS - TRUE, -#else - FALSE, -#endif -#ifdef COFF_DEBUG_STRING_WIDE_PREFIX - 4, -#else - 2, -#endif - COFF_DEFAULT_SECTION_ALIGNMENT_POWER, - coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, - coff_SWAP_reloc_in, ticoff1_bad_format_hook, coff_set_arch_mach_hook, - coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, - coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook, - coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate, - coff_classify_symbol, coff_compute_section_file_positions, - coff_start_final_link, coff_relocate_section, coff_rtype_to_howto, - coff_adjust_symndx, coff_link_add_one_symbol, - coff_link_output_has_begun, coff_final_link_postscript -}; - - /* TI COFF v0, DOS tools (little-endian headers). */ -const bfd_target tic4x_coff0_vec = -{ - "coff0-tic4x", /* Name. */ - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* Data byte order is little. */ - BFD_ENDIAN_LITTLE, /* Header byte order is little (DOS tools). */ - - (HAS_RELOC | EXEC_P | /* Object flags. */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */ - '_', /* Leading symbol underscore. */ - '/', /* ar_pad_char. */ - 15, /* ar_max_namelen. */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - NULL, - - (PTR)&ticoff0_swap_table -}; +CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff0_vec, "coff0-tic4x", HAS_LOAD_PAGE, 0, '_', NULL, (PTR)&ticoff0_swap_table); /* TI COFF v0, SPARC tools (big-endian headers). */ -const bfd_target tic4x_coff0_beh_vec = -{ - "coff0-beh-tic4x", /* Name. */ - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* Data byte order is little. */ - BFD_ENDIAN_BIG, /* Header byte order is big. */ - - (HAS_RELOC | EXEC_P | /* Object flags. */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */ - '_', /* Leading symbol underscore. */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - &tic4x_coff0_vec, - - (PTR)&ticoff0_swap_table -}; +CREATE_BIGHDR_COFF_TARGET_VEC(tic4x_coff0_beh_vec, "coff0-beh-tic4x", HAS_LOAD_PAGE, 0, '_', &tic4x_coff0_vec, (PTR)&ticoff0_swap_table); /* TI COFF v1, DOS tools (little-endian headers). */ -const bfd_target tic4x_coff1_vec = -{ - "coff1-tic4x", /* Name. */ - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* Data byte order is little. */ - BFD_ENDIAN_LITTLE, /* Header byte order is little (DOS tools). */ - - (HAS_RELOC | EXEC_P | /* Object flags. */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */ - '_', /* Leading symbol underscore. */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - &tic4x_coff0_beh_vec, - - (PTR)&ticoff1_swap_table -}; +CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff1_vec, "coff1-tic4x", HAS_LOAD_PAGE, 0, '_', &tic4x_coff0_beh_vec, (PTR)&ticoff1_swap_table); /* TI COFF v1, SPARC tools (big-endian headers). */ -const bfd_target tic4x_coff1_beh_vec = -{ - "coff1-beh-tic4x", /* Name. */ - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* Data byte order is little. */ - BFD_ENDIAN_BIG, /* Header byte order is big. */ - - (HAS_RELOC | EXEC_P | /* Object flags. */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */ - '_', /* Leading symbol underscore. */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - &tic4x_coff1_vec, - - (PTR)&ticoff1_swap_table -}; +CREATE_BIGHDR_COFF_TARGET_VEC(tic4x_coff1_beh_vec, "coff1-beh-tic4x", HAS_LOAD_PAGE, 0, '_', &tic4x_coff1_vec, (PTR)&ticoff1_swap_table); /* TI COFF v2, TI DOS tools output (little-endian headers). */ -const bfd_target tic4x_coff2_vec = -{ - "coff2-tic4x", /* Name. */ - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* Data byte order is little. */ - BFD_ENDIAN_LITTLE, /* Header byte order is little (DOS tools). */ - - (HAS_RELOC | EXEC_P | /* Object flags. */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */ - '_', /* Leading symbol underscore. */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - &tic4x_coff1_beh_vec, - - COFF_SWAP_TABLE -}; +CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff2_vec, "coff2-tic4x", HAS_LOAD_PAGE, 0, '_', &tic4x_coff1_beh_vec, COFF_SWAP_TABLE); /* TI COFF v2, TI SPARC tools output (big-endian headers). */ -const bfd_target tic4x_coff2_beh_vec = -{ - "coff2-beh-tic4x", /* Name. */ - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* Data byte order is little. */ - BFD_ENDIAN_BIG, /* Header byte order is big. */ - - (HAS_RELOC | EXEC_P | /* Object flags. */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */ - '_', /* Leading symbol underscore. */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - &tic4x_coff2_vec, - - COFF_SWAP_TABLE -}; +CREATE_BIGHDR_COFF_TARGET_VEC(tic4x_coff2_beh_vec, "coff2-beh-tic4x", HAS_LOAD_PAGE, 0, '_', &tic4x_coff2_vec, COFF_SWAP_TABLE); diff --git a/bfd/coff-tic54x.c b/bfd/coff-tic54x.c index cf7227c8261..fdf1b5a00c1 100644 --- a/bfd/coff-tic54x.c +++ b/bfd/coff-tic54x.c @@ -50,10 +50,6 @@ static reloc_howto_type * tic54x_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static void tic54x_lookup_howto PARAMS ((arelent *, struct internal_reloc *)); -static bfd_boolean ticoff0_bad_format_hook - PARAMS ((bfd *, PTR)); -static bfd_boolean ticoff1_bad_format_hook - PARAMS ((bfd *, PTR)); static bfd_boolean ticoff_bfd_is_local_label_name PARAMS ((bfd *, const char *)); @@ -323,32 +319,6 @@ coff_tic54x_rtype_to_howto (abfd, sec, rel, h, sym, addendp) return genrel.howto; } -static bfd_boolean -ticoff0_bad_format_hook (abfd, filehdr) - bfd * abfd ATTRIBUTE_UNUSED; - PTR filehdr; -{ - struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; - - if (COFF0_BADMAG (*internal_f)) - return FALSE; - - return TRUE; -} - -static bfd_boolean -ticoff1_bad_format_hook (abfd, filehdr) - bfd * abfd ATTRIBUTE_UNUSED; - PTR filehdr; -{ - struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; - - if (COFF1_BADMAG (*internal_f)) - return FALSE; - - return TRUE; -} - /* Replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local labels. */ @@ -435,88 +405,6 @@ tic54x_reloc_processing (relent, reloc, symbols, abfd, section) tic54x_lookup_howto (relent, reloc); } -/* COFF0 differs in file/section header size and relocation entry size. */ -static const bfd_coff_backend_data ticoff0_swap_table = - { - coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, - coff_SWAP_aux_out, coff_SWAP_sym_out, - coff_SWAP_lineno_out, coff_SWAP_reloc_out, - coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out, - coff_SWAP_scnhdr_out, - FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN, -#ifdef COFF_LONG_FILENAMES - TRUE, -#else - FALSE, -#endif -#ifdef COFF_LONG_SECTION_NAMES - TRUE, -#else - FALSE, -#endif -#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS - TRUE, -#else - FALSE, -#endif -#ifdef COFF_DEBUG_STRING_WIDE_PREFIX - 4, -#else - 2, -#endif - COFF_DEFAULT_SECTION_ALIGNMENT_POWER, - coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, - coff_SWAP_reloc_in, ticoff0_bad_format_hook, coff_set_arch_mach_hook, - coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, - coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook, - coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate, - coff_classify_symbol, coff_compute_section_file_positions, - coff_start_final_link, coff_relocate_section, coff_rtype_to_howto, - coff_adjust_symndx, coff_link_add_one_symbol, - coff_link_output_has_begun, coff_final_link_postscript - }; - -/* COFF1 differs in section header size. */ -static const bfd_coff_backend_data ticoff1_swap_table = - { - coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, - coff_SWAP_aux_out, coff_SWAP_sym_out, - coff_SWAP_lineno_out, coff_SWAP_reloc_out, - coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out, - coff_SWAP_scnhdr_out, - FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN, -#ifdef COFF_LONG_FILENAMES - TRUE, -#else - FALSE, -#endif -#ifdef COFF_LONG_SECTION_NAMES - TRUE, -#else - FALSE, -#endif - COFF_DEFAULT_SECTION_ALIGNMENT_POWER, -#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS - TRUE, -#else - FALSE, -#endif -#ifdef COFF_DEBUG_STRING_WIDE_PREFIX - 4, -#else - 2, -#endif - coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, - coff_SWAP_reloc_in, ticoff1_bad_format_hook, coff_set_arch_mach_hook, - coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, - coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook, - coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate, - coff_classify_symbol, coff_compute_section_file_positions, - coff_start_final_link, coff_relocate_section, coff_rtype_to_howto, - coff_adjust_symndx, coff_link_add_one_symbol, - coff_link_output_has_begun, coff_final_link_postscript - }; - /* TI COFF v0, DOS tools (little-endian headers). */ const bfd_target tic54x_coff0_vec = { diff --git a/bfd/coff-tic80.c b/bfd/coff-tic80.c index 4185e7b18d8..c7ec9bd61f2 100644 --- a/bfd/coff-tic80.c +++ b/bfd/coff-tic80.c @@ -1,5 +1,6 @@ /* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP). - Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1996, 1997, 1999, 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. Written by Fred Fish (fnf@cygnus.com) @@ -576,7 +577,7 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd, + sec->output_offset); } - else if (! info->relocateable) + else if (! info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, @@ -719,4 +720,4 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd, #undef C_LASTENT /* Clashes with TIc80's C_STATLAB */ #include "coffcode.h" -CREATE_LITTLE_COFF_TARGET_VEC (tic80coff_vec, "coff-tic80", D_PAGED, 0, '_', NULL) +CREATE_LITTLE_COFF_TARGET_VEC (tic80coff_vec, "coff-tic80", D_PAGED, 0, '_', NULL, COFF_SWAP_TABLE) diff --git a/bfd/coff-w65.c b/bfd/coff-w65.c index 093764a0da0..cc31a23108d 100644 --- a/bfd/coff-w65.c +++ b/bfd/coff-w65.c @@ -380,4 +380,4 @@ w65_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, bfd_coff_reloc16_get_relocated_section_contents #define coff_bfd_relax_section bfd_coff_reloc16_relax_section -CREATE_LITTLE_COFF_TARGET_VEC (w65_vec, "coff-w65", BFD_IS_RELAXABLE, 0, '_', NULL) +CREATE_LITTLE_COFF_TARGET_VEC (w65_vec, "coff-w65", BFD_IS_RELAXABLE, 0, '_', NULL, COFF_SWAP_TABLE) diff --git a/bfd/coff-we32k.c b/bfd/coff-we32k.c index fb674a95806..b71df53ce81 100644 --- a/bfd/coff-we32k.c +++ b/bfd/coff-we32k.c @@ -66,4 +66,4 @@ static reloc_howto_type howto_table[] = #define coff_write_armap bsd_write_armap -CREATE_BIG_COFF_TARGET_VEC (we32kcoff_vec, "coff-we32k", 0, 0, 0, NULL) +CREATE_BIG_COFF_TARGET_VEC (we32kcoff_vec, "coff-we32k", 0, 0, 0, NULL, COFF_SWAP_TABLE) diff --git a/bfd/coff-z8k.c b/bfd/coff-z8k.c index 068cfac7b6b..3337376fadb 100644 --- a/bfd/coff-z8k.c +++ b/bfd/coff-z8k.c @@ -350,4 +350,4 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) bfd_coff_reloc16_get_relocated_section_contents #define coff_bfd_relax_section bfd_coff_reloc16_relax_section -CREATE_BIG_COFF_TARGET_VEC (z8kcoff_vec, "coff-z8k", 0, 0, '_', NULL) +CREATE_BIG_COFF_TARGET_VEC (z8kcoff_vec, "coff-z8k", 0, 0, '_', NULL, COFF_SWAP_TABLE) diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index dcb96dd7127..c6b18037603 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -1,5 +1,5 @@ /* BFD back-end for IBM RS/6000 "XCOFF64" files. - Copyright 2000, 2001, 2002 + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written Clinton Popetz. Contributed by Cygnus Support. @@ -1277,7 +1277,7 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, + sec->output_offset); } else if ((0 == (h->flags & (XCOFF_DEF_DYNAMIC | XCOFF_IMPORT))) - && ! info->relocateable) + && ! info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 31338ee99ea..e9ad4df7e80 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -362,6 +362,12 @@ static unsigned int coff_compute_checksum static bfd_boolean coff_apply_checksum PARAMS ((bfd *)); #endif +#ifdef TICOFF +static bfd_boolean ticoff0_bad_format_hook + PARAMS ((bfd *, PTR )); +static bfd_boolean ticoff1_bad_format_hook + PARAMS ((bfd *, PTR )); +#endif /* void warning(); */ @@ -1439,6 +1445,36 @@ coff_bad_format_hook (abfd, filehdr) return TRUE; } +#ifdef TICOFF +static bfd_boolean +ticoff0_bad_format_hook (abfd, filehdr) + bfd *abfd ATTRIBUTE_UNUSED; + PTR filehdr; +{ + struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; + + if (COFF0_BADMAG (*internal_f)) + return FALSE; + + return TRUE; +} +#endif + +#ifdef TICOFF +static bfd_boolean +ticoff1_bad_format_hook (abfd, filehdr) + bfd *abfd ATTRIBUTE_UNUSED; + PTR filehdr; +{ + struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; + + if (COFF1_BADMAG (*internal_f)) + return FALSE; + + return TRUE; +} +#endif + /* Check whether this section uses an alignment other than the default. */ @@ -5338,6 +5374,92 @@ static const bfd_coff_backend_data bfd_coff_std_swap_table = coff_link_output_has_begun, coff_final_link_postscript }; +#ifdef TICOFF +/* COFF0 differs in file/section header size and relocation entry size. */ +static const bfd_coff_backend_data ticoff0_swap_table = +{ + coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, + coff_SWAP_aux_out, coff_SWAP_sym_out, + coff_SWAP_lineno_out, coff_SWAP_reloc_out, + coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out, + coff_SWAP_scnhdr_out, + FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN, +#ifdef COFF_LONG_FILENAMES + TRUE, +#else + FALSE, +#endif +#ifdef COFF_LONG_SECTION_NAMES + TRUE, +#else + FALSE, +#endif + COFF_DEFAULT_SECTION_ALIGNMENT_POWER, +#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS + TRUE, +#else + FALSE, +#endif +#ifdef COFF_DEBUG_STRING_WIDE_PREFIX + 4, +#else + 2, +#endif + coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, + coff_SWAP_reloc_in, ticoff0_bad_format_hook, coff_set_arch_mach_hook, + coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, + coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook, + coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate, + coff_classify_symbol, coff_compute_section_file_positions, + coff_start_final_link, coff_relocate_section, coff_rtype_to_howto, + coff_adjust_symndx, coff_link_add_one_symbol, + coff_link_output_has_begun, coff_final_link_postscript +}; +#endif + +#ifdef TICOFF +/* COFF1 differs in section header size. */ +static const bfd_coff_backend_data ticoff1_swap_table = +{ + coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, + coff_SWAP_aux_out, coff_SWAP_sym_out, + coff_SWAP_lineno_out, coff_SWAP_reloc_out, + coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out, + coff_SWAP_scnhdr_out, + FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN, +#ifdef COFF_LONG_FILENAMES + TRUE, +#else + FALSE, +#endif +#ifdef COFF_LONG_SECTION_NAMES + TRUE, +#else + FALSE, +#endif + COFF_DEFAULT_SECTION_ALIGNMENT_POWER, +#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS + TRUE, +#else + FALSE, +#endif +#ifdef COFF_DEBUG_STRING_WIDE_PREFIX + 4, +#else + 2, +#endif + coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, + coff_SWAP_reloc_in, ticoff1_bad_format_hook, coff_set_arch_mach_hook, + coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, + coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook, + coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate, + coff_classify_symbol, coff_compute_section_file_positions, + coff_start_final_link, coff_relocate_section, coff_rtype_to_howto, + coff_adjust_symndx, coff_link_add_one_symbol, + coff_link_output_has_begun, coff_final_link_postscript +}; +#endif + #ifndef coff_close_and_cleanup #define coff_close_and_cleanup _bfd_generic_close_and_cleanup #endif @@ -5413,7 +5535,7 @@ static const bfd_coff_backend_data bfd_coff_std_swap_table = #define coff_bfd_discard_group bfd_generic_discard_group #endif -#define CREATE_BIG_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE) \ +#define CREATE_BIG_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE, SWAP_TABLE) \ const bfd_target VAR = \ { \ NAME , \ @@ -5460,10 +5582,60 @@ const bfd_target VAR = \ \ ALTERNATIVE, \ \ - COFF_SWAP_TABLE \ + SWAP_TABLE \ +}; + +#define CREATE_BIGHDR_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE, SWAP_TABLE) \ +const bfd_target VAR = \ +{ \ + NAME , \ + bfd_target_coff_flavour, \ + BFD_ENDIAN_LITTLE, /* data byte order is little */ \ + BFD_ENDIAN_BIG, /* header byte order is big */ \ + /* object flags */ \ + (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | \ + HAS_SYMS | HAS_LOCALS | WP_TEXT | EXTRA_O_FLAGS), \ + /* section flags */ \ + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | EXTRA_S_FLAGS),\ + UNDER, /* leading symbol underscore */ \ + '/', /* ar_pad_char */ \ + 15, /* ar_max_namelen */ \ + \ + /* Data conversion functions. */ \ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, \ + bfd_getb32, bfd_getb_signed_32, bfd_putb32, \ + bfd_getb16, bfd_getb_signed_16, bfd_putb16, \ + \ + /* Header conversion functions. */ \ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, \ + bfd_getb32, bfd_getb_signed_32, bfd_putb32, \ + bfd_getb16, bfd_getb_signed_16, bfd_putb16, \ + \ + /* bfd_check_format */ \ + { _bfd_dummy_target, coff_object_p, bfd_generic_archive_p, \ + _bfd_dummy_target }, \ + /* bfd_set_format */ \ + { bfd_false, coff_mkobject, _bfd_generic_mkarchive, bfd_false }, \ + /* bfd_write_contents */ \ + { bfd_false, coff_write_object_contents, _bfd_write_archive_contents, \ + bfd_false }, \ + \ + BFD_JUMP_TABLE_GENERIC (coff), \ + BFD_JUMP_TABLE_COPY (coff), \ + BFD_JUMP_TABLE_CORE (_bfd_nocore), \ + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), \ + BFD_JUMP_TABLE_SYMBOLS (coff), \ + BFD_JUMP_TABLE_RELOCS (coff), \ + BFD_JUMP_TABLE_WRITE (coff), \ + BFD_JUMP_TABLE_LINK (coff), \ + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), \ + \ + ALTERNATIVE, \ + \ + SWAP_TABLE \ }; -#define CREATE_LITTLE_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE) \ +#define CREATE_LITTLE_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE, SWAP_TABLE) \ const bfd_target VAR = \ { \ NAME , \ @@ -5508,5 +5680,5 @@ const bfd_target VAR = \ \ ALTERNATIVE, \ \ - COFF_SWAP_TABLE \ + SWAP_TABLE \ }; diff --git a/bfd/cofflink.c b/bfd/cofflink.c index 4e613881242..59b32ed1f6f 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -1,5 +1,5 @@ /* COFF specific linker code. - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. @@ -597,9 +597,9 @@ coff_link_add_symbols (abfd, info) sym_hash += sym.n_numaux + 1; } - /* If this is a non-traditional, non-relocateable link, try to + /* If this is a non-traditional, non-relocatable link, try to optimize the handling of any .stab/.stabstr sections. */ - if (! info->relocateable + if (! info->relocatable && ! info->traditional_format && info->hash->creator->flavour == bfd_get_flavour (abfd) && (info->strip != strip_all && info->strip != strip_debugger)) @@ -739,7 +739,7 @@ _bfd_coff_final_link (abfd, info) || info->strip == strip_some) o->lineno_count += sec->lineno_count; - if (info->relocateable) + if (info->relocatable) o->reloc_count += sec->reloc_count; if (sec->_raw_size > max_contents_size) @@ -749,7 +749,7 @@ _bfd_coff_final_link (abfd, info) if (sec->reloc_count > max_reloc_count) max_reloc_count = sec->reloc_count; } - else if (info->relocateable + else if (info->relocatable && (p->type == bfd_section_reloc_link_order || p->type == bfd_symbol_reloc_link_order)) ++o->reloc_count; @@ -782,9 +782,9 @@ _bfd_coff_final_link (abfd, info) } } - /* If doing a relocateable link, allocate space for the pointers we + /* If doing a relocatable link, allocate space for the pointers we need to keep. */ - if (info->relocateable) + if (info->relocatable) { unsigned int i; @@ -830,9 +830,9 @@ _bfd_coff_final_link (abfd, info) Because of this problem, we also keep the relocs in memory until the end of the link. This wastes memory, - but only when doing a relocateable link, which is not the + but only when doing a relocatable link, which is not the common case. */ - BFD_ASSERT (info->relocateable); + BFD_ASSERT (info->relocatable); amt = o->reloc_count; amt *= sizeof (struct internal_reloc); finfo.section_info[o->target_index].relocs = @@ -884,7 +884,7 @@ _bfd_coff_final_link (abfd, info) finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size); amt = max_reloc_count * relsz; finfo.external_relocs = (bfd_byte *) bfd_malloc (amt); - if (! info->relocateable) + if (! info->relocatable) { amt = max_reloc_count * sizeof (struct internal_reloc); finfo.internal_relocs = (struct internal_reloc *) bfd_malloc (amt); @@ -896,7 +896,7 @@ _bfd_coff_final_link (abfd, info) || (finfo.linenos == NULL && max_lineno_count > 0) || (finfo.contents == NULL && max_contents_size > 0) || (finfo.external_relocs == NULL && max_reloc_count > 0) - || (! info->relocateable + || (! info->relocatable && finfo.internal_relocs == NULL && max_reloc_count > 0)) goto error_return; @@ -1033,7 +1033,7 @@ _bfd_coff_final_link (abfd, info) finfo.outsyms = NULL; } - if (info->relocateable && max_output_reloc_count > 0) + if (info->relocatable && max_output_reloc_count > 0) { /* Now that we have written out all the global symbols, we know the symbol indices to use for relocs against them, and we can @@ -1334,8 +1334,8 @@ mark_relocs (finfo, input_bfd) internal_relocs = _bfd_coff_read_internal_relocs (input_bfd, a, FALSE, finfo->external_relocs, - finfo->info->relocateable, - (finfo->info->relocateable + finfo->info->relocatable, + (finfo->info->relocatable ? (finfo->section_info[ a->output_section->target_index ].relocs + a->output_section->reloc_count) : finfo->internal_relocs) ); @@ -1430,7 +1430,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) going to be involved in the relocations */ if (( finfo->info->strip != strip_none || finfo->info->discard != discard_none) - && finfo->info->relocateable) + && finfo->info->relocatable) { /* mark the symbol array as 'not-used' */ memset (indexp, 0, obj_raw_syment_count (input_bfd) * sizeof * indexp); @@ -1477,7 +1477,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) relocation. */ if ((finfo->info->strip != strip_none || finfo->info->discard != discard_none) - && finfo->info->relocateable) + && finfo->info->relocatable) dont_skip_symbol = *indexp; else dont_skip_symbol = FALSE; @@ -2356,8 +2356,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) target_index = o->output_section->target_index; internal_relocs = (_bfd_coff_read_internal_relocs (input_bfd, o, FALSE, finfo->external_relocs, - finfo->info->relocateable, - (finfo->info->relocateable + finfo->info->relocatable, + (finfo->info->relocatable ? (finfo->section_info[target_index].relocs + o->output_section->reloc_count) : finfo->internal_relocs))); @@ -2374,7 +2374,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) finfo->sec_ptrs)) return FALSE; - if (finfo->info->relocateable) + if (finfo->info->relocatable) { bfd_vma offset; struct internal_reloc *irelend; @@ -2608,9 +2608,9 @@ _bfd_coff_write_global_sym (h, data) /* When a weak symbol is not overriden by a strong one, turn it into an external symbol when not building a - shared or relocateable object. */ + shared or relocatable object. */ if (! finfo->info->shared - && ! finfo->info->relocateable + && ! finfo->info->relocatable && IS_WEAK_EXTERNAL (finfo->output_bfd, isym)) isym.n_sclass = C_EXT; @@ -2666,7 +2666,7 @@ _bfd_coff_write_global_sym (h, data) if (sec->reloc_count > 0xffff && (! obj_pe (output_bfd) - || finfo->info->relocateable)) + || finfo->info->relocatable)) (*_bfd_error_handler) (_("%s: %s: reloc overflow: 0x%lx > 0xffff"), bfd_get_filename (output_bfd), @@ -2675,7 +2675,7 @@ _bfd_coff_write_global_sym (h, data) if (sec->lineno_count > 0xffff && (! obj_pe (output_bfd) - || finfo->info->relocateable)) + || finfo->info->relocatable)) (*_bfd_error_handler) (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"), bfd_get_filename (output_bfd), @@ -2938,13 +2938,13 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, if (howto == NULL) return FALSE; - /* If we are doing a relocateable link, then we can just ignore + /* If we are doing a relocatable link, then we can just ignore a PC relative reloc that is pcrel_offset. It will already - have the correct value. If this is not a relocateable link, + have the correct value. If this is not a relocatable link, then we should ignore the symbol value. */ if (howto->pc_relative && howto->pcrel_offset) { - if (info->relocateable) + if (info->relocatable) continue; if (sym != NULL && sym->n_scnum != 0) addend += sym->n_value; @@ -2987,7 +2987,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, else if (h->root.type == bfd_link_hash_undefweak) val = 0; - else if (! info->relocateable) + else if (! info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, diff --git a/bfd/config.bfd b/bfd/config.bfd index d93b07131a7..e1aa6b74cba 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -68,8 +68,21 @@ esac # Make sure that the left side always has two dashes. Otherwise you # can get spurious matches. Even for unambiguous cases, do this as a # convention, else the table becomes a real mess to understand and maintain. +# +# Keep obsolete entries above the START comment, to keep them out of +# targmatch.h. case "${targ}" in + mips*-dec-bsd*) + echo "This target is obsolete and has been removed." + exit 1 + ;; + + mips*-*-pe*) + echo "This target is obsolete and has been removed." + exit 1 + ;; + # START OF targmatch.h #ifdef BFD64 alpha*-*-freebsd*) @@ -271,7 +284,7 @@ case "${targ}" in targ_defvec=tic30_coff_vec ;; - c4x-*-*coff* | tic4x-*-*coff*) + c4x-*-*coff* | tic4x-*-*coff* | tic4x-*-rtems*) targ_defvec=tic4x_coff1_vec targ_selvecs="tic4x_coff1_beh_vec tic4x_coff2_vec tic4x_coff2_beh_vec tic4x_coff0_vec tic4x_coff0_beh_vec" targ_underscore=yes @@ -433,7 +446,7 @@ case "${targ}" in targ_cflags=-DOLD_FREEBSD_ABI_LABEL ;; esac ;; - i[3-7]86-*-netbsdelf*) + i[3-7]86-*-netbsdelf* | i[3-7]86-*-netbsd*-gnu*) targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386netbsd_vec ;; @@ -441,11 +454,16 @@ case "${targ}" in targ_defvec=i386pe_vec targ_selvecs="i386pe_vec i386pei_vec bfd_elf32_i386_vec" ;; - i[3-7]86-*-netbsdaout* | i[3-7]86-*-netbsd* | i[3-7]86-*-openbsd*) + i[3-7]86-*-netbsdaout* | i[3-7]86-*-netbsd* | \ + i[3-7]86-*-openbsd[0-2].* | i[3-7]86-*-openbsd3.[0-3]) targ_defvec=i386netbsd_vec targ_selvecs="bfd_elf32_i386_vec i386bsd_vec" targ_underscore=yes ;; + i[3-7]86-*-openbsd*) + targ_defvec=bfd_elf32_i386_vec + targ_selvecs=i386netbsd_vec + ;; i[3-7]86-*-netware*) targ_defvec=bfd_elf32_i386_vec targ_selvecs="nlm32_i386_vec i386coff_vec i386aout_vec" @@ -718,10 +736,6 @@ case "${targ}" in targ_defvec=bfd_elf32_bigmips_vec targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec" ;; - mips*-dec-bsd*) - targ_defvec=aout_mips_little_vec - targ_underscore=yes - ;; mips*-dec-mach3*) targ_defvec=aout_mips_little_vec targ_cflags=-DSTAT_FOR_EXEC @@ -756,11 +770,6 @@ case "${targ}" in targ_defvec=aout_mips_little_vec targ_cflags=-DSTAT_FOR_EXEC ;; - mips*-*-pe*) - targ_defvec=mipslpe_vec - targ_selvecs="mipslpei_vec mipslpei_vec ecoff_little_vec ecoff_big_vec" - targ_underscore=yes - ;; mips*-*-sysv4*) targ_defvec=bfd_elf32_tradbigmips_vec targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" @@ -942,7 +951,6 @@ case "${targ}" in targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" ;; - powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*) targ_defvec=bfd_powerpcle_pe_vec targ_selvecs="bfd_powerpcle_pei_vec bfd_powerpc_pei_vec bfd_powerpcle_pe_vec bfd_powerpc_pe_vec" @@ -1034,7 +1042,6 @@ case "${targ}" in targ_defvec=bfd_elf32_shnbsd_vec targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" ;; - 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" @@ -1104,10 +1111,14 @@ case "${targ}" in targ_selvecs=bfd_elf32_sparc_vec targ_underscore=yes ;; - sparc-*-openbsd*) + sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1]) targ_defvec=sparcnetbsd_vec targ_underscore=yes ;; + sparc-*-openbsd*) + targ_defvec=bfd_elf32_sparc_vec + targ_selvecs=sparcnetbsd_vec + ;; sparc-*-elf* | sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*) targ_defvec=bfd_elf32_sparc_vec targ_selvecs=sunos_big_vec @@ -1168,7 +1179,6 @@ case "${targ}" in targ_underscore=yes ;; - v850-*-*) targ_defvec=bfd_elf32_v850_vec ;; @@ -1195,6 +1205,11 @@ case "${targ}" in targ_underscore=yes ;; + vax-*-openbsd*) + targ_defvec=vaxnetbsd_vec + targ_underscore=yes + ;; + vax*-*-*vms*) targ_defvec=vms_vax_vec ;; diff --git a/bfd/config.in b/bfd/config.in index 222096e3c02..9a73c730252 100644 --- a/bfd/config.in +++ b/bfd/config.in @@ -25,9 +25,6 @@ /* Define to `long' if doesn't define. */ #undef off_t -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE - /* Define to `unsigned' if doesn't define. */ #undef size_t @@ -160,15 +157,9 @@ /* Define if you have the header file. */ #undef HAVE_SYS_PROCFS_H -/* Define if you have the header file. */ -#undef HAVE_SYS_STAT_H - /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H -/* Define if you have the header file. */ -#undef HAVE_SYS_TYPES_H - /* Define if you have the header file. */ #undef HAVE_TIME_H diff --git a/bfd/configure b/bfd/configure index df2d7ff38fc..3b37998b4c2 100755 --- a/bfd/configure +++ b/bfd/configure @@ -5298,7 +5298,9 @@ rm -f conftest* COREFILE=trad-core.lo TRAD_HEADER='"hosts/tahoe.h"' ;; - vax-*-netbsd*) COREFILE=netbsd-core.lo ;; + vax-*-netbsd* | vax-*-openbsd*) + COREFILE=netbsd-core.lo + ;; vax-*-ultrix2*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxult2.h"' @@ -5334,17 +5336,17 @@ rm -f conftest* do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5338: checking for $ac_hdr" >&5 +echo "configure:5340: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5350: \"$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* @@ -5372,12 +5374,12 @@ done if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5376: checking for prstatus_t in sys/procfs.h" >&5 +echo "configure:5378: checking for prstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus_t=yes else @@ -5408,12 +5410,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6 echo $ac_n "checking for prstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5412: checking for prstatus32_t in sys/procfs.h" >&5 +echo "configure:5414: checking for prstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus32_t=yes else @@ -5444,12 +5446,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus32_t" 1>&6 echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5448: checking for prstatus_t.pr_who in sys/procfs.h" >&5 +echo "configure:5450: checking for prstatus_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes else @@ -5480,12 +5482,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6 echo $ac_n "checking for prstatus32_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5484: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 +echo "configure:5486: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes else @@ -5516,12 +5518,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" 1>&6 echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5520: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:5522: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -5552,12 +5554,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for pxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5556: checking for pxstatus_t in sys/procfs.h" >&5 +echo "configure:5558: checking for pxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pxstatus_t=yes else @@ -5588,12 +5590,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pxstatus_t" 1>&6 echo $ac_n "checking for pstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5592: checking for pstatus32_t in sys/procfs.h" >&5 +echo "configure:5594: checking for pstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus32_t=yes else @@ -5624,12 +5626,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus32_t" 1>&6 echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5628: checking for prpsinfo_t in sys/procfs.h" >&5 +echo "configure:5630: checking for prpsinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo_t=yes else @@ -5660,12 +5662,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6 echo $ac_n "checking for prpsinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5664: checking for prpsinfo32_t in sys/procfs.h" >&5 +echo "configure:5666: checking for prpsinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes else @@ -5696,12 +5698,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo32_t" 1>&6 echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5700: checking for psinfo_t in sys/procfs.h" >&5 +echo "configure:5702: checking for psinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo_t=yes else @@ -5732,12 +5734,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6 echo $ac_n "checking for psinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5736: checking for psinfo32_t in sys/procfs.h" >&5 +echo "configure:5738: checking for psinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo32_t=yes else @@ -5768,12 +5770,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo32_t" 1>&6 echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5772: checking for lwpstatus_t in sys/procfs.h" >&5 +echo "configure:5774: checking for lwpstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpstatus_t=yes else @@ -5804,12 +5806,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6 echo $ac_n "checking for lwpxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5808: checking for lwpxstatus_t in sys/procfs.h" >&5 +echo "configure:5810: checking for lwpxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes else @@ -5840,12 +5842,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpxstatus_t" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5844: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 +echo "configure:5846: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes else @@ -5876,12 +5878,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5880: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 +echo "configure:5882: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes else @@ -5912,12 +5914,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6 echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5916: checking for win32_pstatus_t in sys/procfs.h" >&5 +echo "configure:5918: checking for win32_pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5932: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes else @@ -6396,10 +6398,10 @@ case ${host64}-${target64}-${want64} in if test -n "$GCC" ; then bad_64bit_gcc=no; echo $ac_n "checking for gcc version with buggy 64-bit support""... $ac_c" 1>&6 -echo "configure:6400: checking for gcc version with buggy 64-bit support" >&5 +echo "configure:6402: checking for gcc version with buggy 64-bit support" >&5 # Add more tests for gcc versions with non-working 64-bit support here. cat > conftest.$ac_ext <&6 -echo "configure:6449: checking for $ac_hdr" >&5 +echo "configure:6451: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6461: \"$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* @@ -6484,12 +6486,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6488: checking for $ac_func" >&5 +echo "configure:6490: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6518: \"$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 @@ -6537,7 +6539,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6541: checking for working mmap" >&5 +echo "configure:6543: 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 @@ -6545,7 +6547,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6691: \"$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 @@ -6710,12 +6712,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6714: checking for $ac_func" >&5 +echo "configure:6716: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6744: \"$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 diff --git a/bfd/configure.in b/bfd/configure.in index b7081454d67..379b3ac5577 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -359,7 +359,9 @@ changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/tahoe.h"' ;; - vax-*-netbsd*) COREFILE=netbsd-core.lo ;; + vax-*-netbsd* | vax-*-openbsd*) + COREFILE=netbsd-core.lo + ;; vax-*-ultrix2*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxult2.h"' diff --git a/bfd/cpu-h8300.c b/bfd/cpu-h8300.c index f61e7576a8b..e1c77bfe2e6 100644 --- a/bfd/cpu-h8300.c +++ b/bfd/cpu-h8300.c @@ -82,7 +82,13 @@ h8300_scan (info, string) return (info->mach == bfd_mach_h8300sn); if (*string == 'x' || *string == 'X') - return (info->mach == bfd_mach_h8300sx); + { + string++; + if (*string == 'n' || *string == 'N') + return (info->mach == bfd_mach_h8300sxn); + + return (info->mach == bfd_mach_h8300sx); + } return (info->mach == bfd_mach_h8300s); } @@ -106,6 +112,22 @@ compatible (in, out) return in; } +static const bfd_arch_info_type h8300sxn_info_struct = +{ + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_h8300, + bfd_mach_h8300sxn, + "h8300sxn", /* arch_name */ + "h8300sxn", /* printable name */ + 1, + FALSE, /* the default machine */ + compatible, + h8300_scan, + 0 +}; + static const bfd_arch_info_type h8300sx_info_struct = { 32, /* 32 bits in a word */ @@ -119,7 +141,7 @@ static const bfd_arch_info_type h8300sx_info_struct = FALSE, /* the default machine */ compatible, h8300_scan, - 0 + &h8300sxn_info_struct }; static const bfd_arch_info_type h8300sn_info_struct = diff --git a/bfd/cpu-ns32k.c b/bfd/cpu-ns32k.c index 1fe67d9ffce..1a12b162f20 100644 --- a/bfd/cpu-ns32k.c +++ b/bfd/cpu-ns32k.c @@ -1,5 +1,5 @@ /* BFD support for the ns32k architecture. - Copyright 1990, 1991, 1994, 1995, 1998, 2000, 2001, 2002 + Copyright 1990, 1991, 1994, 1995, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Almost totally rewritten by Ian Dall from initial work by Andrew Cagney. @@ -182,7 +182,7 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, return bfd_reloc_ok; } - /* If we are not producing relocateable output, return an error if + /* If we are not producing relocatable output, return an error if the symbol is not defined. An undefined weak symbol is considered to have a value of zero (SVR4 ABI, p. 4-27). */ if (symbol->section == &bfd_und_section @@ -236,7 +236,7 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, include the position of the location; for example, m88kbcs, or ELF. For those targets, pcrel_offset is TRUE. - If we are producing relocateable output, then we must ensure + If we are producing relocatable output, then we must ensure that this reloc will be correctly computed when the final relocation is done. If pcrel_offset is FALSE we want to wind up with the negative of the location within the section, @@ -245,7 +245,7 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, we do not want to adjust the existing addend at all. FIXME: This seems logical to me, but for the case of - producing relocateable output it is not what the code + producing relocatable output it is not what the code actually does. I don't want to change it, because it seems far too likely that something will break. */ relocation -= @@ -297,7 +297,7 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, should not have any tests that depend upon the flavour. It's seem like entirely the wrong place for such a thing. The second obvious point is that the current code ignores the - reloc addend when producing relocateable output for COFF. + reloc addend when producing relocatable output for COFF. That's peculiar. In fact, I really have no idea what the point of the line you want to remove is. @@ -315,10 +315,10 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, (coff-i386 does subtract the old value, to be compatible with existing coff-i386 targets, like SCO). - So everything works fine when not producing relocateable - output. When we are producing relocateable output, logically + So everything works fine when not producing relocatable + output. When we are producing relocatable output, logically we should do exactly what we do when not producing - relocateable output. Therefore, your patch is correct. In + relocatable output. Therefore, your patch is correct. In fact, it should probably always just set reloc_entry->addend to 0 for all cases, since it is, in fact, going to add the value into the object file. This won't hurt the COFF code, @@ -326,7 +326,7 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, to other formats (the thing to check for would be whether any formats both use the addend and set partial_inplace). - When I wanted to make coff-i386 produce relocateable output, + When I wanted to make coff-i386 produce relocatable output, I ran into the problem that you are running into: I wanted to remove that line. Rather than risk it, I made the coff-i386 relocs use a special function; it's coff_i386_reloc diff --git a/bfd/doc/bfdint.texi b/bfd/doc/bfdint.texi index 27375cd4802..4566731c10e 100644 --- a/bfd/doc/bfdint.texi +++ b/bfd/doc/bfdint.texi @@ -1,6 +1,6 @@ \input texinfo @c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, -@c 2000, 2001 +@c 2000, 2001, 2002, 2003 @c Free Software Foundation, Inc. @setfilename bfdint.info @@ -835,7 +835,7 @@ corresponding field in the target vector is named @item _bfd_get_relocated_section_contents Read the contents of a section and apply the relocation information. -This handles both a final link and a relocateable link; in the latter +This handles both a final link and a relocatable link; in the latter case, it adjust the relocation information as well. This is called via @samp{bfd_get_relocated_section_contents}. Most targets implement it by calling @samp{bfd_generic_get_relocated_section_contents}. @@ -1169,7 +1169,7 @@ allocate space in a different section and use the offset within that section as the value to store. In the IEEE object file format, relocations may involve arbitrary expressions. -When doing a relocateable link, the linker may or may not have to do +When doing a relocatable link, the linker may or may not have to do anything with a relocation, depending upon the definition of the relocation. Simple relocations generally do not require any special action. @@ -1240,9 +1240,9 @@ existing target, you need to do the following: @itemize @bullet @item Make sure you clearly understand what the contents of the section should -look like after assembly, after a relocateable link, and after a final +look like after assembly, after a relocatable link, and after a final link. Make sure you clearly understand the operations the linker must -perform during a relocateable link and during a final link. +perform during a relocatable link and during a final link. @item Write a howto structure for the relocation. The howto structure is @@ -1257,7 +1257,7 @@ call @samp{bfd_install_relocation}, so your howto structure has to be able to handle that. You may need to set the @samp{special_function} field to handle assembly correctly. Be careful to ensure that any code you write to handle the assembler will also work correctly when doing a -relocateable link. For example, see @samp{bfd_elf_generic_reloc}. +relocatable link. For example, see @samp{bfd_elf_generic_reloc}. @item Test the assembler. Consider the cases of relocation against an @@ -1271,14 +1271,14 @@ If your target uses the new linker, which is recommended, add any required handling to the target specific relocation function. In simple cases this will just involve a call to @samp{_bfd_final_link_relocate} or @samp{_bfd_relocate_contents}, depending upon the definition of the -relocation and whether the link is relocateable or not. +relocation and whether the link is relocatable or not. @item Test the linker. Test the case of a final link. If the relocation can overflow, use a linker script to force an overflow and make sure the -error is reported correctly. Test a relocateable link, whether the -symbol is defined or undefined in the relocateable output. For both the -final and relocateable link, test the case when the symbol is a common +error is reported correctly. Test a relocatable link, whether the +symbol is defined or undefined in the relocatable output. For both the +final and relocatable link, test the case when the symbol is a common symbol, when the symbol looked like a common symbol but became a defined symbol, when the symbol is defined in a different object file, and when the symbol is defined in the same object file. @@ -1291,7 +1291,7 @@ thing for the relocation. You may need to set the doing a link in which the output object file format is S-records. @item -Using the linker to generate relocateable output in a different object +Using the linker to generate relocatable output in a different object file format is impossible in the general case, so you generally don't have to worry about that. The GNU linker makes sure to stop that from happening when an input file in a different format has relocations. @@ -1350,7 +1350,7 @@ howto structure. Some mechanism would be used to determine which type of howto structure was being used by a particular format. The new howto structure would clearly define the relocation behaviour in -the case of an assembly, a relocateable link, and a final link. At +the case of an assembly, a relocatable link, and a final link. At least one special function would be defined as an escape, and it might make sense to define more. @@ -1566,7 +1566,7 @@ relocations. @samp{Rela} relocations will require more space in object files (but not in executables, except when using dynamic linking). However, this is outweighed by the simplicity of addend handling when using @samp{Rela} relocations. With @samp{Rel} relocations, the addend -must be stored in the section contents, which makes relocateable links +must be stored in the section contents, which makes relocatable links more complex. For example, consider C code like @code{i = a[1000];} where @samp{a} is @@ -1578,7 +1578,7 @@ relocations, that addend must be stored in the instructions themselves. If you are adding support for a RISC chip which uses two or more instructions to load an address, then the addend may not fit in a single instruction, and will have to be somehow split among the instructions. -This makes linking awkward, particularly when doing a relocateable link +This makes linking awkward, particularly when doing a relocatable link in which the addend may have to be updated. It can be done---the MIPS ELF support does it---but it should be avoided when possible. @@ -1645,7 +1645,7 @@ information, and modify the section contents according to the relocation information. In simple cases, this is little more than a loop over the relocations which computes the value of each relocation and calls @samp{_bfd_final_link_relocate}. The function must check for a -relocateable link, and in that case normally needs to do nothing other +relocatable link, and in that case normally needs to do nothing other than adjust the addend for relocations against a section symbol. The complex cases generally have to do with dynamic linker support. GOT diff --git a/bfd/ecoff.c b/bfd/ecoff.c index 1ba7d56a6e4..ce18f54b0b1 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -81,8 +81,10 @@ static asection bfd_debug_section = "*DEBUG*", 0, 0, NULL, 0, 0, 0, /* linker_mark, linker_has_input, gc_mark, segment_mark, */ 0, 0, 0, 0, - /* sec_info_type, use_rela_p, has_tls_reloc, flag11, flag12, */ - 0, 0, 0, 0, 0, + /* sec_info_type, use_rela_p, has_tls_reloc, */ + 0, 0, 0, + /* need_finalize_relax, has_gp_reloc, */ + 0, 0, /* flag13, flag14, flag15, flag16, flag20, flag24, */ 0, 0, 0, 0, 0, 0, /* vma, lma, _cooked_size, _raw_size, */ @@ -4158,7 +4160,7 @@ _bfd_ecoff_bfd_final_link (abfd, info) ecoff_link_write_external, (PTR) &einfo); - if (info->relocateable) + if (info->relocatable) { /* We need to make a pass over the link_orders to count up the number of relocations we will need to output, so that we know @@ -4188,7 +4190,7 @@ _bfd_ecoff_bfd_final_link (abfd, info) bfd_ecoff_debug_free (handle, abfd, debug, &backend->debug_swap, info); - if (info->relocateable) + if (info->relocatable) { /* Now reset the reloc_count field of the sections in the output BFD to 0, so that we can use them to keep track of how many @@ -4208,7 +4210,7 @@ _bfd_ecoff_bfd_final_link (abfd, info) ecoff_data (abfd)->gp = (h->u.def.value + h->u.def.section->output_section->vma + h->u.def.section->output_offset); - else if (info->relocateable) + else if (info->relocatable) { bfd_vma lo; @@ -4606,11 +4608,11 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order) cooked_size)) goto error_return; - /* If we are producing relocateable output, the relocs were + /* If we are producing relocatable output, the relocs were modified, and we write them out now. We use the reloc_count field of output_section to keep track of the number of relocs we have output so far. */ - if (info->relocateable) + if (info->relocatable) { file_ptr pos = (output_section->rel_filepos + output_section->reloc_count * external_reloc_size); diff --git a/bfd/ecofflink.c b/bfd/ecofflink.c index b74f18a52df..89edae344f5 100644 --- a/bfd/ecofflink.c +++ b/bfd/ecofflink.c @@ -1,5 +1,5 @@ /* Routines to link ECOFF debugging information. - Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002 + Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, . @@ -526,7 +526,7 @@ bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info) ainfo->largest_file_shuffle = 0; - if (! info->relocateable) + if (! info->relocatable) { if (! bfd_hash_table_init (&ainfo->str_hash.table, string_hash_newfunc)) return NULL; @@ -559,7 +559,7 @@ bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info) bfd_hash_table_free (&ainfo->fdr_hash.table); - if (! info->relocateable) + if (! info->relocatable) bfd_hash_table_free (&ainfo->str_hash.table); objalloc_free (ainfo->memory); @@ -879,9 +879,9 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, /* If we are doing a final link, we hash all the strings in the local symbol table together. This reduces the amount of space required by debugging information. We don't do - this when performing a relocateable link because it would + this when performing a relocatable link because it would prevent us from easily merging different FDR's. */ - if (! info->relocateable) + if (! info->relocatable) { bfd_boolean ffilename; const char *name; @@ -958,7 +958,7 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, fdr.iauxBase = output_symhdr->iauxMax; output_symhdr->iauxMax += fdr.caux; } - if (! info->relocateable) + if (! info->relocatable) { /* When are are hashing strings, we lie about the number of @@ -1127,7 +1127,7 @@ ecoff_add_string (ainfo, info, debug, fdr, string) symhdr = &debug->symbolic_header; len = strlen (string); - if (info->relocateable) + if (info->relocatable) { if (!add_memory_shuffle (ainfo, &ainfo->ss, &ainfo->ss_end, (PTR) string, len + 1)) @@ -1287,12 +1287,12 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug, this interface, so that must be changed to do something else. */ bfd_boolean -bfd_ecoff_debug_externals (abfd, debug, swap, relocateable, get_extr, +bfd_ecoff_debug_externals (abfd, debug, swap, relocatable, get_extr, set_index) bfd *abfd; struct ecoff_debug_info *debug; const struct ecoff_debug_swap *swap; - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_boolean (*get_extr) PARAMS ((asymbol *, EXTR *)); void (*set_index) PARAMS ((asymbol *, bfd_size_type)); { @@ -1317,7 +1317,7 @@ bfd_ecoff_debug_externals (abfd, debug, swap, relocateable, get_extr, /* If we're producing an executable, move common symbols into bss. */ - if (! relocateable) + if (! relocatable) { if (esym.asym.sc == scCommon) esym.asym.sc = scBss; @@ -1694,7 +1694,7 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) /* The string table is written out from the hash table if this is a final link. */ - if (info->relocateable) + if (info->relocatable) { BFD_ASSERT (ainfo->ss_hash == (struct string_hash_entry *) NULL); if (! ecoff_write_shuffle (abfd, swap, ainfo->ss, space)) diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 1da605502b5..5e4c1807c7c 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -706,7 +706,7 @@ struct elf_backend_data This function is responsible for adjust the section contents as necessary, and (if using Rela relocs and generating a - relocateable output file) adjusting the reloc addend as + relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -720,7 +720,7 @@ struct elf_backend_data The global hash table entry for the global symbols can be found via elf_sym_hashes (input_bfd). - When generating relocateable output, this function must handle + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted @@ -1254,6 +1254,9 @@ struct elf_obj_tdata /* Number of symbol version references we are about to emit. */ unsigned int cverrefs; + /* Segment flags for the PT_GNU_STACK segment. */ + unsigned int stack_flags; + /* Symbol version definitions in external objects. */ Elf_Internal_Verdef *verdef; diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index 7d0b52bc40f..e422aa96a55 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -403,7 +403,7 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, in which case we can remove it provided we adjust all FDEs. Also, it can be removed if we have removed all FDEs using it. */ - if ((!info->relocateable + if ((!info->relocatable && cie_compare (&cie, &hdr_info->last_cie) == 0) || cie_usage_count == 0) { diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index 5e4458c1170..f3727466015 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -1,5 +1,5 @@ /* Common code for PA ELF implementations. - 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. @@ -1159,7 +1159,7 @@ elf_hppa_unmark_useless_dynamic_symbols (h, data) Ultimately we should have better controls over the generic ELF BFD linker code. */ - if (! info->relocateable + if (! info->relocatable && ! (info->shared && !info->no_undefined) && h->root.type == bfd_link_hash_undefined @@ -1195,7 +1195,7 @@ elf_hppa_remark_useless_dynamic_symbols (h, data) Ultimately we should have better controls over the generic ELF BFD linker code. */ - if (! info->relocateable + if (! info->relocatable && ! (info->shared && !info->no_undefined) && h->root.type == bfd_link_hash_undefined @@ -1265,7 +1265,7 @@ elf_hppa_final_link (abfd, info) bfd_boolean retval; struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info); - if (! info->relocateable) + if (! info->relocatable) { struct elf_link_hash_entry *gp; bfd_vma gp_val; @@ -1376,7 +1376,7 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *relend; struct elf64_hppa_link_hash_table *hppa_info; - if (info->relocateable) + if (info->relocatable) return TRUE; hppa_info = elf64_hppa_hash_table (info); diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c index c35adcba81c..09d7d993ba1 100644 --- a/bfd/elf-m10200.c +++ b/bfd/elf-m10200.c @@ -343,7 +343,7 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section, struct elf_link_hash_entry **sym_hashes; Elf_Internal_Rela *rel, *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -512,10 +512,10 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) /* Assume nothing changes. */ *again = FALSE; - /* We don't have to do anything for a relocateable link, if + /* We don't have to do anything for a relocatable link, if this section does not have relocs, or if this is not a code section. */ - if (link_info->relocateable + if (link_info->relocatable || (sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0 || (sec->flags & SEC_CODE) == 0) @@ -1305,12 +1305,12 @@ mn10200_elf_symbol_address_p (abfd, sec, isym, addr) static bfd_byte * mn10200_elf_get_relocated_section_contents (output_bfd, link_info, link_order, - data, relocateable, symbols) + data, relocatable, symbols) bfd *output_bfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - bfd_boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { Elf_Internal_Shdr *symtab_hdr; @@ -1322,11 +1322,11 @@ mn10200_elf_get_relocated_section_contents (output_bfd, link_info, link_order, /* We only need to handle the case of relaxing, or of having a particular set of section contents, specially. */ - if (relocateable + if (relocatable || elf_section_data (input_section)->this_hdr.contents == NULL) return bfd_generic_get_relocated_section_contents (output_bfd, link_info, link_order, data, - relocateable, + relocatable, symbols); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index cad2b9c7b8c..15d1a336ff9 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -350,7 +350,7 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -550,7 +550,7 @@ mn10300_elf_relocate_section (output_bfd, info, input_bfd, input_section, struct elf32_mn10300_link_hash_entry **sym_hashes; Elf_Internal_Rela *rel, *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -1334,10 +1334,10 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* For error_return. */ section = sec; - /* We don't have to do anything for a relocateable link, if + /* We don't have to do anything for a relocatable link, if this section does not have relocs, or if this is not a code section. */ - if (link_info->relocateable + if (link_info->relocatable || (sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0 || (sec->flags & SEC_CODE) == 0) @@ -2541,12 +2541,12 @@ mn10300_elf_symbol_address_p (abfd, sec, isym, addr) static bfd_byte * mn10300_elf_get_relocated_section_contents (output_bfd, link_info, link_order, - data, relocateable, symbols) + data, relocatable, symbols) bfd *output_bfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - bfd_boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { Elf_Internal_Shdr *symtab_hdr; @@ -2558,11 +2558,11 @@ mn10300_elf_get_relocated_section_contents (output_bfd, link_info, link_order, /* We only need to handle the case of relaxing, or of having a particular set of section contents, specially. */ - if (relocateable + if (relocatable || elf_section_data (input_section)->this_hdr.contents == NULL) return bfd_generic_get_relocated_section_contents (output_bfd, link_info, link_order, data, - relocateable, + relocatable, symbols); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; diff --git a/bfd/elf.c b/bfd/elf.c index 66383e7c0d4..470f3c2f76e 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -936,7 +936,7 @@ const char *const bfd_elf_section_type_names[] = { "SHT_NOBITS", "SHT_REL", "SHT_SHLIB", "SHT_DYNSYM", }; -/* ELF relocs are against symbols. If we are producing relocateable +/* ELF relocs are against symbols. If we are producing relocatable output, and the reloc is against an external symbol, and nothing has given us any additional addend, the resulting reloc will also be against the same symbol. In such a case, we don't want to @@ -944,7 +944,7 @@ const char *const bfd_elf_section_type_names[] = { all be done at final link time. Rather than put special case code into bfd_perform_relocation, all the reloc types use this howto function. It just short circuits the reloc if producing - relocateable output against an external symbol. */ + relocatable output against an external symbol. */ bfd_reloc_status_type bfd_elf_generic_reloc (abfd, @@ -1070,6 +1070,7 @@ _bfd_elf_print_private_bfd_data (abfd, farg) case PT_PHDR: pt = "PHDR"; break; case PT_TLS: pt = "TLS"; break; case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break; + case PT_GNU_STACK: pt = "STACK"; break; default: sprintf (buf, "0x%lx", p->p_type); pt = buf; break; } fprintf (f, "%8s off 0x", pt); @@ -1837,7 +1838,7 @@ bfd_section_from_shdr (abfd, shindex) SHF_ALLOC is set, and this is a shared object, then we also treat this section as a BFD section. We can not base the decision purely on SHF_ALLOC, because that flag is sometimes - set in a relocateable object file, which would confuse the + set in a relocatable object file, which would confuse the linker. */ if ((hdr->sh_flags & SHF_ALLOC) != 0 && (abfd->flags & DYNAMIC) != 0 @@ -2296,6 +2297,9 @@ bfd_section_from_phdr (abfd, hdr, index) return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "eh_frame_hdr"); + case PT_GNU_STACK: + return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "stack"); + default: /* Check for any processor-specific program segment types. If no handler for them, default to making "segment" sections. */ @@ -3513,6 +3517,21 @@ map_sections_to_segments (abfd) pm = &m->next; } + if (elf_tdata (abfd)->stack_flags) + { + amt = sizeof (struct elf_segment_map); + m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_GNU_STACK; + m->p_flags = elf_tdata (abfd)->stack_flags; + m->p_flags_valid = 1; + + *pm = m; + pm = &m->next; + } + free (sections); sections = NULL; @@ -4099,6 +4118,12 @@ get_program_header_size (abfd) ++segs; } + if (elf_tdata (abfd)->stack_flags) + { + /* We need a PT_GNU_STACK segment. */ + ++segs; + } + for (s = abfd->sections; s != NULL; s = s->next) { if ((s->flags & SEC_LOAD) != 0 @@ -7015,18 +7040,30 @@ elfcore_grok_nto_status (abfd, note, tid) char buf[100]; char *name; asection *sect; + short sig; + unsigned flags; /* 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 'tid' field is at offset 4. Pass it back. */ + *tid = bfd_get_32 (abfd, (bfd_byte *) ddata + 4); + + /* nto_procfs_status 'flags' field is at offset 8. */ + flags = bfd_get_32 (abfd, (bfd_byte *) ddata + 8); /* nto_procfs_status 'what' field is at offset 14. */ - elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, (bfd_byte *) ddata + 14); + if ((sig = bfd_get_16 (abfd, (bfd_byte *) ddata + 14)) > 0) + { + elf_tdata (abfd)->core_signal = sig; + elf_tdata (abfd)->core_lwpid = *tid; + } - /* Pass tid back. */ - *tid = elf_tdata (abfd)->core_lwpid; + /* _DEBUG_FLAG_CURTID (current thread) is 0x80. Some cores + do not come from signals so we make sure we set the current + thread just in case. */ + if (flags & 0x00000080) + elf_tdata (abfd)->core_lwpid = *tid; /* Make a ".qnx_core_status/%d" section. */ sprintf (buf, ".qnx_core_status/%d", *tid); @@ -7075,7 +7112,11 @@ elfcore_grok_nto_gregs (abfd, note, tid) sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; - return elfcore_maybe_make_sect (abfd, ".reg", sect); + /* This is the current thread. */ + if (elf_tdata (abfd)->core_lwpid == tid) + return elfcore_maybe_make_sect (abfd, ".reg", sect); + + return TRUE; } #define BFD_QNT_CORE_INFO 7 diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index ba286b1237d..e2d66adb8ca 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -564,7 +564,7 @@ bfd_elf32_arm_add_glue_sections_to_bfd (abfd, info) /* If we are only performing a partial link do not bother adding the glue. */ - if (info->relocateable) + if (info->relocatable) return TRUE; sec = bfd_get_section_by_name (abfd, ARM2THUMB_GLUE_SECTION_NAME); @@ -620,7 +620,7 @@ bfd_elf32_arm_get_bfd_for_interworking (abfd, info) /* If we are only performing a partial link do not bother getting a bfd to hold the glue. */ - if (info->relocateable) + if (info->relocatable) return TRUE; globals = elf32_arm_hash_table (info); @@ -652,7 +652,7 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) /* If we are only performing a partial link do not bother to construct any glue. */ - if (link_info->relocateable) + if (link_info->relocatable) return TRUE; /* Here we have a bfd that is to be included on the link. We have a hook @@ -1838,7 +1838,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, const char *name; #if !USE_REL - if (info->relocateable) + if (info->relocatable) return TRUE; #endif @@ -1870,9 +1870,9 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, howto = bfd_reloc.howto; #if USE_REL - if (info->relocateable) + if (info->relocatable) { - /* This is a relocateable link. We don't have to change + /* This is a relocatable link. We don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ @@ -2630,7 +2630,7 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) asection *sgot, *srelgot, *sreloc; bfd_vma *local_got_offsets; - if (info->relocateable) + if (info->relocatable) return TRUE; sgot = srelgot = sreloc = NULL; diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c index a701dc9d00e..defa9ce4534 100644 --- a/bfd/elf32-avr.c +++ b/bfd/elf32-avr.c @@ -1,5 +1,5 @@ /* AVR-specific support for 32-bit ELF - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Denis Chertykov This file is part of BFD, the Binary File Descriptor library. @@ -455,7 +455,7 @@ elf32_avr_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -719,7 +719,7 @@ elf32_avr_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela * rel; Elf_Internal_Rela * relend; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 40327b650e4..4618a8f2830 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -799,7 +799,7 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; dynobj = elf_hash_table (info)->dynobj; @@ -1129,8 +1129,15 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; case R_CRIS_32_GOTREL: - /* This relocation must only be performed against local symbols. */ - if (h != NULL && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + /* This relocation must only be performed against local symbols. + It's also ok when we link a program and the symbol is either + defined in an ordinary (non-DSO) object or is undefined weak. */ + if (h != NULL + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + && !(!info->shared + && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + || ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 + && h->root.type == bfd_link_hash_undefweak)))) { (*_bfd_error_handler) (_("%s: relocation %s is not allowed for global symbol: `%s' from %s section"), @@ -2267,7 +2274,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs) asection *srelgot; asection *sreloc; - if (info->relocateable) + if (info->relocatable) return TRUE; dynobj = elf_hash_table (info)->dynobj; diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c index 1d6912a0f4c..cc5eddce7fd 100644 --- a/bfd/elf32-d10v.c +++ b/bfd/elf32-d10v.c @@ -1,5 +1,6 @@ /* D10V-specific support for 32-bit ELF - Copyright 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -303,7 +304,7 @@ elf32_d10v_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -388,9 +389,9 @@ elf32_d10v_relocate_section (output_bfd, info, input_bfd, input_section, howto = elf_d10v_howto_table + r_type; - if (info->relocateable) + if (info->relocatable) { - /* This is a relocateable link. We don't have to change + /* This is a relocatable link. We don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ diff --git a/bfd/elf32-dlx.c b/bfd/elf32-dlx.c index a1f7d0d48f1..1f380e88eaa 100644 --- a/bfd/elf32-dlx.c +++ b/bfd/elf32-dlx.c @@ -1,5 +1,5 @@ /* DLX specific support for 32-bit ELF - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -320,7 +320,7 @@ _bfd_dlx_elf_hi16_reloc (abfd, reloc_entry, symbol, data, return ret; } -/* ELF relocs are against symbols. If we are producing relocateable +/* ELF relocs are against symbols. If we are producing relocatable output, and the reloc is against an external symbol, and nothing has given us any additional addend, the resulting reloc will also be against the same symbol. In such a case, we don't want to @@ -328,7 +328,7 @@ _bfd_dlx_elf_hi16_reloc (abfd, reloc_entry, symbol, data, all be done at final link time. Rather than put special case code into bfd_perform_relocation, all the reloc types use this howto function. It just short circuits the reloc if producing - relocateable output against an external symbol. */ + relocatable output against an external symbol. */ static bfd_reloc_status_type elf32_dlx_relocate16 (abfd, reloc_entry, symbol, data, @@ -532,7 +532,7 @@ elf32_dlx_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c index 2311316498e..c4e22908969 100644 --- a/bfd/elf32-fr30.c +++ b/bfd/elf32-fr30.c @@ -1,5 +1,6 @@ /* FR30-specific support for 32-bit ELF. - 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. @@ -478,7 +479,7 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, zero. This function is responsible for adjusting the section contents as - necessary, and (if using Rela relocs and generating a relocateable + necessary, and (if using Rela relocs and generating a relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -492,7 +493,7 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, The global hash table entry for the global symbols can be found via elf_sym_hashes (input_bfd). - When generating relocateable output, this function must handle + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted @@ -515,7 +516,7 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; @@ -726,7 +727,7 @@ fr30_elf_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c index 08dae266d61..19fb324576c 100644 --- a/bfd/elf32-frv.c +++ b/bfd/elf32-frv.c @@ -1,5 +1,5 @@ /* FRV-specific support for 32-bit ELF. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -651,7 +651,7 @@ frv_final_link_relocate (howto, input_bfd, input_section, contents, rel, zero. This function is responsible for adjusting the section contents as - necessary, and (if using Rela relocs and generating a relocateable + necessary, and (if using Rela relocs and generating a relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -665,7 +665,7 @@ frv_final_link_relocate (howto, input_bfd, input_section, contents, rel, The global hash table entry for the global symbols can be found via elf_sym_hashes (input_bfd). - When generating relocateable output, this function must handle + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted @@ -688,7 +688,7 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; @@ -907,7 +907,7 @@ elf32_frv_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd_vma *valp; { if (sym->st_shndx == SHN_COMMON - && !info->relocateable + && !info->relocatable && (int)sym->st_size <= (int)bfd_get_gp_size (abfd)) { /* Common symbols less than or equal to -G nn bytes are @@ -947,7 +947,7 @@ elf32_frv_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c index f272dc8e084..1b623f27f21 100644 --- a/bfd/elf32-h8300.c +++ b/bfd/elf32-h8300.c @@ -426,7 +426,7 @@ elf32_h8_relocate_section (output_bfd, info, input_bfd, input_section, struct elf_link_hash_entry **sym_hashes; Elf_Internal_Rela *rel, *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -582,6 +582,9 @@ elf32_h8_mach (flags) case E_H8_MACH_H8300SX: return bfd_mach_h8300sx; + + case E_H8_MACH_H8300SXN: + return bfd_mach_h8300sxn; } } @@ -622,6 +625,10 @@ elf32_h8_final_write_processing (abfd, linker) case bfd_mach_h8300sx: val = E_H8_MACH_H8300SX; break; + + case bfd_mach_h8300sxn: + val = E_H8_MACH_H8300SXN; + break; } elf_elfheader (abfd)->e_flags &= ~ (EF_H8_MACH); @@ -699,10 +706,10 @@ elf32_h8_relax_section (abfd, sec, link_info, again) /* Assume nothing changes. */ *again = FALSE; - /* We don't have to do anything for a relocateable link, if + /* We don't have to do anything for a relocatable link, if this section does not have relocs, or if this is not a code section. */ - if (link_info->relocateable + if (link_info->relocatable || (sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0 || (sec->flags & SEC_CODE) == 0) @@ -1371,12 +1378,12 @@ elf32_h8_symbol_address_p (abfd, sec, addr) static bfd_byte * elf32_h8_get_relocated_section_contents (output_bfd, link_info, link_order, - data, relocateable, symbols) + data, relocatable, symbols) bfd *output_bfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - bfd_boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { Elf_Internal_Shdr *symtab_hdr; @@ -1388,11 +1395,11 @@ elf32_h8_get_relocated_section_contents (output_bfd, link_info, link_order, /* We only need to handle the case of relaxing, or of having a particular set of section contents, specially. */ - if (relocateable + if (relocatable || elf_section_data (input_section)->this_hdr.contents == NULL) return bfd_generic_get_relocated_section_contents (output_bfd, link_info, link_order, data, - relocateable, + relocatable, symbols); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index becfb73c873..ca3e8e12c91 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -1214,7 +1214,7 @@ elf32_hppa_check_relocs (abfd, info, sec, relocs) asection *sreloc; asection *stubreloc; - if (info->relocateable) + if (info->relocatable) return TRUE; htab = hppa_link_hash_table (info); @@ -3593,7 +3593,7 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -3666,16 +3666,11 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->elf.root.type == bfd_link_hash_undefweak) ; - else if (info->shared && !info->no_undefined + else if (info->shared + && !info->no_undefined && ELF_ST_VISIBILITY (h->elf.other) == STV_DEFAULT && h->elf.type != STT_PARISC_MILLI) - { - 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 { if (!((*info->callbacks->undefined_symbol) diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index 8b74baa93c4..2eacb81035a 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -1,5 +1,5 @@ /* i370-specific support for 32-bit ELF - Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002 + Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. Hacked by Linas Vepstas for i370 linas@linas.org @@ -971,7 +971,7 @@ i370_elf_check_relocs (abfd, info, sec, relocs) bfd_vma *local_got_offsets; asection *sreloc; - if (info->relocateable) + if (info->relocatable) return TRUE; #ifdef DEBUG @@ -1200,7 +1200,7 @@ i370_elf_finish_dynamic_sections (output_bfd, info) This function is responsible for adjust the section contents as necessary, and (if using Rela relocs and generating a - relocateable output file) adjusting the reloc addend as + relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -1214,7 +1214,7 @@ i370_elf_finish_dynamic_sections (output_bfd, info) The global hash table entry for the global symbols can be found via elf_sym_hashes (input_bfd). - When generating relocateable output, this function must handle + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted @@ -1241,7 +1241,7 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma *local_got_offsets; bfd_boolean ret = TRUE; - if (info->relocateable) + if (info->relocatable) return TRUE; #ifdef DEBUG @@ -1249,7 +1249,7 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_archive_filename (input_bfd), bfd_section_name(input_bfd, input_section), (long) input_section->reloc_count, - (info->relocateable) ? " (relocatable)" : ""); + (info->relocatable) ? " (relocatable)" : ""); #endif if (!i370_elf_howto_table[ R_I370_ADDR31 ]) /* Initialize howto table if needed */ diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index cfcb7b34c19..3c7bbd991da 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -24,69 +24,8 @@ #include "libbfd.h" #include "elf-bfd.h" -static reloc_howto_type *elf_i386_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); -static void elf_i386_info_to_howto_rel - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); -static bfd_boolean elf_i386_is_local_label_name - PARAMS ((bfd *, const char *)); -static bfd_boolean elf_i386_grok_prstatus - PARAMS ((bfd *abfd, Elf_Internal_Note *note)); -static bfd_boolean elf_i386_grok_psinfo - PARAMS ((bfd *abfd, Elf_Internal_Note *note)); -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 *elf_i386_link_hash_table_create - PARAMS ((bfd *)); -static bfd_boolean create_got_section - PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean elf_i386_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static void elf_i386_copy_indirect_symbol - PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, - struct elf_link_hash_entry *)); -static int elf_i386_tls_transition - PARAMS ((struct bfd_link_info *, int, int)); - -static bfd_boolean elf_i386_mkobject - PARAMS ((bfd *)); -static bfd_boolean elf_i386_object_p - PARAMS ((bfd *)); -static bfd_boolean elf_i386_check_relocs - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); -static asection *elf_i386_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static bfd_boolean elf_i386_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); -static bfd_boolean elf_i386_adjust_dynamic_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static bfd_boolean allocate_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static bfd_boolean readonly_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static bfd_boolean elf_i386_fake_sections - PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); -static bfd_boolean elf_i386_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_vma dtpoff_base - PARAMS ((struct bfd_link_info *)); -static bfd_vma tpoff - PARAMS ((struct bfd_link_info *, bfd_vma)); -static bfd_boolean elf_i386_relocate_section - PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static bfd_boolean elf_i386_finish_dynamic_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - Elf_Internal_Sym *)); -static enum elf_reloc_type_class elf_i386_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); -static bfd_boolean elf_i386_finish_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); - -#define USE_REL 1 /* 386 uses REL relocations instead of RELA. */ +/* 386 uses REL relocations instead of RELA. */ +#define USE_REL 1 #include "elf/i386.h" @@ -130,8 +69,8 @@ static reloc_howto_type elf_howto_table[]= R_386_standard counts the number up to this point, and R_386_ext_offset is the value to subtract from a reloc type of R_386_16 thru R_386_PC8 to form an index into this table. */ -#define R_386_standard ((unsigned int) R_386_GOTPC + 1) -#define R_386_ext_offset ((unsigned int) R_386_TLS_TPOFF - R_386_standard) +#define R_386_standard (R_386_GOTPC + 1) +#define R_386_ext_offset (R_386_TLS_TPOFF - R_386_standard) /* These relocs are a GNU extension. */ HOWTO(R_386_TLS_TPOFF, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, @@ -165,8 +104,8 @@ static reloc_howto_type elf_howto_table[]= bfd_elf_generic_reloc, "R_386_PC8", TRUE, 0xff, 0xff, TRUE), -#define R_386_ext ((unsigned int) R_386_PC8 + 1 - R_386_ext_offset) -#define R_386_tls_offset ((unsigned int) R_386_TLS_LDO_32 - R_386_ext) +#define R_386_ext (R_386_PC8 + 1 - R_386_ext_offset) +#define R_386_tls_offset (R_386_TLS_LDO_32 - R_386_ext) /* These are common with Solaris TLS implementation. */ HOWTO(R_386_TLS_LDO_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_TLS_LDO_32", @@ -188,8 +127,8 @@ static reloc_howto_type elf_howto_table[]= TRUE, 0xffffffff, 0xffffffff, FALSE), /* Another gap. */ -#define R_386_tls ((unsigned int) R_386_TLS_TPOFF32 + 1 - R_386_tls_offset) -#define R_386_vt_offset ((unsigned int) R_386_GNU_VTINHERIT - R_386_tls) +#define R_386_tls (R_386_TLS_TPOFF32 + 1 - R_386_tls_offset) +#define R_386_vt_offset (R_386_GNU_VTINHERIT - R_386_tls) /* GNU extension to record C++ vtable hierarchy. */ HOWTO (R_386_GNU_VTINHERIT, /* type */ @@ -221,146 +160,144 @@ static reloc_howto_type elf_howto_table[]= 0, /* dst_mask */ FALSE) /* pcrel_offset */ -#define R_386_vt ((unsigned int) R_386_GNU_VTENTRY + 1 - R_386_vt_offset) +#define R_386_vt (R_386_GNU_VTENTRY + 1 - R_386_vt_offset) }; #ifdef DEBUG_GEN_RELOC -#define TRACE(str) fprintf (stderr, "i386 bfd reloc lookup %d (%s)\n", code, str) +#define TRACE(str) \ + fprintf (stderr, "i386 bfd reloc lookup %d (%s)\n", code, str) #else #define TRACE(str) #endif static reloc_howto_type * -elf_i386_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; +elf_i386_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { switch (code) { case BFD_RELOC_NONE: TRACE ("BFD_RELOC_NONE"); - return &elf_howto_table[(unsigned int) R_386_NONE ]; + return &elf_howto_table[R_386_NONE]; case BFD_RELOC_32: TRACE ("BFD_RELOC_32"); - return &elf_howto_table[(unsigned int) R_386_32 ]; + return &elf_howto_table[R_386_32]; case BFD_RELOC_CTOR: TRACE ("BFD_RELOC_CTOR"); - return &elf_howto_table[(unsigned int) R_386_32 ]; + return &elf_howto_table[R_386_32]; case BFD_RELOC_32_PCREL: TRACE ("BFD_RELOC_PC32"); - return &elf_howto_table[(unsigned int) R_386_PC32 ]; + return &elf_howto_table[R_386_PC32]; case BFD_RELOC_386_GOT32: TRACE ("BFD_RELOC_386_GOT32"); - return &elf_howto_table[(unsigned int) R_386_GOT32 ]; + return &elf_howto_table[R_386_GOT32]; case BFD_RELOC_386_PLT32: TRACE ("BFD_RELOC_386_PLT32"); - return &elf_howto_table[(unsigned int) R_386_PLT32 ]; + return &elf_howto_table[R_386_PLT32]; case BFD_RELOC_386_COPY: TRACE ("BFD_RELOC_386_COPY"); - return &elf_howto_table[(unsigned int) R_386_COPY ]; + return &elf_howto_table[R_386_COPY]; case BFD_RELOC_386_GLOB_DAT: TRACE ("BFD_RELOC_386_GLOB_DAT"); - return &elf_howto_table[(unsigned int) R_386_GLOB_DAT ]; + return &elf_howto_table[R_386_GLOB_DAT]; case BFD_RELOC_386_JUMP_SLOT: TRACE ("BFD_RELOC_386_JUMP_SLOT"); - return &elf_howto_table[(unsigned int) R_386_JUMP_SLOT ]; + return &elf_howto_table[R_386_JUMP_SLOT]; case BFD_RELOC_386_RELATIVE: TRACE ("BFD_RELOC_386_RELATIVE"); - return &elf_howto_table[(unsigned int) R_386_RELATIVE ]; + return &elf_howto_table[R_386_RELATIVE]; case BFD_RELOC_386_GOTOFF: TRACE ("BFD_RELOC_386_GOTOFF"); - return &elf_howto_table[(unsigned int) R_386_GOTOFF ]; + return &elf_howto_table[R_386_GOTOFF]; case BFD_RELOC_386_GOTPC: TRACE ("BFD_RELOC_386_GOTPC"); - return &elf_howto_table[(unsigned int) R_386_GOTPC ]; + return &elf_howto_table[R_386_GOTPC]; /* These relocs are a GNU extension. */ case BFD_RELOC_386_TLS_TPOFF: TRACE ("BFD_RELOC_386_TLS_TPOFF"); - return &elf_howto_table[(unsigned int) R_386_TLS_TPOFF - R_386_ext_offset]; + return &elf_howto_table[R_386_TLS_TPOFF - R_386_ext_offset]; case BFD_RELOC_386_TLS_IE: TRACE ("BFD_RELOC_386_TLS_IE"); - return &elf_howto_table[(unsigned int) R_386_TLS_IE - R_386_ext_offset]; + return &elf_howto_table[R_386_TLS_IE - R_386_ext_offset]; case BFD_RELOC_386_TLS_GOTIE: TRACE ("BFD_RELOC_386_TLS_GOTIE"); - return &elf_howto_table[(unsigned int) R_386_TLS_GOTIE - R_386_ext_offset]; + return &elf_howto_table[R_386_TLS_GOTIE - R_386_ext_offset]; case BFD_RELOC_386_TLS_LE: TRACE ("BFD_RELOC_386_TLS_LE"); - return &elf_howto_table[(unsigned int) R_386_TLS_LE - R_386_ext_offset]; + return &elf_howto_table[R_386_TLS_LE - R_386_ext_offset]; case BFD_RELOC_386_TLS_GD: TRACE ("BFD_RELOC_386_TLS_GD"); - return &elf_howto_table[(unsigned int) R_386_TLS_GD - R_386_ext_offset]; + return &elf_howto_table[R_386_TLS_GD - R_386_ext_offset]; case BFD_RELOC_386_TLS_LDM: TRACE ("BFD_RELOC_386_TLS_LDM"); - return &elf_howto_table[(unsigned int) R_386_TLS_LDM - R_386_ext_offset]; + return &elf_howto_table[R_386_TLS_LDM - R_386_ext_offset]; case BFD_RELOC_16: TRACE ("BFD_RELOC_16"); - return &elf_howto_table[(unsigned int) R_386_16 - R_386_ext_offset]; + return &elf_howto_table[R_386_16 - R_386_ext_offset]; case BFD_RELOC_16_PCREL: TRACE ("BFD_RELOC_16_PCREL"); - return &elf_howto_table[(unsigned int) R_386_PC16 - R_386_ext_offset]; + return &elf_howto_table[R_386_PC16 - R_386_ext_offset]; case BFD_RELOC_8: TRACE ("BFD_RELOC_8"); - return &elf_howto_table[(unsigned int) R_386_8 - R_386_ext_offset]; + return &elf_howto_table[R_386_8 - R_386_ext_offset]; case BFD_RELOC_8_PCREL: TRACE ("BFD_RELOC_8_PCREL"); - return &elf_howto_table[(unsigned int) R_386_PC8 - R_386_ext_offset]; + return &elf_howto_table[R_386_PC8 - R_386_ext_offset]; /* Common with Sun TLS implementation. */ case BFD_RELOC_386_TLS_LDO_32: TRACE ("BFD_RELOC_386_TLS_LDO_32"); - return &elf_howto_table[(unsigned int) R_386_TLS_LDO_32 - R_386_tls_offset]; + return &elf_howto_table[R_386_TLS_LDO_32 - R_386_tls_offset]; case BFD_RELOC_386_TLS_IE_32: TRACE ("BFD_RELOC_386_TLS_IE_32"); - return &elf_howto_table[(unsigned int) R_386_TLS_IE_32 - R_386_tls_offset]; + return &elf_howto_table[R_386_TLS_IE_32 - R_386_tls_offset]; case BFD_RELOC_386_TLS_LE_32: TRACE ("BFD_RELOC_386_TLS_LE_32"); - return &elf_howto_table[(unsigned int) R_386_TLS_LE_32 - R_386_tls_offset]; + return &elf_howto_table[R_386_TLS_LE_32 - R_386_tls_offset]; case BFD_RELOC_386_TLS_DTPMOD32: TRACE ("BFD_RELOC_386_TLS_DTPMOD32"); - return &elf_howto_table[(unsigned int) R_386_TLS_DTPMOD32 - R_386_tls_offset]; + return &elf_howto_table[R_386_TLS_DTPMOD32 - R_386_tls_offset]; case BFD_RELOC_386_TLS_DTPOFF32: TRACE ("BFD_RELOC_386_TLS_DTPOFF32"); - return &elf_howto_table[(unsigned int) R_386_TLS_DTPOFF32 - R_386_tls_offset]; + return &elf_howto_table[R_386_TLS_DTPOFF32 - R_386_tls_offset]; case BFD_RELOC_386_TLS_TPOFF32: TRACE ("BFD_RELOC_386_TLS_TPOFF32"); - return &elf_howto_table[(unsigned int) R_386_TLS_TPOFF32 - R_386_tls_offset]; + return &elf_howto_table[R_386_TLS_TPOFF32 - R_386_tls_offset]; case BFD_RELOC_VTABLE_INHERIT: TRACE ("BFD_RELOC_VTABLE_INHERIT"); - return &elf_howto_table[(unsigned int) R_386_GNU_VTINHERIT - - R_386_vt_offset]; + return &elf_howto_table[R_386_GNU_VTINHERIT - R_386_vt_offset]; case BFD_RELOC_VTABLE_ENTRY: TRACE ("BFD_RELOC_VTABLE_ENTRY"); - return &elf_howto_table[(unsigned int) R_386_GNU_VTENTRY - - R_386_vt_offset]; + return &elf_howto_table[R_386_GNU_VTENTRY - R_386_vt_offset]; default: break; @@ -371,10 +308,9 @@ elf_i386_reloc_type_lookup (abfd, code) } static void -elf_i386_info_to_howto_rel (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr; - Elf_Internal_Rela *dst; +elf_i386_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, + arelent *cache_ptr, + Elf_Internal_Rela *dst) { unsigned int r_type = ELF32_R_TYPE (dst->r_info); unsigned int indx; @@ -389,7 +325,7 @@ elf_i386_info_to_howto_rel (abfd, cache_ptr, dst) { (*_bfd_error_handler) (_("%s: invalid relocation type %d"), bfd_archive_filename (abfd), (int) r_type); - indx = (unsigned int) R_386_NONE; + indx = R_386_NONE; } cache_ptr->howto = &elf_howto_table[indx]; } @@ -401,9 +337,7 @@ elf_i386_info_to_howto_rel (abfd, cache_ptr, dst) _bfd_elf_is_local_label_name. */ static bfd_boolean -elf_i386_is_local_label_name (abfd, name) - bfd *abfd; - const char *name; +elf_i386_is_local_label_name (bfd *abfd, const char *name) { if (name[0] == '.' && name[1] == 'X') return TRUE; @@ -413,9 +347,7 @@ elf_i386_is_local_label_name (abfd, name) /* Support for core dump NOTE sections. */ static bfd_boolean -elf_i386_grok_prstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +elf_i386_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) { int offset; size_t raw_size; @@ -445,9 +377,7 @@ elf_i386_grok_prstatus (abfd, note) } static bfd_boolean -elf_i386_grok_psinfo (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +elf_i386_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) { switch (note->descsz) { @@ -456,9 +386,9 @@ elf_i386_grok_psinfo (abfd, note) case 124: /* Linux/i386 elf_prpsinfo */ elf_tdata (abfd)->core_program - = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16); + = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16); elf_tdata (abfd)->core_command - = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80); + = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80); } /* Note that for some reason, a spurious space is tacked @@ -607,8 +537,7 @@ struct elf_i386_obj_tdata (elf_i386_tdata (abfd)->local_got_tls_type) static bfd_boolean -elf_i386_mkobject (abfd) - bfd *abfd; +elf_i386_mkobject (bfd *abfd) { bfd_size_type amt = sizeof (struct elf_i386_obj_tdata); abfd->tdata.any = bfd_zalloc (abfd, amt); @@ -618,8 +547,7 @@ elf_i386_mkobject (abfd) } static bfd_boolean -elf_i386_object_p (abfd) - bfd *abfd; +elf_i386_object_p (bfd *abfd) { /* Allocate our special target data. */ struct elf_i386_obj_tdata *new_tdata; @@ -664,10 +592,9 @@ struct elf_i386_link_hash_table /* Create an entry in an i386 ELF linker hash table. */ static struct bfd_hash_entry * -link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -696,13 +623,12 @@ link_hash_newfunc (entry, table, string) /* Create an i386 ELF linker hash table. */ static struct bfd_link_hash_table * -elf_i386_link_hash_table_create (abfd) - bfd *abfd; +elf_i386_link_hash_table_create (bfd *abfd) { struct elf_i386_link_hash_table *ret; bfd_size_type amt = sizeof (struct elf_i386_link_hash_table); - ret = (struct elf_i386_link_hash_table *) bfd_malloc (amt); + ret = bfd_malloc (amt); if (ret == NULL) return NULL; @@ -729,9 +655,7 @@ elf_i386_link_hash_table_create (abfd) shortcuts to them in our hash table. */ static bfd_boolean -create_got_section (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; +create_got_section (bfd *dynobj, struct bfd_link_info *info) { struct elf_i386_link_hash_table *htab; @@ -760,9 +684,7 @@ create_got_section (dynobj, info) hash table. */ static bfd_boolean -elf_i386_create_dynamic_sections (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; +elf_i386_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) { struct elf_i386_link_hash_table *htab; @@ -789,9 +711,9 @@ elf_i386_create_dynamic_sections (dynobj, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf_i386_copy_indirect_symbol (bed, dir, ind) - struct elf_backend_data *bed; - struct elf_link_hash_entry *dir, *ind; +elf_i386_copy_indirect_symbol (struct elf_backend_data *bed, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) { struct elf_i386_link_hash_entry *edir, *eind; @@ -854,10 +776,7 @@ elf_i386_copy_indirect_symbol (bed, dir, ind) } static int -elf_i386_tls_transition (info, r_type, is_local) - struct bfd_link_info *info; - int r_type; - int is_local; +elf_i386_tls_transition (struct bfd_link_info *info, int r_type, int is_local) { if (info->shared) return r_type; @@ -886,11 +805,10 @@ elf_i386_tls_transition (info, r_type, is_local) table, and dynamic reloc sections. */ static bfd_boolean -elf_i386_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +elf_i386_check_relocs (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { struct elf_i386_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -899,7 +817,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel_end; asection *sreloc; - if (info->relocateable) + if (info->relocatable) return TRUE; htab = elf_i386_hash_table (info); @@ -1004,8 +922,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) size = symtab_hdr->sh_info; size *= (sizeof (bfd_signed_vma) + sizeof(char)); - local_got_refcounts = ((bfd_signed_vma *) - bfd_zalloc (abfd, size)); + local_got_refcounts = bfd_zalloc (abfd, size); if (local_got_refcounts == NULL) return FALSE; elf_local_got_refcounts (abfd) = local_got_refcounts; @@ -1029,7 +946,8 @@ elf_i386_check_relocs (abfd, info, sec, relocs) else { (*_bfd_error_handler) - (_("%s: `%s' accessed both as normal and thread local symbol"), + (_("%s: `%s' accessed both as normal and " + "thread local symbol"), bfd_archive_filename (abfd), h ? h->root.root.string : ""); return FALSE; @@ -1195,8 +1113,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (p == NULL || p->sec != sec) { bfd_size_type amt = sizeof *p; - p = ((struct elf_i386_dyn_relocs *) - bfd_alloc (htab->elf.dynobj, amt)); + p = bfd_alloc (htab->elf.dynobj, amt); if (p == NULL) return FALSE; p->next = *head; @@ -1238,12 +1155,11 @@ elf_i386_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -elf_i386_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf_i386_gc_mark_hook (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) { @@ -1277,11 +1193,10 @@ elf_i386_gc_mark_hook (sec, info, rel, h, sym) /* Update the got entry reference counts for the section being removed. */ static bfd_boolean -elf_i386_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +elf_i386_gc_sweep_hook (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; @@ -1375,9 +1290,8 @@ elf_i386_gc_sweep_hook (abfd, info, sec, relocs) understand. */ static bfd_boolean -elf_i386_adjust_dynamic_symbol (info, h) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; +elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) { struct elf_i386_link_hash_table *htab; asection *s; @@ -1534,9 +1448,7 @@ elf_i386_adjust_dynamic_symbol (info, h) dynamic relocs. */ static bfd_boolean -allocate_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; struct elf_i386_link_hash_table *htab; @@ -1748,9 +1660,7 @@ allocate_dynrelocs (h, inf) /* Find any dynamic relocs that apply to read-only sections. */ static bfd_boolean -readonly_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct elf_i386_link_hash_entry *eh; struct elf_i386_dyn_relocs *p; @@ -1779,9 +1689,8 @@ readonly_dynrelocs (h, inf) /* Set the sizes of the dynamic sections. */ static bfd_boolean -elf_i386_size_dynamic_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +elf_i386_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) { struct elf_i386_link_hash_table *htab; bfd *dynobj; @@ -1797,7 +1706,7 @@ elf_i386_size_dynamic_sections (output_bfd, info) if (htab->elf.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); if (s == NULL) @@ -1948,7 +1857,7 @@ elf_i386_size_dynamic_sections (output_bfd, info) section's contents are written out. This should not happen, but this way if it does, we get a R_386_NONE reloc instead of garbage. */ - s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); + s->contents = bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL) return FALSE; } @@ -1961,9 +1870,9 @@ elf_i386_size_dynamic_sections (output_bfd, info) the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + bfd_elf32_add_dynamic_entry (info, (TAG), (VAL)) - if (! info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) return FALSE; @@ -2007,10 +1916,9 @@ elf_i386_size_dynamic_sections (output_bfd, info) section name, which is a hack, but ought to work. */ static bfd_boolean -elf_i386_fake_sections (abfd, hdr, sec) - bfd *abfd ATTRIBUTE_UNUSED; - Elf_Internal_Shdr *hdr; - asection *sec; +elf_i386_fake_sections (bfd *abfd ATTRIBUTE_UNUSED, + Elf_Internal_Shdr *hdr, + asection *sec) { register const char *name; @@ -2043,8 +1951,7 @@ elf_i386_fake_sections (abfd, hdr, sec) This is PT_TLS segment p_vaddr. */ static bfd_vma -dtpoff_base (info) - struct bfd_link_info *info; +dtpoff_base (struct bfd_link_info *info) { /* If tls_segment is NULL, we should have signalled an error already. */ if (elf_hash_table (info)->tls_segment == NULL) @@ -2056,9 +1963,7 @@ dtpoff_base (info) if STT_TLS virtual address is ADDRESS. */ static bfd_vma -tpoff (info, address) - struct bfd_link_info *info; - bfd_vma address; +tpoff (struct bfd_link_info *info, bfd_vma address) { struct elf_link_tls_segment *tls_segment = elf_hash_table (info)->tls_segment; @@ -2073,16 +1978,14 @@ tpoff (info, address) /* Relocate an i386 ELF section. */ static bfd_boolean -elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, - contents, relocs, local_syms, local_sections) - bfd *output_bfd; - struct bfd_link_info *info; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - Elf_Internal_Rela *relocs; - Elf_Internal_Sym *local_syms; - asection **local_sections; +elf_i386_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) { struct elf_i386_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -2114,11 +2017,11 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, int tls_type; r_type = ELF32_R_TYPE (rel->r_info); - if (r_type == (int) R_386_GNU_VTINHERIT - || r_type == (int) R_386_GNU_VTENTRY) + if (r_type == R_386_GNU_VTINHERIT + || r_type == R_386_GNU_VTENTRY) continue; - if ((indx = (unsigned) r_type) >= R_386_standard + if ((indx = r_type) >= R_386_standard && ((indx = r_type - R_386_ext_offset) - R_386_standard >= R_386_ext - R_386_standard) && ((indx = r_type - R_386_tls_offset) - R_386_ext @@ -2131,7 +2034,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, r_symndx = ELF32_R_SYM (rel->r_info); - if (info->relocateable) + if (info->relocatable) { bfd_vma val; bfd_byte *where; @@ -2633,12 +2536,14 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (val == 0xa1) { /* movl foo, %eax. */ - bfd_put_8 (output_bfd, 0xb8, contents + rel->r_offset - 1); + bfd_put_8 (output_bfd, 0xb8, + contents + rel->r_offset - 1); } else { BFD_ASSERT (rel->r_offset >= 2); - type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2); + type = bfd_get_8 (input_bfd, + contents + rel->r_offset - 2); switch (type) { case 0x8b: @@ -3010,7 +2915,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, - relocation, (bfd_vma) 0); + relocation, 0); if (r != bfd_reloc_ok) { @@ -3032,7 +2937,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (r == bfd_reloc_overflow) { if (! ((*info->callbacks->reloc_overflow) - (info, name, howto->name, (bfd_vma) 0, + (info, name, howto->name, 0, input_bfd, input_section, rel->r_offset))) return FALSE; } @@ -3055,11 +2960,10 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, dynamic sections here. */ static bfd_boolean -elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) - bfd *output_bfd; - struct bfd_link_info *info; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf_i386_finish_dynamic_symbol (bfd *output_bfd, + struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { struct elf_i386_link_hash_table *htab; @@ -3218,10 +3122,9 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) dynamic linker, before writing them out. */ static enum elf_reloc_type_class -elf_i386_reloc_type_class (rela) - const Elf_Internal_Rela *rela; +elf_i386_reloc_type_class (const Elf_Internal_Rela *rela) { - switch ((int) ELF32_R_TYPE (rela->r_info)) + switch (ELF32_R_TYPE (rela->r_info)) { case R_386_RELATIVE: return reloc_class_relative; @@ -3237,9 +3140,8 @@ elf_i386_reloc_type_class (rela) /* Finish up the dynamic sections. */ static bfd_boolean -elf_i386_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +elf_i386_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info) { struct elf_i386_link_hash_table *htab; bfd *dynobj; @@ -3348,11 +3250,11 @@ elf_i386_finish_dynamic_sections (output_bfd, info) if (htab->sgotplt->_raw_size > 0) { bfd_put_32 (output_bfd, - (sdyn == NULL ? (bfd_vma) 0 + (sdyn == NULL ? 0 : sdyn->output_section->vma + sdyn->output_offset), htab->sgotplt->contents); - bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgotplt->contents + 4); - bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgotplt->contents + 8); + bfd_put_32 (output_bfd, 0, htab->sgotplt->contents + 4); + bfd_put_32 (output_bfd, 0, htab->sgotplt->contents + 8); } elf_section_data (htab->sgotplt->output_section)->this_hdr.sh_entsize = 4; @@ -3413,13 +3315,9 @@ elf_i386_finish_dynamic_sections (output_bfd, info) "FreeBSD" label in the ELF header. So we put this label on all executables and (for simplicity) also all other object files. */ -static void elf_i386_post_process_headers - PARAMS ((bfd *, struct bfd_link_info *)); - static void -elf_i386_post_process_headers (abfd, link_info) - bfd *abfd; - struct bfd_link_info *link_info ATTRIBUTE_UNUSED; +elf_i386_post_process_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { Elf_Internal_Ehdr *i_ehdrp; diff --git a/bfd/elf32-i860.c b/bfd/elf32-i860.c index 74112f1389f..cec42be7e3a 100644 --- a/bfd/elf32-i860.c +++ b/bfd/elf32-i860.c @@ -1,5 +1,5 @@ /* Intel i860 specific support for 32-bit ELF. - Copyright 1993, 1995, 1999, 2000, 2001, 2002 + Copyright 1993, 1995, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Full i860 support contributed by Jason Eckhardt . @@ -840,7 +840,7 @@ i860_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca zero. This function is responsible for adjusting the section contents as - necessary, and (if using Rela relocs and generating a relocateable + necessary, and (if using Rela relocs and generating a relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -854,7 +854,7 @@ i860_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca The global hash table entry for the global symbols can be found via elf_sym_hashes (input_bfd). - When generating relocateable output, this function must handle + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted @@ -876,7 +876,7 @@ elf32_i860_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; diff --git a/bfd/elf32-i960.c b/bfd/elf32-i960.c index 4a1e931f293..6218e1a50da 100644 --- a/bfd/elf32-i960.c +++ b/bfd/elf32-i960.c @@ -1,5 +1,5 @@ /* Intel 860 specific support for 32-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. @@ -96,7 +96,7 @@ elf32_i960_info_to_howto_rel (abfd, cache_ptr, dst) cache_ptr->howto = &elf_howto_table[(int) type]; } -/* ELF relocs are against symbols. If we are producing relocateable +/* ELF relocs are against symbols. If we are producing relocatable output, and the reloc is against an external symbol, and nothing has given us any additional addend, the resulting reloc will also be against the same symbol. In such a case, we don't want to @@ -104,7 +104,7 @@ elf32_i960_info_to_howto_rel (abfd, cache_ptr, dst) all be done at final link time. Rather than put special case code into bfd_perform_relocation, all the reloc types use this howto function. It just short circuits the reloc if producing - relocateable output against an external symbol. */ + relocatable output against an external symbol. */ bfd_reloc_status_type elf32_i960_relocate (abfd, diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c index e10e9410ac6..4cb28bb31b8 100644 --- a/bfd/elf32-ip2k.c +++ b/bfd/elf32-ip2k.c @@ -834,7 +834,7 @@ ip2k_elf_relax_section (abfd, sec, link_info, again) /* We don't have to do anything for a relocatable link, if this section does not have relocs, or if this is not a code section. */ - if (link_info->relocateable + if (link_info->relocatable || (sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0 || (sec->flags & SEC_CODE) == 0) @@ -1456,7 +1456,7 @@ ip2k_final_link_relocate (howto, input_bfd, input_section, contents, rel, zero. This function is responsible for adjusting the section contents as - necessary, and (if using Rela relocs and generating a relocateable + necessary, and (if using Rela relocs and generating a relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -1470,7 +1470,7 @@ ip2k_final_link_relocate (howto, input_bfd, input_section, contents, rel, The global hash table entry for the global symbols can be found via elf_sym_hashes (input_bfd). - When generating relocateable output, this function must handle + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted @@ -1493,7 +1493,7 @@ ip2k_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c index ebdd30300ff..e2a3b17aee5 100644 --- a/bfd/elf32-iq2000.c +++ b/bfd/elf32-iq2000.c @@ -458,7 +458,7 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel_end; bfd_boolean changed = FALSE; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -531,7 +531,7 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs) zero. This function is responsible for adjusting the section contents as - necessary, and (if using Rela relocs and generating a relocateable + necessary, and (if using Rela relocs and generating a relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -545,7 +545,7 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs) The global hash table entry for the global symbols can be found via elf_sym_hashes (input_bfd). - When generating relocateable output, this function must handle + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index 3116ace867a..34773ce1a64 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -840,7 +840,7 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) asection **secp; bfd_vma *valp; { - if (! info->relocateable + if (! info->relocatable && (*namep)[0] == '_' && (*namep)[1] == 'S' && strcmp (*namep, "_SDA_BASE_") == 0 && info->hash->creator->flavour == bfd_target_elf_flavour) @@ -903,7 +903,7 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) symbol value correctly. We look up the symbol _SDA_BASE_ in the output BFD. If we can't find it, we're stuck. We cache it in the ELF target data. We don't need to adjust the symbol value for an - external symbol if we are producing relocateable output. */ + external symbol if we are producing relocatable output. */ static bfd_reloc_status_type m32r_elf_final_sda_base (output_bfd, info, error_message, psb) @@ -948,7 +948,7 @@ m32r_elf_final_sda_base (output_bfd, info, error_message, psb) This function is responsible for adjust the section contents as necessary, and (if using Rela relocs and generating a - relocateable output file) adjusting the reloc addend as + relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -962,7 +962,7 @@ m32r_elf_final_sda_base (output_bfd, info, error_message, psb) The global hash table entry for the global symbols can be found via elf_sym_hashes (input_bfd). - When generating relocateable output, this function must handle + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted @@ -987,7 +987,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_boolean ret = TRUE; #if !USE_REL - if (info->relocateable) + if (info->relocatable) return TRUE; #endif @@ -1031,9 +1031,9 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section, r_symndx = ELF32_R_SYM (rel->r_info); #if USE_REL - if (info->relocateable) + if (info->relocatable) { - /* This is a relocateable link. We don't have to change + /* This is a relocatable link. We don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ @@ -1350,10 +1350,10 @@ m32r_elf_relax_section (abfd, sec, link_info, again) /* Assume nothing changes. */ *again = FALSE; - /* We don't have to do anything for a relocateable link, if + /* We don't have to do anything for a relocatable link, if this section does not have relocs, or if this is not a code section. */ - if (link_info->relocateable + if (link_info->relocatable || (sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0 || (sec->flags & SEC_CODE) == 0 @@ -1744,12 +1744,12 @@ m32r_elf_relax_delete_bytes (abfd, sec, addr, count) static bfd_byte * m32r_elf_get_relocated_section_contents (output_bfd, link_info, link_order, - data, relocateable, symbols) + data, relocatable, symbols) bfd *output_bfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - bfd_boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { Elf_Internal_Shdr *symtab_hdr; @@ -1762,11 +1762,11 @@ m32r_elf_get_relocated_section_contents (output_bfd, link_info, link_order, /* We only need to handle the case of relaxing, or of having a particular set of section contents, specially. */ - if (relocateable + if (relocatable || elf_section_data (input_section)->this_hdr.contents == NULL) return bfd_generic_get_relocated_section_contents (output_bfd, link_info, link_order, data, - relocateable, + relocatable, symbols); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -2050,7 +2050,7 @@ m32r_elf_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c index 1b95105299d..03839074549 100644 --- a/bfd/elf32-m68hc11.c +++ b/bfd/elf32-m68hc11.c @@ -687,10 +687,10 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again) /* Assume nothing changes. */ *again = FALSE; - /* We don't have to do anything for a relocateable link, if + /* We don't have to do anything for a relocatable link, if this section does not have relocs, or if this is not a code section. */ - if (link_info->relocateable + if (link_info->relocatable || (sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0 || (sec->flags & SEC_CODE) == 0) diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c index 176a256c744..a3def112f1f 100644 --- a/bfd/elf32-m68hc1x.c +++ b/bfd/elf32-m68hc1x.c @@ -956,7 +956,7 @@ elf32_m68hc11_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela * rel; const Elf_Internal_Rela * rel_end; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = & elf_tdata (abfd)->symtab_hdr; @@ -1152,9 +1152,9 @@ elf32_m68hc11_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_M68HC11_GNU_VTINHERIT ) continue; - if (info->relocateable) + if (info->relocatable) { - /* This is a relocateable link. We don't have to change + /* This is a relocatable link. We don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 1cf23d6abb7..1320429cf1f 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -427,7 +427,7 @@ elf_m68k_check_relocs (abfd, info, sec, relocs) asection *srelgot; asection *sreloc; - if (info->relocateable) + if (info->relocatable) return TRUE; dynobj = elf_hash_table (info)->dynobj; @@ -1358,7 +1358,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; dynobj = elf_hash_table (info)->dynobj; @@ -2153,7 +2153,7 @@ bfd_m68k_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) bfd_byte *p; bfd_size_type amt; - BFD_ASSERT (! info->relocateable); + BFD_ASSERT (! info->relocatable); *errmsg = NULL; diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c index 927418e03e5..e88f01d64be 100644 --- a/bfd/elf32-mcore.c +++ b/bfd/elf32-mcore.c @@ -1,5 +1,5 @@ /* Motorola MCore specific support for 32-bit ELF - Copyright 1994, 1995, 1999, 2000, 2001, 2002 + Copyright 1994, 1995, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -367,7 +367,7 @@ mcore_elf_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section, This function is responsible for adjust the section contents as necessary, and (if using Rela relocs and generating a - relocateable output file) adjusting the reloc addend as + relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -381,7 +381,7 @@ mcore_elf_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section, The global hash table entry for the global symbols can be found via elf_sym_hashes (input_bfd). - When generating relocateable output, this function must handle + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted @@ -411,10 +411,10 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_archive_filename (input_bfd), bfd_section_name(input_bfd, input_section), (long) input_section->reloc_count, - (info->relocateable) ? " (relocatable)" : ""); + (info->relocatable) ? " (relocatable)" : ""); #endif - if (info->relocateable) + if (info->relocatable) return TRUE; if (! mcore_elf_howto_table [R_MCORE_PCRELIMM8BY4]) /* Initialize howto table if needed */ @@ -637,7 +637,7 @@ mcore_elf_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela * rel; const Elf_Internal_Rela * rel_end; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = & elf_tdata (abfd)->symtab_hdr; diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index 3b472464b10..e495cc46dd5 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -47,12 +47,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ECOFF_SIGNED_32 #include "ecoffswap.h" +static bfd_reloc_status_type mips_elf_generic_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type mips_elf_hi16_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type mips_elf_lo16_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type mips_elf_got16_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type gprel32_with_gp + PARAMS ((bfd *, asymbol *, arelent *, asection *, bfd_boolean, PTR, + bfd_vma)); static bfd_reloc_status_type mips_elf_gprel32_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type mips32_64bit_reloc @@ -116,7 +121,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_NONE", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ @@ -131,7 +136,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_16", /* name */ TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ @@ -146,7 +151,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_32", /* name */ TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ @@ -161,7 +166,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_REL32", /* name */ TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ @@ -179,7 +184,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = /* This needs complex overflow detection, because the upper four bits must match the PC + 4. */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_26", /* name */ TRUE, /* partial_inplace */ 0x03ffffff, /* src_mask */ @@ -269,7 +274,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_PC16", /* name */ TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ @@ -284,7 +289,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_CALL16", /* name */ TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ @@ -320,7 +325,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 6, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_SHIFT5", /* name */ TRUE, /* partial_inplace */ 0x000007c0, /* src_mask */ @@ -337,7 +342,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 6, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_SHIFT6", /* name */ TRUE, /* partial_inplace */ 0x000007c4, /* src_mask */ @@ -367,7 +372,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_GOT_DISP", /* name */ TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ @@ -382,7 +387,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_GOT_PAGE", /* name */ TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ @@ -397,7 +402,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_GOT_OFST", /* name */ TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ @@ -412,7 +417,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_GOT_HI16", /* name */ TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ @@ -427,7 +432,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_GOT_LO16", /* name */ TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ @@ -442,7 +447,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_SUB", /* name */ TRUE, /* partial_inplace */ MINUS_ONE, /* src_mask */ @@ -462,7 +467,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_HIGHER", /* name */ TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ @@ -477,7 +482,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_HIGHEST", /* name */ TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ @@ -492,7 +497,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_CALL_HI16", /* name */ TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ @@ -507,7 +512,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_CALL_LO16", /* name */ TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ @@ -522,7 +527,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_SCN_DISP", /* name */ TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ @@ -543,7 +548,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_JALR", /* name */ FALSE, /* partial_inplace */ 0x00000000, /* src_mask */ @@ -645,7 +650,7 @@ static reloc_howto_type elf_mips_gnu_rel16_s2 = TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_GNU_REL16_S2", /* name */ TRUE, /* partial_inplace */ 0xffff, /* src_mask */ @@ -661,7 +666,7 @@ static reloc_howto_type elf_mips_gnu_pcrel64 = TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_PC64", /* name */ TRUE, /* partial_inplace */ MINUS_ONE, /* src_mask */ @@ -677,7 +682,7 @@ static reloc_howto_type elf_mips_gnu_pcrel32 = TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf_generic_reloc, /* special_function */ "R_MIPS_PC32", /* name */ TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ @@ -716,6 +721,33 @@ static reloc_howto_type elf_mips_gnu_vtentry_howto = 0, /* dst_mask */ FALSE); /* pcrel_offset */ +/* We use this instead of bfd_elf_generic_reloc because the latter + gets the handling of zero addends wrong. */ +static bfd_reloc_status_type +mips_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + /* If we're relocating, and this is an external symbol, we don't want + to change anything. */ + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 0 + && (symbol->flags & BSF_LOCAL) != 0) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + + /* Just go on, nothing to see here. */ + return bfd_reloc_continue; +} + /* Do a R_MIPS_HI16 relocation. This has to be done in combination with a R_MIPS_LO16 reloc, because there is a carry from the LO16 to the HI16. Here we just save the information we need; we do the @@ -761,7 +793,7 @@ mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, to change anything. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) + && (symbol->flags & BSF_LOCAL) != 0) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; @@ -771,21 +803,21 @@ mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, if (strcmp (bfd_asymbol_name (symbol), "_gp_disp") == 0) { - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_vma gp; if (ret == bfd_reloc_undefined) abort (); if (output_bfd != NULL) - relocateable = TRUE; + relocatable = TRUE; else { - relocateable = FALSE; + relocatable = FALSE; output_bfd = symbol->section->output_section->owner; } - ret = mips_elf_final_gp (output_bfd, symbol, relocateable, + ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, &gp); if (ret != bfd_reloc_ok) return ret; @@ -855,41 +887,42 @@ mips_elf_lo16_reloc (abfd, reloc_entry, symbol, data, input_section, unsigned long vallo; struct mips_hi16 *next; - /* Do the HI16 relocation. Note that we actually don't need - to know anything about the LO16 itself, except where to - find the low 16 bits of the addend needed by the LO16. */ - insn = bfd_get_32 (abfd, l->addr); - vallo = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - - /* The low order 16 bits are always treated as a signed - value. */ - vallo = ((vallo & 0xffff) ^ 0x8000) - 0x8000; - val = ((insn & 0xffff) << 16) + vallo; - val += l->addend; - - /* If PC-relative, we need to subtract out the address of the LO - half of the HI/LO. (The actual relocation is relative - to that instruction.) */ - if (reloc_entry->howto->pc_relative) - val -= reloc_entry->address; - - /* At this point, "val" has the value of the combined HI/LO - pair. If the low order 16 bits (which will be used for - the LO16 insn) are negative, then we will need an - adjustment for the high order 16 bits. */ - val += 0x8000; - val = (val >> 16) & 0xffff; - - insn &= ~ (bfd_vma) 0xffff; - insn |= val; - bfd_put_32 (abfd, (bfd_vma) insn, l->addr); - if (strcmp (bfd_asymbol_name (symbol), "_gp_disp") == 0) { gp_disp_relent = *reloc_entry; reloc_entry = &gp_disp_relent; reloc_entry->addend = l->addend; } + else + { + /* Do the HI16 relocation. Note that we actually don't need + to know anything about the LO16 itself, except where to + find the low 16 bits of the addend needed by the LO16. */ + insn = bfd_get_32 (abfd, l->addr); + vallo = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + /* The low order 16 bits are always treated as a signed + value. */ + vallo = ((vallo & 0xffff) ^ 0x8000) - 0x8000; + val = ((insn & 0xffff) << 16) + vallo; + val += l->addend; + + /* If PC-relative, we need to subtract out the address of the LO + half of the HI/LO. (The actual relocation is relative + to that instruction.) */ + if (reloc_entry->howto->pc_relative) + val -= reloc_entry->address; + + /* At this point, "val" has the value of the combined HI/LO + pair. If the low order 16 bits (which will be used for + the LO16 insn) are negative, then we will need an + adjustment for the high order 16 bits. */ + val += 0x8000; + val = (val >> 16) & 0xffff; + + insn &= ~ (bfd_vma) 0xffff; + insn |= val; + bfd_put_32 (abfd, (bfd_vma) insn, l->addr); + } next = l->next; free (l); @@ -923,8 +956,8 @@ mips_elf_lo16_reloc (abfd, reloc_entry, symbol, data, input_section, } /* Now do the LO16 reloc in the usual way. */ - return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message); + return mips_elf_generic_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); } /* Do a R_MIPS_GOT16 reloc. This is a reloc against the global offset @@ -956,20 +989,14 @@ mips_elf_got16_reloc (abfd, reloc_entry, symbol, data, input_section, to change anything. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) + && (symbol->flags & BSF_LOCAL) != 0) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } - /* If we're relocating, and this is a local symbol, we can handle it - just like HI16. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) != 0) - return mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message); - - abort (); + return mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); } /* Set the GP value for OUTPUT_BFD. Returns FALSE if this is a @@ -1027,18 +1054,18 @@ mips_elf_assign_gp (output_bfd, pgp) symbol value correctly. We look up the symbol _gp in the output BFD. If we can't find it, we're stuck. We cache it in the ELF target data. We don't need to adjust the symbol value for an - external symbol if we are producing relocateable output. */ + external symbol if we are producing relocatable output. */ static bfd_reloc_status_type -mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, pgp) +mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, pgp) bfd *output_bfd; asymbol *symbol; - bfd_boolean relocateable; + bfd_boolean relocatable; char **error_message; bfd_vma *pgp; { if (bfd_is_und_section (symbol->section) - && ! relocateable) + && ! relocatable) { *pgp = 0; return bfd_reloc_undefined; @@ -1046,10 +1073,10 @@ mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, pgp) *pgp = _bfd_get_gp_value (output_bfd); if (*pgp == 0 - && (! relocateable + && (! relocatable || (symbol->flags & BSF_SECTION_SYM) != 0)) { - if (relocateable) + if (relocatable) { /* Make up a value. */ *pgp = symbol->section->output_section->vma + 0x4000; @@ -1083,47 +1110,41 @@ _bfd_mips_elf32_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, bfd *output_bfd; char **error_message; { - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_reloc_status_type ret; bfd_vma gp; - /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ELF - file. */ + /* If we're relocating, and this is an external symbol, we don't want + to change anything. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) + && (symbol->flags & BSF_LOCAL) != 0) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } if (output_bfd != (bfd *) NULL) - relocateable = TRUE; + relocatable = TRUE; else { - relocateable = FALSE; + relocatable = FALSE; output_bfd = symbol->section->output_section->owner; } - ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, + ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, &gp); if (ret != bfd_reloc_ok) return ret; return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, - input_section, relocateable, + input_section, relocatable, data, gp); } /* Do a R_MIPS_GPREL32 relocation. This is a 32 bit value which must become the offset from the gp register. */ -static bfd_reloc_status_type gprel32_with_gp - PARAMS ((bfd *, asymbol *, arelent *, asection *, bfd_boolean, PTR, - bfd_vma)); - static bfd_reloc_status_type mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -1135,17 +1156,15 @@ mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, bfd *output_bfd; char **error_message; { - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_reloc_status_type ret; bfd_vma gp; - /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ELF - file. */ + /* If we're relocating, and this is an external symbol, we don't want + to change anything. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) + && (symbol->flags & BSF_LOCAL) != 0) { *error_message = (char *) _("32bits gp relative relocation occurs for an external symbol"); @@ -1153,38 +1172,35 @@ mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, } if (output_bfd != (bfd *) NULL) - { - relocateable = TRUE; - gp = _bfd_get_gp_value (output_bfd); - } + relocatable = TRUE; else { - relocateable = FALSE; + relocatable = FALSE; output_bfd = symbol->section->output_section->owner; - - ret = mips_elf_final_gp (output_bfd, symbol, relocateable, - error_message, &gp); - if (ret != bfd_reloc_ok) - return ret; } + ret = mips_elf_final_gp (output_bfd, symbol, relocatable, + error_message, &gp); + if (ret != bfd_reloc_ok) + return ret; + return gprel32_with_gp (abfd, symbol, reloc_entry, input_section, - relocateable, data, gp); + relocatable, data, gp); } static bfd_reloc_status_type -gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocateable, data, +gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocatable, data, gp) bfd *abfd; asymbol *symbol; arelent *reloc_entry; asection *input_section; - bfd_boolean relocateable; + bfd_boolean relocatable; PTR data; bfd_vma gp; { bfd_vma relocation; - unsigned long val; + bfd_vma val; if (bfd_is_com_section (symbol->section)) relocation = 0; @@ -1197,21 +1213,25 @@ gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocateable, data, if (reloc_entry->address > input_section->_cooked_size) return bfd_reloc_outofrange; - val = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - /* Set val to the offset into the section or symbol. */ - val += reloc_entry->addend; + val = reloc_entry->addend; + + if (reloc_entry->howto->partial_inplace) + val += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); /* Adjust val for the final section location and GP value. If we - are producing relocateable output, we don't want to do this for + are producing relocatable output, we don't want to do this for an external symbol. */ - if (! relocateable + if (! relocatable || (symbol->flags & BSF_SECTION_SYM) != 0) val += relocation - gp; - bfd_put_32 (abfd, (bfd_vma) val, (bfd_byte *) data + reloc_entry->address); + if (reloc_entry->howto->partial_inplace) + bfd_put_32 (abfd, val, (bfd_byte *) data + reloc_entry->address); + else + reloc_entry->addend = val; - if (relocateable) + if (relocatable) reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; @@ -1237,8 +1257,8 @@ mips32_64bit_reloc (abfd, reloc_entry, symbol, data, input_section, unsigned long val; bfd_size_type addr; - r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message); + r = mips_elf_generic_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); if (r != bfd_reloc_continue) return r; @@ -1312,33 +1332,33 @@ mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, bfd *output_bfd; char **error_message; { - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_reloc_status_type ret; bfd_vma gp; - unsigned short extend, insn; - unsigned long final; + unsigned short extend = 0; + unsigned short insn = 0; + bfd_signed_vma val; + bfd_vma relocation; - /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ELF - file. */ + /* If we're relocating, and this is an external symbol, we don't want + to change anything. */ if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) + && (symbol->flags & BSF_LOCAL) != 0) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } if (output_bfd != NULL) - relocateable = TRUE; + relocatable = TRUE; else { - relocateable = FALSE; + relocatable = FALSE; output_bfd = symbol->section->output_section->owner; } - ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, + ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, &gp); if (ret != bfd_reloc_ok) return ret; @@ -1346,33 +1366,55 @@ mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, if (reloc_entry->address > input_section->_cooked_size) return bfd_reloc_outofrange; - /* Pick up the mips16 extend instruction and the real instruction. */ - extend = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address); - insn = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address + 2); - - /* Stuff the current addend back as a 32 bit value, do the usual - relocation, and then clean up. */ - bfd_put_32 (abfd, - (bfd_vma) (((extend & 0x1f) << 11) - | (extend & 0x7e0) - | (insn & 0x1f)), - (bfd_byte *) data + reloc_entry->address); - - ret = _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, - input_section, relocateable, data, gp); - - final = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - bfd_put_16 (abfd, - (bfd_vma) ((extend & 0xf800) - | ((final >> 11) & 0x1f) - | (final & 0x7e0)), - (bfd_byte *) data + reloc_entry->address); - bfd_put_16 (abfd, - (bfd_vma) ((insn & 0xffe0) - | (final & 0x1f)), - (bfd_byte *) data + reloc_entry->address + 2); + if (bfd_is_com_section (symbol->section)) + relocation = 0; + else + relocation = symbol->value; - return ret; + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + + /* Set val to the offset into the section or symbol. */ + val = reloc_entry->addend; + + if (reloc_entry->howto->partial_inplace) + { + /* Pick up the mips16 extend instruction and the real instruction. */ + extend = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address); + insn = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address + 2); + val += ((extend & 0x1f) << 11) | (extend & 0x7e0) | (insn & 0x1f); + } + + _bfd_mips_elf_sign_extend(val, 16); + + /* Adjust val for the final section location and GP value. If we + are producing relocatable output, we don't want to do this for + an external symbol. */ + if (! relocatable + || (symbol->flags & BSF_SECTION_SYM) != 0) + val += relocation - gp; + + if (reloc_entry->howto->partial_inplace) + { + bfd_put_16 (abfd, + (bfd_vma) ((extend & 0xf800) + | ((val >> 11) & 0x1f) + | (val & 0x7e0)), + (bfd_byte *) data + reloc_entry->address); + bfd_put_16 (abfd, + (bfd_vma) ((insn & 0xffe0) + | (val & 0x1f)), + (bfd_byte *) data + reloc_entry->address + 2); + } + else + reloc_entry->addend = val; + + if (relocatable) + reloc_entry->address += input_section->output_offset; + else if (((val & ~0xffff) != ~0xffff) && ((val & ~0xffff) != 0)) + return bfd_reloc_overflow; + + return bfd_reloc_ok; } /* A mapping from BFD reloc types to MIPS ELF reloc types. */ @@ -1688,7 +1730,7 @@ bfd_mips_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) Elf_Internal_Rela *irel, *irelend; bfd_byte *p; - BFD_ASSERT (! info->relocateable); + BFD_ASSERT (! info->relocatable); *errmsg = NULL; diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c index 694a30f1198..23f5069cb19 100644 --- a/bfd/elf32-msp430.c +++ b/bfd/elf32-msp430.c @@ -1,5 +1,5 @@ /* MSP430-specific support for 32-bit ELF - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. Contributed by Dmitry Diky This file is part of BFD, the Binary File Descriptor library. @@ -278,7 +278,7 @@ elf32_msp430_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; diff --git a/bfd/elf32-openrisc.c b/bfd/elf32-openrisc.c index 8e8d0bc52fa..a9b6d1d2358 100644 --- a/bfd/elf32-openrisc.c +++ b/bfd/elf32-openrisc.c @@ -1,5 +1,5 @@ /* OpenRISC-specific support for 32-bit ELF. - Copyright 2001, 2002 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Johan Rydberg, jrydberg@opencores.org This file is part of BFD, the Binary File Descriptor library. @@ -298,7 +298,7 @@ openrisc_final_link_relocate (howto, input_bfd, input_section, contents, rel, zero. This function is responsible for adjusting the section contents as - necessary, and (if using Rela relocs and generating a relocateable + necessary, and (if using Rela relocs and generating a relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -312,7 +312,7 @@ openrisc_final_link_relocate (howto, input_bfd, input_section, contents, rel, The global hash table entry for the global symbols can be found via elf_sym_hashes (input_bfd). - When generating relocateable output, this function must handle + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted @@ -335,7 +335,7 @@ openrisc_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -529,7 +529,7 @@ openrisc_elf_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 1e1ab8cce3b..2e1353fdf7e 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -35,88 +35,10 @@ /* RELA relocations are used here. */ -static struct bfd_hash_entry *ppc_elf_link_hash_newfunc - PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, - const char *string)); -static struct bfd_link_hash_table *ppc_elf_link_hash_table_create - PARAMS ((bfd *abfd)); -static void ppc_elf_copy_indirect_symbol - PARAMS ((struct elf_backend_data *bed, struct elf_link_hash_entry *dir, - struct elf_link_hash_entry *ind)); -static reloc_howto_type *ppc_elf_reloc_type_lookup - PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); -static void ppc_elf_info_to_howto - PARAMS ((bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)); -static void ppc_elf_howto_init - PARAMS ((void)); -static int ppc_elf_sort_rela - PARAMS ((const PTR, const PTR)); -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 **)); + (bfd *, arelent *, asymbol *, void *, 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 - PARAMS ((bfd *, flagword)); -static bfd_boolean ppc_elf_merge_private_bfd_data - PARAMS ((bfd *, bfd *)); -static int ppc_elf_additional_program_headers - PARAMS ((bfd *)); -static bfd_boolean ppc_elf_modify_segment_map - PARAMS ((bfd *)); -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 *)); -static bfd_boolean ppc_elf_section_from_shdr - PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); -static bfd_boolean ppc_elf_fake_sections - PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); -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 - 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 - PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec, - const Elf_Internal_Rela *relocs)); -static bfd_boolean ppc_elf_adjust_dynamic_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static bfd_boolean allocate_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static bfd_boolean readonly_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static bfd_boolean ppc_elf_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean ppc_elf_relocate_section - PARAMS ((bfd *, struct bfd_link_info *info, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms, - asection **)); -static bfd_boolean ppc_elf_add_symbol_hook - PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, - const char **, flagword *, asection **, bfd_vma *)); -static bfd_boolean ppc_elf_finish_dynamic_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - Elf_Internal_Sym *)); -static bfd_boolean ppc_elf_finish_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static enum elf_reloc_type_class ppc_elf_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); -static bfd_boolean ppc_elf_grok_prstatus - PARAMS ((bfd *abfd, Elf_Internal_Note *note)); -static bfd_boolean ppc_elf_grok_psinfo - PARAMS ((bfd *abfd, Elf_Internal_Note *note)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); /* Branch prediction bit for branch taken relocs. */ #define BRANCH_PREDICT_BIT 0x200000 @@ -235,10 +157,9 @@ struct ppc_elf_link_hash_table /* Create an entry in a PPC ELF linker hash table. */ static struct bfd_hash_entry * -ppc_elf_link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +ppc_elf_link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -264,13 +185,11 @@ ppc_elf_link_hash_newfunc (entry, table, string) /* Create a PPC ELF linker hash table. */ static struct bfd_link_hash_table * -ppc_elf_link_hash_table_create (abfd) - bfd *abfd; +ppc_elf_link_hash_table_create (bfd *abfd) { struct ppc_elf_link_hash_table *ret; - ret = ((struct ppc_elf_link_hash_table *) - bfd_malloc (sizeof (struct ppc_elf_link_hash_table))); + ret = bfd_malloc (sizeof (struct ppc_elf_link_hash_table)); if (ret == NULL) return NULL; @@ -308,9 +227,9 @@ ppc_elf_link_hash_table_create (abfd) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -ppc_elf_copy_indirect_symbol (bed, dir, ind) - struct elf_backend_data *bed; - struct elf_link_hash_entry *dir, *ind; +ppc_elf_copy_indirect_symbol (struct elf_backend_data *bed, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) { struct ppc_elf_link_hash_entry *edir, *eind; @@ -367,7 +286,7 @@ ppc_elf_copy_indirect_symbol (bed, dir, ind) _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } -static reloc_howto_type *ppc_elf_howto_table[(int) R_PPC_max]; +static reloc_howto_type *ppc_elf_howto_table[R_PPC_max]; static reloc_howto_type ppc_elf_howto_raw[] = { /* This reloc does nothing. */ @@ -1606,7 +1525,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = { /* Initialize the ppc_elf_howto_table, so that linear accesses can be done. */ static void -ppc_elf_howto_init () +ppc_elf_howto_init (void) { unsigned int i, type; @@ -1647,23 +1566,20 @@ ppc_elf_howto_init () /* Sort sections by address. */ static int -ppc_elf_sort_rela (arg1, arg2) - const PTR arg1; - const PTR arg2; +ppc_elf_sort_rela (const void *arg1, const void *arg2) { - const Elf_Internal_Rela **rela1 = (const Elf_Internal_Rela**) arg1; - const Elf_Internal_Rela **rela2 = (const Elf_Internal_Rela**) arg2; + const Elf_Internal_Rela * const *rela1 = arg1; + const Elf_Internal_Rela * const *rela2 = arg2; /* Sort by offset. */ return ((*rela1)->r_offset - (*rela2)->r_offset); } static bfd_boolean -ppc_elf_relax_section (abfd, isec, link_info, again) - bfd *abfd; - asection *isec; - struct bfd_link_info *link_info; - bfd_boolean *again; +ppc_elf_relax_section (bfd *abfd, + asection *isec, + struct bfd_link_info *link_info, + bfd_boolean *again) { #define PAGESIZE 0x1000 @@ -1695,7 +1611,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) else { /* Go get them off disk. */ - contents = (bfd_byte *) bfd_malloc (isec->_raw_size); + contents = bfd_malloc (isec->_raw_size); if (contents == NULL) goto error_return; free_contents = contents; @@ -1714,8 +1630,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) /* Get a copy of the native relocations. */ internal_relocs - = _bfd_elf_link_read_relocs (abfd, isec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, + = _bfd_elf_link_read_relocs (abfd, isec, NULL, NULL, link_info->keep_memory); if (internal_relocs == NULL) goto error_return; @@ -1725,15 +1640,15 @@ ppc_elf_relax_section (abfd, isec, link_info, again) /* 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); + rela_comb = bfd_malloc (amt); if (rela_comb == NULL) goto error_return; for (n = 0; n < isec->reloc_count; ++n) { - long r_type; + enum elf_ppc_reloc_type r_type; r_type = ELF32_R_TYPE (internal_relocs[n].r_info); - if (r_type < 0 || r_type >= (int) R_PPC_max) + if (r_type >= R_PPC_max) goto error_return; /* Prologue constants are sometimes present in the ".text" @@ -1861,7 +1776,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) #undef BO4 if (modified) { - bfd_put_32 (abfd, (bfd_vma) insn, contents + isec_offset); + bfd_put_32 (abfd, insn, contents + isec_offset); section_modified = TRUE; } } @@ -1910,20 +1825,19 @@ ppc_elf_relax_section (abfd, isec, link_info, again) } static reloc_howto_type * -ppc_elf_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; +ppc_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { enum elf_ppc_reloc_type r; + /* Initialize howto table if not already done. */ if (!ppc_elf_howto_table[R_PPC_ADDR32]) - /* Initialize howto table if needed. */ ppc_elf_howto_init (); - switch ((int) code) + switch (code) { default: - return (reloc_howto_type *) NULL; + return NULL; case BFD_RELOC_NONE: r = R_PPC_NONE; break; case BFD_RELOC_32: r = R_PPC_ADDR32; break; @@ -2008,19 +1922,18 @@ ppc_elf_reloc_type_lookup (abfd, code) case BFD_RELOC_VTABLE_ENTRY: r = R_PPC_GNU_VTENTRY; break; } - return ppc_elf_howto_table[(int) r]; + return ppc_elf_howto_table[r]; }; /* Set the howto pointer for a PowerPC ELF reloc. */ static void -ppc_elf_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr; - Elf_Internal_Rela *dst; +ppc_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, + arelent *cache_ptr, + Elf_Internal_Rela *dst) { + /* Initialize howto table if not already done. */ if (!ppc_elf_howto_table[R_PPC_ADDR32]) - /* Initialize howto table if needed. */ ppc_elf_howto_init (); BFD_ASSERT (ELF32_R_TYPE (dst->r_info) < (unsigned int) R_PPC_max); @@ -2030,15 +1943,13 @@ ppc_elf_info_to_howto (abfd, cache_ptr, dst) /* Handle the R_PPC_ADDR16_HA reloc. */ static bfd_reloc_status_type -ppc_elf_addr16_ha_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; +ppc_elf_addr16_ha_reloc (bfd *abfd ATTRIBUTE_UNUSED, + arelent *reloc_entry, + asymbol *symbol, + void *data ATTRIBUTE_UNUSED, + asection *input_section, + bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) { bfd_vma relocation; @@ -2066,15 +1977,13 @@ ppc_elf_addr16_ha_reloc (abfd, reloc_entry, symbol, data, input_section, } 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; +ppc_elf_unhandled_reloc (bfd *abfd, + arelent *reloc_entry, + asymbol *symbol, + void *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 @@ -2086,7 +1995,7 @@ ppc_elf_unhandled_reloc (abfd, reloc_entry, symbol, data, if (error_message != NULL) { static char buf[60]; - sprintf (buf, "generic linker can't handle %s", + sprintf (buf, _("generic linker can't handle %s"), reloc_entry->howto->name); *error_message = buf; } @@ -2097,8 +2006,7 @@ ppc_elf_unhandled_reloc (abfd, reloc_entry, symbol, data, default is 64 bit. */ static bfd_boolean -ppc_elf_object_p (abfd) - bfd *abfd; +ppc_elf_object_p (bfd *abfd) { if (abfd->arch_info->the_default && abfd->arch_info->bits_per_word == 64) { @@ -2117,9 +2025,7 @@ ppc_elf_object_p (abfd) /* Function to set whether a module needs the -mrelocatable bit set. */ static bfd_boolean -ppc_elf_set_private_flags (abfd, flags) - bfd *abfd; - flagword flags; +ppc_elf_set_private_flags (bfd *abfd, flagword flags) { BFD_ASSERT (!elf_flags_init (abfd) || elf_elfheader (abfd)->e_flags == flags); @@ -2133,9 +2039,7 @@ ppc_elf_set_private_flags (abfd, flags) object file when linking. */ static bfd_boolean -ppc_elf_merge_private_bfd_data (ibfd, obfd) - bfd *ibfd; - bfd *obfd; +ppc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) { flagword old_flags; flagword new_flags; @@ -2173,7 +2077,8 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) { error = TRUE; (*_bfd_error_handler) - (_("%s: compiled with -mrelocatable and linked with modules compiled normally"), + (_("%s: compiled with -mrelocatable and linked with " + "modules compiled normally"), bfd_archive_filename (ibfd)); } else if ((new_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0 @@ -2181,7 +2086,8 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) { error = TRUE; (*_bfd_error_handler) - (_("%s: compiled normally and linked with modules compiled with -mrelocatable"), + (_("%s: compiled normally and linked with " + "modules compiled with -mrelocatable"), bfd_archive_filename (ibfd)); } @@ -2208,7 +2114,8 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) { error = TRUE; (*_bfd_error_handler) - (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), + (_("%s: uses different e_flags (0x%lx) fields " + "than previous modules (0x%lx)"), bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags); } @@ -2226,10 +2133,7 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) is called when elfcode.h finds a section with an unknown type. */ static bfd_boolean -ppc_elf_section_from_shdr (abfd, hdr, name) - bfd *abfd; - Elf_Internal_Shdr *hdr; - const char *name; +ppc_elf_section_from_shdr (bfd *abfd, Elf_Internal_Shdr *hdr, const char *name) { asection *newsect; flagword flags; @@ -2252,10 +2156,9 @@ ppc_elf_section_from_shdr (abfd, hdr, name) /* Set up any other section flags and such that may be necessary. */ static bfd_boolean -ppc_elf_fake_sections (abfd, shdr, asect) - bfd *abfd ATTRIBUTE_UNUSED; - Elf_Internal_Shdr *shdr; - asection *asect; +ppc_elf_fake_sections (bfd *abfd ATTRIBUTE_UNUSED, + Elf_Internal_Shdr *shdr, + asection *asect) { if ((asect->flags & SEC_EXCLUDE) != 0) shdr->sh_flags |= SHF_EXCLUDE; @@ -2268,10 +2171,9 @@ ppc_elf_fake_sections (abfd, shdr, asect) /* Create a special linker section */ static elf_linker_section_t * -ppc_elf_create_linker_section (abfd, info, which) - bfd *abfd; - struct bfd_link_info *info; - enum elf_linker_section_enum which; +ppc_elf_create_linker_section (bfd *abfd, + struct bfd_link_info *info, + enum elf_linker_section_enum which) { bfd *dynobj = elf_hash_table (info)->dynobj; elf_linker_section_t *lsect; @@ -2311,7 +2213,7 @@ ppc_elf_create_linker_section (abfd, info, which) (int) which); bfd_set_error (bfd_error_bad_value); - return (elf_linker_section_t *) 0; + return NULL; case LINKER_SECTION_SDATA: /* .sdata/.sbss section */ defaults.name = ".sdata"; @@ -2341,8 +2243,7 @@ ppc_elf_create_linker_section (abfd, info, which) need to bump up the number of section headers. */ static int -ppc_elf_additional_program_headers (abfd) - bfd *abfd; +ppc_elf_additional_program_headers (bfd *abfd) { asection *s; int ret; @@ -2367,8 +2268,7 @@ ppc_elf_additional_program_headers (abfd) /* Modify the segment map if needed. */ static bfd_boolean -ppc_elf_modify_segment_map (abfd) - bfd *abfd ATTRIBUTE_UNUSED; +ppc_elf_modify_segment_map (bfd *abfd ATTRIBUTE_UNUSED) { return TRUE; } @@ -2376,9 +2276,7 @@ ppc_elf_modify_segment_map (abfd) /* The powerpc .got has a blrl instruction in it. Mark it executable. */ static bfd_boolean -ppc_elf_create_got (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +ppc_elf_create_got (bfd *abfd, struct bfd_link_info *info) { struct ppc_elf_link_hash_table *htab; asection *s; @@ -2414,9 +2312,7 @@ ppc_elf_create_got (abfd, info) to create .dynbss and .rela.bss). */ static bfd_boolean -ppc_elf_create_dynamic_sections (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +ppc_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) { struct ppc_elf_link_hash_table *htab; asection *s; @@ -2464,9 +2360,8 @@ ppc_elf_create_dynamic_sections (abfd, info) understand. */ static bfd_boolean -ppc_elf_adjust_dynamic_symbol (info, h) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; +ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) { struct ppc_elf_link_hash_table *htab; asection *s; @@ -2655,11 +2550,9 @@ ppc_elf_adjust_dynamic_symbol (info, h) /* Allocate space in associated reloc sections for dynamic relocs. */ static bfd_boolean -allocate_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { - struct bfd_link_info *info = (struct bfd_link_info *) inf; + struct bfd_link_info *info = inf; struct ppc_elf_link_hash_entry *eh; struct ppc_elf_link_hash_table *htab; struct ppc_elf_dyn_relocs *p; @@ -2719,7 +2612,7 @@ allocate_dynrelocs (h, inf) 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) + > PLT_NUM_SINGLE_ENTRIES) s->_raw_size += PLT_ENTRY_SIZE; /* We also need to make an entry in the .rela.plt section. */ @@ -2804,7 +2697,7 @@ allocate_dynrelocs (h, inf) generated via assembly. We want calls to protected symbols to resolve directly to the function rather than going via the plt. If people want function pointer comparisons to work as expected - then they should avoid writing weird assembly. */ + then they should avoid writing weird assembly. */ if (SYMBOL_CALLS_LOCAL (info, h)) { struct ppc_elf_dyn_relocs **pp; @@ -2869,9 +2762,7 @@ allocate_dynrelocs (h, inf) /* Find any dynamic relocs that apply to read-only sections. */ static bfd_boolean -readonly_dynrelocs (h, info) - struct elf_link_hash_entry *h; - PTR info; +readonly_dynrelocs (struct elf_link_hash_entry *h, void *info) { struct ppc_elf_dyn_relocs *p; @@ -2901,9 +2792,8 @@ readonly_dynrelocs (h, info) /* Set the sizes of the dynamic sections. */ static bfd_boolean -ppc_elf_size_dynamic_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) { struct ppc_elf_link_hash_table *htab; asection *s; @@ -2920,7 +2810,7 @@ ppc_elf_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (htab->elf.dynobj, ".interp"); BFD_ASSERT (s != NULL); @@ -3087,7 +2977,7 @@ ppc_elf_size_dynamic_sections (output_bfd, info) } /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_zalloc (htab->elf.dynobj, s->_raw_size); + s->contents = bfd_zalloc (htab->elf.dynobj, s->_raw_size); if (s->contents == NULL) return FALSE; } @@ -3100,9 +2990,9 @@ ppc_elf_size_dynamic_sections (output_bfd, info) the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + bfd_elf32_add_dynamic_entry (info, (TAG), (VAL)) - if (!info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) return FALSE; @@ -3129,7 +3019,7 @@ ppc_elf_size_dynamic_sections (output_bfd, info) need a DT_TEXTREL entry. */ if ((info->flags & DF_TEXTREL) == 0) elf_link_hash_traverse (elf_hash_table (info), readonly_dynrelocs, - (PTR) info); + info); if ((info->flags & DF_TEXTREL) != 0) { @@ -3143,11 +3033,10 @@ ppc_elf_size_dynamic_sections (output_bfd, info) } 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; +update_local_sym_info (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; @@ -3157,7 +3046,7 @@ update_local_sym_info (abfd, symtab_hdr, r_symndx, tls_type) 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); + local_got_refcounts = bfd_zalloc (abfd, size); if (local_got_refcounts == NULL) return FALSE; elf_local_got_refcounts (abfd) = local_got_refcounts; @@ -3170,14 +3059,12 @@ update_local_sym_info (abfd, symtab_hdr, r_symndx, tls_type) } static void -bad_shared_reloc (abfd, r_type) - bfd *abfd; - enum elf_ppc_reloc_type r_type; +bad_shared_reloc (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); + ppc_elf_howto_table[r_type]->name); bfd_set_error (bfd_error_bad_value); } @@ -3186,11 +3073,10 @@ bad_shared_reloc (abfd, r_type) table. */ static bfd_boolean -ppc_elf_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +ppc_elf_check_relocs (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { struct ppc_elf_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -3199,7 +3085,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel_end; asection *sreloc; - if (info->relocateable) + if (info->relocatable) return TRUE; #ifdef DEBUG @@ -3208,9 +3094,12 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) bfd_archive_filename (abfd)); #endif + /* Initialize howto table if not already done. */ + if (!ppc_elf_howto_table[R_PPC_ADDR32]) + ppc_elf_howto_init (); + /* Create the linker generated sections all the time so that the special symbols are created. */ - htab = ppc_elf_hash_table (info); if (htab->sdata == NULL) { @@ -3264,7 +3153,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) } } - r_type = (enum elf_ppc_reloc_type) ELF32_R_TYPE (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); switch (r_type) { case R_PPC_GOT_TLSLD16: @@ -3383,6 +3272,12 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) { /* It does not make sense to have a procedure linkage table entry for a local symbol. */ + (*_bfd_error_handler) (_("%s(%s+0x%lx): %s reloc against " + "local symbol"), + bfd_archive_filename (abfd), + sec->name, + (long) rel->r_offset, + ppc_elf_howto_table[r_type]->name); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -3540,7 +3435,9 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) struct ppc_elf_dyn_relocs **head; #ifdef DEBUG - fprintf (stderr, "ppc_elf_check_relocs need to create relocation for %s\n", + fprintf (stderr, + "ppc_elf_check_relocs needs to " + "create relocation for %s\n", (h && h->root.root.string ? h->root.root.string : "")); #endif @@ -3604,8 +3501,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) p = *head; if (p == NULL || p->sec != sec) { - p = ((struct ppc_elf_dyn_relocs *) - bfd_alloc (htab->elf.dynobj, sizeof *p)); + p = bfd_alloc (htab->elf.dynobj, sizeof *p); if (p == NULL) return FALSE; p->next = *head; @@ -3631,12 +3527,11 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -ppc_elf_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +ppc_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) { @@ -3671,11 +3566,10 @@ ppc_elf_gc_mark_hook (sec, info, rel, h, sym) section being removed. */ static bfd_boolean -ppc_elf_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +ppc_elf_gc_sweep_hook (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { struct ppc_elf_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -3715,7 +3609,7 @@ ppc_elf_gc_sweep_hook (abfd, info, sec, relocs) } } - r_type = (enum elf_ppc_reloc_type) ELF32_R_TYPE (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); switch (r_type) { case R_PPC_GOT_TLSLD16: @@ -3796,9 +3690,7 @@ ppc_elf_gc_sweep_hook (abfd, info, sec, relocs) /* Set htab->tls_sec and htab->tls_get_addr. */ bfd_boolean -ppc_elf_tls_setup (obfd, info) - bfd *obfd; - struct bfd_link_info *info; +ppc_elf_tls_setup (bfd *obfd, struct bfd_link_info *info) { asection *tls; struct ppc_elf_link_hash_table *htab; @@ -3820,15 +3712,14 @@ ppc_elf_tls_setup (obfd, info) opportunities. */ bfd_boolean -ppc_elf_tls_optimize (obfd, info) - bfd *obfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +ppc_elf_tls_optimize (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) + if (info->relocatable || info->shared) return TRUE; htab = ppc_elf_hash_table (info); @@ -3844,8 +3735,7 @@ ppc_elf_tls_optimize (obfd, info) int expecting_tls_get_addr; /* Read the relocations. */ - relstart = _bfd_elf_link_read_relocs (ibfd, sec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, + relstart = _bfd_elf_link_read_relocs (ibfd, sec, NULL, NULL, info->keep_memory); if (relstart == NULL) return FALSE; @@ -3878,7 +3768,7 @@ ppc_elf_tls_optimize (obfd, info) || !(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); + r_type = ELF32_R_TYPE (rel->r_info); switch (r_type) { case R_PPC_GOT_TLSLD16: @@ -4015,17 +3905,16 @@ ppc_elf_tls_optimize (obfd, info) file. We use it to put .comm items in .sbss, and not .bss. */ static bfd_boolean -ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) - bfd *abfd; - struct bfd_link_info *info; - const Elf_Internal_Sym *sym; - const char **namep ATTRIBUTE_UNUSED; - flagword *flagsp ATTRIBUTE_UNUSED; - asection **secp; - bfd_vma *valp; +ppc_elf_add_symbol_hook (bfd *abfd, + struct bfd_link_info *info, + const Elf_Internal_Sym *sym, + const char **namep ATTRIBUTE_UNUSED, + flagword *flagsp ATTRIBUTE_UNUSED, + asection **secp, + bfd_vma *valp) { if (sym->st_shndx == SHN_COMMON - && !info->relocateable + && !info->relocatable && sym->st_size <= elf_gp_size (abfd) && info->hash->creator->flavour == bfd_target_elf_flavour) { @@ -4043,17 +3932,16 @@ ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) 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); + sdata->bss_section = bfd_zalloc (abfd, amt); if (sdata->bss_section == NULL) return FALSE; sdata->bss_section->name = sdata->bss_name; sdata->bss_section->flags = SEC_IS_COMMON; sdata->bss_section->output_section = sdata->bss_section; amt = sizeof (asymbol); - sdata->bss_section->symbol = (asymbol *) bfd_zalloc (abfd, amt); + sdata->bss_section->symbol = bfd_zalloc (abfd, amt); amt = sizeof (asymbol *); - sdata->bss_section->symbol_ptr_ptr = - (asymbol **) bfd_zalloc (abfd, amt); + sdata->bss_section->symbol_ptr_ptr = bfd_zalloc (abfd, amt); if (sdata->bss_section->symbol == NULL || sdata->bss_section->symbol_ptr_ptr == NULL) return FALSE; @@ -4074,11 +3962,10 @@ ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) dynamic sections here. */ static bfd_boolean -ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) - bfd *output_bfd; - struct bfd_link_info *info; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +ppc_elf_finish_dynamic_symbol (bfd *output_bfd, + struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { struct ppc_elf_link_hash_table *htab; @@ -4183,9 +4070,8 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) /* Finish up the dynamic sections. */ static bfd_boolean -ppc_elf_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +ppc_elf_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info) { asection *sdyn; struct ppc_elf_link_hash_table *htab; @@ -4241,10 +4127,10 @@ ppc_elf_finish_dynamic_sections (output_bfd, info) if (htab->got) { unsigned char *contents = htab->got->contents; - bfd_put_32 (output_bfd, (bfd_vma) 0x4e800021 /* blrl */, contents); + bfd_put_32 (output_bfd, 0x4e800021 /* blrl */, contents); if (sdyn == NULL) - bfd_put_32 (output_bfd, (bfd_vma) 0, contents + 4); + bfd_put_32 (output_bfd, 0, contents + 4); else bfd_put_32 (output_bfd, sdyn->output_section->vma + sdyn->output_offset, @@ -4265,7 +4151,7 @@ ppc_elf_finish_dynamic_sections (output_bfd, info) This function is responsible for adjust the section contents as necessary, and (if using Rela relocs and generating a - relocateable output file) adjusting the reloc addend as + relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -4279,23 +4165,21 @@ ppc_elf_finish_dynamic_sections (output_bfd, info) The global hash table entry for the global symbols can be found via elf_sym_hashes (input_bfd). - When generating relocateable output, this function must handle + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted accordingly. */ static bfd_boolean -ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, - contents, relocs, local_syms, local_sections) - bfd *output_bfd; - struct bfd_link_info *info; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - Elf_Internal_Rela *relocs; - Elf_Internal_Sym *local_syms; - asection **local_sections; +ppc_elf_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; @@ -4309,18 +4193,19 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_boolean ret = TRUE; #ifdef DEBUG - fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, %ld relocations%s\n", + fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, " + "%ld relocations%s\n", bfd_archive_filename (input_bfd), bfd_section_name(input_bfd, input_section), (long) input_section->reloc_count, - (info->relocateable) ? " (relocatable)" : ""); + (info->relocatable) ? " (relocatable)" : ""); #endif - if (info->relocateable) + if (info->relocatable) return TRUE; + /* Initialize howto table if not already done. */ if (!ppc_elf_howto_table[R_PPC_ADDR32]) - /* Initialize howto table if needed. */ ppc_elf_howto_init (); htab = ppc_elf_hash_table (info); @@ -4346,10 +4231,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, 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; + r_type = ELF32_R_TYPE (rel->r_info); + sym = NULL; + sec = NULL; + h = NULL; unresolved_reloc = FALSE; warned = FALSE; r_symndx = ELF32_R_SYM (rel->r_info); @@ -4542,8 +4427,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* 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_type2 = 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 @@ -4642,8 +4526,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, 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]; + if (r_type < R_PPC_max) + howto = ppc_elf_howto_table[r_type]; switch (r_type) { default: @@ -5010,7 +4894,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, int skip; #ifdef DEBUG - fprintf (stderr, "ppc_elf_relocate_section need to create relocation for %s\n", + fprintf (stderr, "ppc_elf_relocate_section needs to " + "create relocation for %s\n", (h && h->root.root.string ? h->root.root.string : "")); #endif @@ -5089,11 +4974,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT (indx > 0); #ifdef DEBUG if (indx <= 0) - { - printf ("indx=%d section=%s flags=%08x name=%s\n", - indx, osec->name, osec->flags, - h->root.root.string); - } + printf ("indx=%d section=%s flags=%08x name=%s\n", + indx, osec->name, osec->flags, + h->root.root.string); #endif } @@ -5146,7 +5029,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, 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 (sec != NULL); 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) @@ -5180,18 +5063,20 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, const char *name; const struct elf_link_hash_entry *sh; - BFD_ASSERT (sec != (asection *) 0); + BFD_ASSERT (sec != NULL); name = bfd_get_section_name (abfd, sec->output_section); if (! ((strncmp (name, ".sdata", 6) == 0 && (name[6] == 0 || name[6] == '.')) || (strncmp (name, ".sbss", 5) == 0 && (name[5] == 0 || name[5] == '.')))) { - (*_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, - howto->name, - name); + (*_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, + howto->name, + name); } sh = htab->sdata->sym_hash; addend -= (sh->root.u.def.value @@ -5206,16 +5091,18 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, const char *name; const struct elf_link_hash_entry *sh; - BFD_ASSERT (sec != (asection *) 0); + BFD_ASSERT (sec != NULL); name = bfd_get_section_name (abfd, sec->output_section); if (! (strncmp (name, ".sdata2", 7) == 0 || strncmp (name, ".sbss2", 6) == 0)) { - (*_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, - howto->name, - name); + (*_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, + howto->name, + name); bfd_set_error (bfd_error_bad_value); ret = FALSE; @@ -5236,7 +5123,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, const struct elf_link_hash_entry *sh; int reg; - BFD_ASSERT (sec != (asection *) 0); + BFD_ASSERT (sec != NULL); name = bfd_get_section_name (abfd, sec->output_section); if (((strncmp (name, ".sdata", 6) == 0 && (name[6] == 0 || name[6] == '.')) @@ -5268,11 +5155,13 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, else { - (*_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, - howto->name, - name); + (*_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, + howto->name, + name); bfd_set_error (bfd_error_bad_value); ret = FALSE; @@ -5293,7 +5182,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC_SECTOFF_LO: case R_PPC_SECTOFF_HI: case R_PPC_SECTOFF_HA: - BFD_ASSERT (sec != (asection *) 0); + BFD_ASSERT (sec != NULL); addend -= sec->output_section->vma; break; @@ -5362,7 +5251,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } #ifdef DEBUG - fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, offset = %ld, addend = %ld\n", + fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, " + "offset = %ld, addend = %ld\n", howto->name, (int) r_type, sym_name, @@ -5443,10 +5333,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } static enum elf_reloc_type_class -ppc_elf_reloc_type_class (rela) - const Elf_Internal_Rela *rela; +ppc_elf_reloc_type_class (const Elf_Internal_Rela *rela) { - switch ((int) ELF32_R_TYPE (rela->r_info)) + switch (ELF32_R_TYPE (rela->r_info)) { case R_PPC_RELATIVE: return reloc_class_relative; @@ -5464,9 +5353,7 @@ ppc_elf_reloc_type_class (rela) /* Support for core dump NOTE sections. */ static bfd_boolean -ppc_elf_grok_prstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +ppc_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) { int offset; unsigned int raw_size; @@ -5496,9 +5383,7 @@ ppc_elf_grok_prstatus (abfd, note) } static bfd_boolean -ppc_elf_grok_psinfo (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +ppc_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) { switch (note->descsz) { @@ -5535,31 +5420,17 @@ typedef struct apuinfo_list } 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 unsigned long apuinfo_list_element PARAMS ((unsigned long)); -static void apuinfo_list_finish PARAMS ((void)); - -extern void ppc_elf_begin_write_processing - PARAMS ((bfd *, struct bfd_link_info *)); -extern void ppc_elf_final_write_processing - PARAMS ((bfd *, bfd_boolean)); -extern bfd_boolean ppc_elf_write_section - PARAMS ((bfd *, asection *, bfd_byte *)); +static apuinfo_list *head; static void -apuinfo_list_init PARAMS ((void)) +apuinfo_list_init (void) { head = NULL; } static void -apuinfo_list_add (value) - unsigned long value; +apuinfo_list_add (unsigned long value) { apuinfo_list *entry = head; @@ -5580,7 +5451,7 @@ apuinfo_list_add (value) } static unsigned -apuinfo_list_length PARAMS ((void)) +apuinfo_list_length (void) { apuinfo_list *entry; unsigned long count; @@ -5594,8 +5465,7 @@ apuinfo_list_length PARAMS ((void)) } static inline unsigned long -apuinfo_list_element (number) - unsigned long number; +apuinfo_list_element (unsigned long number) { apuinfo_list * entry; @@ -5608,7 +5478,7 @@ apuinfo_list_element (number) } static void -apuinfo_list_finish PARAMS ((void)) +apuinfo_list_finish (void) { apuinfo_list *entry; @@ -5628,10 +5498,8 @@ apuinfo_list_finish PARAMS ((void)) /* Scan the input BFDs and create a linked list of the APUinfo values that will need to be emitted. */ -void -ppc_elf_begin_write_processing (abfd, link_info) - bfd *abfd; - struct bfd_link_info *link_info; +static void +ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info) { bfd *ibfd; asection *asec; @@ -5721,9 +5589,9 @@ ppc_elf_begin_write_processing (abfd, link_info) if (strcmp (ptr + 12, APUINFO_LABEL) != 0) goto fail; - /* Get the number of apuinfo entries. */ + /* Get the number of bytes used for apuinfo entries. */ datum = bfd_get_32 (ibfd, ptr + 4); - if ((datum * 4 + 20) != length) + if (datum + 20 != length) goto fail; /* Make sure that we do not run off the end of the section. */ @@ -5731,8 +5599,8 @@ ppc_elf_begin_write_processing (abfd, link_info) goto fail; /* Scan the apuinfo section, building a list of apuinfo numbers. */ - for (i = 0; i < datum; i++) - apuinfo_list_add (bfd_get_32 (ibfd, ptr + 20 + (i * 4))); + for (i = 0; i < datum; i += 4) + apuinfo_list_add (bfd_get_32 (ibfd, ptr + 20 + i)); /* Update the offset. */ offset += length; @@ -5762,11 +5630,10 @@ ppc_elf_begin_write_processing (abfd, link_info) /* Prevent the output section from accumulating the input sections' contents. We have already stored this in our linked list structure. */ -bfd_boolean -ppc_elf_write_section (abfd, asec, contents) - bfd *abfd ATTRIBUTE_UNUSED; - asection *asec; - bfd_byte *contents ATTRIBUTE_UNUSED; +static bfd_boolean +ppc_elf_write_section (bfd *abfd ATTRIBUTE_UNUSED, + asection *asec, + bfd_byte *contents ATTRIBUTE_UNUSED) { return (apuinfo_list_length () && strcmp (asec->name, APUINFO_SECTION_NAME) == 0); @@ -5775,10 +5642,8 @@ ppc_elf_write_section (abfd, asec, contents) /* Finally we can generate the output section. */ -void -ppc_elf_final_write_processing (abfd, linker) - bfd *abfd; - bfd_boolean linker ATTRIBUTE_UNUSED; +static void +ppc_elf_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED) { bfd_byte *buffer; asection *asec; @@ -5808,7 +5673,7 @@ ppc_elf_final_write_processing (abfd, linker) /* Create the apuinfo header. */ num_entries = apuinfo_list_length (); bfd_put_32 (abfd, sizeof APUINFO_LABEL, buffer); - bfd_put_32 (abfd, num_entries, buffer + 4); + bfd_put_32 (abfd, num_entries * 4, buffer + 4); bfd_put_32 (abfd, 0x2, buffer + 8); strcpy (buffer + 12, APUINFO_LABEL); diff --git a/bfd/elf32-ppc.h b/bfd/elf32-ppc.h index ead9c944d69..72be813a804 100644 --- a/bfd/elf32-ppc.h +++ b/bfd/elf32-ppc.h @@ -17,7 +17,5 @@ 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. */ -bfd_boolean ppc_elf_tls_setup - PARAMS ((bfd *, struct bfd_link_info *)); -bfd_boolean ppc_elf_tls_optimize - PARAMS ((bfd *, struct bfd_link_info *)); +bfd_boolean ppc_elf_tls_setup (bfd *, struct bfd_link_info *); +bfd_boolean ppc_elf_tls_optimize (bfd *, struct bfd_link_info *); diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 9475f60a669..50d430dba99 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -895,7 +895,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) bfd_signed_vma *local_got_refcounts; int tls_type, old_tls_type; - if (info->relocateable) + if (info->relocatable) return TRUE; htab = elf_s390_hash_table (info); @@ -1927,7 +1927,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) if (htab->elf.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); if (s == NULL) @@ -2085,7 +2085,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) #define add_dynamic_entry(TAG, VAL) \ bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) - if (! info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) return FALSE; @@ -2198,7 +2198,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; htab = elf_s390_hash_table (info); diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 4ff31bfb695..af8dd6718a6 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -2034,7 +2034,7 @@ sh_elf_relax_section (abfd, sec, link_info, again) *again = FALSE; - if (link_info->relocateable + if (link_info->relocatable || (sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0) return TRUE; @@ -4338,7 +4338,7 @@ sh_elf_size_dynamic_sections (output_bfd, info) if (htab->root.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); @@ -4500,7 +4500,7 @@ sh_elf_size_dynamic_sections (output_bfd, info) #define add_dynamic_entry(TAG, VAL) \ bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) - if (! info->shared) + if (info->executable) { if (! add_dynamic_entry (DT_DEBUG, 0)) return FALSE; @@ -4650,9 +4650,9 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, (info, _("Unexpected STO_SH5_ISA32 on local symbol is not handled"), input_bfd, input_section, rel->r_offset)); - if (info->relocateable) + if (info->relocatable) { - /* This is a relocateable link. We don't have to change + /* This is a relocatable link. We don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ @@ -4721,8 +4721,8 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, { /* Section symbol are never (?) placed in the hash table, so we can just ignore hash relocations when creating a - relocateable object file. */ - if (info->relocateable) + relocatable object file. */ + if (info->relocatable) continue; h = sym_hashes[r_symndx - symtab_hdr->sh_info]; @@ -5718,12 +5718,12 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, static bfd_byte * sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order, - data, relocateable, symbols) + data, relocatable, symbols) bfd *output_bfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - bfd_boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { Elf_Internal_Shdr *symtab_hdr; @@ -5735,11 +5735,11 @@ sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order, /* We only need to handle the case of relaxing, or of having a particular set of section contents, specially. */ - if (relocateable + if (relocatable || elf_section_data (input_section)->this_hdr.contents == NULL) return bfd_generic_get_relocated_section_contents (output_bfd, link_info, link_order, data, - relocateable, + relocatable, symbols); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -6211,7 +6211,7 @@ sh_elf_check_relocs (abfd, info, sec, relocs) srelgot = NULL; sreloc = NULL; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c index 1a2acc1c7c8..4728842ac0d 100644 --- a/bfd/elf32-sh64.c +++ b/bfd/elf32-sh64.c @@ -403,11 +403,11 @@ sh64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) { struct elf_link_hash_entry *h; - /* For relocateable links, we register the DataLabel sym in its own + /* For relocatable links, we register the DataLabel sym in its own right, and tweak the name when it's output. Otherwise, we make an indirect symbol of it. */ flagword flags - = info->relocateable || info->emitrelocations + = info->relocatable || info->emitrelocations ? BSF_GLOBAL : BSF_GLOBAL | BSF_INDIRECT; char *dl_name @@ -451,9 +451,9 @@ sh64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) free (dl_name); if (h->type != STT_DATALABEL - || ((info->relocateable || info->emitrelocations) + || ((info->relocatable || info->emitrelocations) && h->root.type != bfd_link_hash_undefined) - || (! info->relocateable && !info->emitrelocations + || (! info->relocatable && !info->emitrelocations && h->root.type != bfd_link_hash_indirect)) { /* Make sure we don't get confused on invalid input. */ @@ -498,7 +498,7 @@ sh64_elf_link_output_symbol_hook (abfd, info, cname, sym, input_sec) { char *name = (char *) cname; - if (info->relocateable || info->emitrelocations) + if (info->relocatable || info->emitrelocations) { if (ELF_ST_TYPE (sym->st_info) == STT_DATALABEL) name[strlen (name) - strlen (DATALABEL_SUFFIX)] = 0; diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index e2c65448150..83d4c47187f 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -862,7 +862,7 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) asection *sreloc; bfd_boolean checked_tlsgd = FALSE; - if (info->relocateable) + if (info->relocatable) return TRUE; htab = elf32_sparc_hash_table (info); @@ -1820,7 +1820,7 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); @@ -1997,7 +1997,7 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) #define add_dynamic_entry(TAG, VAL) \ bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) - if (!info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) return FALSE; @@ -2126,7 +2126,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; htab = elf32_sparc_hash_table (info); diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index 62bbbdacf21..e41d0c0d7c4 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -189,7 +189,7 @@ static reloc_howto_type v850_elf_howto_table[] = FALSE), /* pcrel_offset */ /* Simple 32bit reloc. */ - HOWTO (R_V850_32, /* type */ + HOWTO (R_V850_ABS32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ @@ -197,7 +197,7 @@ static reloc_howto_type v850_elf_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ v850_elf_reloc, /* special_function */ - "R_V850_32", /* name */ + "R_V850_ABS32", /* name */ FALSE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ @@ -518,6 +518,21 @@ static reloc_howto_type v850_elf_howto_table[] = 0, /* src_mask */ 0, /* dst_mask */ TRUE), /* pcrel_offset */ + + /* Simple pc-relative 32bit reloc. */ + HOWTO (R_V850_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + v850_elf_reloc, /* special_function */ + "R_V850_REL32", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; /* Map BFD reloc types to V850 ELF reloc types. */ @@ -538,7 +553,8 @@ static const struct v850_elf_reloc_map v850_elf_reloc_map[] = { BFD_RELOC_HI16_S, R_V850_HI16_S }, { BFD_RELOC_HI16, R_V850_HI16 }, { BFD_RELOC_LO16, R_V850_LO16 }, - { BFD_RELOC_32, R_V850_32 }, + { BFD_RELOC_32, R_V850_ABS32 }, + { BFD_RELOC_32_PCREL, R_V850_REL32 }, { BFD_RELOC_16, R_V850_16 }, { BFD_RELOC_8, R_V850_8 }, { BFD_RELOC_V850_SDA_16_16_OFFSET, R_V850_SDA_16_16_OFFSET }, @@ -636,7 +652,7 @@ v850_elf_check_relocs (abfd, info, sec, relocs) int other = 0; const char *common = (const char *)0; - if (info->relocateable) + if (info->relocatable) return TRUE; #ifdef DEBUG @@ -672,7 +688,8 @@ v850_elf_check_relocs (abfd, info, sec, relocs) case R_V850_HI16_S: case R_V850_HI16: case R_V850_LO16: - case R_V850_32: + case R_V850_ABS32: + case R_V850_REL32: case R_V850_16: case R_V850_8: case R_V850_CALLT_6_7_OFFSET: @@ -905,7 +922,8 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) /* fprintf (stderr, "reloc type %d not SUPPORTED\n", r_type ); */ return bfd_reloc_notsupported; - case R_V850_32: + case R_V850_REL32: + case R_V850_ABS32: bfd_put_32 (abfd, addend, address); return bfd_reloc_ok; @@ -1466,11 +1484,17 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, value = SEXT24 (value); break; + case R_V850_REL32: + value -= (input_section->output_section->vma + + input_section->output_offset + + offset); + break; + case R_V850_HI16_S: case R_V850_HI16: case R_V850_LO16: case R_V850_16: - case R_V850_32: + case R_V850_ABS32: case R_V850_8: break; @@ -1608,7 +1632,7 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; @@ -2496,7 +2520,7 @@ v850_elf_relax_section (abfd, sec, link_info, again) *again = FALSE; - if (link_info->relocateable + if (link_info->relocatable || (sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0) return TRUE; diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index 1aca042c61c..3ad97478856 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -578,7 +578,7 @@ elf_vax_check_relocs (abfd, info, sec, relocs) asection *srelgot; asection *sreloc; - if (info->relocateable) + if (info->relocatable) return TRUE; dynobj = elf_hash_table (info)->dynobj; @@ -1440,7 +1440,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; dynobj = elf_hash_table (info)->dynobj; diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c index c05c186cbc2..af9a04882fe 100644 --- a/bfd/elf32-xstormy16.c +++ b/bfd/elf32-xstormy16.c @@ -1,5 +1,5 @@ /* XSTORMY16-specific support for 32-bit ELF. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -423,7 +423,7 @@ xstormy16_elf_check_relocs (abfd, info, sec, relocs) asection *splt; bfd *dynobj; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata(abfd)->symtab_hdr; @@ -609,7 +609,7 @@ xstormy16_elf_relax_section (dynobj, splt, info, again) /* Assume nothing changes. */ *again = FALSE; - if (info->relocateable) + if (info->relocatable) return TRUE; /* We only relax the .plt section at the moment. */ @@ -739,7 +739,7 @@ xstormy16_elf_always_size_sections (output_bfd, info) bfd *dynobj; asection *splt; - if (info->relocateable) + if (info->relocatable) return TRUE; dynobj = elf_hash_table (info)->dynobj; @@ -766,7 +766,7 @@ xstormy16_elf_always_size_sections (output_bfd, info) zero. This function is responsible for adjusting the section contents as - necessary, and (if using Rela relocs and generating a relocateable + necessary, and (if using Rela relocs and generating a relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -780,7 +780,7 @@ xstormy16_elf_always_size_sections (output_bfd, info) The global hash table entry for the global symbols can be found via elf_sym_hashes (input_bfd). - When generating relocateable output, this function must handle + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted @@ -805,7 +805,7 @@ xstormy16_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd *dynobj; asection *splt; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index b277540107c..1f8d86de223 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -127,7 +127,7 @@ static char *build_encoding_error_message PARAMS ((xtensa_opcode, xtensa_encode_result)); static bfd_reloc_status_type bfd_elf_xtensa_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static void do_fix_for_relocateable_link +static void do_fix_for_relocatable_link PARAMS ((Elf_Internal_Rela *, bfd *, asection *)); static void do_fix_for_final_link PARAMS ((Elf_Internal_Rela *, asection *, bfd_vma *)); @@ -609,7 +609,7 @@ elf_xtensa_check_relocs (abfd, info, sec, relocs) property_table_entry *lit_table; int ltblsize; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -1662,7 +1662,7 @@ bfd_elf_xtensa_reloc (abfd, reloc_entry, symbol, data, input_section, asection *reloc_target_output_section; bfd_boolean is_weak_undef; - /* ELF relocs are against symbols. If we are producing relocateable + /* ELF relocs are against symbols. If we are producing relocatable output, and the reloc is against an external symbol, the resulting reloc will also be against the same symbol. In such a case, we don't want to change anything about the way the reloc is handled, @@ -1841,7 +1841,7 @@ xtensa_elf_dynamic_symbol_p (info, h) /* Relocate an Xtensa ELF section. This is invoked by the linker for - both relocateable and final links. */ + both relocatable and final links. */ static bfd_boolean elf_xtensa_relocate_section (output_bfd, info, input_bfd, @@ -1909,9 +1909,9 @@ elf_xtensa_relocate_section (output_bfd, info, input_bfd, r_symndx = ELF32_R_SYM (rel->r_info); - if (info->relocateable) + if (info->relocatable) { - /* This is a relocateable link. + /* This is a relocatable link. 1) If the reloc is against a section symbol, adjust according to the output section. 2) If there is a new target for this relocation, @@ -1922,7 +1922,7 @@ elf_xtensa_relocate_section (output_bfd, info, input_bfd, if (relaxing_section) { /* Check if this references a section in another input file. */ - do_fix_for_relocateable_link (rel, input_bfd, input_section); + do_fix_for_relocatable_link (rel, input_bfd, input_section); r_type = ELF32_R_TYPE (rel->r_info); } @@ -1934,7 +1934,7 @@ elf_xtensa_relocate_section (output_bfd, info, input_bfd, r_type = ELF32_R_TYPE (rel->r_info); } - /* This is a relocateable link, so we don't have to change + /* This is a relocatable link, so we don't have to change anything unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ @@ -1950,7 +1950,7 @@ elf_xtensa_relocate_section (output_bfd, info, input_bfd, /* If there is an addend with a partial_inplace howto, then move the addend to the contents. This is a hack - to work around problems with DWARF in relocateable links + to work around problems with DWARF in relocatable links with some previous version of BFD. Now we can't easily get rid of the hack without breaking backward compatibility.... */ if (rel->r_addend) @@ -1973,7 +1973,7 @@ elf_xtensa_relocate_section (output_bfd, info, input_bfd, } } - /* Done with work for relocateable link; continue with next reloc. */ + /* Done with work for relocatable link; continue with next reloc. */ continue; } @@ -2465,7 +2465,7 @@ elf_xtensa_finish_dynamic_sections (output_bfd, info) } /* Combine adjacent literal table entries. */ - BFD_ASSERT (! info->relocateable); + BFD_ASSERT (! info->relocatable); num_xtlit_entries = elf_xtensa_combine_prop_entries (output_bfd, ".xt.lit"); if (num_xtlit_entries < 0) return FALSE; @@ -4431,10 +4431,10 @@ is_resolvable_asm_expansion (abfd, sec, contents, irel, link_info, if (!target_sec->output_section) return FALSE; - /* For relocateable sections, we can only simplify when the output + /* For relocatable sections, we can only simplify when the output section of the target is the same as the output section of the source. */ - if (link_info->relocateable + if (link_info->relocatable && (target_sec->output_section != sec->output_section)) return FALSE; @@ -5345,7 +5345,7 @@ relax_section_symbols (abfd, sec) /* "Fix" handling functions, called while performing relocations. */ static void -do_fix_for_relocateable_link (rel, input_bfd, input_section) +do_fix_for_relocatable_link (rel, input_bfd, input_section) Elf_Internal_Rela *rel; bfd *input_bfd; asection *input_section; diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 9ce3bf3b56a..767d89c4072 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -2058,7 +2058,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) /* We are not currently changing any sizes, so only one pass. */ *again = FALSE; - if (link_info->relocateable + if (link_info->relocatable || (sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0) return TRUE; @@ -2465,7 +2465,7 @@ elf64_alpha_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd_vma *valp; { if (sym->st_shndx == SHN_COMMON - && !info->relocateable + && !info->relocatable && sym->st_size <= elf_gp_size (abfd)) { /* Common symbols less than or equal to -G nn bytes are @@ -3057,7 +3057,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) bfd_boolean got_created; bfd_size_type amt; - if (info->relocateable) + if (info->relocatable) return TRUE; dynobj = elf_hash_table(info)->dynobj; @@ -3863,7 +3863,7 @@ elf64_alpha_always_size_sections (output_bfd, info) { bfd *i; - if (info->relocateable) + if (info->relocatable) return TRUE; /* First, take care of the indirect symbols created by versioning. */ @@ -4090,7 +4090,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (!info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); @@ -4176,7 +4176,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) #define add_dynamic_entry(TAG, VAL) \ bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) - if (!info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) return FALSE; @@ -4330,7 +4330,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, const char *section_name; /* Handle relocatable links with a smaller loop. */ - if (info->relocateable) + if (info->relocatable) return elf64_alpha_relocate_section_r (output_bfd, info, input_bfd, input_section, contents, relocs, local_syms, local_sections); diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 8ce5b20f3f7..4c88a543a37 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -599,7 +599,7 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs) size_t buf_len; int sec_symndx; - if (info->relocateable) + if (info->relocatable) return TRUE; /* If this is the first dynamic object found in the link, create diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index a43b3da9f70..bec1acaa1c3 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -1447,15 +1447,17 @@ mips_elf64_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, want to change anything. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) + && (symbol->flags & BSF_LOCAL) != 0) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } - if (((reloc_entry->addend & 0xffff) + 0x8000) & ~0xffff) - reloc_entry->addend += 0x8000; + if (reloc_entry->howto->partial_inplace) + { + if (((reloc_entry->addend & 0xffff) + 0x8000) & ~0xffff) + reloc_entry->addend += 0x8000; + } return bfd_reloc_continue; } @@ -1488,7 +1490,8 @@ mips_elf64_got16_reloc (abfd, reloc_entry, symbol, data, input_section, /* If we're relocating, and this is a local symbol, we can handle it just like an R_MIPS_HI16. */ if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) != 0) + && ((symbol->flags & BSF_SECTION_SYM) != 0 + || (symbol->flags & BSF_LOCAL) == 0)) return mips_elf64_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); @@ -1553,18 +1556,18 @@ mips_elf64_assign_gp (output_bfd, pgp) symbol value correctly. We look up the symbol _gp in the output BFD. If we can't find it, we're stuck. We cache it in the ELF target data. We don't need to adjust the symbol value for an - external symbol if we are producing relocateable output. */ + external symbol if we are producing relocatable output. */ static bfd_reloc_status_type -mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message, pgp) +mips_elf64_final_gp (output_bfd, symbol, relocatable, error_message, pgp) bfd *output_bfd; asymbol *symbol; - bfd_boolean relocateable; + bfd_boolean relocatable; char **error_message; bfd_vma *pgp; { if (bfd_is_und_section (symbol->section) - && ! relocateable) + && ! relocatable) { *pgp = 0; return bfd_reloc_undefined; @@ -1572,10 +1575,10 @@ mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message, pgp) *pgp = _bfd_get_gp_value (output_bfd); if (*pgp == 0 - && (! relocateable + && (! relocatable || (symbol->flags & BSF_SECTION_SYM) != 0)) { - if (relocateable) + if (relocatable) { /* Make up a value. */ *pgp = symbol->section->output_section->vma /*+ 0x4000*/; @@ -1606,38 +1609,35 @@ mips_elf64_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, bfd *output_bfd; char **error_message; { - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_reloc_status_type ret; bfd_vma gp; - /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ELF - file. */ + /* If we're relocating, and this is an external symbol, we don't want + to change anything. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) + && (symbol->flags & BSF_LOCAL) != 0) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } if (output_bfd != (bfd *) NULL) - relocateable = TRUE; + relocatable = TRUE; else { - relocateable = FALSE; + relocatable = FALSE; output_bfd = symbol->section->output_section->owner; } - ret = mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message, + ret = mips_elf64_final_gp (output_bfd, symbol, relocatable, error_message, &gp); if (ret != bfd_reloc_ok) return ret; return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, - input_section, relocateable, + input_section, relocatable, data, gp); } @@ -1654,7 +1654,7 @@ mips_elf64_literal_reloc (abfd, reloc_entry, symbol, data, input_section, bfd *output_bfd; char **error_message; { - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_reloc_status_type ret; bfd_vma gp; @@ -1662,8 +1662,7 @@ mips_elf64_literal_reloc (abfd, reloc_entry, symbol, data, input_section, want to change anything. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) + && (symbol->flags & BSF_LOCAL) != 0) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; @@ -1671,20 +1670,20 @@ mips_elf64_literal_reloc (abfd, reloc_entry, symbol, data, input_section, /* FIXME: The entries in the .lit8 and .lit4 sections should be merged. */ if (output_bfd != (bfd *) NULL) - relocateable = TRUE; + relocatable = TRUE; else { - relocateable = FALSE; + relocatable = FALSE; output_bfd = symbol->section->output_section->owner; } - ret = mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message, + ret = mips_elf64_final_gp (output_bfd, symbol, relocatable, error_message, &gp); if (ret != bfd_reloc_ok) return ret; return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, - input_section, relocateable, + input_section, relocatable, data, gp); } @@ -1702,19 +1701,17 @@ mips_elf64_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, bfd *output_bfd; char **error_message; { - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_reloc_status_type ret; bfd_vma gp; bfd_vma relocation; - unsigned long val; + bfd_vma val; - /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ELF - file. */ + /* If we're relocating, and this is an external symbol, we don't want + to change anything. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) + && (symbol->flags & BSF_LOCAL) != 0) { *error_message = (char *) _("32bits gp relative relocation occurs for an external symbol"); @@ -1722,21 +1719,18 @@ mips_elf64_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, } if (output_bfd != (bfd *) NULL) - { - relocateable = TRUE; - gp = _bfd_get_gp_value (output_bfd); - } + relocatable = TRUE; else { - relocateable = FALSE; + relocatable = FALSE; output_bfd = symbol->section->output_section->owner; - - ret = mips_elf64_final_gp (output_bfd, symbol, relocateable, - error_message, &gp); - if (ret != bfd_reloc_ok) - return ret; } + ret = mips_elf64_final_gp (output_bfd, symbol, relocatable, + error_message, &gp); + if (ret != bfd_reloc_ok) + return ret; + if (bfd_is_com_section (symbol->section)) relocation = 0; else @@ -1748,27 +1742,25 @@ mips_elf64_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, if (reloc_entry->address > input_section->_cooked_size) return bfd_reloc_outofrange; - if (reloc_entry->howto->src_mask == 0) - { - /* This case arises with the 64-bit MIPS ELF ABI. */ - val = 0; - } - else - val = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - /* Set val to the offset into the section or symbol. */ - val += reloc_entry->addend; + val = reloc_entry->addend; + + if (reloc_entry->howto->partial_inplace) + val += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); /* Adjust val for the final section location and GP value. If we - are producing relocateable output, we don't want to do this for + are producing relocatable output, we don't want to do this for an external symbol. */ - if (! relocateable + if (! relocatable || (symbol->flags & BSF_SECTION_SYM) != 0) val += relocation - gp; - bfd_put_32 (abfd, val, (bfd_byte *) data + reloc_entry->address); + if (reloc_entry->howto->partial_inplace) + bfd_put_32 (abfd, val, (bfd_byte *) data + reloc_entry->address); + else + reloc_entry->addend = val; - if (relocateable) + if (relocatable) reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; @@ -1792,15 +1784,17 @@ mips_elf64_shift6_reloc (abfd, reloc_entry, symbol, data, input_section, want to change anything. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) + && (symbol->flags & BSF_LOCAL) != 0) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } - reloc_entry->addend = (reloc_entry->addend & 0x00007c0) - | (reloc_entry->addend & 0x00000800) >> 9; + if (reloc_entry->howto->partial_inplace) + { + reloc_entry->addend = ((reloc_entry->addend & 0x00007c0) + | (reloc_entry->addend & 0x00000800) >> 9); + } return bfd_reloc_continue; } @@ -1854,33 +1848,33 @@ mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, bfd *output_bfd; char **error_message; { - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_reloc_status_type ret; bfd_vma gp; - unsigned short extend, insn; - unsigned long final; + unsigned short extend = 0; + unsigned short insn = 0; + bfd_signed_vma val; + bfd_vma relocation; /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ELF - file. */ + addend, we don't want to change anything. */ if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) + && (symbol->flags & BSF_LOCAL) != 0) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } if (output_bfd != NULL) - relocateable = TRUE; + relocatable = TRUE; else { - relocateable = FALSE; + relocatable = FALSE; output_bfd = symbol->section->output_section->owner; } - ret = mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message, + ret = mips_elf64_final_gp (output_bfd, symbol, relocatable, error_message, &gp); if (ret != bfd_reloc_ok) return ret; @@ -1888,33 +1882,55 @@ mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, if (reloc_entry->address > input_section->_cooked_size) return bfd_reloc_outofrange; - /* Pick up the mips16 extend instruction and the real instruction. */ - extend = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address); - insn = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address + 2); - - /* Stuff the current addend back as a 32 bit value, do the usual - relocation, and then clean up. */ - bfd_put_32 (abfd, - (bfd_vma) (((extend & 0x1f) << 11) - | (extend & 0x7e0) - | (insn & 0x1f)), - (bfd_byte *) data + reloc_entry->address); - - ret = _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, - input_section, relocateable, data, gp); - - final = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - bfd_put_16 (abfd, - (bfd_vma) ((extend & 0xf800) - | ((final >> 11) & 0x1f) - | (final & 0x7e0)), - (bfd_byte *) data + reloc_entry->address); - bfd_put_16 (abfd, - (bfd_vma) ((insn & 0xffe0) - | (final & 0x1f)), - (bfd_byte *) data + reloc_entry->address + 2); + if (bfd_is_com_section (symbol->section)) + relocation = 0; + else + relocation = symbol->value; - return ret; + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + + /* Set val to the offset into the section or symbol. */ + val = reloc_entry->addend; + + if (reloc_entry->howto->partial_inplace) + { + /* Pick up the mips16 extend instruction and the real instruction. */ + extend = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address); + insn = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address + 2); + val += ((extend & 0x1f) << 11) | (extend & 0x7e0) | (insn & 0x1f); + } + + _bfd_mips_elf_sign_extend(val, 16); + + /* Adjust val for the final section location and GP value. If we + are producing relocatable output, we don't want to do this for + an external symbol. */ + if (! relocatable + || (symbol->flags & BSF_SECTION_SYM) != 0) + val += relocation - gp; + + if (reloc_entry->howto->partial_inplace) + { + bfd_put_16 (abfd, + (bfd_vma) ((extend & 0xf800) + | ((val >> 11) & 0x1f) + | (val & 0x7e0)), + (bfd_byte *) data + reloc_entry->address); + bfd_put_16 (abfd, + (bfd_vma) ((insn & 0xffe0) + | (val & 0x1f)), + (bfd_byte *) data + reloc_entry->address + 2); + } + else + reloc_entry->addend = val; + + if (relocatable) + reloc_entry->address += input_section->output_offset; + else if (((val & ~0xffff) != ~0xffff) && ((val & ~0xffff) != 0)) + return bfd_reloc_overflow; + + return bfd_reloc_ok; } /* A mapping from BFD reloc types to MIPS ELF reloc types. */ diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index d0213e6a493..54c4ca892b8 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -1229,9 +1229,9 @@ mmix_elf_relocate_section (output_bfd, info, input_bfd, input_section, r_symndx = ELF64_R_SYM (rel->r_info); - if (info->relocateable) + if (info->relocatable) { - /* This is a relocateable link. We don't have to change + /* This is a relocatable link. We don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ @@ -1669,7 +1669,7 @@ mmix_elf_check_common_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - if (info->relocateable) + if (info->relocatable) return TRUE; /* We currently have to abuse this COFF-specific member, since there's @@ -1780,7 +1780,7 @@ mmix_elf_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -2352,10 +2352,10 @@ mmix_elf_relax_section (abfd, sec, link_info, again) if (sec->_cooked_size == 0) sec->_cooked_size = sec->_raw_size; - /* We don't have to do anything for a relocateable link, if + /* We don't have to do anything for a relocatable link, if this section does not have relocs, or if this is not a code section. */ - if (link_info->relocateable + if (link_info->relocatable || (sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0 || (sec->flags & SEC_CODE) == 0 diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index f32d261fe6e..bc331c8be66 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -15,12 +15,13 @@ 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. */ +/* The 64-bit PowerPC ELF ABI may be found at + http://www.linuxbase.org/spec/ELF/ppc64/PPC-elf64abi.txt, and + http://www.linuxbase.org/spec/ELF/ppc64/spec/book1.html */ #include "bfd.h" #include "sysdep.h" @@ -30,36 +31,65 @@ #include "elf/ppc64.h" #include "elf64-ppc.h" -static void ppc_howto_init - PARAMS ((void)); -static reloc_howto_type *ppc64_elf_reloc_type_lookup - PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); -static void ppc64_elf_info_to_howto - PARAMS ((bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)); static bfd_reloc_status_type ppc64_elf_ha_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_brtaken_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_sectoff_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_sectoff_ha_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_toc_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_toc_ha_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_toc64_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_unhandled_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_boolean ppc64_elf_object_p - PARAMS ((bfd *)); -static bfd_boolean ppc64_elf_merge_private_bfd_data - PARAMS ((bfd *, bfd *)); -static bfd_boolean ppc64_elf_new_section_hook - PARAMS ((bfd *, asection *)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); +#define TARGET_LITTLE_SYM bfd_elf64_powerpcle_vec +#define TARGET_LITTLE_NAME "elf64-powerpcle" +#define TARGET_BIG_SYM bfd_elf64_powerpc_vec +#define TARGET_BIG_NAME "elf64-powerpc" +#define ELF_ARCH bfd_arch_powerpc +#define ELF_MACHINE_CODE EM_PPC64 +#define ELF_MAXPAGESIZE 0x10000 +#define elf_info_to_howto ppc64_elf_info_to_howto + +#define elf_backend_want_got_sym 0 +#define elf_backend_want_plt_sym 0 +#define elf_backend_plt_alignment 3 +#define elf_backend_plt_not_loaded 1 +#define elf_backend_got_symbol_offset 0 +#define elf_backend_got_header_size 8 +#define elf_backend_plt_header_size PLT_INITIAL_ENTRY_SIZE +#define elf_backend_can_gc_sections 1 +#define elf_backend_can_refcount 1 +#define elf_backend_rela_normal 1 + +#define bfd_elf64_bfd_reloc_type_lookup ppc64_elf_reloc_type_lookup +#define bfd_elf64_bfd_merge_private_bfd_data ppc64_elf_merge_private_bfd_data +#define bfd_elf64_new_section_hook ppc64_elf_new_section_hook +#define bfd_elf64_bfd_link_hash_table_create ppc64_elf_link_hash_table_create +#define bfd_elf64_bfd_link_hash_table_free ppc64_elf_link_hash_table_free + +#define elf_backend_object_p ppc64_elf_object_p +#define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections +#define elf_backend_copy_indirect_symbol ppc64_elf_copy_indirect_symbol +#define elf_backend_check_relocs ppc64_elf_check_relocs +#define elf_backend_gc_mark_hook ppc64_elf_gc_mark_hook +#define elf_backend_gc_sweep_hook ppc64_elf_gc_sweep_hook +#define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol +#define elf_backend_hide_symbol ppc64_elf_hide_symbol +#define elf_backend_always_size_sections ppc64_elf_func_desc_adjust +#define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections +#define elf_backend_relocate_section ppc64_elf_relocate_section +#define elf_backend_finish_dynamic_symbol ppc64_elf_finish_dynamic_symbol +#define elf_backend_reloc_type_class ppc64_elf_reloc_type_class +#define elf_backend_finish_dynamic_sections ppc64_elf_finish_dynamic_sections + /* The name of the dynamic interpreter. This is put in the .interp section. */ #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" @@ -77,7 +107,10 @@ static bfd_boolean ppc64_elf_new_section_hook #define TP_OFFSET 0x7000 #define DTP_OFFSET 0x8000 -/* .plt call stub instructions. */ +/* .plt call stub instructions. The normal stub is like this, but + sometimes the .plt entry crosses a 64k boundary and we need to + insert an addis to adjust r12. */ +#define PLT_CALL_STUB_SIZE (7*4) #define ADDIS_R12_R2 0x3d820000 /* addis %r12,%r2,xxx@ha */ #define STD_R2_40R1 0xf8410028 /* std %r2,40(%r1) */ #define LD_R11_0R12 0xe96c0000 /* ld %r11,xxx+0@l(%r12) */ @@ -86,19 +119,31 @@ static bfd_boolean ppc64_elf_new_section_hook /* ld %r11,xxx+16@l(%r12) */ #define BCTR 0x4e800420 /* bctr */ -/* The normal stub is this size. */ -#define PLT_CALL_STUB_SIZE (7*4) - -/* But sometimes the .plt entry crosses a 64k boundary, and we need - to adjust the high word with this insn. */ -#define ADDIS_R12_R12_1 0x3d8c0001 /* addis %r12,%r12,1 */ - -/* The .glink fixup call stub is the same as the .plt call stub, but - the first instruction restores r2, and the std is omitted. */ -#define LD_R2_40R1 0xe8410028 /* ld %r2,40(%r1) */ -/* Always allow this much space. */ -#define GLINK_CALL_STUB_SIZE (8*4) +#define ADDIS_R2_R2 0x3c420000 /* addis %r2,%r2,off@ha */ +#define ADDI_R2_R2 0x38420000 /* addi %r2,%r2,off@l */ + +#define LD_R2_40R1 0xe8410028 /* ld %r2,40(%r1) */ + +/* glink call stub instructions. We enter with the index in R0, and the + address of glink entry in CTR. From that, we can calculate PLT0. */ +#define GLINK_CALL_STUB_SIZE (16*4) +#define MFCTR_R12 0x7d8902a6 /* mfctr %r12 */ +#define SLDI_R11_R0_3 0x780b1f24 /* sldi %r11,%r0,3 */ +#define ADDIC_R2_R0_32K 0x34408000 /* addic. %r2,%r0,-32768 */ +#define SUB_R12_R12_R11 0x7d8b6050 /* sub %r12,%r12,%r11 */ +#define SRADI_R2_R2_63 0x7c42fe76 /* sradi %r2,%r2,63 */ +#define SLDI_R11_R0_2 0x780b1764 /* sldi %r11,%r0,2 */ +#define AND_R2_R2_R11 0x7c425838 /* and %r2,%r2,%r11 */ + /* sub %r12,%r12,%r11 */ +#define ADD_R12_R12_R2 0x7d8c1214 /* add %r12,%r12,%r2 */ +#define ADDIS_R12_R12 0x3d8c0000 /* addis %r12,%r12,xxx@ha */ + /* ld %r11,xxx@l(%r12) */ +#define ADDI_R12_R12 0x398c0000 /* addi %r12,%r12,xxx@l */ + /* ld %r2,8(%r12) */ + /* mtctr %r11 */ + /* ld %r11,16(%r12) */ + /* bctr */ /* Pad with this. */ #define NOP 0x60000000 @@ -1718,7 +1763,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_GOT_TPREL16_DS", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ - 0xffff, /* dst_mask */ + 0xfffc, /* dst_mask */ FALSE), /* pcrel_offset */ /* Like GOT_TPREL16_DS, but no overflow. */ @@ -1733,7 +1778,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_GOT_TPREL16_LO_DS", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ - 0xffff, /* dst_mask */ + 0xfffc, /* dst_mask */ FALSE), /* pcrel_offset */ /* Like GOT_TPREL16_LO_DS, but next higher group of 16 bits. */ @@ -1802,7 +1847,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { be done. */ static void -ppc_howto_init () +ppc_howto_init (void) { unsigned int i, type; @@ -1818,9 +1863,8 @@ ppc_howto_init () } static reloc_howto_type * -ppc64_elf_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; +ppc64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { enum elf_ppc64_reloc_type r = R_PPC64_NONE; @@ -1828,10 +1872,10 @@ ppc64_elf_reloc_type_lookup (abfd, code) /* Initialize howto table if needed. */ ppc_howto_init (); - switch ((int) code) + switch (code) { default: - return (reloc_howto_type *) NULL; + return NULL; case BFD_RELOC_NONE: r = R_PPC64_NONE; break; @@ -2037,16 +2081,14 @@ ppc64_elf_reloc_type_lookup (abfd, code) break; } - return ppc64_elf_howto_table[(int) r]; + return ppc64_elf_howto_table[r]; }; /* Set the howto pointer for a PowerPC ELF reloc. */ static void -ppc64_elf_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr; - Elf_Internal_Rela *dst; +ppc64_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, + Elf_Internal_Rela *dst) { unsigned int type; @@ -2063,15 +2105,9 @@ ppc64_elf_info_to_howto (abfd, cache_ptr, dst) /* Handle the R_PPC64_ADDR16_HA and similar relocs. */ static bfd_reloc_status_type -ppc64_elf_ha_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; +ppc64_elf_ha_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *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 @@ -2088,15 +2124,9 @@ ppc64_elf_ha_reloc (abfd, reloc_entry, symbol, data, } static bfd_reloc_status_type -ppc64_elf_brtaken_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; +ppc64_elf_brtaken_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) { long insn; enum elf_ppc64_reloc_type r_type; @@ -2114,7 +2144,7 @@ ppc64_elf_brtaken_reloc (abfd, reloc_entry, symbol, data, octets = reloc_entry->address * bfd_octets_per_byte (abfd); insn = bfd_get_32 (abfd, (bfd_byte *) data + octets); insn &= ~(0x01 << 21); - r_type = (enum elf_ppc64_reloc_type) reloc_entry->howto->type; + r_type = reloc_entry->howto->type; if (r_type == R_PPC64_ADDR14_BRTAKEN || r_type == R_PPC64_REL14_BRTAKEN) insn |= 0x01 << 21; /* 'y' or 't' bit, lowest bit of BO field. */ @@ -2150,20 +2180,14 @@ ppc64_elf_brtaken_reloc (abfd, reloc_entry, symbol, data, if ((bfd_signed_vma) (target - from) < 0) insn ^= 0x01 << 21; } - bfd_put_32 (abfd, (bfd_vma) insn, (bfd_byte *) data + octets); + bfd_put_32 (abfd, insn, (bfd_byte *) data + octets); return bfd_reloc_continue; } static bfd_reloc_status_type -ppc64_elf_sectoff_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; +ppc64_elf_sectoff_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *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 @@ -2178,15 +2202,9 @@ ppc64_elf_sectoff_reloc (abfd, reloc_entry, symbol, data, } static bfd_reloc_status_type -ppc64_elf_sectoff_ha_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; +ppc64_elf_sectoff_ha_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *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 @@ -2204,15 +2222,9 @@ ppc64_elf_sectoff_ha_reloc (abfd, reloc_entry, symbol, data, } static bfd_reloc_status_type -ppc64_elf_toc_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; +ppc64_elf_toc_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) { bfd_vma TOCstart; @@ -2233,15 +2245,9 @@ ppc64_elf_toc_reloc (abfd, reloc_entry, symbol, data, } static bfd_reloc_status_type -ppc64_elf_toc_ha_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; +ppc64_elf_toc_ha_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) { bfd_vma TOCstart; @@ -2265,15 +2271,9 @@ ppc64_elf_toc_ha_reloc (abfd, reloc_entry, symbol, data, } static bfd_reloc_status_type -ppc64_elf_toc64_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; +ppc64_elf_toc64_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) { bfd_vma TOCstart; bfd_size_type octets; @@ -2295,15 +2295,9 @@ ppc64_elf_toc64_reloc (abfd, reloc_entry, symbol, data, } static bfd_reloc_status_type -ppc64_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; +ppc64_elf_unhandled_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *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 @@ -2326,8 +2320,7 @@ ppc64_elf_unhandled_reloc (abfd, reloc_entry, symbol, data, default is 32 bit. */ static bfd_boolean -ppc64_elf_object_p (abfd) - bfd *abfd; +ppc64_elf_object_p (bfd *abfd) { if (abfd->arch_info->the_default && abfd->arch_info->bits_per_word == 32) { @@ -2347,9 +2340,7 @@ ppc64_elf_object_p (abfd) object file when linking. */ static bfd_boolean -ppc64_elf_merge_private_bfd_data (ibfd, obfd) - bfd *ibfd; - bfd *obfd; +ppc64_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) { /* Check if we have the same endianess. */ if (ibfd->xvec->byteorder != obfd->xvec->byteorder @@ -2359,9 +2350,11 @@ ppc64_elf_merge_private_bfd_data (ibfd, obfd) const char *msg; if (bfd_big_endian (ibfd)) - msg = _("%s: compiled for a big endian system and target is little endian"); + msg = _("%s: compiled for a big endian system " + "and target is little endian"); else - msg = _("%s: compiled for a little endian system and target is big endian"); + msg = _("%s: compiled for a little endian system " + "and target is big endian"); (*_bfd_error_handler) (msg, bfd_archive_filename (ibfd)); @@ -2394,17 +2387,15 @@ struct _ppc64_elf_section_data ((struct _ppc64_elf_section_data *) elf_section_data (sec)) static bfd_boolean -ppc64_elf_new_section_hook (abfd, sec) - bfd *abfd; - asection *sec; +ppc64_elf_new_section_hook (bfd *abfd, asection *sec) { struct _ppc64_elf_section_data *sdata; bfd_size_type amt = sizeof (*sdata); - sdata = (struct _ppc64_elf_section_data *) bfd_zalloc (abfd, amt); + sdata = bfd_zalloc (abfd, amt); if (sdata == NULL) return FALSE; - sec->used_by_bfd = (PTR) sdata; + sec->used_by_bfd = sdata; return _bfd_elf_new_section_hook (abfd, sec); } @@ -2574,12 +2565,31 @@ struct plt_entry . mtctr %r11 . ld %r11,xxx+16@toc@l(%r12) . bctr + + ppc_stub_long_branch and ppc_stub_plt_branch may also have additional + code to adjust the value and save r2 to support multiple toc sections. + A ppc_stub_long_branch with an r2 offset looks like: + . std %r2,40(%r1) + . addis %r2,%r2,off@ha + . addi %r2,%r2,off@l + . b dest + + A ppc_stub_plt_branch with an r2 offset looks like: + . std %r2,40(%r1) + . addis %r12,%r2,xxx@toc@ha + . ld %r11,xxx@toc@l(%r12) + . addis %r2,%r2,off@ha + . addi %r2,%r2,off@l + . mtctr %r11 + . bctr */ enum ppc_stub_type { ppc_stub_none, ppc_stub_long_branch, + ppc_stub_long_branch_r2off, ppc_stub_plt_branch, + ppc_stub_plt_branch_r2off, ppc_stub_plt_call }; @@ -2588,6 +2598,8 @@ struct ppc_stub_hash_entry { /* Base hash table entry structure. */ struct bfd_hash_entry root; + enum ppc_stub_type stub_type; + /* The stub section. */ asection *stub_sec; @@ -2599,8 +2611,6 @@ struct ppc_stub_hash_entry { bfd_vma target_value; asection *target_section; - enum ppc_stub_type stub_type; - /* The symbol table entry, if any, that this was derived from. */ struct ppc_link_hash_entry *h; @@ -2677,8 +2687,8 @@ struct ppc_link_hash_table bfd *stub_bfd; /* Linker call-backs. */ - asection * (*add_stub_section) PARAMS ((const char *, asection *)); - void (*layout_sections_again) PARAMS ((void)); + asection * (*add_stub_section) (const char *, asection *); + void (*layout_sections_again) (void); /* Array to keep track of which stub sections have been created, and information on stub grouping. */ @@ -2687,23 +2697,37 @@ struct ppc_link_hash_table asection *link_sec; /* The stub section. */ asection *stub_sec; + /* Along with elf_gp, specifies the TOC pointer used in this group. */ + bfd_vma toc_off; } *stub_group; - /* Assorted information used by ppc64_elf_size_stubs. */ + /* Support for multiple toc sections. */ + unsigned int no_multi_toc; + unsigned int multi_toc_needed; + + /* Temp used when calculating TOC pointers. */ + bfd_vma toc_curr; + + /* Highest input section id. */ + int top_id; + + /* Highest output section index. */ int top_index; + + /* List of input sections for each output section. */ asection **input_list; /* Short-cuts to get to dynamic linker sections. */ - asection *sgot; - asection *srelgot; - asection *splt; - asection *srelplt; - asection *sdynbss; - asection *srelbss; - asection *sglink; + asection *got; + asection *relgot; + asection *plt; + asection *relplt; + asection *dynbss; + asection *relbss; + asection *glink; asection *sfpr; - asection *sbrlt; - asection *srelbrlt; + asection *brlt; + asection *relbrlt; /* Short-cut to first output tls section. */ asection *tls_sec; @@ -2717,6 +2741,12 @@ struct ppc_link_hash_table bfd_vma offset; } tlsld_got; + /* Statistics. */ + unsigned long stub_count[ppc_stub_plt_call]; + + /* Set if we should emit symbols for stubs. */ + unsigned int emit_stub_syms; + /* Set on error. */ unsigned int stub_error; @@ -2734,88 +2764,6 @@ struct ppc_link_hash_table struct sym_sec_cache sym_sec; }; -static struct bfd_hash_entry *stub_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static struct bfd_hash_entry *branch_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -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 *ppc64_elf_link_hash_table_create - PARAMS ((bfd *)); -static void ppc64_elf_link_hash_table_free - PARAMS ((struct bfd_link_hash_table *)); -static char *ppc_stub_name - PARAMS ((const asection *, const asection *, - const struct ppc_link_hash_entry *, const Elf_Internal_Rela *)); -static struct ppc_stub_hash_entry *ppc_get_stub_entry - PARAMS ((const asection *, const asection *, struct elf_link_hash_entry *, - const Elf_Internal_Rela *, struct ppc_link_hash_table *)); -static struct ppc_stub_hash_entry *ppc_add_stub - PARAMS ((const char *, asection *, struct ppc_link_hash_table *)); -static bfd_boolean create_linkage_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean create_got_section - PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean ppc64_elf_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static void ppc64_elf_copy_indirect_symbol - PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, - struct elf_link_hash_entry *)); -static bfd_boolean update_local_sym_info - PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned long, bfd_vma, int)); -static bfd_boolean update_plt_info - PARAMS ((bfd *, struct ppc_link_hash_entry *, bfd_vma)); -static bfd_boolean ppc64_elf_check_relocs - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); -static asection * ppc64_elf_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static bfd_boolean ppc64_elf_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); -static bfd_boolean func_desc_adjust - PARAMS ((struct elf_link_hash_entry *, PTR)); -static bfd_boolean ppc64_elf_func_desc_adjust - PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean ppc64_elf_adjust_dynamic_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static void ppc64_elf_hide_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean)); -static bfd_boolean get_sym_h - PARAMS ((struct elf_link_hash_entry **, Elf_Internal_Sym **, asection **, - char **, Elf_Internal_Sym **, unsigned long, bfd *)); -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)); -static bfd_boolean readonly_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static enum elf_reloc_type_class ppc64_elf_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); -static bfd_boolean ppc64_elf_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static enum ppc_stub_type ppc_type_of_stub - PARAMS ((asection *, const Elf_Internal_Rela *, - struct ppc_link_hash_entry **, bfd_vma)); -static bfd_byte *build_plt_stub - PARAMS ((bfd *, bfd_byte *, int, int)); -static bfd_boolean ppc_build_one_stub - PARAMS ((struct bfd_hash_entry *, PTR)); -static bfd_boolean ppc_size_one_stub - PARAMS ((struct bfd_hash_entry *, PTR)); -static void group_sections - PARAMS ((struct ppc_link_hash_table *, bfd_size_type, bfd_boolean)); -static bfd_boolean ppc64_elf_relocate_section - PARAMS ((bfd *, struct bfd_link_info *info, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms, - asection **)); -static bfd_boolean ppc64_elf_finish_dynamic_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - Elf_Internal_Sym *)); -static bfd_boolean ppc64_elf_finish_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); - /* Get the ppc64 ELF linker hash table from a link_info structure. */ #define ppc_hash_table(p) \ @@ -2832,10 +2780,9 @@ static bfd_boolean ppc64_elf_finish_dynamic_sections /* Create an entry in the stub hash table. */ static struct bfd_hash_entry * -stub_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +stub_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -2854,11 +2801,11 @@ stub_hash_newfunc (entry, table, string) /* Initialize the local fields. */ eh = (struct ppc_stub_hash_entry *) entry; + eh->stub_type = ppc_stub_none; eh->stub_sec = NULL; eh->stub_offset = 0; eh->target_value = 0; eh->target_section = NULL; - eh->stub_type = ppc_stub_none; eh->h = NULL; eh->id_sec = NULL; } @@ -2869,10 +2816,9 @@ stub_hash_newfunc (entry, table, string) /* Create an entry in the branch hash table. */ static struct bfd_hash_entry * -branch_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +branch_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -2901,10 +2847,9 @@ branch_hash_newfunc (entry, table, string) /* Create an entry in a ppc64 ELF linker hash table. */ static struct bfd_hash_entry * -link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -2936,13 +2881,12 @@ link_hash_newfunc (entry, table, string) /* Create a ppc64 ELF linker hash table. */ static struct bfd_link_hash_table * -ppc64_elf_link_hash_table_create (abfd) - bfd *abfd; +ppc64_elf_link_hash_table_create (bfd *abfd) { struct ppc_link_hash_table *htab; bfd_size_type amt = sizeof (struct ppc_link_hash_table); - htab = (struct ppc_link_hash_table *) bfd_malloc (amt); + htab = bfd_zmalloc (amt); if (htab == NULL) return NULL; @@ -2960,28 +2904,6 @@ ppc64_elf_link_hash_table_create (abfd) if (!bfd_hash_table_init (&htab->branch_hash_table, branch_hash_newfunc)) return NULL; - htab->stub_bfd = NULL; - htab->add_stub_section = NULL; - htab->layout_sections_again = NULL; - htab->stub_group = NULL; - htab->sgot = NULL; - htab->srelgot = NULL; - htab->splt = NULL; - htab->srelplt = NULL; - htab->sdynbss = NULL; - htab->srelbss = NULL; - htab->sglink = NULL; - htab->sfpr = NULL; - 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 @@ -2997,8 +2919,7 @@ ppc64_elf_link_hash_table_create (abfd) /* Free the derived linker hash table. */ static void -ppc64_elf_link_hash_table_free (hash) - struct bfd_link_hash_table *hash; +ppc64_elf_link_hash_table_free (struct bfd_link_hash_table *hash) { struct ppc_link_hash_table *ret = (struct ppc_link_hash_table *) hash; @@ -3010,11 +2931,10 @@ ppc64_elf_link_hash_table_free (hash) /* Build a name for an entry in the stub hash table. */ static char * -ppc_stub_name (input_section, sym_sec, h, rel) - const asection *input_section; - const asection *sym_sec; - const struct ppc_link_hash_entry *h; - const Elf_Internal_Rela *rel; +ppc_stub_name (const asection *input_section, + const asection *sym_sec, + const struct ppc_link_hash_entry *h, + const Elf_Internal_Rela *rel) { char *stub_name; bfd_size_type len; @@ -3038,7 +2958,7 @@ ppc_stub_name (input_section, sym_sec, h, rel) } else { - len = 8 + 1 + 8 + 1 + 8 + 1 + 16 + 1; + len = 8 + 1 + 8 + 1 + 8 + 1 + 8 + 1; stub_name = bfd_malloc (len); if (stub_name != NULL) { @@ -3056,12 +2976,11 @@ ppc_stub_name (input_section, sym_sec, h, rel) creating the stub name takes a bit of time. */ static struct ppc_stub_hash_entry * -ppc_get_stub_entry (input_section, sym_sec, hash, rel, htab) - const asection *input_section; - const asection *sym_sec; - struct elf_link_hash_entry *hash; - const Elf_Internal_Rela *rel; - struct ppc_link_hash_table *htab; +ppc_get_stub_entry (const asection *input_section, + const asection *sym_sec, + struct elf_link_hash_entry *hash, + const Elf_Internal_Rela *rel, + struct ppc_link_hash_table *htab) { struct ppc_stub_hash_entry *stub_entry; struct ppc_link_hash_entry *h = (struct ppc_link_hash_entry *) hash; @@ -3103,10 +3022,9 @@ ppc_get_stub_entry (input_section, sym_sec, hash, rel, htab) stub entry are initialised. */ static struct ppc_stub_hash_entry * -ppc_add_stub (stub_name, section, htab) - const char *stub_name; - asection *section; - struct ppc_link_hash_table *htab; +ppc_add_stub (const char *stub_name, + asection *section, + struct ppc_link_hash_table *htab) { asection *link_sec; asection *stub_sec; @@ -3159,9 +3077,7 @@ ppc_add_stub (stub_name, section, htab) /* Create sections for linker generated code. */ static bfd_boolean -create_linkage_sections (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; +create_linkage_sections (bfd *dynobj, struct bfd_link_info *info) { struct ppc_link_hash_table *htab; flagword flags; @@ -3178,29 +3094,29 @@ create_linkage_sections (dynobj, info) return FALSE; /* Create .glink for lazy dynamic linking support. */ - htab->sglink = bfd_make_section_anyway (dynobj, ".glink"); - if (htab->sglink == NULL - || ! bfd_set_section_flags (dynobj, htab->sglink, flags) - || ! bfd_set_section_alignment (dynobj, htab->sglink, 2)) + htab->glink = bfd_make_section_anyway (dynobj, ".glink"); + if (htab->glink == NULL + || ! bfd_set_section_flags (dynobj, htab->glink, flags) + || ! bfd_set_section_alignment (dynobj, htab->glink, 2)) return FALSE; /* Create .branch_lt for plt_branch stubs. */ flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - htab->sbrlt = bfd_make_section_anyway (dynobj, ".branch_lt"); - if (htab->sbrlt == NULL - || ! bfd_set_section_flags (dynobj, htab->sbrlt, flags) - || ! bfd_set_section_alignment (dynobj, htab->sbrlt, 3)) + htab->brlt = bfd_make_section_anyway (dynobj, ".branch_lt"); + if (htab->brlt == NULL + || ! bfd_set_section_flags (dynobj, htab->brlt, flags) + || ! bfd_set_section_alignment (dynobj, htab->brlt, 3)) return FALSE; if (info->shared) { flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - htab->srelbrlt = bfd_make_section_anyway (dynobj, ".rela.branch_lt"); - if (!htab->srelbrlt - || ! bfd_set_section_flags (dynobj, htab->srelbrlt, flags) - || ! bfd_set_section_alignment (dynobj, htab->srelbrlt, 3)) + htab->relbrlt = bfd_make_section_anyway (dynobj, ".rela.branch_lt"); + if (!htab->relbrlt + || ! bfd_set_section_flags (dynobj, htab->relbrlt, flags) + || ! bfd_set_section_alignment (dynobj, htab->relbrlt, 3)) return FALSE; } return TRUE; @@ -3210,9 +3126,7 @@ create_linkage_sections (dynobj, info) shortcuts to them in our hash table. */ static bfd_boolean -create_got_section (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; +create_got_section (bfd *dynobj, struct bfd_link_info *info) { struct ppc_link_hash_table *htab; @@ -3220,17 +3134,17 @@ create_got_section (dynobj, info) return FALSE; htab = ppc_hash_table (info); - htab->sgot = bfd_get_section_by_name (dynobj, ".got"); - if (!htab->sgot) + htab->got = bfd_get_section_by_name (dynobj, ".got"); + if (!htab->got) abort (); - htab->srelgot = bfd_make_section (dynobj, ".rela.got"); - if (!htab->srelgot - || ! bfd_set_section_flags (dynobj, htab->srelgot, + htab->relgot = bfd_make_section (dynobj, ".rela.got"); + if (!htab->relgot + || ! bfd_set_section_flags (dynobj, htab->relgot, (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, htab->srelgot, 3)) + || ! bfd_set_section_alignment (dynobj, htab->relgot, 3)) return FALSE; return TRUE; } @@ -3238,27 +3152,25 @@ create_got_section (dynobj, info) /* Create the dynamic sections, and set up shortcuts. */ static bfd_boolean -ppc64_elf_create_dynamic_sections (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; +ppc64_elf_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) { struct ppc_link_hash_table *htab; htab = ppc_hash_table (info); - if (!htab->sgot && !create_got_section (dynobj, info)) + if (!htab->got && !create_got_section (dynobj, info)) return FALSE; if (!_bfd_elf_create_dynamic_sections (dynobj, info)) return FALSE; - htab->splt = bfd_get_section_by_name (dynobj, ".plt"); - htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); - htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss"); + htab->plt = bfd_get_section_by_name (dynobj, ".plt"); + htab->relplt = bfd_get_section_by_name (dynobj, ".rela.plt"); + htab->dynbss = bfd_get_section_by_name (dynobj, ".dynbss"); if (!info->shared) - htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss"); + htab->relbss = bfd_get_section_by_name (dynobj, ".rela.bss"); - if (!htab->splt || !htab->srelplt || !htab->sdynbss - || (!info->shared && !htab->srelbss)) + if (!htab->plt || !htab->relplt || !htab->dynbss + || (!info->shared && !htab->relbss)) abort (); return TRUE; @@ -3267,9 +3179,9 @@ ppc64_elf_create_dynamic_sections (dynobj, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -ppc64_elf_copy_indirect_symbol (bed, dir, ind) - struct elf_backend_data *bed ATTRIBUTE_UNUSED; - struct elf_link_hash_entry *dir, *ind; +ppc64_elf_copy_indirect_symbol (struct elf_backend_data *bed ATTRIBUTE_UNUSED, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) { struct ppc_link_hash_entry *edir, *eind; flagword mask; @@ -3408,8 +3320,7 @@ ppc64_elf_copy_indirect_symbol (bed, dir, ind) symbols undefined on the command-line. */ bfd_boolean -ppc64_elf_mark_entry_syms (info) - struct bfd_link_info *info; +ppc64_elf_mark_entry_syms (struct bfd_link_info *info) { struct ppc_link_hash_table *htab; struct bfd_sym_chain *sym; @@ -3427,12 +3338,8 @@ ppc64_elf_mark_entry_syms (info) } static bfd_boolean -update_local_sym_info (abfd, symtab_hdr, r_symndx, r_addend, tls_type) - bfd *abfd; - Elf_Internal_Shdr *symtab_hdr; - unsigned long r_symndx; - bfd_vma r_addend; - int tls_type; +update_local_sym_info (bfd *abfd, Elf_Internal_Shdr *symtab_hdr, + unsigned long r_symndx, bfd_vma r_addend, int tls_type) { struct got_entry **local_got_ents = elf_local_got_ents (abfd); char *local_got_tls_masks; @@ -3442,7 +3349,7 @@ update_local_sym_info (abfd, symtab_hdr, r_symndx, r_addend, tls_type) bfd_size_type size = symtab_hdr->sh_info; size *= sizeof (*local_got_ents) + sizeof (*local_got_tls_masks); - local_got_ents = (struct got_entry **) bfd_zalloc (abfd, size); + local_got_ents = bfd_zalloc (abfd, size); if (local_got_ents == NULL) return FALSE; elf_local_got_ents (abfd) = local_got_ents; @@ -3458,7 +3365,7 @@ update_local_sym_info (abfd, symtab_hdr, r_symndx, r_addend, tls_type) if (ent == NULL) { bfd_size_type amt = sizeof (*ent); - ent = (struct got_entry *) bfd_alloc (abfd, amt); + ent = bfd_alloc (abfd, amt); if (ent == NULL) return FALSE; ent->next = local_got_ents[r_symndx]; @@ -3476,10 +3383,7 @@ update_local_sym_info (abfd, symtab_hdr, r_symndx, r_addend, tls_type) } static bfd_boolean -update_plt_info (abfd, eh, addend) - bfd *abfd; - struct ppc_link_hash_entry *eh; - bfd_vma addend; +update_plt_info (bfd *abfd, struct ppc_link_hash_entry *eh, bfd_vma addend) { struct plt_entry *ent; @@ -3489,7 +3393,7 @@ update_plt_info (abfd, eh, addend) if (ent == NULL) { bfd_size_type amt = sizeof (*ent); - ent = (struct plt_entry *) bfd_alloc (abfd, amt); + ent = bfd_alloc (abfd, amt); if (ent == NULL) return FALSE; ent->next = eh->elf.plt.plist; @@ -3508,11 +3412,8 @@ update_plt_info (abfd, eh, addend) linkage table, and dynamic reloc sections. */ static bfd_boolean -ppc64_elf_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, + asection *sec, const Elf_Internal_Rela *relocs) { struct ppc_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -3522,7 +3423,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) asection *sreloc; asection **opd_sym_map; - if (info->relocateable) + if (info->relocatable) return TRUE; htab = ppc_hash_table (info); @@ -3553,7 +3454,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) bfd_size_type amt; amt = sec->_raw_size * sizeof (union opd_info) / 24; - opd_sym_map = (asection **) bfd_zalloc (abfd, amt); + opd_sym_map = bfd_zalloc (abfd, amt); if (opd_sym_map == NULL) return FALSE; ppc64_elf_section_data (sec)->opd.func_sec = opd_sym_map; @@ -3579,7 +3480,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info); + r_type = ELF64_R_TYPE (rel->r_info); switch (r_type) { case R_PPC64_GOT_TLSLD16: @@ -3622,7 +3523,8 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) case R_PPC64_GOT16_LO: case R_PPC64_GOT16_LO_DS: /* This symbol requires a global offset table entry. */ - if (htab->sgot == NULL + sec->has_gp_reloc = 1; + if (htab->got == NULL && !create_got_section (htab->elf.dynobj, info)) return FALSE; @@ -3639,7 +3541,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) if (ent == NULL) { bfd_size_type amt = sizeof (*ent); - ent = (struct got_entry *) bfd_alloc (abfd, amt); + ent = bfd_alloc (abfd, amt); if (ent == NULL) return FALSE; ent->next = eh->elf.got.glist; @@ -3690,12 +3592,6 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) case R_PPC64_SECTOFF_HA: case R_PPC64_SECTOFF_DS: case R_PPC64_SECTOFF_LO_DS: - case R_PPC64_TOC16: - case R_PPC64_TOC16_LO: - case R_PPC64_TOC16_HI: - case R_PPC64_TOC16_HA: - case R_PPC64_TOC16_DS: - case R_PPC64_TOC16_LO_DS: case R_PPC64_DTPREL16: case R_PPC64_DTPREL16_LO: case R_PPC64_DTPREL16_HI: @@ -3708,6 +3604,16 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) case R_PPC64_DTPREL16_HIGHESTA: break; + /* Nor do these. */ + case R_PPC64_TOC16: + case R_PPC64_TOC16_LO: + case R_PPC64_TOC16_HI: + case R_PPC64_TOC16_HA: + case R_PPC64_TOC16_DS: + case R_PPC64_TOC16_LO_DS: + sec->has_gp_reloc = 1; + break; + /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ case R_PPC64_GNU_VTINHERIT: @@ -3792,8 +3698,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) { /* 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); + ppc64_elf_section_data (sec)->t_symndx = bfd_zalloc (abfd, amt); if (ppc64_elf_section_data (sec)->t_symndx == NULL) return FALSE; } @@ -3846,8 +3751,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) if (opd_sym_map != NULL && h == NULL && rel + 1 < rel_end - && ((enum elf_ppc64_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info) - == R_PPC64_TOC)) + && ELF64_R_TYPE ((rel + 1)->r_info) == R_PPC64_TOC) { asection *s; @@ -4002,9 +3906,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) p = *head; if (p == NULL || p->sec != sec) { - p = ((struct ppc_dyn_relocs *) - bfd_alloc (htab->elf.dynobj, - (bfd_size_type) sizeof *p)); + p = bfd_alloc (htab->elf.dynobj, sizeof *p); if (p == NULL) return FALSE; p->next = *head; @@ -4032,12 +3934,11 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -ppc64_elf_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +ppc64_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { asection *rsec = NULL; @@ -4046,7 +3947,7 @@ ppc64_elf_gc_mark_hook (sec, info, rel, h, sym) enum elf_ppc64_reloc_type r_type; struct ppc_link_hash_entry *fdh; - r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info); + r_type = ELF64_R_TYPE (rel->r_info); switch (r_type) { case R_PPC64_GNU_VTINHERIT: @@ -4103,11 +4004,8 @@ ppc64_elf_gc_mark_hook (sec, info, rel, h, sym) section being removed. */ static bfd_boolean -ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +ppc64_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info, + asection *sec, const Elf_Internal_Rela *relocs) { struct ppc_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -4131,7 +4029,7 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) 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); + r_type = ELF64_R_TYPE (rel->r_info); if (r_symndx >= symtab_hdr->sh_info) { struct ppc_link_hash_entry *eh; @@ -4241,9 +4139,7 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) information on function code symbol entries to their corresponding function descriptor symbol entries. */ static bfd_boolean -func_desc_adjust (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +func_desc_adjust (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; struct ppc_link_hash_table *htab; @@ -4255,7 +4151,7 @@ func_desc_adjust (h, inf) if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; - info = (struct bfd_link_info *) inf; + info = inf; htab = ppc_hash_table (info); /* If this is a function code symbol, transfer dynamic linking @@ -4366,9 +4262,8 @@ func_desc_adjust (h, inf) dynamic linking information gathered so far on function code symbol entries, to their corresponding function descriptor symbol entries. */ static bfd_boolean -ppc64_elf_func_desc_adjust (obfd, info) - bfd *obfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +ppc64_elf_func_desc_adjust (bfd *obfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) { struct ppc_link_hash_table *htab; unsigned int lowest_savef = MAX_SAVE_FPR + 2; @@ -4426,7 +4321,7 @@ ppc64_elf_func_desc_adjust (obfd, info) } } - elf_link_hash_traverse (&htab->elf, func_desc_adjust, (PTR) info); + elf_link_hash_traverse (&htab->elf, func_desc_adjust, info); htab->sfpr->_raw_size = ((MAX_SAVE_FPR + 2 - lowest_savef) * 4 + (MAX_SAVE_FPR + 2 - lowest_restf) * 4); @@ -4442,7 +4337,7 @@ ppc64_elf_func_desc_adjust (obfd, info) htab->sfpr->_raw_size = 4; } - p = (bfd_byte *) bfd_alloc (htab->elf.dynobj, htab->sfpr->_raw_size); + p = bfd_alloc (htab->elf.dynobj, htab->sfpr->_raw_size); if (p == NULL) return FALSE; htab->sfpr->contents = p; @@ -4483,9 +4378,8 @@ ppc64_elf_func_desc_adjust (obfd, info) understand. */ static bfd_boolean -ppc64_elf_adjust_dynamic_symbol (info, h) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; +ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) { struct ppc_link_hash_table *htab; asection *s; @@ -4585,7 +4479,7 @@ ppc64_elf_adjust_dynamic_symbol (info, h) .rela.bss section we are going to use. */ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) { - htab->srelbss->_raw_size += sizeof (Elf64_External_Rela); + htab->relbss->_raw_size += sizeof (Elf64_External_Rela); h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY; } @@ -4596,7 +4490,7 @@ ppc64_elf_adjust_dynamic_symbol (info, h) power_of_two = 4; /* Apply the required alignment. */ - s = htab->sdynbss; + s = htab->dynbss; s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two)); if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) { @@ -4617,10 +4511,9 @@ ppc64_elf_adjust_dynamic_symbol (info, h) /* If given a function descriptor symbol, hide both the function code sym and the descriptor. */ static void -ppc64_elf_hide_symbol (info, h, force_local) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; - bfd_boolean force_local; +ppc64_elf_hide_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h, + bfd_boolean force_local) { _bfd_elf_link_hash_hide_symbol (info, h, force_local); @@ -4674,14 +4567,9 @@ ppc64_elf_hide_symbol (info, h, force_local) } static bfd_boolean -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 **tls_maskp; - Elf_Internal_Sym **locsymsp; - unsigned long r_symndx; - bfd *ibfd; +get_sym_h (struct elf_link_hash_entry **hp, Elf_Internal_Sym **symp, + asection **symsecp, char **tls_maskp, Elf_Internal_Sym **locsymsp, + unsigned long r_symndx, bfd *ibfd) { Elf_Internal_Shdr *symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; @@ -4772,14 +4660,11 @@ get_sym_h (hp, symp, symsecp, tls_maskp, locsymsp, r_symndx, ibfd) /* 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. */ + 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; +get_tls_mask (char **tls_maskp, Elf_Internal_Sym **locsymsp, + const Elf_Internal_Rela *rel, bfd *ibfd) { unsigned long r_symndx; unsigned int next_r; @@ -4826,9 +4711,7 @@ get_tls_mask (tls_maskp, locsymsp, rel, ibfd) } bfd_boolean -ppc64_elf_edit_opd (obfd, info) - bfd *obfd; - struct bfd_link_info *info; +ppc64_elf_edit_opd (bfd *obfd, struct bfd_link_info *info) { bfd *ibfd; @@ -4854,10 +4737,10 @@ ppc64_elf_edit_opd (obfd, info) { /* Must be a ld -r link. ie. check_relocs hasn't been called. */ - adjust = (long *) bfd_zalloc (obfd, amt); + adjust = bfd_zalloc (obfd, amt); ppc64_elf_section_data (sec)->opd.adjust = adjust; } - memset (adjust, 0, (size_t) amt); + memset (adjust, 0, amt); if (sec->output_section == bfd_abs_section_ptr) continue; @@ -4871,8 +4754,7 @@ ppc64_elf_edit_opd (obfd, info) sym_hashes = elf_sym_hashes (ibfd); /* Read the relocations. */ - relstart = _bfd_elf_link_read_relocs (ibfd, sec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, + relstart = _bfd_elf_link_read_relocs (ibfd, sec, NULL, NULL, info->keep_memory); if (relstart == NULL) return FALSE; @@ -4893,7 +4775,7 @@ ppc64_elf_edit_opd (obfd, info) /* .opd contains a regular array of 24 byte entries. We're only interested in the reloc pointing to a function entry point. */ - r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info); + r_type = ELF64_R_TYPE (rel->r_info); if (r_type == R_PPC64_TOC) continue; @@ -4908,7 +4790,7 @@ ppc64_elf_edit_opd (obfd, info) if (rel + 1 >= relend) continue; - r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info); + r_type = ELF64_R_TYPE ((rel + 1)->r_info); if (r_type != R_PPC64_TOC) continue; @@ -4975,7 +4857,7 @@ ppc64_elf_edit_opd (obfd, info) { bfd_byte *loc = bfd_alloc (ibfd, sec->_raw_size); if (loc == NULL - || !bfd_get_section_contents (ibfd, sec, loc, (bfd_vma) 0, + || !bfd_get_section_contents (ibfd, sec, loc, 0, sec->_raw_size)) { if (local_syms != NULL @@ -5134,9 +5016,7 @@ ppc64_elf_edit_opd (obfd, info) /* Set htab->tls_sec. */ bfd_boolean -ppc64_elf_tls_setup (obfd, info) - bfd *obfd; - struct bfd_link_info *info; +ppc64_elf_tls_setup (bfd *obfd, struct bfd_link_info *info) { asection *tls; struct ppc_link_hash_table *htab; @@ -5171,15 +5051,13 @@ ppc64_elf_tls_setup (obfd, info) dynamic relocations. */ bfd_boolean -ppc64_elf_tls_optimize (obfd, info) - bfd *obfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) { bfd *ibfd; asection *sec; struct ppc_link_hash_table *htab; - if (info->relocateable || info->shared) + if (info->relocatable || info->shared) return TRUE; htab = ppc_hash_table (info); @@ -5194,8 +5072,7 @@ ppc64_elf_tls_optimize (obfd, info) int expecting_tls_get_addr; /* Read the relocations. */ - relstart = _bfd_elf_link_read_relocs (ibfd, sec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, + relstart = _bfd_elf_link_read_relocs (ibfd, sec, NULL, NULL, info->keep_memory); if (relstart == NULL) return FALSE; @@ -5251,8 +5128,7 @@ ppc64_elf_tls_optimize (obfd, info) < (bfd_vma) 1 << 32); } - r_type - = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info); + r_type = ELF64_R_TYPE (rel->r_info); switch (r_type) { case R_PPC64_GOT_TLSLD16: @@ -5473,9 +5349,7 @@ ppc64_elf_tls_optimize (obfd, info) dynamic relocs. */ static bfd_boolean -allocate_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; struct ppc_link_hash_table *htab; @@ -5506,7 +5380,7 @@ allocate_dynrelocs (h, inf) /* If this is the first .plt entry, make room for the special first entry. */ - s = htab->splt; + s = htab->plt; if (s->_raw_size == 0) s->_raw_size += PLT_INITIAL_ENTRY_SIZE; @@ -5516,7 +5390,7 @@ allocate_dynrelocs (h, inf) s->_raw_size += PLT_ENTRY_SIZE; /* Make room for the .glink code. */ - s = htab->sglink; + s = htab->glink; if (s->_raw_size == 0) s->_raw_size += GLINK_CALL_STUB_SIZE; /* We need bigger stubs past index 32767. */ @@ -5525,7 +5399,7 @@ allocate_dynrelocs (h, inf) s->_raw_size += 2*4; /* We also need to make an entry in the .rela.plt section. */ - s = htab->srelplt; + s = htab->relplt; s->_raw_size += sizeof (Elf64_External_Rela); doneone = TRUE; } @@ -5590,7 +5464,7 @@ allocate_dynrelocs (h, inf) continue; } - s = htab->sgot; + s = htab->got; gent->got.offset = s->_raw_size; s->_raw_size += (gent->tls_type & eh->tls_mask & (TLS_GD | TLS_LD)) ? 16 : 8; @@ -5599,7 +5473,7 @@ allocate_dynrelocs (h, inf) || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)) && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT || h->root.type != bfd_link_hash_undefweak)) - htab->srelgot->_raw_size + htab->relgot->_raw_size += (gent->tls_type & eh->tls_mask & TLS_GD ? 2 * sizeof (Elf64_External_Rela) : sizeof (Elf64_External_Rela)); @@ -5688,9 +5562,7 @@ allocate_dynrelocs (h, inf) /* Find any dynamic relocs that apply to read-only sections. */ static bfd_boolean -readonly_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct ppc_link_hash_entry *eh; struct ppc_dyn_relocs *p; @@ -5705,7 +5577,7 @@ readonly_dynrelocs (h, inf) if (s != NULL && (s->flags & SEC_READONLY) != 0) { - struct bfd_link_info *info = (struct bfd_link_info *) inf; + struct bfd_link_info *info = inf; info->flags |= DF_TEXTREL; @@ -5719,9 +5591,8 @@ readonly_dynrelocs (h, inf) /* Set the sizes of the dynamic sections. */ static bfd_boolean -ppc64_elf_size_dynamic_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) { struct ppc_link_hash_table *htab; bfd *dynobj; @@ -5737,7 +5608,7 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) if (htab->elf.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); if (s == NULL) @@ -5749,10 +5620,10 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) if (htab->tlsld_got.refcount > 0) { - htab->tlsld_got.offset = htab->sgot->_raw_size; - htab->sgot->_raw_size += 16; + htab->tlsld_got.offset = htab->got->_raw_size; + htab->got->_raw_size += 16; if (info->shared) - htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); + htab->relgot->_raw_size += sizeof (Elf64_External_Rela); } else htab->tlsld_got.offset = (bfd_vma) -1; @@ -5806,8 +5677,8 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) locsymcount = symtab_hdr->sh_info; end_lgot_ents = lgot_ents + locsymcount; lgot_masks = (char *) end_lgot_ents; - s = htab->sgot; - srel = htab->srelgot; + s = htab->got; + srel = htab->relgot; for (; lgot_ents < end_lgot_ents; ++lgot_ents, ++lgot_masks) { struct got_entry *ent; @@ -5850,7 +5721,7 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) /* Allocate global sym .plt and .got entries, and space for global sym dynamic relocs. */ - elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); + elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info); /* We now have determined the sizes of the various dynamic sections. Allocate memory for them. */ @@ -5864,12 +5735,20 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) and a non-zero _cooked_size sticks. */ s->_cooked_size = 0; - if (s == htab->sbrlt || s == htab->srelbrlt) + if (s == htab->brlt || s == htab->relbrlt) /* These haven't been allocated yet; don't strip. */ continue; - else if (s == htab->splt - || s == htab->sgot - || s == htab->sglink) + else if (s == htab->got) + { + /* Automatic multiple tocs aren't possible if we are using the + GOT. The GOT is accessed via r2, so we can't adjust r2. + FIXME: There's no reason why we couldn't lay out multiple + GOTs too. */ + if (s->_raw_size > elf_backend_got_header_size) + htab->no_multi_toc = 1; + } + else if (s == htab->plt + || s == htab->glink) { /* Strip this section if we don't need it; see the comment below. */ @@ -5890,7 +5769,7 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) } else { - if (s != htab->srelplt) + if (s != htab->relplt) relocs = TRUE; /* We use the reloc_count field as a counter if we need @@ -5921,7 +5800,7 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) sections instead of garbage. We also rely on the section contents being zero when writing the GOT. */ - s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); + s->contents = bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL) return FALSE; } @@ -5934,15 +5813,15 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + bfd_elf64_add_dynamic_entry (info, (TAG), (VAL)) - if (!info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) return FALSE; } - if (htab->splt != NULL && htab->splt->_raw_size != 0) + if (htab->plt != NULL && htab->plt->_raw_size != 0) { if (!add_dynamic_entry (DT_PLTGOT, 0) || !add_dynamic_entry (DT_PLTRELSZ, 0) @@ -5969,8 +5848,7 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) /* If any dynamic relocs apply to a read-only section, then we need a DT_TEXTREL entry. */ if ((info->flags & DF_TEXTREL) == 0) - elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, - (PTR) info); + elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, info); if ((info->flags & DF_TEXTREL) != 0) { @@ -5986,18 +5864,17 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) /* Determine the type of stub needed, if any, for a call. */ -static INLINE enum ppc_stub_type -ppc_type_of_stub (input_sec, rel, hash, destination) - asection *input_sec; - const Elf_Internal_Rela *rel; - struct ppc_link_hash_entry **hash; - bfd_vma destination; +static inline enum ppc_stub_type +ppc_type_of_stub (asection *input_sec, + const Elf_Internal_Rela *rel, + struct ppc_link_hash_entry **hash, + bfd_vma destination) { struct ppc_link_hash_entry *h = *hash; bfd_vma location; bfd_vma branch_offset; bfd_vma max_branch_offset; - unsigned int r_type; + enum elf_ppc64_reloc_type r_type; if (h != NULL) { @@ -6014,8 +5891,8 @@ ppc_type_of_stub (input_sec, rel, hash, destination) } } - if (h->elf.root.type == bfd_link_hash_undefweak - || h->elf.root.type == bfd_link_hash_undefined) + if (h->elf.root.type != bfd_link_hash_defined + && h->elf.root.type != bfd_link_hash_defweak) return ppc_stub_none; } @@ -6029,7 +5906,7 @@ ppc_type_of_stub (input_sec, rel, hash, destination) /* Determine if a long branch stub is needed. */ max_branch_offset = 1 << 25; - if (r_type != (unsigned int) R_PPC64_REL24) + if (r_type != R_PPC64_REL24) max_branch_offset = 1 << 15; if (branch_offset + max_branch_offset >= 2 * max_branch_offset) @@ -6042,29 +5919,22 @@ ppc_type_of_stub (input_sec, rel, hash, destination) /* Build a .plt call stub. */ -static bfd_byte * -build_plt_stub (obfd, p, offset, glink) - bfd *obfd; - bfd_byte *p; - int offset; - int glink; +static inline bfd_byte * +build_plt_stub (bfd *obfd, bfd_byte *p, int offset) { #define PPC_LO(v) ((v) & 0xffff) #define PPC_HI(v) (((v) >> 16) & 0xffff) #define PPC_HA(v) PPC_HI ((v) + 0x8000) - if (glink) - bfd_put_32 (obfd, LD_R2_40R1, p), p += 4; bfd_put_32 (obfd, ADDIS_R12_R2 | PPC_HA (offset), p), p += 4; - if (!glink) - bfd_put_32 (obfd, STD_R2_40R1, p), p += 4; + bfd_put_32 (obfd, STD_R2_40R1, p), p += 4; bfd_put_32 (obfd, LD_R11_0R12 | PPC_LO (offset), p), p += 4; if (PPC_HA (offset + 8) != PPC_HA (offset)) - bfd_put_32 (obfd, ADDIS_R12_R12_1, p), p += 4; + bfd_put_32 (obfd, ADDIS_R12_R12 | 1, p), p += 4; offset += 8; bfd_put_32 (obfd, LD_R2_0R12 | PPC_LO (offset), p), p += 4; if (PPC_HA (offset + 8) != PPC_HA (offset)) - bfd_put_32 (obfd, ADDIS_R12_R12_1, p), p += 4; + bfd_put_32 (obfd, ADDIS_R12_R12 | 1, p), p += 4; offset += 8; bfd_put_32 (obfd, MTCTR_R11, p), p += 4; bfd_put_32 (obfd, LD_R11_0R12 | PPC_LO (offset), p), p += 4; @@ -6073,9 +5943,7 @@ build_plt_stub (obfd, p, offset, glink) } static bfd_boolean -ppc_build_one_stub (gen_entry, in_arg) - struct bfd_hash_entry *gen_entry; - PTR in_arg; +ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) { struct ppc_stub_hash_entry *stub_entry; struct ppc_branch_hash_entry *br_entry; @@ -6092,7 +5960,7 @@ ppc_build_one_stub (gen_entry, in_arg) /* Massage our args to the form they really have. */ stub_entry = (struct ppc_stub_hash_entry *) gen_entry; - info = (struct bfd_link_info *) in_arg; + info = in_arg; htab = ppc_hash_table (info); stub_sec = stub_entry->stub_sec; @@ -6101,11 +5969,29 @@ ppc_build_one_stub (gen_entry, in_arg) stub_entry->stub_offset = stub_sec->_cooked_size; loc = stub_sec->contents + stub_entry->stub_offset; + if (htab->emit_stub_syms) + { + struct elf_link_hash_entry *h; + h = elf_link_hash_lookup (&htab->elf, stub_entry->root.string, + TRUE, FALSE, FALSE); + if (h == NULL) + return FALSE; + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = stub_entry->stub_sec; + h->root.u.def.value = stub_entry->stub_offset; + h->elf_link_hash_flags = (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK + | ELF_LINK_FORCED_LOCAL); + } + stub_bfd = stub_sec->owner; + htab->stub_count[stub_entry->stub_type - 1] += 1; switch (stub_entry->stub_type) { case ppc_stub_long_branch: + case ppc_stub_long_branch_r2off: /* Branches are relative. This is where we are going to. */ off = (stub_entry->target_value + stub_entry->target_section->output_offset @@ -6116,13 +6002,30 @@ ppc_build_one_stub (gen_entry, in_arg) + stub_sec->output_offset + stub_sec->output_section->vma); - BFD_ASSERT (off + (1 << 25) < (bfd_vma) (1 << 26)); + if (stub_entry->stub_type != ppc_stub_long_branch_r2off) + size = 4; + else + { + bfd_vma r2off; + + r2off = (htab->stub_group[stub_entry->target_section->id].toc_off + - htab->stub_group[stub_entry->id_sec->id].toc_off); + bfd_put_32 (stub_bfd, STD_R2_40R1, loc); + loc += 4; + bfd_put_32 (stub_bfd, ADDIS_R2_R2 | PPC_HA (r2off), loc); + loc += 4; + bfd_put_32 (stub_bfd, ADDI_R2_R2 | PPC_LO (r2off), loc); + loc += 4; + off -= 12; + size = 16; + } + bfd_put_32 (stub_bfd, B_DOT | (off & 0x3fffffc), loc); - bfd_put_32 (stub_bfd, (bfd_vma) B_DOT | (off & 0x3fffffc), loc); - size = 4; + BFD_ASSERT (off + (1 << 25) < (bfd_vma) (1 << 26)); break; case ppc_stub_plt_branch: + case ppc_stub_plt_branch_r2off: br_entry = ppc_branch_hash_lookup (&htab->branch_hash_table, stub_entry->root.string + 9, FALSE, FALSE); @@ -6138,33 +6041,33 @@ ppc_build_one_stub (gen_entry, in_arg) + stub_entry->target_section->output_offset + stub_entry->target_section->output_section->vma); - bfd_put_64 (htab->sbrlt->owner, off, - htab->sbrlt->contents + br_entry->offset); + bfd_put_64 (htab->brlt->owner, off, + htab->brlt->contents + br_entry->offset); if (info->shared) { /* Create a reloc for the branch lookup table entry. */ Elf_Internal_Rela rela; - bfd_byte *loc; + bfd_byte *rl; rela.r_offset = (br_entry->offset - + htab->sbrlt->output_offset - + htab->sbrlt->output_section->vma); + + htab->brlt->output_offset + + htab->brlt->output_section->vma); rela.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); rela.r_addend = off; - loc = htab->srelbrlt->contents; - loc += htab->srelbrlt->reloc_count++ * sizeof (Elf64_External_Rela); - bfd_elf64_swap_reloca_out (htab->srelbrlt->owner, &rela, loc); + rl = htab->relbrlt->contents; + rl += htab->relbrlt->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (htab->relbrlt->owner, &rela, rl); } off = (br_entry->offset - + htab->sbrlt->output_offset - + htab->sbrlt->output_section->vma - - elf_gp (htab->sbrlt->output_section->owner) - - TOC_BASE_OFF); + + htab->brlt->output_offset + + htab->brlt->output_section->vma + - elf_gp (htab->brlt->output_section->owner) + - htab->stub_group[stub_entry->id_sec->id].toc_off); - if (off + 0x80000000 > 0xffffffff || (off & 7) != 0) + if (off + 0x80008000 > 0xffffffff || (off & 7) != 0) { (*_bfd_error_handler) (_("linkage table error against `%s'"), @@ -6175,11 +6078,34 @@ ppc_build_one_stub (gen_entry, in_arg) } indx = off; - bfd_put_32 (stub_bfd, (bfd_vma) ADDIS_R12_R2 | PPC_HA (indx), loc); - bfd_put_32 (stub_bfd, (bfd_vma) LD_R11_0R12 | PPC_LO (indx), loc + 4); - bfd_put_32 (stub_bfd, (bfd_vma) MTCTR_R11, loc + 8); - bfd_put_32 (stub_bfd, (bfd_vma) BCTR, loc + 12); - size = 16; + if (stub_entry->stub_type != ppc_stub_plt_branch_r2off) + { + bfd_put_32 (stub_bfd, ADDIS_R12_R2 | PPC_HA (indx), loc); + loc += 4; + bfd_put_32 (stub_bfd, LD_R11_0R12 | PPC_LO (indx), loc); + size = 16; + } + else + { + bfd_vma r2off; + + r2off = (htab->stub_group[stub_entry->target_section->id].toc_off + - htab->stub_group[stub_entry->id_sec->id].toc_off); + bfd_put_32 (stub_bfd, STD_R2_40R1, loc); + loc += 4; + bfd_put_32 (stub_bfd, ADDIS_R12_R2 | PPC_HA (indx), loc); + loc += 4; + bfd_put_32 (stub_bfd, LD_R11_0R12 | PPC_LO (indx), loc); + loc += 4; + bfd_put_32 (stub_bfd, ADDIS_R2_R2 | PPC_HA (r2off), loc); + loc += 4; + bfd_put_32 (stub_bfd, ADDI_R2_R2 | PPC_LO (r2off), loc); + size = 28; + } + loc += 4; + bfd_put_32 (stub_bfd, MTCTR_R11, loc); + loc += 4; + bfd_put_32 (stub_bfd, BCTR, loc); break; case ppc_stub_plt_call: @@ -6191,7 +6117,9 @@ ppc_build_one_stub (gen_entry, in_arg) { /* Point the symbol at the stub. There may be multiple stubs, we don't really care; The main thing is to make this sym - defined somewhere. */ + defined somewhere. Maybe defining the symbol in the stub + section is a silly idea. If we didn't do this, htab->top_id + could disappear. */ stub_entry->h->oh->root.type = bfd_link_hash_defined; stub_entry->h->oh->root.u.def.section = stub_entry->stub_sec; stub_entry->h->oh->root.u.def.value = stub_entry->stub_offset; @@ -6209,12 +6137,12 @@ ppc_build_one_stub (gen_entry, in_arg) abort (); off &= ~ (bfd_vma) 1; - off += (htab->splt->output_offset - + htab->splt->output_section->vma - - elf_gp (htab->splt->output_section->owner) - - TOC_BASE_OFF); + off += (htab->plt->output_offset + + htab->plt->output_section->vma + - elf_gp (htab->plt->output_section->owner) + - htab->stub_group[stub_entry->id_sec->id].toc_off); - if (off + 0x80000000 > 0xffffffff || (off & 7) != 0) + if (off + 0x80008000 > 0xffffffff || (off & 7) != 0) { (*_bfd_error_handler) (_("linkage table error against `%s'"), @@ -6224,7 +6152,7 @@ ppc_build_one_stub (gen_entry, in_arg) return FALSE; } - p = build_plt_stub (stub_bfd, loc, (int) off, 0); + p = build_plt_stub (stub_bfd, loc, off); size = p - loc; break; @@ -6242,9 +6170,7 @@ ppc_build_one_stub (gen_entry, in_arg) long_branch stubs won't do. */ static bfd_boolean -ppc_size_one_stub (gen_entry, in_arg) - struct bfd_hash_entry *gen_entry; - PTR in_arg; +ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) { struct ppc_stub_hash_entry *stub_entry; struct ppc_link_hash_table *htab; @@ -6253,7 +6179,7 @@ ppc_size_one_stub (gen_entry, in_arg) /* Massage our args to the form they really have. */ stub_entry = (struct ppc_stub_hash_entry *) gen_entry; - htab = (struct ppc_link_hash_table *) in_arg; + htab = in_arg; if (stub_entry->stub_type == ppc_stub_plt_call) { @@ -6267,21 +6193,19 @@ ppc_size_one_stub (gen_entry, in_arg) } if (off >= (bfd_vma) -2) abort (); - off += (htab->splt->output_offset - + htab->splt->output_section->vma - - elf_gp (htab->splt->output_section->owner) - - TOC_BASE_OFF); + off += (htab->plt->output_offset + + htab->plt->output_section->vma + - elf_gp (htab->plt->output_section->owner) + - htab->stub_group[stub_entry->id_sec->id].toc_off); - size = 28; - if (PPC_HA ((int) off + 16) != PPC_HA ((int) off)) + size = PLT_CALL_STUB_SIZE; + if (PPC_HA (off + 16) != PPC_HA (off)) size += 4; } else { - /* ppc_stub_long_branch or ppc_stub_plt_branch. */ - stub_entry->stub_type = ppc_stub_long_branch; - size = 4; - + /* ppc_stub_long_branch or ppc_stub_plt_branch, or their r2off + variants. */ off = (stub_entry->target_value + stub_entry->target_section->output_offset + stub_entry->target_section->output_section->vma); @@ -6289,6 +6213,19 @@ ppc_size_one_stub (gen_entry, in_arg) + stub_entry->stub_sec->output_offset + stub_entry->stub_sec->output_section->vma); + /* Reset the stub type from the plt variant in case we now + can reach with a shorter stub. */ + if (stub_entry->stub_type >= ppc_stub_plt_branch) + stub_entry->stub_type += ppc_stub_long_branch - ppc_stub_plt_branch; + + size = 4; + if (stub_entry->stub_type == ppc_stub_long_branch_r2off) + { + off -= 12; + size = 16; + } + + /* If the branch offset if too big, use a ppc_stub_plt_branch. */ if (off + (1 << 25) >= (bfd_vma) (1 << 26)) { struct ppc_branch_hash_entry *br_entry; @@ -6307,11 +6244,14 @@ ppc_size_one_stub (gen_entry, in_arg) if (br_entry->iter != htab->stub_iteration) { br_entry->iter = htab->stub_iteration; - br_entry->offset = htab->sbrlt->_raw_size; - htab->sbrlt->_raw_size += 8; + br_entry->offset = htab->brlt->_raw_size; + htab->brlt->_raw_size += 8; } - stub_entry->stub_type = ppc_stub_plt_branch; + + stub_entry->stub_type += ppc_stub_plt_branch - ppc_stub_long_branch; size = 16; + if (stub_entry->stub_type != ppc_stub_plt_branch) + size = 28; } } @@ -6324,23 +6264,20 @@ ppc_size_one_stub (gen_entry, in_arg) 0 when no stubs will be needed, and 1 on success. */ int -ppc64_elf_setup_section_lists (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +ppc64_elf_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info) { bfd *input_bfd; - int top_id, top_index; + int top_id, top_index, id; asection *section; - asection **input_list, **list; + asection **input_list; bfd_size_type amt; struct ppc_link_hash_table *htab = ppc_hash_table (info); - if (htab->elf.root.creator->flavour != bfd_target_elf_flavour - || htab->sbrlt == NULL) + if (htab->brlt == NULL) return 0; /* Find the top input section id. */ - for (input_bfd = info->input_bfds, top_id = 0; + for (input_bfd = info->input_bfds, top_id = 3; input_bfd != NULL; input_bfd = input_bfd->link_next) { @@ -6353,11 +6290,18 @@ ppc64_elf_setup_section_lists (output_bfd, info) } } + htab->top_id = top_id; amt = sizeof (struct map_stub) * (top_id + 1); - htab->stub_group = (struct map_stub *) bfd_zmalloc (amt); + htab->stub_group = bfd_zmalloc (amt); if (htab->stub_group == NULL) return -1; + /* Set toc_off for com, und, abs and ind sections. */ + for (id = 0; id < 3; id++) + htab->stub_group[id].toc_off = TOC_BASE_OFF; + + elf_gp (output_bfd) = htab->toc_curr = ppc64_elf_toc (output_bfd); + /* We can't use output_bfd->section_count here to find the top output section index as some sections may have been removed, and _bfd_strip_section_from_output doesn't renumber the indices. */ @@ -6371,27 +6315,107 @@ ppc64_elf_setup_section_lists (output_bfd, info) htab->top_index = top_index; amt = sizeof (asection *) * (top_index + 1); - input_list = (asection **) bfd_malloc (amt); + input_list = bfd_zmalloc (amt); htab->input_list = input_list; if (input_list == NULL) return -1; - /* For sections we aren't interested in, mark their entries with a - value we can check later. */ - list = input_list + top_index; - do - *list = bfd_abs_section_ptr; - while (list-- != input_list); + return 1; +} - for (section = output_bfd->sections; - section != NULL; - section = section->next) +/* The linker repeatedly calls this function for each toc input + section. Group input bfds such that the toc within a group + is less than 64k in size. Will break with cute linker scripts + that play games with dot in the output toc section. */ + +void +ppc64_elf_next_toc_section (struct bfd_link_info *info, asection *isec) +{ + struct ppc_link_hash_table *htab = ppc_hash_table (info); + + if (!htab->no_multi_toc) { - if ((section->flags & SEC_CODE) != 0) - input_list[section->index] = NULL; + bfd_vma addr = isec->output_offset + isec->output_section->vma; + bfd_vma off = addr - htab->toc_curr; + if (off + isec->_raw_size > 0x10000) + { + htab->toc_curr = addr; + htab->multi_toc_needed = 1; + } + elf_gp (isec->owner) = (htab->toc_curr + - elf_gp (isec->output_section->owner) + + TOC_BASE_OFF); } +} - return 1; +/* Called after the last call to the above function. */ + +void +ppc64_elf_reinit_toc (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) +{ + struct ppc_link_hash_table *htab = ppc_hash_table (info); + + /* toc_curr tracks the TOC offset used for code sections below in + ppc64_elf_next_input_section. Start off at 0x8000. */ + htab->toc_curr = TOC_BASE_OFF; +} + +/* No toc references were found in ISEC. If the code in ISEC makes no + calls, then there's no need to use toc adjusting stubs when branching + into ISEC. Actually, indirect calls from ISEC are OK as they will + load r2. */ + +static int +toc_adjusting_stub_needed (struct bfd_link_info *info, asection *isec) +{ + bfd_byte *contents; + bfd_size_type i; + int ret; + int branch_ok; + + /* Hack for linux kernel. .fixup contains branches, but only back to + the function that hit an exception. */ + branch_ok = strcmp (isec->name, ".fixup") == 0; + + contents = elf_section_data (isec)->this_hdr.contents; + if (contents == NULL) + { + contents = bfd_malloc (isec->_raw_size); + if (contents == NULL) + return -1; + if (! bfd_get_section_contents (isec->owner, isec, contents, + (file_ptr) 0, isec->_raw_size)) + { + free (contents); + return -1; + } + if (info->keep_memory) + elf_section_data (isec)->this_hdr.contents = contents; + } + + /* Code scan, because we don't necessarily have relocs on calls to + static functions. */ + ret = 0; + for (i = 0; i < isec->_raw_size; i += 4) + { + unsigned long insn = bfd_get_32 (isec->owner, contents + i); + /* Is this a branch? */ + if ((insn & (0x1f << 26)) == (18 << 26) + /* If branch and link, it's a function call. */ + && ((insn & 1) != 0 + /* Sibling calls use a plain branch. I don't know a way + of deciding whether a branch is really a sibling call. */ + || !branch_ok)) + { + ret = 1; + break; + } + } + + if (elf_section_data (isec)->this_hdr.contents != contents) + free (contents); + return ret; } /* The linker repeatedly calls this function for each input section, @@ -6399,26 +6423,42 @@ ppc64_elf_setup_section_lists (output_bfd, info) Build lists of input sections to determine groupings between which we may insert linker stubs. */ -void -ppc64_elf_next_input_section (info, isec) - struct bfd_link_info *info; - asection *isec; +bfd_boolean +ppc64_elf_next_input_section (struct bfd_link_info *info, asection *isec) { struct ppc_link_hash_table *htab = ppc_hash_table (info); + int ret; - if (isec->output_section->index <= htab->top_index) + if ((isec->output_section->flags & SEC_CODE) != 0 + && isec->output_section->index <= htab->top_index) { asection **list = htab->input_list + isec->output_section->index; - if (*list != bfd_abs_section_ptr) - { - /* Steal the link_sec pointer for our list. */ + /* Steal the link_sec pointer for our list. */ #define PREV_SEC(sec) (htab->stub_group[(sec)->id].link_sec) - /* This happens to make the list in reverse order, - which is what we want. */ - PREV_SEC (isec) = *list; - *list = isec; - } + /* This happens to make the list in reverse order, + which is what we want. */ + PREV_SEC (isec) = *list; + *list = isec; } + + /* If a code section has a function that uses the TOC then we need + to use the right TOC (obviously). Also, make sure that .opd gets + the correct TOC value. */ + if (isec->has_gp_reloc || (isec->flags & SEC_CODE) == 0) + { + if (elf_gp (isec->owner) != 0) + htab->toc_curr = elf_gp (isec->owner); + } + else if ((ret = toc_adjusting_stub_needed (info, isec)) < 0) + return FALSE; + else + isec->has_gp_reloc = ret; + + /* Functions that don't use the TOC can belong in any TOC group. + Use the last TOC base. This happens to make _init and _fini + pasting work. */ + htab->stub_group[isec->id].toc_off = htab->toc_curr; + return TRUE; } /* See whether we can group stub sections together. Grouping stub @@ -6429,23 +6469,21 @@ ppc64_elf_next_input_section (info, isec) the middle of a function is not a good idea. */ static void -group_sections (htab, stub_group_size, stubs_always_before_branch) - struct ppc_link_hash_table *htab; - bfd_size_type stub_group_size; - bfd_boolean stubs_always_before_branch; +group_sections (struct ppc_link_hash_table *htab, + bfd_size_type stub_group_size, + bfd_boolean stubs_always_before_branch) { asection **list = htab->input_list + htab->top_index; do { asection *tail = *list; - if (tail == bfd_abs_section_ptr) - continue; while (tail != NULL) { asection *curr; asection *prev; bfd_size_type total; bfd_boolean big_sec; + bfd_vma curr_toc; curr = tail; if (tail->_cooked_size) @@ -6453,10 +6491,12 @@ group_sections (htab, stub_group_size, stubs_always_before_branch) else total = tail->_raw_size; big_sec = total >= stub_group_size; + curr_toc = htab->stub_group[tail->id].toc_off; while ((prev = PREV_SEC (curr)) != NULL && ((total += curr->output_offset - prev->output_offset) - < stub_group_size)) + < stub_group_size) + && htab->stub_group[prev->id].toc_off == curr_toc) curr = prev; /* OK, the size from the start of CURR to the end is less @@ -6487,7 +6527,8 @@ group_sections (htab, stub_group_size, stubs_always_before_branch) total = 0; while (prev != NULL && ((total += tail->output_offset - prev->output_offset) - < stub_group_size)) + < stub_group_size) + && htab->stub_group[prev->id].toc_off == curr_toc) { tail = prev; prev = PREV_SEC (tail); @@ -6509,14 +6550,12 @@ group_sections (htab, stub_group_size, stubs_always_before_branch) instruction. */ bfd_boolean -ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, - add_stub_section, layout_sections_again) - bfd *output_bfd; - bfd *stub_bfd; - struct bfd_link_info *info; - bfd_signed_vma group_size; - asection * (*add_stub_section) PARAMS ((const char *, asection *)); - void (*layout_sections_again) PARAMS ((void)); +ppc64_elf_size_stubs (bfd *output_bfd, + bfd *stub_bfd, + struct bfd_link_info *info, + bfd_signed_vma group_size, + asection *(*add_stub_section) (const char *, asection *), + void (*layout_sections_again) (void)) { bfd_size_type stub_group_size; bfd_boolean stubs_always_before_branch; @@ -6594,8 +6633,7 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, /* Get the relocs. */ internal_relocs - = _bfd_elf_link_read_relocs (input_bfd, section, NULL, - (Elf_Internal_Rela *) NULL, + = _bfd_elf_link_read_relocs (input_bfd, section, NULL, NULL, info->keep_memory); if (internal_relocs == NULL) goto error_ret_free_local; @@ -6605,7 +6643,8 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, irelaend = irela + section->reloc_count; for (; irela < irelaend; irela++) { - unsigned int r_type, r_indx; + enum elf_ppc64_reloc_type r_type; + unsigned int r_indx; enum ppc_stub_type stub_type; struct ppc_stub_hash_entry *stub_entry; asection *sym_sec; @@ -6620,17 +6659,17 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, r_type = ELF64_R_TYPE (irela->r_info); r_indx = ELF64_R_SYM (irela->r_info); - if (r_type >= (unsigned int) R_PPC64_max) + if (r_type >= R_PPC64_max) { bfd_set_error (bfd_error_bad_value); goto error_ret_free_internal; } /* Only look for stubs on branch instructions. */ - if (r_type != (unsigned int) R_PPC64_REL24 - && r_type != (unsigned int) R_PPC64_REL14 - && r_type != (unsigned int) R_PPC64_REL14_BRTAKEN - && r_type != (unsigned int) R_PPC64_REL14_BRNTAKEN) + if (r_type != R_PPC64_REL24 + && r_type != R_PPC64_REL14 + && r_type != R_PPC64_REL14_BRTAKEN + && r_type != R_PPC64_REL14_BRNTAKEN) continue; /* Now determine the call target, its name, value, @@ -6676,6 +6715,24 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, /* Determine what (if any) linker stub is needed. */ stub_type = ppc_type_of_stub (section, irela, &hash, destination); + + if (stub_type != ppc_stub_plt_call) + { + /* Check whether we need a TOC adjusting stub. + Since the linker pastes together pieces from + different object files when creating the + _init and _fini functions, it may be that a + call to what looks like a local sym is in + fact a call needing a TOC adjustment. */ + if (sym_sec != NULL + && sym_sec->output_section != NULL + && (htab->stub_group[sym_sec->id].toc_off + != htab->stub_group[section->id].toc_off) + && sym_sec->has_gp_reloc + && section->has_gp_reloc) + stub_type = ppc_stub_long_branch_r2off; + } + if (stub_type == ppc_stub_none) continue; @@ -6728,9 +6785,9 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, return FALSE; } + stub_entry->stub_type = stub_type; stub_entry->target_value = sym_value; stub_entry->target_section = sym_sec; - stub_entry->stub_type = stub_type; stub_entry->h = hash; stub_entry->addend = irela->r_addend; stub_changed = TRUE; @@ -6763,8 +6820,8 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, stub_sec->_raw_size = 0; stub_sec->_cooked_size = 0; } - htab->sbrlt->_raw_size = 0; - htab->sbrlt->_cooked_size = 0; + htab->brlt->_raw_size = 0; + htab->brlt->_cooked_size = 0; bfd_hash_traverse (&htab->stub_hash_table, ppc_size_one_stub, htab); @@ -6784,8 +6841,7 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, move, we'll be called again. Provide a value for TOCstart. */ bfd_vma -ppc64_elf_toc (obfd) - bfd *obfd; +ppc64_elf_toc (bfd *obfd) { asection *s; bfd_vma TOCstart; @@ -6842,14 +6898,15 @@ ppc64_elf_toc (obfd) hash table. This function is called via gldelf64ppc_finish. */ bfd_boolean -ppc64_elf_build_stubs (info) - struct bfd_link_info *info; +ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, + struct bfd_link_info *info, + char **stats) { struct ppc_link_hash_table *htab = ppc_hash_table (info); asection *stub_sec; - bfd_vma plt_r2; bfd_byte *p; + htab->emit_stub_syms = emit_stub_syms; for (stub_sec = htab->stub_bfd->sections; stub_sec != NULL; stub_sec = stub_sec->next) @@ -6860,59 +6917,94 @@ ppc64_elf_build_stubs (info) size = stub_sec->_raw_size; if (size != 0) { - stub_sec->contents = (bfd_byte *) bfd_zalloc (htab->stub_bfd, size); + stub_sec->contents = bfd_zalloc (htab->stub_bfd, size); if (stub_sec->contents == NULL) return FALSE; } stub_sec->_cooked_size = 0; } - if (htab->splt != NULL) + if (htab->plt != NULL) { unsigned int indx; + bfd_vma plt0; /* Build the .glink plt call stub. */ - plt_r2 = (htab->splt->output_offset - + htab->splt->output_section->vma - - elf_gp (htab->splt->output_section->owner) - - TOC_BASE_OFF); - p = htab->sglink->contents; - p = build_plt_stub (htab->sglink->owner, p, (int) plt_r2, 1); - while (p < htab->sglink->contents + GLINK_CALL_STUB_SIZE) + plt0 = (htab->plt->output_section->vma + + htab->plt->output_offset + - (htab->glink->output_section->vma + + htab->glink->output_offset + + GLINK_CALL_STUB_SIZE)); + if (plt0 + 0x80008000 > 0xffffffff) { - bfd_put_32 (htab->sglink->owner, NOP, p); - p += 4; + (*_bfd_error_handler) (_(".glink and .plt too far apart")); + bfd_set_error (bfd_error_bad_value); + return FALSE; } + p = htab->glink->contents; + bfd_put_32 (htab->glink->owner, MFCTR_R12, p); + p += 4; + bfd_put_32 (htab->glink->owner, SLDI_R11_R0_3, p); + p += 4; + bfd_put_32 (htab->glink->owner, ADDIC_R2_R0_32K, p); + p += 4; + bfd_put_32 (htab->glink->owner, SUB_R12_R12_R11, p); + p += 4; + bfd_put_32 (htab->glink->owner, SRADI_R2_R2_63, p); + p += 4; + bfd_put_32 (htab->glink->owner, SLDI_R11_R0_2, p); + p += 4; + bfd_put_32 (htab->glink->owner, AND_R2_R2_R11, p); + p += 4; + bfd_put_32 (htab->glink->owner, SUB_R12_R12_R11, p); + p += 4; + bfd_put_32 (htab->glink->owner, ADD_R12_R12_R2, p); + p += 4; + bfd_put_32 (htab->glink->owner, ADDIS_R12_R12 | PPC_HA (plt0), p); + p += 4; + bfd_put_32 (htab->glink->owner, LD_R11_0R12 | PPC_LO (plt0), p); + p += 4; + bfd_put_32 (htab->glink->owner, ADDI_R12_R12 | PPC_LO (plt0), p); + p += 4; + bfd_put_32 (htab->glink->owner, LD_R2_0R12 | 8, p); + p += 4; + bfd_put_32 (htab->glink->owner, MTCTR_R11, p); + p += 4; + bfd_put_32 (htab->glink->owner, LD_R11_0R12 | 16, p); + p += 4; + bfd_put_32 (htab->glink->owner, BCTR, p); + p += 4; + /* Build the .glink lazy link call stubs. */ indx = 0; - while (p < htab->sglink->contents + htab->sglink->_raw_size) + while (p < htab->glink->contents + htab->glink->_raw_size) { if (indx < 0x8000) { - bfd_put_32 (htab->sglink->owner, LI_R0_0 | indx, p); + bfd_put_32 (htab->glink->owner, LI_R0_0 | indx, p); p += 4; } else { - bfd_put_32 (htab->sglink->owner, LIS_R0_0 | PPC_HI (indx), p); + bfd_put_32 (htab->glink->owner, LIS_R0_0 | PPC_HI (indx), p); p += 4; - bfd_put_32 (htab->sglink->owner, ORI_R0_R0_0 | PPC_LO (indx), p); + bfd_put_32 (htab->glink->owner, ORI_R0_R0_0 | PPC_LO (indx), p); p += 4; } - bfd_put_32 (htab->sglink->owner, - B_DOT | ((htab->sglink->contents - p) & 0x3fffffc), p); + bfd_put_32 (htab->glink->owner, + B_DOT | ((htab->glink->contents - p) & 0x3fffffc), p); indx++; p += 4; } - htab->sglink->_cooked_size = p - htab->sglink->contents; + htab->glink->_cooked_size = p - htab->glink->contents; } - if (htab->sbrlt->_raw_size != 0) + if (htab->brlt->_raw_size != 0) { - htab->sbrlt->contents = (bfd_byte *) bfd_zalloc (htab->sbrlt->owner, - htab->sbrlt->_raw_size); - if (htab->sbrlt->contents == NULL) + htab->brlt->contents = bfd_zalloc (htab->brlt->owner, + htab->brlt->_raw_size); + if (htab->brlt->contents == NULL) return FALSE; } @@ -6928,13 +7020,35 @@ ppc64_elf_build_stubs (info) } if (stub_sec != NULL - || htab->sglink->_raw_size != htab->sglink->_cooked_size) + || htab->glink->_raw_size != htab->glink->_cooked_size) { htab->stub_error = TRUE; (*_bfd_error_handler) (_("stubs don't match calculated size")); } - return !htab->stub_error; + if (htab->stub_error) + return FALSE; + + if (stats != NULL) + { + *stats = bfd_malloc (500); + if (*stats == NULL) + return FALSE; + + sprintf (*stats, _("linker stubs in %u groups\n" + " branch %lu\n" + " toc adjust %lu\n" + " long branch %lu\n" + " long toc adj %lu\n" + " plt call %lu"), + htab->stub_bfd->section_count, + htab->stub_count[ppc_stub_long_branch - 1], + htab->stub_count[ppc_stub_long_branch_r2off - 1], + htab->stub_count[ppc_stub_plt_branch - 1], + htab->stub_count[ppc_stub_plt_branch_r2off - 1], + htab->stub_count[ppc_stub_plt_call - 1]); + } + return TRUE; } /* The RELOCATE_SECTION function is called by the ELF backend linker @@ -6946,7 +7060,7 @@ ppc64_elf_build_stubs (info) This function is responsible for adjust the section contents as necessary, and (if using Rela relocs and generating a - relocateable output file) adjusting the reloc addend as + relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -6960,23 +7074,21 @@ ppc64_elf_build_stubs (info) The global hash table entry for the global symbols can be found via elf_sym_hashes (input_bfd). - When generating relocateable output, this function must handle + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted accordingly. */ static bfd_boolean -ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, - contents, relocs, local_syms, local_sections) - bfd *output_bfd; - struct bfd_link_info *info; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - Elf_Internal_Rela *relocs; - Elf_Internal_Sym *local_syms; - asection **local_sections; +ppc64_elf_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) { struct ppc_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -6992,7 +7104,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Disabled until we sort out how ld should choose 'y' vs 'at'. */ bfd_boolean is_power4 = FALSE; - if (info->relocateable) + if (info->relocatable) return TRUE; /* Initialize howto table if needed. */ @@ -7023,26 +7135,21 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma relocation; bfd_boolean unresolved_reloc; bfd_boolean warned; - long insn; + long insn, mask; struct ppc_stub_hash_entry *stub_entry; bfd_vma max_br_offset; bfd_vma from; - r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info); + r_type = ELF64_R_TYPE (rel->r_info); r_symndx = ELF64_R_SYM (rel->r_info); - sym = (Elf_Internal_Sym *) 0; - sec = (asection *) 0; - h = (struct elf_link_hash_entry *) 0; - sym_name = (const char *) 0; + sym = NULL; + sec = NULL; + h = NULL; + sym_name = NULL; unresolved_reloc = FALSE; warned = FALSE; - if (r_type == R_PPC64_TOC) - { - /* Relocation value is TOC base. Symbol is ignored. */ - relocation = TOCstart + TOC_BASE_OFF; - } - else if (r_symndx < symtab_hdr->sh_info) + if (r_symndx < symtab_hdr->sh_info) { /* It's a local symbol. */ sym = local_syms + r_symndx; @@ -7153,7 +7260,11 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, tls_mask = *toc_tls; if (r_type == R_PPC64_TOC16_DS || r_type == R_PPC64_TOC16_LO_DS) - goto toctprel; + { + if (tls_mask != 0 + && (tls_mask & (TLS_DTPREL | TLS_TPREL)) == 0) + goto toctprel; + } else { /* If we found a GD reloc pair, then we might be @@ -7176,11 +7287,11 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_GOT_TPREL16_DS: case R_PPC64_GOT_TPREL16_LO_DS: - toctprel: if (tls_mask != 0 && (tls_mask & TLS_TPREL) == 0) { bfd_vma insn; + toctprel: insn = bfd_get_32 (output_bfd, contents + rel->r_offset - 2); insn &= 31 << 21; insn |= 0x3c0d0000; /* addis 0,13,0 */ @@ -7292,8 +7403,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* 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_type2 = 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 @@ -7360,7 +7470,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (tls_gd == 0) { /* We changed the symbol on an LD reloc. Start over - in order to get h, sym, sec etc. right. */ + in order to get h, sym, sec etc. right. */ rel--; continue; } @@ -7380,8 +7490,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, r_type = R_PPC64_TPREL64; else { - bfd_put_64 (output_bfd, (bfd_vma) 1, - contents + rel->r_offset); + bfd_put_64 (output_bfd, 1, contents + rel->r_offset); r_type = R_PPC64_NONE; } rel->r_info = ELF64_R_INFO (r_symndx, r_type); @@ -7391,8 +7500,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, { if ((tls_mask & TLS_LD) == 0) { - bfd_put_64 (output_bfd, (bfd_vma) 1, - contents + rel->r_offset); + bfd_put_64 (output_bfd, 1, contents + rel->r_offset); r_type = R_PPC64_NONE; rel->r_info = ELF64_R_INFO (r_symndx, r_type); } @@ -7449,20 +7557,28 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, insn ^= 0x01 << 21; } - bfd_put_32 (output_bfd, (bfd_vma) insn, contents + rel->r_offset); + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); break; case R_PPC64_REL24: - /* A REL24 branching to a linkage function is followed by a - nop. We replace the nop with a ld in order to restore - the TOC base pointer. Only calls to shared objects need - to alter the TOC base. These are recognized by their - need for a PLT entry. */ - if (h != NULL - && (fdh = ((struct ppc_link_hash_entry *) h)->oh) != NULL - && fdh->plt.plist != NULL + /* Calls to functions with a different TOC, such as calls to + shared objects, need to alter the TOC pointer. This is + done using a linkage stub. A REL24 branching to these + linkage stubs needs to be followed by a nop, as the nop + will be replaced with an instruction to restore the TOC + base pointer. */ + if (((h != NULL + && (fdh = ((struct ppc_link_hash_entry *) h)->oh) != NULL + && fdh->plt.plist != NULL) + || ((fdh = h, sec) != NULL + && sec->output_section != NULL + && (htab->stub_group[sec->id].toc_off + != htab->stub_group[input_section->id].toc_off))) && (stub_entry = ppc_get_stub_entry (input_section, sec, fdh, - rel, htab)) != NULL) + rel, htab)) != NULL + && (stub_entry->stub_type == ppc_stub_plt_call + || stub_entry->stub_type == ppc_stub_plt_branch_r2off + || stub_entry->stub_type == ppc_stub_long_branch_r2off)) { bfd_boolean can_plt_call = 0; @@ -7472,7 +7588,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (insn == NOP || insn == CROR_151515 || insn == CROR_313131) { - bfd_put_32 (input_bfd, (bfd_vma) LD_R2_40R1, + bfd_put_32 (input_bfd, LD_R2_40R1, contents + rel->r_offset + 4); can_plt_call = 1; } @@ -7480,11 +7596,42 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (!can_plt_call) { - /* If this is a plain branch rather than a branch - and link, don't require a nop. */ - insn = bfd_get_32 (input_bfd, contents + rel->r_offset); - if ((insn & 1) == 0) - can_plt_call = 1; + if (stub_entry->stub_type == ppc_stub_plt_call) + { + /* If this is a plain branch rather than a branch + and link, don't require a nop. */ + insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + if ((insn & 1) == 0) + can_plt_call = 1; + } + else + { + if (strcmp (input_section->output_section->name, + ".init") == 0 + || strcmp (input_section->output_section->name, + ".fini") == 0) + (*_bfd_error_handler) + (_("%s(%s+0x%lx): automatic multiple TOCs " + "not supported using your crt files; " + "recompile with -mminimal-toc or upgrade gcc"), + bfd_archive_filename (input_bfd), + input_section->name, + (long) rel->r_offset); + else + (*_bfd_error_handler) + (_("%s(%s+0x%lx): sibling call optimization to `%s' " + "does not allow automatic multiple TOCs; " + "recompile with -mminimal-toc or " + "-fno-optimize-sibling-calls, " + "or make `%s' extern"), + bfd_archive_filename (input_bfd), + input_section->name, + (long) rel->r_offset, + sym_name, + sym_name); + bfd_set_error (bfd_error_bad_value); + ret = FALSE; + } } if (can_plt_call) @@ -7492,7 +7639,8 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (stub_entry->stub_offset + stub_entry->stub_sec->output_offset + stub_entry->stub_sec->output_section->vma); - unresolved_reloc = FALSE; + if (stub_entry->stub_type == ppc_stub_plt_call) + unresolved_reloc = FALSE; } } @@ -7588,7 +7736,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma off; unsigned long indx = 0; - if (htab->sgot == NULL) + if (htab->got == NULL) abort (); if (tls_type == (TLS_TLS | TLS_LD) @@ -7650,21 +7798,23 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT || h->root.type != bfd_link_hash_undefweak)) { - outrel.r_offset = (htab->sgot->output_section->vma - + htab->sgot->output_offset + outrel.r_offset = (htab->got->output_section->vma + + htab->got->output_offset + off); + outrel.r_addend = rel->r_addend; if (tls_type & (TLS_LD | TLS_GD)) { outrel.r_addend = 0; outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPMOD64); if (tls_type == (TLS_TLS | TLS_GD)) { - loc = htab->srelgot->contents; - loc += (htab->srelgot->reloc_count++ + loc = htab->relgot->contents; + loc += (htab->relgot->reloc_count++ * sizeof (Elf64_External_Rela)); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); outrel.r_offset += 8; + outrel.r_addend = rel->r_addend; outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPREL64); } @@ -7674,23 +7824,31 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, 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); + { + outrel.r_info = ELF64_R_INFO (indx, R_PPC64_RELATIVE); + + /* Write the .got section contents for the sake + of prelink. */ + loc = htab->got->contents + off; + bfd_put_64 (output_bfd, outrel.r_addend + relocation, + loc); + } else outrel.r_info = ELF64_R_INFO (indx, R_PPC64_GLOB_DAT); - outrel.r_addend = rel->r_addend; - if (indx == 0) + + if (indx == 0 && tls_type != (TLS_TLS | TLS_LD)) { outrel.r_addend += relocation; if (tls_type & (TLS_GD | TLS_DTPREL | TLS_TPREL)) outrel.r_addend -= htab->tls_sec->vma; } - loc = htab->srelgot->contents; - loc += (htab->srelgot->reloc_count++ + loc = htab->relgot->contents; + loc += (htab->relgot->reloc_count++ * sizeof (Elf64_External_Rela)); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); } - /* Init the .got section contents if we're not + /* Init the .got section contents here if we're not emitting a reloc. */ else { @@ -7706,20 +7864,20 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (tls_type == (TLS_TLS | TLS_GD)) { bfd_put_64 (output_bfd, relocation, - htab->sgot->contents + off + 8); + htab->got->contents + off + 8); relocation = 1; } } bfd_put_64 (output_bfd, relocation, - htab->sgot->contents + off); + htab->got->contents + off); } } if (off >= (bfd_vma) -2) abort (); - relocation = htab->sgot->output_offset + off; + relocation = htab->got->output_offset + off; /* TOC base (r2) is TOC start plus 0x8000. */ addend = - TOC_BASE_OFF; @@ -7743,21 +7901,32 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, symbol. This happens when statically linking PIC code, or when using -Bsymbolic. Go find a match if there is a PLT entry. */ - if (htab->splt != NULL) + if (htab->plt != NULL) { struct plt_entry *ent; for (ent = h->plt.plist; ent != NULL; ent = ent->next) if (ent->addend == rel->r_addend && ent->plt.offset != (bfd_vma) -1) { - relocation = (htab->splt->output_section->vma - + htab->splt->output_offset + relocation = (htab->plt->output_section->vma + + htab->plt->output_offset + ent->plt.offset); unresolved_reloc = FALSE; } } break; + case R_PPC64_TOC: + /* Relocation value is TOC base. */ + relocation = TOCstart; + if (r_symndx == 0) + relocation += htab->stub_group[input_section->id].toc_off; + else if (sec != NULL && !unresolved_reloc) + relocation += htab->stub_group[sec->id].toc_off; + else + unresolved_reloc = TRUE; + goto dodyn2; + /* TOC16 relocs. We want the offset relative to the TOC base, which is the address of the start of the TOC plus 0x8000. The TOC consists of sections .got, .toc, .tocbss, and .plt, @@ -7768,7 +7937,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_TOC16_DS: case R_PPC64_TOC16_LO_DS: case R_PPC64_TOC16_HA: - addend -= TOCstart + TOC_BASE_OFF; + addend -= TOCstart + htab->stub_group[input_section->id].toc_off; break; /* Relocate against the beginning of the section. */ @@ -7778,7 +7947,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_SECTOFF_DS: case R_PPC64_SECTOFF_LO_DS: case R_PPC64_SECTOFF_HA: - if (sec != (asection *) 0) + if (sec != NULL) addend -= sec->output_section->vma; break; @@ -7864,7 +8033,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; /* Fall thru. */ - case R_PPC64_TOC: + dodyn2: if ((input_section->flags & SEC_ALLOC) == 0) break; @@ -7890,6 +8059,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_boolean skip, relocate; asection *sreloc; bfd_byte *loc; + bfd_vma out_off; /* When generating a dynamic object, these relocations are copied into the output file to be resolved at run @@ -7898,22 +8068,34 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, skip = FALSE; relocate = FALSE; - outrel.r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, - rel->r_offset); - if (outrel.r_offset == (bfd_vma) -1) + out_off = _bfd_elf_section_offset (output_bfd, info, + input_section, rel->r_offset); + if (out_off == (bfd_vma) -1) skip = TRUE; - else if (outrel.r_offset == (bfd_vma) -2) + else if (out_off == (bfd_vma) -2) skip = TRUE, relocate = TRUE; - outrel.r_offset += (input_section->output_section->vma - + input_section->output_offset); + out_off += (input_section->output_section->vma + + input_section->output_offset); + outrel.r_offset = out_off; outrel.r_addend = rel->r_addend; + /* Optimize unaligned reloc use. */ + if ((r_type == R_PPC64_ADDR64 && (out_off & 7) != 0) + || (r_type == R_PPC64_UADDR64 && (out_off & 7) == 0)) + r_type ^= R_PPC64_ADDR64 ^ R_PPC64_UADDR64; + else if ((r_type == R_PPC64_ADDR32 && (out_off & 3) != 0) + || (r_type == R_PPC64_UADDR32 && (out_off & 3) == 0)) + r_type ^= R_PPC64_ADDR32 ^ R_PPC64_UADDR32; + else if ((r_type == R_PPC64_ADDR16 && (out_off & 1) != 0) + || (r_type == R_PPC64_UADDR16 && (out_off & 1) == 0)) + r_type ^= R_PPC64_ADDR16 ^ R_PPC64_UADDR16; + if (skip) memset (&outrel, 0, sizeof outrel); else if (h != NULL && !SYMBOL_REFERENCES_LOCAL (info, h) - && !is_opd) + && !is_opd + && r_type != R_PPC64_TOC) outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); else { @@ -7921,8 +8103,6 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, or this is an opd section reloc which must point at a local function. */ outrel.r_addend += relocation; - /* ??? why? */ - relocate = TRUE; if (r_type == R_PPC64_ADDR64 || r_type == R_PPC64_TOC) { if (is_opd && h != NULL) @@ -7940,6 +8120,12 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, unresolved_reloc = FALSE; } outrel.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); + + /* We need to relocate .opd contents for ld.so. + Prelink also wants simple and consistent rules + for relocs. This make all RELATIVE relocs have + *r_offset equal to r_addend. */ + relocate = TRUE; } else { @@ -7981,9 +8167,29 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* If this reloc is against an external symbol, it will be computed at runtime, so there's no need to do - anything now. */ + anything now. However, for the sake of prelink ensure + that the section contents are a known value. */ if (! relocate) - continue; + { + unresolved_reloc = FALSE; + /* The value chosen here is quite arbitrary as ld.so + ignores section contents except for the special + case of .opd where the contents might be accessed + before relocation. Choose zero, as that won't + cause reloc overflow. */ + relocation = 0; + addend = 0; + /* Use *r_offset == r_addend for R_PPC64_ADDR64 relocs + to improve backward compatibility with older + versions of ld. */ + if (r_type == R_PPC64_ADDR64) + addend = outrel.r_addend; + /* Adjust pc_relative relocs to have zero in *r_offset. */ + else if (ppc64_elf_howto_table[r_type]->pc_relative) + addend = (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); + } } break; @@ -8008,7 +8214,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: relocation %s is not supported for symbol %s."), bfd_archive_filename (input_bfd), - ppc64_elf_howto_table[(int) r_type]->name, sym_name); + ppc64_elf_howto_table[r_type]->name, sym_name); bfd_set_error (bfd_error_invalid_operation); ret = FALSE; @@ -8072,12 +8278,23 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_TPREL16_LO_DS: case R_PPC64_DTPREL16_DS: case R_PPC64_DTPREL16_LO_DS: - if (((relocation + addend) & 3) != 0) + insn = bfd_get_32 (input_bfd, contents + (rel->r_offset & ~3)); + mask = 3; + /* If this reloc is against an lq insn, then the value must be + a multiple of 16. This is somewhat of a hack, but the + "correct" way to do this by defining _DQ forms of all the + _DS relocs bloats all reloc switches in this file. It + doesn't seem to make much sense to use any of these relocs + in data, so testing the insn should be safe. */ + if ((insn & (0x3f << 26)) == (56 << 26)) + mask = 15; + if (((relocation + addend) & mask) != 0) { (*_bfd_error_handler) - (_("%s: error: relocation %s not a multiple of 4"), + (_("%s: error: relocation %s not a multiple of %d"), bfd_archive_filename (input_bfd), - ppc64_elf_howto_table[(int) r_type]->name); + ppc64_elf_howto_table[r_type]->name, + mask + 1); bfd_set_error (bfd_error_bad_value); ret = FALSE; continue; @@ -8094,12 +8311,18 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, max_br_offset = 1 << 25; branch_check: - /* If the branch is out of reach, then redirect the - call to the local stub for this function. */ + /* If the branch is out of reach or the TOC register needs + adjusting, then redirect the call to the local stub for + this function. */ from = (rel->r_offset + input_section->output_offset + input_section->output_section->vma); - if (relocation + addend - from + max_br_offset >= 2 * max_br_offset + if ((relocation + addend - from + max_br_offset >= 2 * max_br_offset + || (sec != NULL + && sec->output_section != NULL + && sec->id <= htab->top_id + && (htab->stub_group[sec->id].toc_off + != htab->stub_group[input_section->id].toc_off))) && (stub_entry = ppc_get_stub_entry (input_section, sec, h, rel, htab)) != NULL) { @@ -8148,7 +8371,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, continue; if (h != NULL && h->root.type == bfd_link_hash_undefweak - && ppc64_elf_howto_table[(int) r_type]->pc_relative) + && ppc64_elf_howto_table[r_type]->pc_relative) { /* Assume this is a call protected by other code that detects the symbol is undefined. If this is the case, @@ -8160,7 +8383,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } if (!((*info->callbacks->reloc_overflow) - (info, sym_name, ppc64_elf_howto_table[(int) r_type]->name, + (info, sym_name, ppc64_elf_howto_table[r_type]->name, rel->r_addend, input_bfd, input_section, rel->r_offset))) return FALSE; } @@ -8171,7 +8394,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_archive_filename (input_bfd), bfd_get_section_name (input_bfd, input_section), (long) rel->r_offset, - ppc64_elf_howto_table[(int) r_type]->name, + ppc64_elf_howto_table[r_type]->name, sym_name, (int) r); ret = FALSE; @@ -8186,11 +8409,10 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, dynamic sections here. */ static bfd_boolean -ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) - bfd *output_bfd; - struct bfd_link_info *info; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +ppc64_elf_finish_dynamic_symbol (bfd *output_bfd, + struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { struct ppc_link_hash_table *htab; bfd *dynobj; @@ -8210,20 +8432,20 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) /* This symbol has an entry in the procedure linkage table. Set it up. */ - if (htab->splt == NULL - || htab->srelplt == NULL - || htab->sglink == NULL) + if (htab->plt == NULL + || htab->relplt == NULL + || htab->glink == NULL) abort (); /* 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 + rela.r_offset = (htab->plt->output_section->vma + + htab->plt->output_offset + ent->plt.offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_JMP_SLOT); rela.r_addend = ent->addend; - loc = htab->srelplt->contents; + loc = htab->relplt->contents; loc += ((ent->plt.offset - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE * sizeof (Elf64_External_Rela)); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); @@ -8240,7 +8462,7 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) if (h->dynindx == -1 || (h->root.type != bfd_link_hash_defined && h->root.type != bfd_link_hash_defweak) - || htab->srelbss == NULL) + || htab->relbss == NULL) abort (); rela.r_offset = (h->root.u.def.value @@ -8248,8 +8470,8 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) + h->root.u.def.section->output_offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_COPY); rela.r_addend = 0; - loc = htab->srelbss->contents; - loc += htab->srelbss->reloc_count++ * sizeof (Elf64_External_Rela); + loc = htab->relbss->contents; + loc += htab->relbss->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); } @@ -8264,12 +8486,11 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) dynamic linker, before writing them out. */ static enum elf_reloc_type_class -ppc64_elf_reloc_type_class (rela) - const Elf_Internal_Rela *rela; +ppc64_elf_reloc_type_class (const Elf_Internal_Rela *rela) { enum elf_ppc64_reloc_type r_type; - r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rela->r_info); + r_type = ELF64_R_TYPE (rela->r_info); switch (r_type) { case R_PPC64_RELATIVE: @@ -8286,9 +8507,8 @@ ppc64_elf_reloc_type_class (rela) /* Finish up the dynamic sections. */ static bfd_boolean -ppc64_elf_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +ppc64_elf_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info) { struct ppc_link_hash_table *htab; bfd *dynobj; @@ -8302,7 +8522,7 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info) { Elf64_External_Dyn *dyncon, *dynconend; - if (sdyn == NULL || htab->sgot == NULL) + if (sdyn == NULL || htab->got == NULL) abort (); dyncon = (Elf64_External_Dyn *) sdyn->contents; @@ -8320,8 +8540,13 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info) continue; case DT_PPC64_GLINK: - s = htab->sglink; + s = htab->glink; dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + /* We stupidly defined DT_PPC64_GLINK to be the start + of glink rather than the first entry point, which is + what ld.so needs, and now have a bigger stub to + support automatic multiple TOCs. */ + dyn.d_un.d_ptr += GLINK_CALL_STUB_SIZE - 32; break; case DT_PPC64_OPD: @@ -8339,23 +8564,23 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info) break; case DT_PLTGOT: - s = htab->splt; + s = htab->plt; dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; break; case DT_JMPREL: - s = htab->srelplt; + s = htab->relplt; dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; break; case DT_PLTRELSZ: - dyn.d_un.d_val = htab->srelplt->_raw_size; + dyn.d_un.d_val = htab->relplt->_raw_size; break; case DT_RELASZ: /* Don't count procedure linkage table relocs in the overall reloc count. */ - s = htab->srelplt; + s = htab->relplt; if (s == NULL) continue; dyn.d_un.d_val -= s->_raw_size; @@ -8365,7 +8590,7 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info) /* We may not be using the standard ELF linker script. If .rela.plt is the first .rela section, we adjust DT_RELA to not include it. */ - s = htab->srelplt; + s = htab->relplt; if (s == NULL) continue; if (dyn.d_un.d_ptr != s->output_section->vma + s->output_offset) @@ -8378,75 +8603,26 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info) } } - if (htab->sgot != NULL && htab->sgot->_raw_size != 0) + if (htab->got != NULL && htab->got->_raw_size != 0) { /* Fill in the first entry in the global offset table. We use it to hold the link-time TOCbase. */ bfd_put_64 (output_bfd, elf_gp (output_bfd) + TOC_BASE_OFF, - htab->sgot->contents); + htab->got->contents); /* Set .got entry size. */ - elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize = 8; + elf_section_data (htab->got->output_section)->this_hdr.sh_entsize = 8; } - if (htab->splt != NULL && htab->splt->_raw_size != 0) + if (htab->plt != NULL && htab->plt->_raw_size != 0) { /* Set .plt entry size. */ - elf_section_data (htab->splt->output_section)->this_hdr.sh_entsize + elf_section_data (htab->plt->output_section)->this_hdr.sh_entsize = PLT_ENTRY_SIZE; } return TRUE; } -#define TARGET_LITTLE_SYM bfd_elf64_powerpcle_vec -#define TARGET_LITTLE_NAME "elf64-powerpcle" -#define TARGET_BIG_SYM bfd_elf64_powerpc_vec -#define TARGET_BIG_NAME "elf64-powerpc" -#define ELF_ARCH bfd_arch_powerpc -#define ELF_MACHINE_CODE EM_PPC64 -#define ELF_MAXPAGESIZE 0x10000 -#define elf_info_to_howto ppc64_elf_info_to_howto - -#ifdef EM_CYGNUS_POWERPC -#define ELF_MACHINE_ALT1 EM_CYGNUS_POWERPC -#endif - -#ifdef EM_PPC_OLD -#define ELF_MACHINE_ALT2 EM_PPC_OLD -#endif - -#define elf_backend_want_got_sym 0 -#define elf_backend_want_plt_sym 0 -#define elf_backend_plt_alignment 3 -#define elf_backend_plt_not_loaded 1 -#define elf_backend_got_symbol_offset 0 -#define elf_backend_got_header_size 8 -#define elf_backend_plt_header_size PLT_INITIAL_ENTRY_SIZE -#define elf_backend_can_gc_sections 1 -#define elf_backend_can_refcount 1 -#define elf_backend_rela_normal 1 - -#define bfd_elf64_bfd_reloc_type_lookup ppc64_elf_reloc_type_lookup -#define bfd_elf64_bfd_merge_private_bfd_data ppc64_elf_merge_private_bfd_data -#define bfd_elf64_new_section_hook ppc64_elf_new_section_hook -#define bfd_elf64_bfd_link_hash_table_create ppc64_elf_link_hash_table_create -#define bfd_elf64_bfd_link_hash_table_free ppc64_elf_link_hash_table_free - -#define elf_backend_object_p ppc64_elf_object_p -#define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections -#define elf_backend_copy_indirect_symbol ppc64_elf_copy_indirect_symbol -#define elf_backend_check_relocs ppc64_elf_check_relocs -#define elf_backend_gc_mark_hook ppc64_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook ppc64_elf_gc_sweep_hook -#define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol -#define elf_backend_hide_symbol ppc64_elf_hide_symbol -#define elf_backend_always_size_sections ppc64_elf_func_desc_adjust -#define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections -#define elf_backend_relocate_section ppc64_elf_relocate_section -#define elf_backend_finish_dynamic_symbol ppc64_elf_finish_dynamic_symbol -#define elf_backend_reloc_type_class ppc64_elf_reloc_type_class -#define elf_backend_finish_dynamic_sections ppc64_elf_finish_dynamic_sections - #include "elf64-target.h" diff --git a/bfd/elf64-ppc.h b/bfd/elf64-ppc.h index 4b80cc56ecb..0572d528016 100644 --- a/bfd/elf64-ppc.h +++ b/bfd/elf64-ppc.h @@ -18,21 +18,25 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ bfd_boolean ppc64_elf_mark_entry_syms - PARAMS ((struct bfd_link_info *)); + (struct bfd_link_info *); bfd_boolean ppc64_elf_edit_opd - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); bfd_boolean ppc64_elf_tls_setup - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); bfd_boolean ppc64_elf_tls_optimize - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); bfd_vma ppc64_elf_toc - PARAMS ((bfd *)); + (bfd *); int ppc64_elf_setup_section_lists - PARAMS ((bfd *, struct bfd_link_info *)); -void ppc64_elf_next_input_section - PARAMS ((struct bfd_link_info *, asection *)); + (bfd *, struct bfd_link_info *); +void ppc64_elf_next_toc_section + (struct bfd_link_info *, asection *); +void ppc64_elf_reinit_toc + (bfd *, struct bfd_link_info *); +bfd_boolean ppc64_elf_next_input_section + (struct bfd_link_info *, asection *); bfd_boolean ppc64_elf_size_stubs - PARAMS ((bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - asection *(*) (const char *, asection *), void (*) (void))); + (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, + asection *(*) (const char *, asection *), void (*) (void)); bfd_boolean ppc64_elf_build_stubs - PARAMS ((struct bfd_link_info *)); + (bfd_boolean, struct bfd_link_info *, char **); diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 98555f269bf..21501de8d2a 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -849,7 +849,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) bfd_signed_vma *local_got_refcounts; int tls_type, old_tls_type; - if (info->relocateable) + if (info->relocatable) return TRUE; htab = elf_s390_hash_table (info); @@ -1898,7 +1898,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) if (htab->elf.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); if (s == NULL) @@ -2056,7 +2056,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) #define add_dynamic_entry(TAG, VAL) \ bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) - if (! info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) return FALSE; @@ -2169,7 +2169,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; htab = elf_s390_hash_table (info); diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index d666fca9cbe..95bbbd2af1f 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -1585,9 +1585,9 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section, _("Unexpected STO_SH5_ISA32 on local symbol is not handled"), input_bfd, input_section, rel->r_offset)); - if (info->relocateable) + if (info->relocatable) { - /* This is a relocateable link. We don't have to change + /* This is a relocatable link. We don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ @@ -1631,8 +1631,8 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section, { /* Section symbols are never (?) placed in the hash table, so we can just ignore hash relocations when creating a - relocateable object file. */ - if (info->relocateable) + relocatable object file. */ + if (info->relocatable) continue; h = sym_hashes[r_symndx - symtab_hdr->sh_info]; @@ -2178,12 +2178,12 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section, static bfd_byte * sh_elf64_get_relocated_section_contents (output_bfd, link_info, link_order, - data, relocateable, symbols) + data, relocatable, symbols) bfd *output_bfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - bfd_boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { Elf_Internal_Shdr *symtab_hdr; @@ -2195,11 +2195,11 @@ sh_elf64_get_relocated_section_contents (output_bfd, link_info, link_order, /* We only need to handle the case of relaxing, or of having a particular set of section contents, specially. */ - if (relocateable + if (relocatable || elf_section_data (input_section)->this_hdr.contents == NULL) return bfd_generic_get_relocated_section_contents (output_bfd, link_info, link_order, data, - relocateable, + relocatable, symbols); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -2527,7 +2527,7 @@ sh_elf64_check_relocs (abfd, info, sec, relocs) srelgot = NULL; sreloc = NULL; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -2932,11 +2932,11 @@ sh64_elf64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) { struct elf_link_hash_entry *h; - /* For relocateable links, we register the DataLabel sym in its own + /* For relocatable links, we register the DataLabel sym in its own right, and tweak the name when it's output. Otherwise, we make an indirect symbol of it. */ flagword flags - = info->relocateable || info->emitrelocations + = info->relocatable || info->emitrelocations ? BSF_GLOBAL : BSF_GLOBAL | BSF_INDIRECT; char *dl_name @@ -2980,9 +2980,9 @@ sh64_elf64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) free (dl_name); if (h->type != STT_DATALABEL - || ((info->relocateable || info->emitrelocations) + || ((info->relocatable || info->emitrelocations) && h->root.type != bfd_link_hash_undefined) - || (! info->relocateable && !info->emitrelocations + || (! info->relocatable && !info->emitrelocations && h->root.type != bfd_link_hash_indirect)) { /* Make sure we don't get confused on invalid input. */ @@ -3027,7 +3027,7 @@ sh64_elf64_link_output_symbol_hook (abfd, info, cname, sym, input_sec) { char *name = (char *) cname; - if (info->relocateable || info->emitrelocations) + if (info->relocatable || info->emitrelocations) { if (ELF_ST_TYPE (sym->st_info) == STT_DATALABEL) name[strlen (name) - strlen (DATALABEL_SUFFIX)] = 0; @@ -3643,7 +3643,7 @@ sh64_elf64_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); @@ -3777,7 +3777,7 @@ sh64_elf64_size_dynamic_sections (output_bfd, info) must add the entries now so that we get the correct size for the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ - if (! info->shared) + if (info->executable) { if (! bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0)) return FALSE; diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index d7ad1b725de..dbaa954b413 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -1101,7 +1101,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) asection *srelgot; asection *sreloc; - if (info->relocateable || !(sec->flags & SEC_ALLOC)) + if (info->relocatable || !(sec->flags & SEC_ALLOC)) return TRUE; dynobj = elf_hash_table (info)->dynobj; @@ -1781,7 +1781,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); @@ -1880,7 +1880,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) struct elf_strtab_hash *dynstr; struct elf_link_hash_table *eht = elf_hash_table (info); - if (!info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) return FALSE; @@ -2022,7 +2022,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; dynobj = elf_hash_table (info)->dynobj; @@ -2684,7 +2684,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, overflows. We don't, but this breaks stabs debugging info, whose relocations are only 32-bits wide. Ignore overflows for discarded entries. */ - if (r_type == R_SPARC_32 + if ((r_type == R_SPARC_32 || r_type == R_SPARC_DISP32) && _bfd_elf_section_offset (output_bfd, info, input_section, rel->r_offset) == (bfd_vma) -1) break; diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index c0ce57d708d..76af7df9e68 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -705,7 +705,7 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel_end; asection *sreloc; - if (info->relocateable) + if (info->relocatable) return TRUE; htab = elf64_x86_64_hash_table (info); @@ -1618,7 +1618,7 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) if (htab->elf.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); if (s == NULL) @@ -1779,7 +1779,7 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) #define add_dynamic_entry(TAG, VAL) \ bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) - if (! info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) return FALSE; @@ -1872,7 +1872,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) + if (info->relocatable) return TRUE; htab = elf64_x86_64_hash_table (info); diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 55c5b4264e0..6686ab97ced 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -1187,7 +1187,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) else sym->symbol.section = bfd_abs_section_ptr; - /* If this is a relocateable file, then the symbol value is + /* If this is a relocatable file, then the symbol value is already section relative. */ if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) sym->symbol.value -= sym->symbol.section->vma; @@ -1363,7 +1363,9 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count, relent->addend = rela.r_addend; - if (entsize == sizeof (Elf_External_Rela)) + if ((entsize == sizeof (Elf_External_Rela) + && ebd->elf_info_to_howto != NULL) + || ebd->elf_info_to_howto_rel == NULL) (*ebd->elf_info_to_howto) (abfd, relent, &rela); else (*ebd->elf_info_to_howto_rel) (abfd, relent, &rela); diff --git a/bfd/elflink.c b/bfd/elflink.c index cc311863e1a..d6f6d705ead 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -94,7 +94,7 @@ _bfd_elf_create_got_section (abfd, info) h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; h->type = STT_OBJECT; - if (info->shared + if (! info->executable && ! _bfd_elf_link_record_dynamic_symbol (info, h)) return FALSE; @@ -144,7 +144,7 @@ _bfd_elf_link_create_dynamic_sections (abfd, info) /* A dynamically linked executable has a .interp section, but a shared library does not. */ - if (! info->shared) + if (info->executable) { s = bfd_make_section (abfd, ".interp"); if (s == NULL @@ -227,7 +227,7 @@ _bfd_elf_link_create_dynamic_sections (abfd, info) h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; h->type = STT_OBJECT; - if (info->shared + if (! info->executable && ! _bfd_elf_link_record_dynamic_symbol (info, h)) return FALSE; @@ -295,7 +295,7 @@ _bfd_elf_create_dynamic_sections (abfd, info) h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; h->type = STT_OBJECT; - if (info->shared + if (! info->executable && ! _bfd_elf_link_record_dynamic_symbol (info, h)) return FALSE; } @@ -1760,7 +1760,7 @@ _bfd_elf_link_assign_sym_version (h, data) /* If we are building an application, we need to create a version node for this version. */ - if (t == NULL && ! info->shared) + if (t == NULL && info->executable) { struct bfd_elf_version_tree **pp; int version_index; diff --git a/bfd/elflink.h b/bfd/elflink.h index 7b32491d945..f4a65bf273b 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -463,7 +463,7 @@ elf_link_add_object_symbols (abfd, info) /* You can't use -r against a dynamic object. Also, there's no hope of using a dynamic object which does not exactly match the format of the output file. */ - if (info->relocateable || info->hash->creator != abfd->xvec) + if (info->relocatable || info->hash->creator != abfd->xvec) { bfd_set_error (bfd_error_invalid_operation); goto error_return; @@ -474,7 +474,7 @@ elf_link_add_object_symbols (abfd, info) .gnu.warning.SYMBOL are treated as warning symbols for the given symbol. This differs from .gnu.warning sections, which generate warnings when they are included in an output file. */ - if (! info->shared) + if (info->executable) { asection *s; @@ -534,7 +534,7 @@ elf_link_add_object_symbols (abfd, info) FALSE, collect, (struct bfd_link_hash_entry **) NULL))) goto error_return; - if (! info->relocateable) + if (! info->relocatable) { /* Clobber the section size so that the warning does not get copied into the output file. */ @@ -1321,7 +1321,7 @@ elf_link_add_object_symbols (abfd, info) } else new_flag = ELF_LINK_HASH_DEF_REGULAR; - if (info->shared + if (! info->executable || (old_flags & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_DYNAMIC)) != 0) dynsym = TRUE; @@ -1658,7 +1658,7 @@ elf_link_add_object_symbols (abfd, info) } } - if (! info->relocateable && ! dynamic + if (! info->relocatable && ! dynamic && is_elf_hash_table (info)) { asection *s; @@ -1937,6 +1937,43 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, if (! is_elf_hash_table (info)) return TRUE; + if (info->execstack) + elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X; + else if (info->noexecstack) + elf_tdata (output_bfd)->stack_flags = PF_R | PF_W; + else + { + bfd *inputobj; + asection *notesec = NULL; + int exec = 0; + + for (inputobj = info->input_bfds; + inputobj; + inputobj = inputobj->link_next) + { + asection *s; + + if (inputobj->flags & DYNAMIC) + continue; + s = bfd_get_section_by_name (inputobj, ".note.GNU-stack"); + if (s) + { + if (s->flags & SEC_CODE) + exec = PF_X; + notesec = s; + } + else + exec = PF_X; + } + if (notesec) + { + elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | exec; + if (exec && info->relocatable + && notesec->output_section != bfd_abs_section_ptr) + notesec->output_section->flags |= SEC_CODE; + } + } + /* Any syms created from now on start with -1 in got.refcount/offset and plt.refcount/offset. */ elf_hash_table (info)->init_refcount = elf_hash_table (info)->init_offset; @@ -2174,7 +2211,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, if (bfd_get_section_by_name (output_bfd, ".preinit_array") != NULL) { /* DT_PREINIT_ARRAY is not allowed in shared library. */ - if (info->shared) + if (! info->executable) { bfd *sub; asection *o; @@ -2440,7 +2477,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, if (info->flags_1) { - if (! info->shared) + if (info->executable) info->flags_1 &= ~ (DF_1_INITFIRST | DF_1_NODELETE | DF_1_NOOPEN); @@ -2872,7 +2909,7 @@ struct elf_outext_info struct elf_final_link_info *finfo; }; -/* When performing a relocateable link, the input relocations are +/* When performing a relocatable link, the input relocations are preserved. But, if they reference global symbols, the indices referenced must be updated. Update all the relocations in REL_HDR (there are COUNT of them), using the data in REL_HASH. */ @@ -3149,7 +3186,7 @@ elf_bfd_final_link (abfd, info) dynamic = elf_hash_table (info)->dynamic_sections_created; dynobj = elf_hash_table (info)->dynobj; - emit_relocs = (info->relocateable + emit_relocs = (info->relocatable || info->emitrelocations || bed->elf_backend_emit_relocs); @@ -3234,7 +3271,7 @@ elf_bfd_final_link (abfd, info) if (sec->flags & SEC_MERGE) merged = TRUE; - if (info->relocateable || info->emitrelocations) + if (info->relocatable || info->emitrelocations) reloc_count = sec->reloc_count; else if (bed->elf_backend_count_relocs) { @@ -3359,7 +3396,7 @@ elf_bfd_final_link (abfd, info) o->vma = 0; } - if (! info->relocateable && merged) + if (! info->relocatable && merged) elf_link_hash_traverse (elf_hash_table (info), _bfd_elf_link_sec_merge_syms, (PTR) abfd); @@ -3487,7 +3524,7 @@ elf_bfd_final_link (abfd, info) if (o != NULL) o->target_index = bfd_get_symcount (abfd); elfsym.st_shndx = i; - if (info->relocateable || o == NULL) + if (info->relocatable || o == NULL) elfsym.st_value = 0; else elfsym.st_value = o->vma; @@ -3598,13 +3635,13 @@ elf_bfd_final_link (abfd, info) Unfortunately, there is no way to know the total number of local symbols until we have seen all of them, and the local symbol indices precede the global symbol indices. This means that when - we are generating relocateable output, and we see a reloc against + we are generating relocatable output, and we see a reloc against a global symbol, we can not know the symbol index until we have finished examining all the local symbols to see which ones we are going to output. To deal with this, we keep the relocations in memory, and don't output them until the end of the link. This is an unfortunate waste of memory, but I don't see a good way around - it. Fortunately, it only happens when performing a relocateable + it. Fortunately, it only happens when performing a relocatable link, which is not the common case. FIXME: If keep_memory is set we could write the relocs out and then read them again; I don't know how bad the memory loss will be. */ @@ -4044,7 +4081,7 @@ elf_bfd_final_link (abfd, info) } } - if (info->relocateable) + if (info->relocatable) { bfd_boolean failed = FALSE; @@ -4416,8 +4453,9 @@ elf_link_output_extsym (h, data) program is run. We don't have to worry about symbols that are referenced by regular files, because we will already have issued warnings for them. */ - if (! finfo->info->relocateable - && (! finfo->info->shared || ! finfo->info->allow_shlib_undefined) + if (! finfo->info->relocatable + && (finfo->info->executable + || ! 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 @@ -4434,7 +4472,7 @@ elf_link_output_extsym (h, data) /* We should also warn if a forced local symbol is referenced from shared libraries. */ - if (! finfo->info->relocateable + if (! finfo->info->relocatable && (! finfo->info->shared || ! finfo->info->allow_shlib_undefined) && (h->elf_link_hash_flags & (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC @@ -4532,11 +4570,11 @@ elf_link_output_extsym (h, data) return FALSE; } - /* ELF symbols in relocateable files are section relative, - but in nonrelocateable files they are virtual + /* ELF symbols in relocatable files are section relative, + but in nonrelocatable files they are virtual addresses. */ sym.st_value = h->root.u.def.value + input_sec->output_offset; - if (! finfo->info->relocateable) + if (! finfo->info->relocatable) { sym.st_value += input_sec->output_section->vma; if (h->type == STT_TLS) @@ -4619,7 +4657,7 @@ elf_link_output_extsym (h, data) /* If a non-weak symbol with non-default visibility is not defined locally, it is a fatal error. */ - if (! finfo->info->relocateable + if (! finfo->info->relocatable && ELF_ST_VISIBILITY (sym.st_other) != STV_DEFAULT && ELF_ST_BIND (sym.st_info) != STB_WEAK && h->root.type == bfd_link_hash_undefined @@ -4749,7 +4787,7 @@ elf_link_input_bfd (finfo, input_bfd) if ((input_bfd->flags & DYNAMIC) != 0) return TRUE; - emit_relocs = (finfo->info->relocateable + emit_relocs = (finfo->info->relocatable || finfo->info->emitrelocations || bed->elf_backend_emit_relocs); @@ -4844,7 +4882,7 @@ elf_link_input_bfd (finfo, input_bfd) continue; /* If we are discarding all local symbols, we don't want to - output this one. If we are generating a relocateable output + output this one. If we are generating a relocatable output file, then some of the local symbols may be required by relocs; we output them below as we discover that they are needed. */ @@ -4859,7 +4897,7 @@ elf_link_input_bfd (finfo, input_bfd) if ((isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE) && isec != NULL && ((! isec->linker_mark && (isec->flags & SEC_HAS_CONTENTS) != 0) - || (! finfo->info->relocateable + || (! finfo->info->relocatable && (isec->flags & SEC_EXCLUDE) != 0))) continue; @@ -4874,7 +4912,7 @@ elf_link_input_bfd (finfo, input_bfd) && (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, FALSE) == NULL)) || (((finfo->info->discard == discard_sec_merge - && (isec->flags & SEC_MERGE) && ! finfo->info->relocateable) + && (isec->flags & SEC_MERGE) && ! finfo->info->relocatable) || finfo->info->discard == discard_l) && bfd_is_local_label_name (input_bfd, name))) continue; @@ -4891,7 +4929,7 @@ elf_link_input_bfd (finfo, input_bfd) *pindex = bfd_get_symcount (output_bfd); - /* ELF symbols in relocateable files are section relative, but + /* ELF symbols in relocatable files are section relative, but in executable files they are virtual addresses. Note that this code assumes that all ELF sections have an associated BFD section with a reasonable value for output_offset; below @@ -4899,7 +4937,7 @@ elf_link_input_bfd (finfo, input_bfd) output_section. Any special sections must be set up to meet these requirements. */ osym.st_value += isec->output_offset; - if (! finfo->info->relocateable) + if (! finfo->info->relocatable) { osym.st_value += isec->output_section->vma; if (ELF_ST_TYPE (osym.st_info) == STT_TLS) @@ -4967,9 +5005,9 @@ elf_link_input_bfd (finfo, input_bfd) from discarded sections and section symbols from removed link-once sections. Complain about relocs against discarded sections. Zero relocs against removed - link-once sections. */ - if (!finfo->info->relocateable - && !elf_section_ignore_discarded_relocs (o)) + link-once sections. Preserve debug information as much + as we can. */ + if (!elf_section_ignore_discarded_relocs (o)) { Elf_Internal_Rela *rel, *relend; @@ -4978,6 +5016,7 @@ elf_link_input_bfd (finfo, input_bfd) for ( ; rel < relend; rel++) { unsigned long r_symndx = ELF_R_SYM (rel->r_info); + asection *sec; if (r_symndx >= locsymcount || (elf_bad_symtab (input_bfd) @@ -4992,28 +5031,36 @@ elf_link_input_bfd (finfo, input_bfd) /* Complain if the definition comes from a discarded section. */ + sec = h->root.u.def.section; if ((h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) - && elf_discarded_section (h->root.u.def.section)) + && elf_discarded_section (sec)) { if ((o->flags & SEC_DEBUGGING) != 0) { BFD_ASSERT (r_symndx != 0); - memset (rel, 0, sizeof (*rel)); + /* Try to preserve debug information. */ + if ((o->flags & SEC_DEBUGGING) != 0 + && sec->kept_section != NULL + && sec->_raw_size == sec->kept_section->_raw_size) + h->root.u.def.section + = sec->kept_section; + else + memset (rel, 0, sizeof (*rel)); } else - { - if (! ((*finfo->info->callbacks->undefined_symbol) - (finfo->info, h->root.root.string, - input_bfd, o, rel->r_offset, - TRUE))) - return FALSE; - } + finfo->info->callbacks->error_handler + (LD_DEFINITION_IN_DISCARDED_SECTION, + _("%T: discarded in section `%s' from %s\n"), + h->root.root.string, + h->root.root.string, + h->root.u.def.section->name, + bfd_archive_filename (h->root.u.def.section->owner)); } } else { - asection *sec = finfo->sections[r_symndx]; + sec = finfo->sections[r_symndx]; if (sec != NULL && elf_discarded_section (sec)) { @@ -5021,32 +5068,36 @@ elf_link_input_bfd (finfo, input_bfd) || (sec->flags & SEC_LINK_ONCE) != 0) { BFD_ASSERT (r_symndx != 0); - rel->r_info - = ELF_R_INFO (0, ELF_R_TYPE (rel->r_info)); - rel->r_addend = 0; + /* Try to preserve debug information. */ + if ((o->flags & SEC_DEBUGGING) != 0 + && sec->kept_section != NULL + && sec->_raw_size == sec->kept_section->_raw_size) + finfo->sections[r_symndx] + = sec->kept_section; + else + { + rel->r_info + = ELF_R_INFO (0, ELF_R_TYPE (rel->r_info)); + rel->r_addend = 0; + } } else { - bfd_boolean ok; - const char *msg - = _("local symbols in discarded section %s"); - bfd_size_type amt - = strlen (sec->name) + strlen (msg) - 1; - char *buf = (char *) bfd_malloc (amt); - - if (buf != NULL) - sprintf (buf, msg, sec->name); - else - buf = (char *) sec->name; - ok = (*finfo->info->callbacks - ->undefined_symbol) (finfo->info, buf, - input_bfd, o, - rel->r_offset, - TRUE); - if (buf != sec->name) + static int count; + int ok; + char *buf; + + ok = asprintf (&buf, "local symbol %d", + count++); + if (ok <= 0) + buf = (char *) "local symbol"; + finfo->info->callbacks->error_handler + (LD_DEFINITION_IN_DISCARDED_SECTION, + _("%T: discarded in section `%s' from %s\n"), + buf, buf, sec->name, + bfd_archive_filename (input_bfd)); + if (ok != -1) free (buf); - if (!ok) - return FALSE; } } } @@ -5057,7 +5108,7 @@ elf_link_input_bfd (finfo, input_bfd) The back end routine is responsible for adjusting the section contents as necessary, and (if using Rela relocs - and generating a relocateable output file) adjusting the + and generating a relocatable output file) adjusting the reloc addend as necessary. The back end routine does not have to worry about setting @@ -5067,7 +5118,7 @@ elf_link_input_bfd (finfo, input_bfd) internal symbols, and can access the hash table entries for the external symbols via elf_sym_hashes (input_bfd). - When generating relocateable output, the back end routine + When generating relocatable output, the back end routine must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be a section symbol corresponding to the output section, which will require @@ -5106,7 +5157,7 @@ elf_link_input_bfd (finfo, input_bfd) + elf_section_data (o->output_section)->rel_count + elf_section_data (o->output_section)->rel_count2); last_offset = o->output_offset; - if (!finfo->info->relocateable) + if (!finfo->info->relocatable) last_offset += o->output_section->vma; for (next_erel = 0; irela < irelaend; irela++, next_erel++) { @@ -5139,7 +5190,7 @@ elf_link_input_bfd (finfo, input_bfd) irela->r_offset += o->output_offset; /* Relocs in an executable have to be virtual addresses. */ - if (!finfo->info->relocateable) + if (!finfo->info->relocatable) irela->r_offset += o->output_section->vma; last_offset = irela->r_offset; @@ -5243,7 +5294,7 @@ elf_link_input_bfd (finfo, input_bfd) return FALSE; sym.st_value += sec->output_offset; - if (! finfo->info->relocateable) + if (! finfo->info->relocatable) { sym.st_value += osec->vma; if (ELF_ST_TYPE (sym.st_info) == STT_TLS) @@ -5271,7 +5322,7 @@ elf_link_input_bfd (finfo, input_bfd) /* Swap out the relocs. */ if (bed->elf_backend_emit_relocs - && !(finfo->info->relocateable + && !(finfo->info->relocatable || finfo->info->emitrelocations)) reloc_emitter = bed->elf_backend_emit_relocs; else @@ -5471,10 +5522,10 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order) } /* The address of a reloc is relative to the section in a - relocateable file, and is a virtual address in an executable + relocatable file, and is a virtual address in an executable file. */ offset = link_order->offset; - if (! info->relocateable) + if (! info->relocatable) offset += output_section->vma; for (i = 0; i < bed->s->int_rels_per_ext_rel; i++) @@ -6138,7 +6189,7 @@ elf_gc_sections (abfd, info) struct elf_link_hash_entry *h, Elf_Internal_Sym *)); if (!get_elf_backend_data (abfd)->can_gc_sections - || info->relocateable || info->emitrelocations + || info->relocatable || info->emitrelocations || elf_hash_table (info)->dynamic_sections_created) return TRUE; @@ -6252,23 +6303,25 @@ elf_gc_record_vtentry (abfd, sec, h, addend) if (addend >= h->vtable_entries_size) { - size_t size, bytes; + size_t size, bytes, file_align; bfd_boolean *ptr = h->vtable_entries_used; /* While the symbol is undefined, we have to be prepared to handle a zero size. */ + file_align = 1 << log_file_align; if (h->root.type == bfd_link_hash_undefined) - size = addend; + size = addend + file_align; else { size = h->size; - if (size < addend) + if (addend >= size) { /* Oops! We've got a reference past the defined end of the table. This is probably a bug -- shall we warn? */ - size = addend; + size = addend + file_align; } } + size = (size + file_align - 1) & -file_align; /* Allocate one extra entry for use as a "done" flag for the consolidation pass. */ @@ -6546,7 +6599,7 @@ elf_bfd_discard_info (output_bfd, info) continue; eh = bfd_get_section_by_name (abfd, ".eh_frame"); - if (info->relocateable + if (info->relocatable || (eh != NULL && (eh->_raw_size == 0 || bfd_is_abs_section (eh->output_section)))) @@ -6652,7 +6705,7 @@ elf_bfd_discard_info (output_bfd, info) } if (info->eh_frame_hdr - && !info->relocateable + && !info->relocatable && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info)) ret = TRUE; diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c index 2e499488821..60c6ad0404f 100644 --- a/bfd/elfn32-mips.c +++ b/bfd/elfn32-mips.c @@ -1453,9 +1453,10 @@ mips_elf_got16_reloc (abfd, reloc_entry, symbol, data, input_section, char **error_message; { /* If we're relocating, and this is a local symbol, we can handle it - just like HI16. */ + just like an R_MIPS_HI16. */ if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) != 0) + && ((symbol->flags & BSF_SECTION_SYM) != 0 + || (symbol->flags & BSF_LOCAL) == 0)) return mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); @@ -1519,18 +1520,18 @@ mips_elf_assign_gp (output_bfd, pgp) symbol value correctly. We look up the symbol _gp in the output BFD. If we can't find it, we're stuck. We cache it in the ELF target data. We don't need to adjust the symbol value for an - external symbol if we are producing relocateable output. */ + external symbol if we are producing relocatable output. */ static bfd_reloc_status_type -mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, pgp) +mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, pgp) bfd *output_bfd; asymbol *symbol; - bfd_boolean relocateable; + bfd_boolean relocatable; char **error_message; bfd_vma *pgp; { if (bfd_is_und_section (symbol->section) - && ! relocateable) + && ! relocatable) { *pgp = 0; return bfd_reloc_undefined; @@ -1538,10 +1539,10 @@ mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, pgp) *pgp = _bfd_get_gp_value (output_bfd); if (*pgp == 0 - && (! relocateable + && (! relocatable || (symbol->flags & BSF_SECTION_SYM) != 0)) { - if (relocateable) + if (relocatable) { /* Make up a value. */ *pgp = symbol->section->output_section->vma /*+ 0x4000*/; @@ -1572,27 +1573,27 @@ mips_elf_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, bfd *output_bfd; char **error_message ATTRIBUTE_UNUSED; { - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_reloc_status_type ret; bfd_vma gp; GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) if (output_bfd != (bfd *) NULL) - relocateable = TRUE; + relocatable = TRUE; else { - relocateable = FALSE; + relocatable = FALSE; output_bfd = symbol->section->output_section->owner; } - ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, + ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, &gp); if (ret != bfd_reloc_ok) return ret; return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, - input_section, relocateable, + input_section, relocatable, data, gp); } @@ -1609,7 +1610,7 @@ mips_elf_literal_reloc (abfd, reloc_entry, symbol, data, input_section, bfd *output_bfd; char **error_message; { - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_reloc_status_type ret; bfd_vma gp; @@ -1617,20 +1618,20 @@ mips_elf_literal_reloc (abfd, reloc_entry, symbol, data, input_section, /* FIXME: The entries in the .lit8 and .lit4 sections should be merged. */ if (output_bfd != (bfd *) NULL) - relocateable = TRUE; + relocatable = TRUE; else { - relocateable = FALSE; + relocatable = FALSE; output_bfd = symbol->section->output_section->owner; } - ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, + ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, &gp); if (ret != bfd_reloc_ok) return ret; return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, - input_section, relocateable, + input_section, relocatable, data, gp); } @@ -1648,18 +1649,16 @@ mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, bfd *output_bfd; char **error_message; { - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_reloc_status_type ret; bfd_vma gp; GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) - /* R_MIPS_GPREL32 relocations are defined for local symbols only. - We will only have an addend if this is a newly created reloc, - not read from an ELF file. */ + /* R_MIPS_GPREL32 relocations are defined for local symbols only. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) + && (symbol->flags & BSF_LOCAL) != 0) { *error_message = (char *) _("32bits gp relative relocation occurs for an external symbol"); @@ -1668,32 +1667,32 @@ mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, if (output_bfd != (bfd *) NULL) { - relocateable = TRUE; + relocatable = TRUE; gp = _bfd_get_gp_value (output_bfd); } else { - relocateable = FALSE; + relocatable = FALSE; output_bfd = symbol->section->output_section->owner; - ret = mips_elf_final_gp (output_bfd, symbol, relocateable, + ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, &gp); if (ret != bfd_reloc_ok) return ret; } return gprel32_with_gp (abfd, symbol, reloc_entry, input_section, - relocateable, data, gp); + relocatable, data, gp); } static bfd_reloc_status_type -gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocateable, data, +gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocatable, data, gp) bfd *abfd; asymbol *symbol; arelent *reloc_entry; asection *input_section; - bfd_boolean relocateable; + bfd_boolean relocatable; PTR data; bfd_vma gp; { @@ -1720,15 +1719,15 @@ gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocateable, data, val += reloc_entry->addend; /* Adjust val for the final section location and GP value. If we - are producing relocateable output, we don't want to do this for + are producing relocatable output, we don't want to do this for an external symbol. */ - if (! relocateable + if (! relocatable || (symbol->flags & BSF_SECTION_SYM) != 0) val += relocation - gp; bfd_put_32 (abfd, (bfd_vma) val, (bfd_byte *) data + reloc_entry->address); - if (relocateable) + if (relocatable) reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; @@ -1750,8 +1749,11 @@ mips_elf_shift6_reloc (abfd, reloc_entry, symbol, data, input_section, { GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) - reloc_entry->addend = (reloc_entry->addend & 0x00007c0) - | (reloc_entry->addend & 0x00000800) >> 9; + if (reloc_entry->howto->partial_inplace) + { + reloc_entry->addend = ((reloc_entry->addend & 0x00007c0) + | (reloc_entry->addend & 0x00000800) >> 9); + } SET_RELOC_ADDEND (reloc_entry) @@ -1798,23 +1800,25 @@ mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, bfd *output_bfd; char **error_message; { - bfd_boolean relocateable; + bfd_boolean relocatable; bfd_reloc_status_type ret; bfd_vma gp; - unsigned short extend, insn; - unsigned long final; + unsigned short extend = 0; + unsigned short insn = 0; + bfd_signed_vma val; + bfd_vma relocation; GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) if (output_bfd != NULL) - relocateable = TRUE; + relocatable = TRUE; else { - relocateable = FALSE; + relocatable = FALSE; output_bfd = symbol->section->output_section->owner; } - ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, + ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, &gp); if (ret != bfd_reloc_ok) return ret; @@ -1822,33 +1826,55 @@ mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, if (reloc_entry->address > input_section->_cooked_size) return bfd_reloc_outofrange; - /* Pick up the mips16 extend instruction and the real instruction. */ - extend = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address); - insn = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address + 2); - - /* Stuff the current addend back as a 32 bit value, do the usual - relocation, and then clean up. */ - bfd_put_32 (abfd, - (bfd_vma) (((extend & 0x1f) << 11) - | (extend & 0x7e0) - | (insn & 0x1f)), - (bfd_byte *) data + reloc_entry->address); - - ret = _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, - input_section, relocateable, data, gp); - - final = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - bfd_put_16 (abfd, - (bfd_vma) ((extend & 0xf800) - | ((final >> 11) & 0x1f) - | (final & 0x7e0)), - (bfd_byte *) data + reloc_entry->address); - bfd_put_16 (abfd, - (bfd_vma) ((insn & 0xffe0) - | (final & 0x1f)), - (bfd_byte *) data + reloc_entry->address + 2); + if (bfd_is_com_section (symbol->section)) + relocation = 0; + else + relocation = symbol->value; - return ret; + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + + /* Set val to the offset into the section or symbol. */ + val = reloc_entry->addend; + + if (reloc_entry->howto->partial_inplace) + { + /* Pick up the mips16 extend instruction and the real instruction. */ + extend = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address); + insn = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address + 2); + val += ((extend & 0x1f) << 11) | (extend & 0x7e0) | (insn & 0x1f); + } + + _bfd_mips_elf_sign_extend(val, 16); + + /* Adjust val for the final section location and GP value. If we + are producing relocatable output, we don't want to do this for + an external symbol. */ + if (! relocatable + || (symbol->flags & BSF_SECTION_SYM) != 0) + val += relocation - gp; + + if (reloc_entry->howto->partial_inplace) + { + bfd_put_16 (abfd, + (bfd_vma) ((extend & 0xf800) + | ((val >> 11) & 0x1f) + | (val & 0x7e0)), + (bfd_byte *) data + reloc_entry->address); + bfd_put_16 (abfd, + (bfd_vma) ((insn & 0xffe0) + | (val & 0x1f)), + (bfd_byte *) data + reloc_entry->address + 2); + } + else + reloc_entry->addend = val; + + if (relocatable) + reloc_entry->address += input_section->output_offset; + else if (((val & ~0xffff) != ~0xffff) && ((val & ~0xffff) != 0)) + return bfd_reloc_overflow; + + return bfd_reloc_ok; } #undef GET_RELOC_ADDEND diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index ab2ff21c887..2098f6fa9fa 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -1341,7 +1341,7 @@ elfNN_ia64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd_vma *valp; { if (sym->st_shndx == SHN_COMMON - && !info->relocateable + && !info->relocatable && sym->st_size <= elf_gp_size (abfd)) { /* Common symbols less than or equal to -G nn bytes are @@ -2228,7 +2228,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; asection *got, *fptr, *srel; - if (info->relocateable) + if (info->relocatable) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -2903,7 +2903,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) /* Set the contents of the .interp section to the interpreter. */ if (ia64_info->root.dynamic_sections_created - && !info->shared) + && info->executable) { sec = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (sec != NULL); @@ -3078,7 +3078,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) later (in finish_dynamic_sections) but we must add the entries now so that we get the correct size for the .dynamic section. */ - if (!info->shared) + if (info->executable) { /* The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ @@ -3779,7 +3779,7 @@ elfNN_ia64_final_link (abfd, info) ia64_info = elfNN_ia64_hash_table (info); /* Make sure we've got ourselves a nice fat __gp value. */ - if (!info->relocateable) + if (!info->relocatable) { bfd_vma gp_val = _bfd_get_gp_value (abfd); struct elf_link_hash_entry *gp; @@ -3805,7 +3805,7 @@ elfNN_ia64_final_link (abfd, info) of the .IA_64.unwind section. Force this section to be relocated into memory rather than written immediately to the output file. */ unwind_output_sec = NULL; - if (!info->relocateable) + if (!info->relocatable) { asection *s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind); if (s) @@ -3863,7 +3863,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, ia64_info = elfNN_ia64_hash_table (info); /* Infect various flags from the input section to the output section. */ - if (info->relocateable) + if (info->relocatable) { bfd_vma flags; @@ -4325,7 +4325,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, { int i; for (i = m->count - 1; i >= 0; i--) - if (m->sections[i] == sym_sec->output_section) + if (m->sections[i] == input_section->output_section) break; if (i >= 0) break; diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 4199ff7064f..478a0dbed87 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -163,7 +163,7 @@ struct mips_elf_hash_sort_data long min_got_dynindx; /* The greatest dynamic symbol table index corresponding to a symbol with a GOT entry that is not referenced (e.g., a dynamic symbol - with dynamic relocations pointing to it from non-primary GOTs). */ + with dynamic relocations pointing to it from non-primary GOTs). */ long max_unref_got_dynindx; /* The greatest dynamic symbol table index not corresponding to a symbol without a GOT entry. */ @@ -245,7 +245,8 @@ struct mips_elf_link_hash_table struct extsym_info { - bfd *abfd; struct bfd_link_info *info; + bfd *abfd; + struct bfd_link_info *info; struct ecoff_debug_info *debug; const struct ecoff_debug_swap *swap; bfd_boolean failed; @@ -433,7 +434,6 @@ static const Elf_Internal_Rela *mips_elf_next_relocation const Elf_Internal_Rela *)); static bfd_boolean mips_elf_local_relocation_p PARAMS ((bfd *, const Elf_Internal_Rela *, asection **, bfd_boolean)); -static bfd_vma mips_elf_sign_extend PARAMS ((bfd_vma, int)); static bfd_boolean mips_elf_overflow_p PARAMS ((bfd_vma, int)); static bfd_vma mips_elf_high PARAMS ((bfd_vma)); static bfd_vma mips_elf_higher PARAMS ((bfd_vma)); @@ -516,11 +516,11 @@ static bfd *reldyn_sorting_bfd; /* The name of the options section. */ #define MIPS_ELF_OPTIONS_SECTION_NAME(abfd) \ - (ABI_64_P (abfd) ? ".MIPS.options" : ".options") + (NEWABI_P (abfd) ? ".MIPS.options" : ".options") /* The name of the stub section. */ #define MIPS_ELF_STUB_SECTION_NAME(abfd) \ - (ABI_64_P (abfd) ? ".MIPS.stubs" : ".stub") + (NEWABI_P (abfd) ? ".MIPS.stubs" : ".stub") /* The size of an external REL relocation. */ #define MIPS_ELF_REL_SIZE(abfd) \ @@ -1080,18 +1080,18 @@ mips_elf_check_mips16_stubs (h, data) bfd_reloc_status_type _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, input_section, - relocateable, data, gp) + relocatable, data, gp) bfd *abfd; asymbol *symbol; arelent *reloc_entry; asection *input_section; - bfd_boolean relocateable; + bfd_boolean relocatable; PTR data; bfd_vma gp; { bfd_vma relocation; - unsigned long insn; - unsigned long val; + unsigned long insn = 0; + bfd_signed_vma val; if (bfd_is_com_section (symbol->section)) relocation = 0; @@ -1104,35 +1104,36 @@ _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, input_section, if (reloc_entry->address > input_section->_cooked_size) return bfd_reloc_outofrange; - insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); - /* Set val to the offset into the section or symbol. */ - if (reloc_entry->howto->src_mask == 0) - { - /* This case occurs with the 64-bit MIPS ELF ABI. */ - val = reloc_entry->addend; - } - else + val = reloc_entry->addend; + + if (reloc_entry->howto->partial_inplace) { - val = ((insn & 0xffff) + reloc_entry->addend) & 0xffff; - if (val & 0x8000) - val -= 0x10000; + insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + val += insn & 0xffff; } + _bfd_mips_elf_sign_extend(val, 16); + /* Adjust val for the final section location and GP value. If we - are producing relocateable output, we don't want to do this for + are producing relocatable output, we don't want to do this for an external symbol. */ - if (! relocateable + if (! relocatable || (symbol->flags & BSF_SECTION_SYM) != 0) val += relocation - gp; - insn = (insn & ~0xffff) | (val & 0xffff); - bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); + if (reloc_entry->howto->partial_inplace) + { + insn = (insn & ~0xffff) | (val & 0xffff); + bfd_put_32 (abfd, (bfd_vma) insn, + (bfd_byte *) data + reloc_entry->address); + } + else + reloc_entry->addend = val; - if (relocateable) + if (relocatable) reloc_entry->address += input_section->output_offset; - - else if ((long) val >= 0x8000 || (long) val < -0x8000) + else if (((val & ~0xffff) != ~0xffff) && ((val & ~0xffff) != 0)) return bfd_reloc_overflow; return bfd_reloc_ok; @@ -1662,7 +1663,7 @@ mips_elf_rel_dyn_section (dynobj, create_p) | SEC_LINKER_CREATED | SEC_READONLY)) || ! bfd_set_section_alignment (dynobj, sreloc, - 4)) + MIPS_ELF_LOG_FILE_ALIGN (dynobj))) return NULL; } return sreloc; @@ -2740,8 +2741,8 @@ mips_elf_local_relocation_p (input_bfd, relocation, local_sections, /* Sign-extend VALUE, which has the indicated number of BITS. */ -static bfd_vma -mips_elf_sign_extend (value, bits) +bfd_vma +_bfd_mips_elf_sign_extend (value, bits) bfd_vma value; int bits; { @@ -2869,6 +2870,8 @@ mips_elf_create_got_section (abfd, info, maybe_exclude) if (maybe_exclude) flags |= SEC_EXCLUDE; + /* We have to use an alignment of 2**4 here because this is hardcoded + in the function stub generation and in the linker script. */ s = bfd_make_section (abfd, ".got"); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags) @@ -3150,7 +3153,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, /* If this is a 32- or 64-bit call to a 16-bit function with a stub, we need to redirect the call to the stub, unless we're already *in* a stub. */ - if (r_type != R_MIPS16_26 && !info->relocateable + if (r_type != R_MIPS16_26 && !info->relocatable && ((h != NULL && h->fn_stub != NULL) || (local_p && elf_tdata (input_bfd)->local_stubs != NULL && elf_tdata (input_bfd)->local_stubs[r_symndx] != NULL)) @@ -3171,7 +3174,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, } /* If this is a 16-bit call to a 32- or 64-bit function with a stub, we need to redirect the call to the stub. */ - else if (r_type == R_MIPS16_26 && !info->relocateable + else if (r_type == R_MIPS16_26 && !info->relocatable && h != NULL && (h->call_stub != NULL || h->call_fp_stub != NULL) && !target_is_16_bit_code_p) @@ -3207,7 +3210,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, /* Calls from 16-bit code to 32-bit code and vice versa require the special jalx instruction. */ - *require_jalxp = (!info->relocateable + *require_jalxp = (!info->relocatable && (((r_type == R_MIPS16_26) && !target_is_16_bit_code_p) || ((r_type == R_MIPS_26) && target_is_16_bit_code_p))); @@ -3304,7 +3307,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, return bfd_reloc_continue; case R_MIPS_16: - value = symbol + mips_elf_sign_extend (addend, 16); + value = symbol + _bfd_mips_elf_sign_extend (addend, 16); overflowed_p = mips_elf_overflow_p (value, 16); break; @@ -3355,7 +3358,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, break; case R_MIPS_GNU_REL16_S2: - value = symbol + mips_elf_sign_extend (addend << 2, 18) - p; + value = symbol + _bfd_mips_elf_sign_extend (addend << 2, 18) - p; overflowed_p = mips_elf_overflow_p (value, 18); value = (value >> 2) & howto->dst_mask; break; @@ -3380,7 +3383,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, if (local_p) value = (((addend << 2) | ((p + 4) & 0xf0000000)) + symbol) >> 2; else - value = (mips_elf_sign_extend (addend << 2, 28) + symbol) >> 2; + value = (_bfd_mips_elf_sign_extend (addend << 2, 28) + symbol) >> 2; value &= howto->dst_mask; break; @@ -3440,7 +3443,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, instruction. If the addend was separate, leave it alone, otherwise we may lose significant bits. */ if (howto->partial_inplace) - addend = mips_elf_sign_extend (addend, 16); + addend = _bfd_mips_elf_sign_extend (addend, 16); value = symbol + addend - gp; /* If the symbol was local, any earlier relocatable links will have adjusted its addend with the gp offset, so compensate @@ -3489,7 +3492,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, break; case R_MIPS_PC16: - value = mips_elf_sign_extend (addend, 16) + symbol - p; + value = _bfd_mips_elf_sign_extend (addend, 16) + symbol - p; overflowed_p = mips_elf_overflow_p (value, 16); break; @@ -3649,7 +3652,7 @@ mips_elf_perform_relocation (info, howto, relocation, value, input_bfd, JALX is the 5-bit value 00011. X is 0 for jal, 1 for jalx. Note that the immediate value in the first word is swapped. - When producing a relocateable object file, R_MIPS16_26 is + When producing a relocatable object file, R_MIPS16_26 is handled mostly like R_MIPS_26. In particular, the addend is stored as a straight 26-bit value in a 32-bit instruction. (gas makes life simpler for itself by never adjusting a @@ -3687,13 +3690,13 @@ mips_elf_perform_relocation (info, howto, relocation, value, input_bfd, where targ26-16 is sub1 followed by sub2 (i.e., the addend field A is ((sub1 << 16) | sub2)). - When producing a relocateable object file, the calculation is + When producing a relocatable object file, the calculation is (((A < 2) | ((P + 4) & 0xf0000000) + S) >> 2) When producing a fully linked file, the calculation is let R = (((A < 2) | ((P + 4) & 0xf0000000) + S) >> 2) ((R & 0x1f0000) << 5) | ((R & 0x3e00000) >> 5) | (R & 0xffff) */ - if (!info->relocateable) + if (!info->relocatable) /* Shuffle the bits according to the formula above. */ value = (((value & 0x1f0000) << 5) | ((value & 0x3e00000) >> 5) @@ -3852,7 +3855,7 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec, /* We begin by assuming that the offset for the dynamic relocation is the same as for the original relocation. We'll adjust this later to reflect the correct output offsets. */ - if (elf_section_data (input_section)->sec_info_type != ELF_INFO_TYPE_STABS) + if (input_section->sec_info_type != ELF_INFO_TYPE_STABS) { outrel[1].r_offset = rel[1].r_offset; outrel[2].r_offset = rel[2].r_offset; @@ -4638,30 +4641,11 @@ _bfd_mips_elf_fake_sections (abfd, hdr, sec) hdr->sh_entsize = 8; } - /* The generic elf_fake_sections will set up REL_HDR using the - default kind of relocations. But, we may actually need both - kinds of relocations, so we set up the second header here. - - This is not necessary for the O32 ABI since that only uses Elf32_Rel - relocations (cf. System V ABI, MIPS RISC Processor Supplement, - 3rd Edition, p. 4-17). It breaks the IRIX 5/6 32-bit ld, since one - of the resulting empty .rela.
sections starts with - sh_offset == object size, and ld doesn't allow that. While the check - is arguably bogus for empty or SHT_NOBITS sections, it can easily be - avoided by not emitting those useless sections in the first place. */ - if (! SGI_COMPAT (abfd) && ! NEWABI_P(abfd) - && (sec->flags & SEC_RELOC) != 0) - { - struct bfd_elf_section_data *esd; - bfd_size_type amt = sizeof (Elf_Internal_Shdr); - - esd = elf_section_data (sec); - BFD_ASSERT (esd->rel_hdr2 == NULL); - esd->rel_hdr2 = (Elf_Internal_Shdr *) bfd_zalloc (abfd, amt); - if (!esd->rel_hdr2) - return FALSE; - _bfd_elf_init_reloc_shdr (abfd, esd->rel_hdr2, sec, !sec->use_rela_p); - } + /* The generic elf_fake_sections will set up REL_HDR using the default + kind of relocations. We used to set up a second header for the + non-default kind of relocations here, but only NewABI would use + these, and the IRIX ld doesn't like resulting empty RELA sections. + Thus we create those header only on demand now. */ return TRUE; } @@ -4973,19 +4957,19 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info) /* Change alignments of some sections. */ s = bfd_get_section_by_name (abfd, ".hash"); if (s != NULL) - bfd_set_section_alignment (abfd, s, 4); + bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd)); s = bfd_get_section_by_name (abfd, ".dynsym"); if (s != NULL) - bfd_set_section_alignment (abfd, s, 4); + bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd)); s = bfd_get_section_by_name (abfd, ".dynstr"); if (s != NULL) - bfd_set_section_alignment (abfd, s, 4); + bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd)); s = bfd_get_section_by_name (abfd, ".reginfo"); if (s != NULL) - bfd_set_section_alignment (abfd, s, 4); + bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd)); s = bfd_get_section_by_name (abfd, ".dynamic"); if (s != NULL) - bfd_set_section_alignment (abfd, s, 4); + bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd)); } if (!info->shared) @@ -5060,7 +5044,7 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) asection *sreloc; struct elf_backend_data *bed; - if (info->relocateable) + if (info->relocatable) return TRUE; dynobj = elf_hash_table (info)->dynobj; @@ -5556,7 +5540,7 @@ _bfd_mips_relax_section (abfd, sec, link_info, again) /* We are not currently changing any sizes, so only one pass. */ *again = FALSE; - if (link_info->relocateable) + if (link_info->relocatable) return TRUE; internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, @@ -5747,7 +5731,7 @@ _bfd_mips_elf_adjust_dynamic_symbol (info, h) any R_MIPS_32 or R_MIPS_REL32 relocs against it into the output file. */ hmips = (struct mips_elf_link_hash_entry *) h; - if (! info->relocateable + if (! info->relocatable && hmips->possibly_dynamic_relocs != 0 && (h->root.type == bfd_link_hash_defweak || (h->elf_link_hash_flags @@ -5845,7 +5829,7 @@ _bfd_mips_elf_always_size_sections (output_bfd, info) bfd_set_section_size (output_bfd, ri, (bfd_size_type) sizeof (Elf32_External_RegInfo)); - if (! (info->relocateable + if (! (info->relocatable || ! mips_elf_hash_table (info)->mips16_stubs_seen)) mips_elf_link_hash_traverse (mips_elf_hash_table (info), mips_elf_check_mips16_stubs, @@ -6352,7 +6336,7 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, input_bfd, contents); l &= lo16_howto->src_mask; l <<= lo16_howto->rightshift; - l = mips_elf_sign_extend (l, 16); + l = _bfd_mips_elf_sign_extend (l, 16); addend <<= 16; @@ -6383,7 +6367,7 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, addend = rel->r_addend; } - if (info->relocateable) + if (info->relocatable) { Elf_Internal_Sym *sym; unsigned long r_symndx; @@ -6397,7 +6381,7 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, they're against a section symbol, in which case we need to adjust by the section offset, or unless they're GP relative in which case we need to adjust by the amount - that we're adjusting GP in this relocateable object. */ + that we're adjusting GP in this relocatable object. */ if (! mips_elf_local_relocation_p (input_bfd, rel, local_sections, FALSE)) @@ -7798,10 +7782,10 @@ _bfd_mips_elf_hide_symbol (info, entry, force_local) h = (struct mips_elf_link_hash_entry *) entry; if (h->forced_local) return; - h->forced_local = TRUE; + h->forced_local = force_local; dynobj = elf_hash_table (info)->dynobj; - if (dynobj != NULL) + if (dynobj != NULL && force_local) { got = mips_elf_got_section (dynobj, FALSE); g = mips_elf_section_data (got)->u.got_info; @@ -7897,7 +7881,7 @@ _bfd_mips_elf_discard_info (abfd, cookie, info) cookie->rel = cookie->rels; cookie->relend = cookie->rels + o->reloc_count; - for (i = 0, skip = 0; i < o->_raw_size; i ++) + for (i = 0, skip = 0; i < o->_raw_size / PDR_SIZE; i ++) { if (MNAME(abfd,_bfd_elf,reloc_symbol_deleted_p) (i * PDR_SIZE, cookie)) { @@ -8128,12 +8112,12 @@ _bfd_mips_elf_set_section_contents (abfd, section, location, offset, count) bfd_byte * _bfd_elf_mips_get_relocated_section_contents (abfd, link_info, link_order, - data, relocateable, symbols) + data, relocatable, symbols) bfd *abfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - bfd_boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { /* Get enough memory to hold the stuff */ @@ -8241,7 +8225,7 @@ _bfd_elf_mips_get_relocated_section_contents (abfd, link_info, link_order, { /* bypass special_function call */ r = _bfd_mips_elf_gprel16_with_gp (input_bfd, sym, *parent, - input_section, relocateable, + input_section, relocatable, (PTR) data, gp); goto skip_bfd_perform_relocation; } @@ -8251,11 +8235,11 @@ _bfd_elf_mips_get_relocated_section_contents (abfd, link_info, link_order, *parent, (PTR) data, input_section, - relocateable ? abfd : (bfd *) NULL, + relocatable ? abfd : (bfd *) NULL, &error_message); skip_bfd_perform_relocation: - if (relocateable) + if (relocatable) { asection *os = input_section->output_section; @@ -8462,7 +8446,7 @@ _bfd_mips_elf_final_link (abfd, info) elf_gp (abfd) = (h->u.def.value + h->u.def.section->output_section->vma + h->u.def.section->output_offset); - else if (info->relocateable) + else if (info->relocatable) { bfd_vma lo = MINUS_ONE; @@ -8783,7 +8767,7 @@ _bfd_mips_elf_final_link (abfd, info) information describing how the small data area would change depending upon the -G switch. These sections not used in executables files. */ - if (! info->relocateable) + if (! info->relocatable) { for (p = o->link_order_head; p != (struct bfd_link_order *) NULL; diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h index 3064c39d137..088dd6a57eb 100644 --- a/bfd/elfxx-mips.h +++ b/bfd/elfxx-mips.h @@ -108,6 +108,7 @@ extern bfd_reloc_status_type _bfd_mips_elf32_gprel16_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); extern unsigned long _bfd_elf_mips_mach PARAMS ((flagword)); -extern bfd_boolean _bfd_mips_relax_section (bfd *, asection *, - struct bfd_link_info *, - bfd_boolean *); +extern bfd_boolean _bfd_mips_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *)); +extern bfd_vma _bfd_mips_elf_sign_extend + PARAMS ((bfd_vma, int)); diff --git a/bfd/i386linux.c b/bfd/i386linux.c index 6403e1c608b..84ae477d562 100644 --- a/bfd/i386linux.c +++ b/bfd/i386linux.c @@ -353,7 +353,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, insert = FALSE; - if (! info->relocateable + if (! info->relocatable && linux_hash_table (info)->dynobj == NULL && strcmp (name, SHARABLE_CONFLICTS) == 0 && (flags & BSF_CONSTRUCTOR) != 0 diff --git a/bfd/ieee.c b/bfd/ieee.c index 59d57430d89..f0ba1e5b115 100644 --- a/bfd/ieee.c +++ b/bfd/ieee.c @@ -3590,7 +3590,7 @@ static const unsigned char exten[] = 0xf0, 0x20, 0x00, 0xf1, 0xce, 0x20, 0x00, 37, 3, 3, /* Set version 3 rev 3. */ 0xf1, 0xce, 0x20, 0x00, 39, 2, /* Keep symbol in original case. */ - 0xf1, 0xce, 0x20, 0x00, 38 /* Set object type relocateable to x. */ + 0xf1, 0xce, 0x20, 0x00, 38 /* Set object type relocatable to x. */ }; static const unsigned char envi[] = diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 9bbdebd2184..46695e766ad 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -1509,7 +1509,7 @@ bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd, struct bfd_link_info *link_info, struct bfd_link_order *link_order, bfd_byte *data, - bfd_boolean relocateable, + bfd_boolean relocatable, asymbol **symbols)); /* Extracted from archures.c. */ diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h index fac76506d4a..0c19433753c 100644 --- a/bfd/libcoff-in.h +++ b/bfd/libcoff-in.h @@ -1,6 +1,6 @@ /* BFD COFF object file private structure. 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. @@ -434,7 +434,7 @@ struct coff_debug_merge_hash_table bfd_hash_lookup (&(table)->root, (string), (create), (copy))) /* Information we keep for each section in the output file when doing - a relocateable link. */ + a relocatable link. */ struct coff_link_section_info { @@ -461,7 +461,7 @@ struct coff_final_link_info bfd_boolean global_to_static; /* Hash table for long symbol names. */ struct bfd_strtab_hash *strtab; - /* When doing a relocateable link, an array of information kept for + /* When doing a relocatable link, an array of information kept for each output section, indexed by the target_index field. */ struct coff_link_section_info *section_info; /* Symbol index of last C_FILE symbol (-1 if none). */ diff --git a/bfd/libcoff.h b/bfd/libcoff.h index 1beec22af08..3cac32a4545 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -4,7 +4,7 @@ /* BFD COFF object file private structure. 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. @@ -438,7 +438,7 @@ struct coff_debug_merge_hash_table bfd_hash_lookup (&(table)->root, (string), (create), (copy))) /* Information we keep for each section in the output file when doing - a relocateable link. */ + a relocatable link. */ struct coff_link_section_info { @@ -465,7 +465,7 @@ struct coff_final_link_info bfd_boolean global_to_static; /* Hash table for long symbol names. */ struct bfd_strtab_hash *strtab; - /* When doing a relocateable link, an array of information kept for + /* When doing a relocatable link, an array of information kept for each output section, indexed by the target_index field. */ struct coff_link_section_info *section_info; /* Symbol index of last C_FILE symbol (-1 if none). */ diff --git a/bfd/linker.c b/bfd/linker.c index c0e3236f853..72f8bfd909d 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -88,7 +88,7 @@ SUBSECTION For example, with each entry in the hash table the a.out linker keeps the index the symbol has in the final output file - (this index number is used so that when doing a relocateable + (this index number is used so that when doing a relocatable link the symbol index used in the output file can be quickly filled in when copying over a reloc). The a.out linker code defines the required structures and functions for a hash table @@ -277,7 +277,7 @@ SUBSECTION the input sections and copy the data into the output sections. It must build an output symbol table including any local symbols from the input files and the global symbols from the - hash table. When producing relocateable output, it must + hash table. When producing relocatable output, it must modify the input relocs and write them into the output file. There may also be object format dependent work to be done. @@ -317,7 +317,7 @@ SUBSUBSECTION types of information. They also describe relocs that must be created by the BFD backend, but do not correspond to any input file; this is used to support -Ur, which builds constructors - while generating a relocateable object file. + while generating a relocatable object file. INODE Relocating the section contents, Writing the symbol table, Information provided by the linker, Performing the Final Link @@ -339,7 +339,7 @@ SUBSUBSECTION input files. The <<_bfd_final_link>> function should read the contents of the section and any associated relocs, apply the relocs to the section contents, and write out the modified - section contents. If performing a relocateable link, the + section contents. If performing a relocatable link, the relocs themselves must also be modified and written out. @findex _bfd_relocate_contents @@ -2043,7 +2043,7 @@ _bfd_generic_final_link (abfd, info) if (! generic_add_output_symbol (abfd, &outsymalloc, NULL)) return FALSE; - if (info->relocateable) + if (info->relocatable) { /* Allocate space for the output relocs for each section. */ for (o = abfd->sections; @@ -2362,7 +2362,7 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) break; case discard_sec_merge: output = TRUE; - if (info->relocateable + if (info->relocatable || ! (sym->section->flags & SEC_MERGE)) break; /* FALLTHROUGH */ @@ -2534,7 +2534,7 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order) { arelent *r; - if (! info->relocateable) + if (! info->relocatable) abort (); if (sec->orelocation == (arelent **) NULL) abort (); @@ -2767,7 +2767,7 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, BFD_ASSERT (input_section->output_offset == link_order->offset); BFD_ASSERT (input_section->_cooked_size == link_order->size); - if (info->relocateable + if (info->relocatable && input_section->reloc_count > 0 && output_section->orelocation == (arelent **) NULL) { @@ -2777,7 +2777,7 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, types of object files. Handling this case correctly is difficult, and sometimes impossible. */ (*_bfd_error_handler) - (_("Attempt to do relocateable link with %s input and %s output"), + (_("Attempt to do relocatable link with %s input and %s output"), bfd_get_target (input_bfd), bfd_get_target (output_bfd)); bfd_set_error (bfd_error_wrong_format); return FALSE; @@ -2842,7 +2842,7 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, if (contents == NULL && sec_size != 0) goto error_return; new_contents = (bfd_get_relocated_section_contents - (output_bfd, info, link_order, contents, info->relocateable, + (output_bfd, info, link_order, contents, info->relocatable, _bfd_generic_link_get_symbols (input_bfd))); if (!new_contents) goto error_return; diff --git a/bfd/m68klinux.c b/bfd/m68klinux.c index 1a829806975..90f342cba29 100644 --- a/bfd/m68klinux.c +++ b/bfd/m68klinux.c @@ -357,7 +357,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, insert = FALSE; - if (! info->relocateable + if (! info->relocatable && linux_hash_table (info)->dynobj == NULL && strcmp (name, SHARABLE_CONFLICTS) == 0 && (flags & BSF_CONSTRUCTOR) != 0 diff --git a/bfd/opncls.c b/bfd/opncls.c index 47719797df3..5237190d97c 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -716,28 +716,32 @@ bfd_release (abfd, block) without debug symbols). */ -static unsigned long calc_crc32 PARAMS ((unsigned long, const unsigned char *, size_t)); static char * get_debug_link_info PARAMS ((bfd *, unsigned long *)); static bfd_boolean separate_debug_file_exists PARAMS ((const char *, const unsigned long)); static char * find_separate_debug_file PARAMS ((bfd *, const char *)); +#define GNU_DEBUGLINK ".gnu_debuglink" /* -INTERNAL_FUNCTION - calc_crc32 +FUNCTION + bfd_calc_gnu_debuglink_crc32 SYNOPSIS - unsigned long calc_crc32 (unsigned long crc, const unsigned char *buf, size_t len); + unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); DESCRIPTION - Advance the CRC32 given by @var{crc} through @var{len} - bytes of @var{buf}. Return the updated CRC32 value. + Computes a CRC value as used in the .gnu_debuglink section. + Advances the previously computed @var{crc} value by computing + and adding in the crc32 for @var{len} bytes of @var{buf}. + +RETURNS + Return the updated CRC32 value. */ -static unsigned long -calc_crc32 (crc, buf, len) +unsigned long +bfd_calc_gnu_debuglink_crc32 (crc, buf, len) unsigned long crc; const unsigned char *buf; - size_t len; + bfd_size_type len; { static const unsigned long crc32_table[256] = { @@ -808,7 +812,7 @@ INTERNAL_FUNCTION get_debug_link_info SYNOPSIS - char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out) + char * get_debug_link_info (bfd * abfd, unsigned long * crc32_out) DESCRIPTION fetch the filename and CRC32 value for any separate debuginfo @@ -818,8 +822,8 @@ DESCRIPTION static char * get_debug_link_info (abfd, crc32_out) - bfd *abfd; - unsigned long *crc32_out; + bfd * abfd; + unsigned long * crc32_out; { asection * sect; bfd_size_type debuglink_size; @@ -831,14 +835,17 @@ get_debug_link_info (abfd, crc32_out) BFD_ASSERT (abfd); BFD_ASSERT (crc32_out); - sect = bfd_get_section_by_name (abfd, ".gnu_debuglink"); + sect = bfd_get_section_by_name (abfd, GNU_DEBUGLINK); if (sect == NULL) return NULL; debuglink_size = bfd_section_size (abfd, sect); - contents = xmalloc (debuglink_size); + contents = malloc (debuglink_size); + if (contents == NULL) + return NULL; + ret = bfd_get_section_contents (abfd, sect, contents, (file_ptr)0, debuglink_size); if (! ret) @@ -877,7 +884,7 @@ separate_debug_file_exists (name, crc) static char buffer [8 * 1024]; unsigned long file_crc = 0; int fd; - int count; + bfd_size_type count; BFD_ASSERT (name); @@ -886,7 +893,7 @@ separate_debug_file_exists (name, crc) return FALSE; while ((count = read (fd, buffer, sizeof (buffer))) > 0) - file_crc = calc_crc32 (file_crc, buffer, count); + file_crc = bfd_calc_gnu_debuglink_crc32 (file_crc, buffer, count); close (fd); @@ -930,16 +937,21 @@ find_separate_debug_file (abfd, debug_file_directory) return NULL; basename = get_debug_link_info (abfd, & crc32); - if (basename == NULL) return NULL; + if (strlen (basename) < 1) { free (basename); return NULL; } - dir = xstrdup (abfd->filename); + dir = strdup (abfd->filename); + if (dir == NULL) + { + free (basename); + return NULL; + } BFD_ASSERT (strlen (dir) != 0); /* Strip off filename part. */ @@ -950,11 +962,17 @@ find_separate_debug_file (abfd, debug_file_directory) dir[i + 1] = '\0'; BFD_ASSERT (dir[i] == '/' || dir[0] == '\0') - debugfile = xmalloc (strlen (debug_file_directory) + 1 - + strlen (dir) - + strlen (".debug/") - + strlen (basename) - + 1); + debugfile = malloc (strlen (debug_file_directory) + 1 + + strlen (dir) + + strlen (".debug/") + + strlen (basename) + + 1); + if (debugfile == NULL) + { + free (basename); + free (dir); + return NULL; + } /* First try in the same directory as the original file: */ strcpy (debugfile, dir); @@ -1037,3 +1055,158 @@ bfd_follow_gnu_debuglink (abfd, dir) #endif return find_separate_debug_file (abfd, dir); } + +/* +FUNCTION + bfd_create_gnu_debuglink_section + +SYNOPSIS + struct sec * bfd_create_gnu_debuglink_section (bfd * abfd, const char * filename); + +DESCRIPTION + + Takes a @var{BFD} and adds a .gnu_debuglink section to it. The section is sized + to be big enough to contain a link to the specified @var{filename}. + +RETURNS + A pointer to the new section is returned if all is ok. Otherwise <> is + returned and bfd_error is set. +*/ + +asection * +bfd_create_gnu_debuglink_section + (bfd * abfd, + const char * filename) +{ + asection * sect; + bfd_size_type debuglink_size; + + if (abfd == NULL || filename == NULL) + { + bfd_set_error (bfd_error_invalid_operation); + return NULL; + } + + /* Strip off any path components in filename. */ + filename = lbasename (filename); + + sect = bfd_get_section_by_name (abfd, GNU_DEBUGLINK); + if (sect) + { + /* Section already exists. */ + bfd_set_error (bfd_error_invalid_operation); + return NULL; + } + + sect = bfd_make_section (abfd, GNU_DEBUGLINK); + if (sect == NULL) + return NULL; + + if (! bfd_set_section_flags (abfd, sect, + SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING)) + /* XXX Should we delete the section from the bfd ? */ + return NULL; + + + debuglink_size = strlen (filename) + 1; + debuglink_size += 3; + debuglink_size &= ~3; + debuglink_size += 4; + + if (! bfd_set_section_size (abfd, sect, debuglink_size)) + /* XXX Should we delete the section from the bfd ? */ + return NULL; + + return sect; +} + + +/* +FUNCTION + bfd_fill_in_gnu_debuglink_section + +SYNOPSIS + bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd * abfd, struct sec * sect, const char * filename); + +DESCRIPTION + + Takes a @var{BFD} and containing a .gnu_debuglink section @var{SECT} + and fills in the contents of the section to contain a link to the + specified @var{filename}. The filename should be relative to the + current directory. + +RETURNS + <> is returned if all is ok. Otherwise <> is returned + and bfd_error is set. +*/ + +bfd_boolean +bfd_fill_in_gnu_debuglink_section + (bfd * abfd, + struct sec * sect, + const char * filename) +{ + bfd_size_type debuglink_size; + unsigned long crc32; + char * contents; + bfd_size_type crc_offset; + FILE * handle; + static char buffer[8 * 1024]; + size_t count; + + if (abfd == NULL || sect == NULL || filename == NULL) + { + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + } + + /* Make sure that we can read the file. + XXX - Should we attempt to locate the debug info file using the same + algorithm as gdb ? At the moment, since we are creating the + .gnu_debuglink section, we insist upon the user providing us with a + correct-for-section-creation-time path, but this need not conform to + the gdb location algorithm. */ + handle = fopen (filename, FOPEN_RB); + if (handle == NULL) + { + bfd_set_error (bfd_error_system_call); + return FALSE; + } + + crc32 = 0; + while ((count = fread (buffer, 1, sizeof buffer, handle)) > 0) + crc32 = bfd_calc_gnu_debuglink_crc32 (crc32, buffer, count); + fclose (handle); + + /* Strip off any path components in filename, + now that we no longer need them. */ + filename = lbasename (filename); + + debuglink_size = strlen (filename) + 1; + debuglink_size += 3; + debuglink_size &= ~3; + debuglink_size += 4; + + contents = malloc (debuglink_size); + if (contents == NULL) + { + /* XXX Should we delete the section from the bfd ? */ + bfd_set_error (bfd_error_no_memory); + return FALSE; + } + + strcpy (contents, filename); + crc_offset = debuglink_size - 4; + + bfd_put_32 (abfd, crc32, (bfd_byte *) (contents + crc_offset)); + + if (! bfd_set_section_contents (abfd, sect, contents, + (file_ptr)0, debuglink_size)) + { + /* XXX Should we delete the section from the bfd ? */ + free (contents); + return FALSE; + } + + return TRUE; +} diff --git a/bfd/pdp11.c b/bfd/pdp11.c index 95d78a1103d..52f7b70fc55 100644 --- a/bfd/pdp11.c +++ b/bfd/pdp11.c @@ -1,5 +1,5 @@ /* BFD back-end for PDP-11 a.out binaries. - Copyright 2001, 2002 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -3436,7 +3436,7 @@ NAME(aout,final_link) (abfd, info, callback) includes_hash_initialized = TRUE; /* Figure out the largest section size. Also, if generating - relocateable output, count the relocs. */ + relocatable output, count the relocs. */ trsize = 0; drsize = 0; max_contents_size = 0; @@ -3446,7 +3446,7 @@ NAME(aout,final_link) (abfd, info, callback) { size_t sz; - if (info->relocateable) + if (info->relocatable) { if (bfd_get_flavour (sub) == bfd_target_aout_flavour) { @@ -3460,7 +3460,7 @@ NAME(aout,final_link) (abfd, info, callback) work out the number of relocs needed, and then multiply by the reloc size. */ (*_bfd_error_handler) - ("%s: relocateable link from %s to %s not supported", + ("%s: relocatable link from %s to %s not supported", bfd_get_filename (abfd), sub->xvec->name, abfd->xvec->name); bfd_set_error (bfd_error_invalid_operation); @@ -3490,7 +3490,7 @@ NAME(aout,final_link) (abfd, info, callback) } } - if (info->relocateable) + if (info->relocatable) { if (obj_textsec (abfd) != (asection *) NULL) trsize += (_bfd_count_link_order_relocs (obj_textsec (abfd) @@ -4460,9 +4460,9 @@ aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr, input_size)) return FALSE; - /* If we are producing relocateable output, the relocs were + /* If we are producing relocatable output, the relocs were modified, and we now write them out. */ - if (finfo->info->relocateable && rel_size > 0) + if (finfo->info->relocatable && rel_size > 0) { if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0) return FALSE; @@ -4521,7 +4521,7 @@ pdp11_aout_link_input_section (finfo, input_bfd, input_section, relocs, struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *, bfd_vma *)); bfd *output_bfd; - bfd_boolean relocateable; + bfd_boolean relocatable; struct external_nlist *syms; char *strings; struct aout_link_hash_entry **sym_hashes; @@ -4537,7 +4537,7 @@ pdp11_aout_link_input_section (finfo, input_bfd, input_section, relocs, BFD_ASSERT (input_bfd->xvec->header_byteorder == output_bfd->xvec->header_byteorder); - relocateable = finfo->info->relocateable; + relocatable = finfo->info->relocatable; syms = obj_aout_external_syms (input_bfd); strings = obj_aout_external_strings (input_bfd); sym_hashes = obj_aout_sym_hashes (input_bfd); @@ -4578,9 +4578,9 @@ pdp11_aout_link_input_section (finfo, input_bfd, input_section, relocs, howto = howto_table_pdp11 + howto_idx; } - if (relocateable) + if (relocatable) { - /* We are generating a relocateable output file, and must + /* We are generating a relocatable output file, and must modify the reloc accordingly. */ if (r_extern) { diff --git a/bfd/pe-mips.c b/bfd/pe-mips.c index c9a4d5841d9..3066aaa442b 100644 --- a/bfd/pe-mips.c +++ b/bfd/pe-mips.c @@ -1,6 +1,6 @@ /* BFD back-end for MIPS PE COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Modified from coff-i386.c by DJ Delorie, dj@cygnus.com This file is part of BFD, the Binary File Descriptor library. @@ -73,7 +73,7 @@ static bfd_boolean coff_pe_mips_relocate_section section for a reference to a common symbol is the value itself plus any desired offset. Ian Taylor, Cygnus Support. */ -/* If we are producing relocateable output, we need to do some +/* If we are producing relocatable output, we need to do some adjustments to the object file that are not done by the bfd_perform_relocation function. This function is called by every reloc type to make any required adjustments. */ @@ -118,7 +118,7 @@ coff_mips_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, { /* For some reason bfd_perform_relocation always effectively ignores the addend for a COFF target when producing - relocateable output. This seems to be always wrong for 386 + relocatable output. This seems to be always wrong for 386 COFF, so we handle the addend here instead. */ diff = reloc_entry->addend; } @@ -467,7 +467,7 @@ coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp) #ifndef COFF_WITH_PE /* If the output symbol is common (in which case this must be a - relocateable link), we need to add in the final size of the + relocatable link), we need to add in the final size of the common symbol. */ if (h != NULL && h->root.type == bfd_link_hash_common) *addendp += h->root.u.c.size; @@ -654,7 +654,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, unsigned int i; bfd_boolean got_lo; - if (info->relocateable) + if (info->relocatable) { (*_bfd_error_handler) (_("\ %s: `ld -r' not supported with PE MIPS objects\n"), @@ -722,13 +722,13 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, if (howto == NULL) return FALSE; - /* If we are doing a relocateable link, then we can just ignore + /* If we are doing a relocatable link, then we can just ignore a PC relative reloc that is pcrel_offset. It will already - have the correct value. If this is not a relocateable link, + have the correct value. If this is not a relocatable link, then we should ignore the symbol value. */ if (howto->pc_relative && howto->pcrel_offset) { - if (info->relocateable) + if (info->relocatable) continue; if (sym != NULL && sym->n_scnum != 0) addend += sym->n_value; @@ -768,7 +768,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, + sec->output_offset); } - else if (! info->relocateable) + else if (! info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c index ba1c219bd34..7f1a6a3dfe2 100644 --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c @@ -961,7 +961,7 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out) } if (coff_data (abfd)->link_info - && ! coff_data (abfd)->link_info->relocateable + && ! coff_data (abfd)->link_info->relocatable && ! coff_data (abfd)->link_info->shared && strcmp (scnhdr_int->s_name, ".text") == 0) { diff --git a/bfd/pef.c b/bfd/pef.c index b4c5bfed1e8..550dbb81f55 100644 --- a/bfd/pef.c +++ b/bfd/pef.c @@ -1,5 +1,5 @@ /* PEF support for BFD. - Copyright 1999, 2000, 2001, 2002 + Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include "safe-ctype.h" #include "pef.h" #include "pef-traceback.h" @@ -33,76 +33,56 @@ #define BFD_IO_FUNCS 0 #endif -#define bfd_pef_close_and_cleanup _bfd_generic_close_and_cleanup -#define bfd_pef_bfd_free_cached_info _bfd_generic_bfd_free_cached_info -#define bfd_pef_new_section_hook _bfd_generic_new_section_hook -#define bfd_pef_bfd_is_local_label_name bfd_generic_is_local_label_name -#define bfd_pef_get_lineno _bfd_nosymbols_get_lineno -#define bfd_pef_find_nearest_line _bfd_nosymbols_find_nearest_line -#define bfd_pef_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol -#define bfd_pef_read_minisymbols _bfd_generic_read_minisymbols -#define bfd_pef_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol - -#define bfd_pef_get_reloc_upper_bound _bfd_norelocs_get_reloc_upper_bound -#define bfd_pef_canonicalize_reloc _bfd_norelocs_canonicalize_reloc -#define bfd_pef_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup - -#define bfd_pef_set_arch_mach _bfd_generic_set_arch_mach - -#define bfd_pef_get_section_contents _bfd_generic_get_section_contents -#define bfd_pef_set_section_contents _bfd_generic_set_section_contents - -#define bfd_pef_bfd_get_relocated_section_contents \ - bfd_generic_get_relocated_section_contents -#define bfd_pef_bfd_relax_section bfd_generic_relax_section -#define bfd_pef_bfd_gc_sections bfd_generic_gc_sections -#define bfd_pef_bfd_merge_sections bfd_generic_merge_sections -#define bfd_pef_bfd_discard_group bfd_generic_discard_group -#define bfd_pef_bfd_link_hash_table_create _bfd_generic_link_hash_table_create -#define bfd_pef_bfd_link_hash_table_free _bfd_generic_link_hash_table_free -#define bfd_pef_bfd_link_add_symbols _bfd_generic_link_add_symbols -#define bfd_pef_bfd_link_just_syms _bfd_generic_link_just_syms -#define bfd_pef_bfd_final_link _bfd_generic_final_link -#define bfd_pef_bfd_link_split_section _bfd_generic_link_split_section -#define bfd_pef_get_section_contents_in_window \ - _bfd_generic_get_section_contents_in_window - -static void bfd_pef_print_symbol -PARAMS ((bfd *abfd, PTR afile, asymbol *symbol, bfd_print_symbol_type how)); -static void bfd_pef_convert_architecture -PARAMS ((unsigned long architecture, - enum bfd_architecture *type, unsigned long *subtype)); -static bfd_boolean bfd_pef_mkobject PARAMS ((bfd *abfd)); -static int bfd_pef_parse_traceback_table -PARAMS ((bfd *abfd, asection *section, unsigned char *buf, - size_t len, size_t pos, asymbol *sym, FILE *file)); -static const char *bfd_pef_section_name PARAMS ((bfd_pef_section *section)); -static unsigned long bfd_pef_section_flags PARAMS ((bfd_pef_section *section)); -static asection *bfd_pef_make_bfd_section -PARAMS ((bfd *abfd, bfd_pef_section *section)); -static int bfd_pef_read_header PARAMS ((bfd *abfd, bfd_pef_header *header)); -static const bfd_target *bfd_pef_object_p PARAMS ((bfd *)); -static int bfd_pef_parse_traceback_tables -PARAMS ((bfd *abfd, asection *sec, unsigned char *buf, - size_t len, long *nsym, asymbol **csym)); -static int bfd_pef_parse_function_stub -PARAMS ((bfd *abfd, unsigned char *buf, size_t len, unsigned long *offset)); -static int bfd_pef_parse_function_stubs -PARAMS ((bfd *abfd, asection *codesec, unsigned char *codebuf, size_t codelen, - unsigned char *loaderbuf, size_t loaderlen, unsigned long *nsym, - asymbol **csym)); -static long bfd_pef_parse_symbols PARAMS ((bfd *abfd, asymbol **csym)); -static long bfd_pef_count_symbols PARAMS ((bfd *abfd)); -static long bfd_pef_get_symtab_upper_bound PARAMS ((bfd *)); -static long bfd_pef_get_symtab PARAMS ((bfd *, asymbol **)); -static asymbol *bfd_pef_make_empty_symbol PARAMS ((bfd *)); -static void bfd_pef_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); -static int bfd_pef_sizeof_headers PARAMS ((bfd *, bfd_boolean)); - -static int bfd_pef_xlib_read_header -PARAMS ((bfd *abfd, bfd_pef_xlib_header *header)); -static int bfd_pef_xlib_scan PARAMS ((bfd *abfd, bfd_pef_xlib_header *header)); -static const bfd_target *bfd_pef_xlib_object_p PARAMS ((bfd *abfd)); +#define bfd_pef_close_and_cleanup _bfd_generic_close_and_cleanup +#define bfd_pef_bfd_free_cached_info _bfd_generic_bfd_free_cached_info +#define bfd_pef_new_section_hook _bfd_generic_new_section_hook +#define bfd_pef_bfd_is_local_label_name bfd_generic_is_local_label_name +#define bfd_pef_get_lineno _bfd_nosymbols_get_lineno +#define bfd_pef_find_nearest_line _bfd_nosymbols_find_nearest_line +#define bfd_pef_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol +#define bfd_pef_read_minisymbols _bfd_generic_read_minisymbols +#define bfd_pef_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol +#define bfd_pef_get_reloc_upper_bound _bfd_norelocs_get_reloc_upper_bound +#define bfd_pef_canonicalize_reloc _bfd_norelocs_canonicalize_reloc +#define bfd_pef_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup +#define bfd_pef_set_arch_mach _bfd_generic_set_arch_mach +#define bfd_pef_get_section_contents _bfd_generic_get_section_contents +#define bfd_pef_set_section_contents _bfd_generic_set_section_contents +#define bfd_pef_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents +#define bfd_pef_bfd_relax_section bfd_generic_relax_section +#define bfd_pef_bfd_gc_sections bfd_generic_gc_sections +#define bfd_pef_bfd_merge_sections bfd_generic_merge_sections +#define bfd_pef_bfd_discard_group bfd_generic_discard_group +#define bfd_pef_bfd_link_hash_table_create _bfd_generic_link_hash_table_create +#define bfd_pef_bfd_link_hash_table_free _bfd_generic_link_hash_table_free +#define bfd_pef_bfd_link_add_symbols _bfd_generic_link_add_symbols +#define bfd_pef_bfd_link_just_syms _bfd_generic_link_just_syms +#define bfd_pef_bfd_final_link _bfd_generic_final_link +#define bfd_pef_bfd_link_split_section _bfd_generic_link_split_section +#define bfd_pef_get_section_contents_in_window _bfd_generic_get_section_contents_in_window + +static void bfd_pef_print_symbol PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); +static void bfd_pef_convert_architecture PARAMS ((unsigned long, enum bfd_architecture *, unsigned long *)); +static bfd_boolean bfd_pef_mkobject PARAMS ((bfd *)); +static int bfd_pef_parse_traceback_table PARAMS ((bfd *, asection *, unsigned char *, size_t, size_t, asymbol *, FILE *)); +static const char *bfd_pef_section_name PARAMS ((bfd_pef_section *)); +static unsigned long bfd_pef_section_flags PARAMS ((bfd_pef_section *)); +static asection *bfd_pef_make_bfd_section PARAMS ((bfd *, bfd_pef_section *)); +static int bfd_pef_read_header PARAMS ((bfd *, bfd_pef_header *)); +static const bfd_target *bfd_pef_object_p PARAMS ((bfd *)); +static int bfd_pef_parse_traceback_tables PARAMS ((bfd *, asection *, unsigned char *, size_t, long *, asymbol **)); +static int bfd_pef_parse_function_stub PARAMS ((bfd *, unsigned char *, size_t, unsigned long *)); +static int bfd_pef_parse_function_stubs PARAMS ((bfd *, asection *, unsigned char *, size_t, unsigned char *, size_t, unsigned long *, asymbol **)); +static long bfd_pef_parse_symbols PARAMS ((bfd *, asymbol **)); +static long bfd_pef_count_symbols PARAMS ((bfd *)); +static long bfd_pef_get_symtab_upper_bound PARAMS ((bfd *)); +static long bfd_pef_get_symtab PARAMS ((bfd *, asymbol **)); +static asymbol *bfd_pef_make_empty_symbol PARAMS ((bfd *)); +static void bfd_pef_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); +static int bfd_pef_sizeof_headers PARAMS ((bfd *, bfd_boolean)); +static int bfd_pef_xlib_read_header PARAMS ((bfd *, bfd_pef_xlib_header *)); +static int bfd_pef_xlib_scan PARAMS ((bfd *, bfd_pef_xlib_header *)); +static const bfd_target *bfd_pef_xlib_object_p PARAMS ((bfd *)); static void bfd_pef_print_symbol (abfd, afile, symbol, how) @@ -112,6 +92,7 @@ bfd_pef_print_symbol (abfd, afile, symbol, how) bfd_print_symbol_type how; { FILE *file = (FILE *) afile; + switch (how) { case bfd_print_symbol_name: @@ -186,14 +167,14 @@ bfd_pef_parse_traceback_table (abfd, section, buf, len, pos, sym, file) sym->flags = 0; sym->udata.i = 0; - /* memcpy is fine since all fields are unsigned char */ + /* memcpy is fine since all fields are unsigned char. */ if ((pos + 8) > len) return -1; memcpy (&table, buf + pos, 8); - /* calling code relies on returned symbols having a name and - correct offset */ + /* Calling code relies on returned symbols having a name and + correct offset. */ if ((table.lang != TB_C) && (table.lang != TB_CPLUSPLUS)) return -1; @@ -218,8 +199,8 @@ bfd_pef_parse_traceback_table (abfd, section, buf, len, pos, sym, file) off.tb_offset = bfd_getb32 (buf + pos + offset); offset += 4; - /* need to subtract 4 because the offset includes the 0x0L - preceding the table */ + /* Need to subtract 4 because the offset includes the 0x0L + preceding the table. */ if (file != NULL) fprintf (file, " [offset = 0x%lx]", off.tb_offset); @@ -271,14 +252,14 @@ bfd_pef_parse_traceback_table (abfd, section, buf, len, pos, sym, file) memcpy (namebuf, buf + pos + offset, name.name_len); namebuf[name.name_len] = '\0'; - /* strip leading period inserted by compiler */ + /* Strip leading period inserted by compiler. */ if (namebuf[0] == '.') memmove (namebuf, namebuf + 1, name.name_len + 1); sym->name = namebuf; for (s = sym->name; (*s != '\0'); s++) - if (! isprint (*s)) + if (! ISPRINT (*s)) return -1; offset += name.name_len; @@ -713,8 +694,7 @@ static int bfd_pef_parse_traceback_tables (abfd, sec, buf, len, nsym, csym) for (;;) { - /* we're reading symbols two at a time */ - + /* We're reading symbols two at a time. */ if (csym && ((csym[count] == NULL) || (csym[count + 1] == NULL))) break; @@ -735,7 +715,7 @@ static int bfd_pef_parse_traceback_tables (abfd, sec, buf, len, nsym, csym) &function, 0); if (ret < 0) { - /* skip over 0x0L to advance to next possible traceback table */ + /* Skip over 0x0L to advance to next possible traceback table. */ pos += 4; continue; } @@ -743,7 +723,7 @@ static int bfd_pef_parse_traceback_tables (abfd, sec, buf, len, nsym, csym) BFD_ASSERT (function.name != NULL); /* Don't bother to compute the name if we are just - counting symbols */ + counting symbols. */ if (csym) { @@ -913,7 +893,7 @@ static int bfd_pef_parse_function_stubs (abfd, codesec, codebuf, codelen, { if (*s == '\0') break; - if (! isprint (*s)) + if (! ISPRINT (*s)) goto error; namelen++; } diff --git a/bfd/po/Make-in b/bfd/po/Make-in index a288585d893..1608b2d6272 100644 --- a/bfd/po/Make-in +++ b/bfd/po/Make-in @@ -24,6 +24,8 @@ gnulocaledir = $(prefix)/share/locale gettextsrcdir = $(prefix)/share/gettext/po subdir = po +DESTDIR = + INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -124,9 +126,9 @@ install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $(datadir); \ + $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ else \ - $(top_srcdir)/mkinstalldirs $(datadir); \ + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ fi @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ @@ -136,7 +138,7 @@ install-data-yes: all *) destdir=$(localedir);; \ esac; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - dir=$$destdir/$$lang/LC_MESSAGES; \ + dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ if test -r $(MKINSTALLDIRS); then \ $(MKINSTALLDIRS) $$dir; \ else \ @@ -166,12 +168,12 @@ install-data-yes: all done if test "$(PACKAGE)" = "gettext"; then \ if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $(gettextsrcdir); \ + $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ else \ - $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ fi; \ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ - $(gettextsrcdir)/Makefile.in.in; \ + $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ else \ : ; \ fi @@ -184,12 +186,12 @@ uninstall: for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ done - rm -f $(gettextsrcdir)/po-Makefile.in.in + rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in check: all diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in index 24d4a48337c..bbd8ddad096 100644 --- a/bfd/po/SRC-POTFILES.in +++ b/bfd/po/SRC-POTFILES.in @@ -111,6 +111,7 @@ cpu-vax.c cpu-w65.c cpu-we32k.c cpu-xstormy16.c +cpu-xtensa.c cpu-z8k.c demo64.c dwarf1.c @@ -149,6 +150,7 @@ elf32-iq2000.c elf32-m32r.c elf32-m68hc11.c elf32-m68hc12.c +elf32-m68hc1x.c elf32-m68k.c elf32-m88k.c elf32-mcore.c @@ -166,6 +168,7 @@ elf32-sparc.c elf32-v850.c elf32-vax.c elf32-xstormy16.c +elf32-xtensa.c elf32.c elf64-alpha.c elf64-gen.c @@ -304,3 +307,5 @@ xcoff-target.h xcofflink.c xsym.c xsym.h +xtensa-isa.c +xtensa-modules.c diff --git a/bfd/po/bfd.pot b/bfd/po/bfd.pot index 8471c0cda7e..f402c966b59 100644 --- a/bfd/po/bfd.pot +++ b/bfd/po/bfd.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2002-02-08 03:22-0200\n" +"POT-Creation-Date: 2003-06-03 14:40+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -14,163 +14,176 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: aout-adobe.c:196 +#: aout-adobe.c:204 #, c-format msgid "%s: Unknown section type in a.out.adobe file: %x\n" msgstr "" -#: aout-cris.c:208 +#: aout-cris.c:207 #, c-format msgid "%s: Invalid relocation type exported: %d" msgstr "" -#: aout-cris.c:252 +#: aout-cris.c:251 #, c-format msgid "%s: Invalid relocation type imported: %d" msgstr "" -#: aout-cris.c:263 +#: aout-cris.c:262 #, c-format msgid "%s: Bad relocation record imported: %d" msgstr "" -#: aoutx.h:1282 aoutx.h:1699 +#: aoutx.h:1295 aoutx.h:1716 #, c-format msgid "%s: can not represent section `%s' in a.out object file format" msgstr "" -#: aoutx.h:1669 +#: aoutx.h:1682 #, c-format msgid "" "%s: can not represent section for symbol `%s' in a.out object file format" msgstr "" -#: aoutx.h:1671 +#: aoutx.h:1684 msgid "*unknown*" msgstr "" -#: aoutx.h:3735 +#: aoutx.h:3776 #, c-format msgid "%s: relocateable link from %s to %s not supported" msgstr "" -#: archive.c:1826 +#: archive.c:1823 msgid "Warning: writing archive was slow: rewriting timestamp\n" msgstr "" -#: archive.c:2093 +#: archive.c:2090 msgid "Reading archive file mod timestamp" msgstr "" -#. FIXME: bfd can't call perror. -#: archive.c:2120 +#: archive.c:2116 msgid "Writing updated armap timestamp" msgstr "" -#: bfd.c:274 +#: bfd.c:286 msgid "No error" msgstr "" -#: bfd.c:275 +#: bfd.c:287 msgid "System call error" msgstr "" -#: bfd.c:276 +#: bfd.c:288 msgid "Invalid bfd target" msgstr "" -#: bfd.c:277 +#: bfd.c:289 msgid "File in wrong format" msgstr "" -#: bfd.c:278 +#: bfd.c:290 msgid "Archive object file in wrong format" msgstr "" -#: bfd.c:279 +#: bfd.c:291 msgid "Invalid operation" msgstr "" -#: bfd.c:280 +#: bfd.c:292 msgid "Memory exhausted" msgstr "" -#: bfd.c:281 +#: bfd.c:293 msgid "No symbols" msgstr "" -#: bfd.c:282 +#: bfd.c:294 msgid "Archive has no index; run ranlib to add one" msgstr "" -#: bfd.c:283 +#: bfd.c:295 msgid "No more archived files" msgstr "" -#: bfd.c:284 +#: bfd.c:296 msgid "Malformed archive" msgstr "" -#: bfd.c:285 +#: bfd.c:297 msgid "File format not recognized" msgstr "" -#: bfd.c:286 +#: bfd.c:298 msgid "File format is ambiguous" msgstr "" -#: bfd.c:287 +#: bfd.c:299 msgid "Section has no contents" msgstr "" -#: bfd.c:288 +#: bfd.c:300 msgid "Nonrepresentable section on output" msgstr "" -#: bfd.c:289 +#: bfd.c:301 msgid "Symbol needs debug section which does not exist" msgstr "" -#: bfd.c:290 +#: bfd.c:302 msgid "Bad value" msgstr "" -#: bfd.c:291 +#: bfd.c:303 msgid "File truncated" msgstr "" -#: bfd.c:292 +#: bfd.c:304 msgid "File too big" msgstr "" -#: bfd.c:293 +#: bfd.c:305 msgid "#" msgstr "" -#: bfd.c:700 +#: bfd.c:712 #, c-format msgid "BFD %s assertion fail %s:%d" msgstr "" -#: bfd.c:719 +#: bfd.c:731 #, c-format msgid "BFD %s internal error, aborting at %s line %d in %s\n" msgstr "" -#: bfd.c:723 +#: bfd.c:735 #, c-format msgid "BFD %s internal error, aborting at %s line %d\n" msgstr "" -#: bfd.c:725 +#: bfd.c:737 msgid "Please report this bug.\n" msgstr "" +#: bfdwin.c:206 +#, c-format +msgid "not mapping: data=%lx mapped=%d\n" +msgstr "" + +#: bfdwin.c:209 +msgid "not mapping: env var not set\n" +msgstr "" + #: binary.c:306 #, c-format msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx." msgstr "" +#: coff-rs6000.c:3616 coff64-rs6000.c:2109 +#, c-format +msgid "%s: symbol `%s' has unrecognized smclas %d" +msgstr "" + #: coff-a29k.c:119 msgid "Missing IHCONST" msgstr "" @@ -179,7 +192,7 @@ msgstr "" msgid "Missing IHIHALF" msgstr "" -#: coff-a29k.c:212 coff-or32.c:228 +#: coff-a29k.c:212 coff-or32.c:236 msgid "Unrecognized reloc" msgstr "" @@ -191,323 +204,334 @@ msgstr "" msgid "missing IHIHALF reloc" msgstr "" -#: coff-alpha.c:881 coff-alpha.c:918 coff-alpha.c:1989 coff-mips.c:1433 +#: coff-alpha.c:884 coff-alpha.c:921 coff-alpha.c:1992 coff-mips.c:1397 msgid "GP relative relocation used when GP not defined" msgstr "" -#: coff-alpha.c:1485 +#: coff-alpha.c:1488 msgid "using multiple gp values" msgstr "" -#: coff-arm.c:1051 elf32-arm.h:285 +#: coff-arm.c:1066 elf32-arm.h:294 #, c-format msgid "%s: unable to find THUMB glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1080 elf32-arm.h:320 +#: coff-arm.c:1096 elf32-arm.h:329 #, c-format msgid "%s: unable to find ARM glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1375 coff-arm.c:1470 elf32-arm.h:886 elf32-arm.h:990 +#: coff-arm.c:1394 coff-arm.c:1489 elf32-arm.h:892 elf32-arm.h:999 #, c-format msgid "%s(%s): warning: interworking not enabled." msgstr "" -#: coff-arm.c:1379 elf32-arm.h:993 +#: coff-arm.c:1398 elf32-arm.h:1002 #, c-format msgid " first occurrence: %s: arm call to thumb" msgstr "" -#: coff-arm.c:1474 elf32-arm.h:889 +#: coff-arm.c:1493 elf32-arm.h:895 #, c-format msgid " first occurrence: %s: thumb call to arm" msgstr "" -#: coff-arm.c:1477 +#: coff-arm.c:1496 msgid " consider relinking with --support-old-code enabled" msgstr "" -#: coff-arm.c:1767 coff-tic80.c:686 cofflink.c:3017 +#: coff-arm.c:1788 coff-tic80.c:686 cofflink.c:3038 #, c-format msgid "%s: bad reloc address 0x%lx in section `%s'" msgstr "" -#: coff-arm.c:2107 +#: coff-arm.c:2132 #, c-format msgid "%s: illegal symbol index in reloc: %d" msgstr "" -#: coff-arm.c:2235 +#: coff-arm.c:2265 #, c-format msgid "ERROR: %s is compiled for APCS-%d, whereas %s is compiled for APCS-%d" msgstr "" -#: coff-arm.c:2250 elf32-arm.h:2287 +#: coff-arm.c:2280 elf32-arm.h:2328 #, c-format msgid "" "ERROR: %s passes floats in float registers, whereas %s passes them in " "integer registers" msgstr "" -#: coff-arm.c:2253 elf32-arm.h:2292 +#: coff-arm.c:2283 elf32-arm.h:2333 #, c-format msgid "" "ERROR: %s passes floats in integer registers, whereas %s passes them in " "float registers" msgstr "" -#: coff-arm.c:2268 +#: coff-arm.c:2298 #, c-format msgid "" "ERROR: %s is compiled as position independent code, whereas target %s is " "absolute position" msgstr "" -#: coff-arm.c:2271 +#: coff-arm.c:2301 #, c-format msgid "" "ERROR: %s is compiled as absolute position code, whereas target %s is " "position independent" msgstr "" -#: coff-arm.c:2300 elf32-arm.h:2348 +#: coff-arm.c:2330 elf32-arm.h:2405 #, c-format msgid "Warning: %s supports interworking, whereas %s does not" msgstr "" -#: coff-arm.c:2303 elf32-arm.h:2355 +#: coff-arm.c:2333 elf32-arm.h:2412 #, c-format msgid "Warning: %s does not support interworking, whereas %s does" msgstr "" -#: coff-arm.c:2330 +#: coff-arm.c:2360 #, c-format msgid "private flags = %x:" msgstr "" -#: coff-arm.c:2338 elf32-arm.h:2408 +#: coff-arm.c:2368 elf32-arm.h:2467 msgid " [floats passed in float registers]" msgstr "" -#: coff-arm.c:2340 +#: coff-arm.c:2370 msgid " [floats passed in integer registers]" msgstr "" -#: coff-arm.c:2343 elf32-arm.h:2411 +#: coff-arm.c:2373 elf32-arm.h:2470 msgid " [position independent]" msgstr "" -#: coff-arm.c:2345 +#: coff-arm.c:2375 msgid " [absolute position]" msgstr "" -#: coff-arm.c:2349 +#: coff-arm.c:2379 msgid " [interworking flag not initialised]" msgstr "" -#: coff-arm.c:2351 +#: coff-arm.c:2381 msgid " [interworking supported]" msgstr "" -#: coff-arm.c:2353 +#: coff-arm.c:2383 msgid " [interworking not supported]" msgstr "" -#: coff-arm.c:2401 elf32-arm.h:2114 +#: coff-arm.c:2431 elf32-arm.h:2150 #, c-format msgid "" "Warning: Not setting interworking flag of %s since it has already been " "specified as non-interworking" msgstr "" -#: coff-arm.c:2405 elf32-arm.h:2118 +#: coff-arm.c:2435 elf32-arm.h:2154 #, c-format msgid "Warning: Clearing the interworking flag of %s due to outside request" msgstr "" -#: coff-i960.c:136 coff-i960.c:485 -msgid "uncertain calling convention for non-COFF symbol" +#: coffcode.h:1102 +#, c-format +msgid "%s (%s): Section flag %s (0x%x) ignored" msgstr "" -#: coff-m68k.c:481 coff-mips.c:2431 elf32-m68k.c:2212 elf32-mips.c:9967 -msgid "unsupported reloc type" +#: coffcode.h:2178 +#, c-format +msgid "Unrecognized TI COFF target id '0x%x'" msgstr "" -#: coff-mips.c:875 elf32-mips.c:1997 elf64-mips.c:1739 -msgid "GP relative relocation when _gp not defined" +#: coffcode.h:4401 +#, c-format +msgid "%s: warning: illegal symbol index %ld in line numbers" msgstr "" -#. No other sections should appear in -membedded-pic -#. code. -#: coff-mips.c:2468 -msgid "reloc against unsupported section" +#: coffcode.h:4415 +#, c-format +msgid "%s: warning: duplicate line number information for `%s'" msgstr "" -#: coff-mips.c:2476 -msgid "reloc not properly aligned" +#: coffcode.h:4769 +#, c-format +msgid "%s: Unrecognized storage class %d for %s symbol `%s'" msgstr "" -#: coff-rs6000.c:2710 coff64-rs6000.c:1164 +#: coffcode.h:4902 #, c-format -msgid "%s: unsupported relocation type 0x%02x" +msgid "warning: %s: local symbol `%s' has no section" msgstr "" -#: coff-rs6000.c:2756 coff64-rs6000.c:1210 +#: coff-tic4x.c:248 coff-tic54x.c:403 coffcode.h:5009 #, c-format -msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" +msgid "%s: warning: illegal symbol index %ld in relocs" msgstr "" -#: coff-rs6000.c:3006 coff64-rs6000.c:2060 +#: coffcode.h:5047 #, c-format -msgid "%s: symbol `%s' has unrecognized smclas %d" +msgid "%s: illegal relocation type %d at address 0x%lx" msgstr "" -#: coff-tic54x.c:279 coff-tic80.c:449 +#: coffgen.c:1666 #, c-format -msgid "Unrecognized reloc type 0x%x" +msgid "%s: bad string table size %lu" msgstr "" -#: coff-tic54x.c:390 coffcode.h:4874 +#: coff-h8300.c:1096 #, c-format -msgid "%s: warning: illegal symbol index %ld in relocs" +msgid "cannot handle R_MEM_INDIRECT reloc when using %s output" msgstr "" -#: coff-w65.c:363 -#, c-format -msgid "ignoring reloc %s\n" +#: coff-i960.c:137 coff-i960.c:486 +msgid "uncertain calling convention for non-COFF symbol" msgstr "" -#: coffcode.h:1081 +#: cofflink.c:538 elflink.h:1276 #, c-format -msgid "%s (%s): Section flag %s (0x%x) ignored" +msgid "Warning: type of symbol `%s' changed from %d to %d in %s" msgstr "" -#: coffcode.h:2137 +#: cofflink.c:2328 #, c-format -msgid "Unrecognized TI COFF target id '0x%x'" +msgid "%s: relocs in section `%s', but it has no contents" msgstr "" -#: coffcode.h:4263 +#: cofflink.c:2671 coffswap.h:890 #, c-format -msgid "%s: warning: illegal symbol index %ld in line numbers" +msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" msgstr "" -#: coffcode.h:4277 +#: cofflink.c:2680 coffswap.h:876 #, c-format -msgid "%s: warning: duplicate line number information for `%s'" +msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: coffcode.h:4636 -#, c-format -msgid "%s: Unrecognized storage class %d for %s symbol `%s'" +#: coff-m68k.c:482 coff-mips.c:2394 elf32-m68k.c:2193 elf32-mips.c:1741 +msgid "unsupported reloc type" msgstr "" -#: coffcode.h:4767 -#, c-format -msgid "warning: %s: local symbol `%s' has no section" +#: coff-mips.c:839 elf32-mips.c:1061 elf64-mips.c:1587 elfn32-mips.c:1553 +msgid "GP relative relocation when _gp not defined" +msgstr "" + +#. No other sections should appear in -membedded-pic +#. code. +#: coff-mips.c:2431 +msgid "reloc against unsupported section" +msgstr "" + +#: coff-mips.c:2439 +msgid "reloc not properly aligned" msgstr "" -#: coffcode.h:4912 +#: coff-rs6000.c:2790 #, c-format -msgid "%s: illegal relocation type %d at address 0x%lx" +msgid "%s: unsupported relocation type 0x%02x" msgstr "" -#: coffgen.c:1661 +#: coff-rs6000.c:2883 #, c-format -msgid "%s: bad string table size %lu" +msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" msgstr "" -#: cofflink.c:536 elflink.h:1967 +#: coff-tic4x.c:200 coff-tic54x.c:292 coff-tic80.c:449 #, c-format -msgid "Warning: type of symbol `%s' changed from %d to %d in %s" +msgid "Unrecognized reloc type 0x%x" msgstr "" -#: cofflink.c:2317 +#: coff-w65.c:364 #, c-format -msgid "%s: relocs in section `%s', but it has no contents" +msgid "ignoring reloc %s\n" msgstr "" -#: cofflink.c:2653 coffswap.h:889 +#: cpu-arm.c:196 cpu-arm.c:206 #, c-format -msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" +msgid "ERROR: %s is compiled for the EP9312, whereas %s is compiled for XScale" msgstr "" -#: cofflink.c:2662 coffswap.h:876 +#: cpu-arm.c:344 #, c-format -msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" +msgid "warning: unable to update contents of %s section in %s" msgstr "" -#: dwarf2.c:381 +#: dwarf2.c:380 msgid "Dwarf Error: Can't find .debug_str section." msgstr "" -#: dwarf2.c:398 +#: dwarf2.c:397 #, c-format msgid "" -"Dwarf Error: DW_FORM_strp offset (%u) greater than or equal to .debug_str " -"size (%u)." +"Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str " +"size (%lu)." msgstr "" -#: dwarf2.c:542 +#: dwarf2.c:541 msgid "Dwarf Error: Can't find .debug_abbrev section." msgstr "" -#: dwarf2.c:559 +#: dwarf2.c:556 #, c-format msgid "" -"Dwarf Error: Abbrev offset (%u) greater than or equal to .debug_abbrev size " -"(%u)." +"Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size " +"(%lu)." msgstr "" #: dwarf2.c:756 #, c-format -msgid "Dwarf Error: Invalid or unhandled FORM value: %d." +msgid "Dwarf Error: Invalid or unhandled FORM value: %u." msgstr "" -#: dwarf2.c:843 +#: dwarf2.c:933 msgid "Dwarf Error: mangled line number section (bad file number)." msgstr "" -#: dwarf2.c:929 +#: dwarf2.c:1032 msgid "Dwarf Error: Can't find .debug_line section." msgstr "" -#: dwarf2.c:952 +#: dwarf2.c:1049 #, c-format msgid "" -"Dwarf Error: Line offset (%u) greater than or equal to .debug_line size (%u)." +"Dwarf Error: Line offset (%lu) greater than or equal to .debug_line size (%" +"lu)." msgstr "" -#: dwarf2.c:1143 +#: dwarf2.c:1255 msgid "Dwarf Error: mangled line number section." msgstr "" -#: dwarf2.c:1318 dwarf2.c:1529 +#: dwarf2.c:1470 dwarf2.c:1620 #, c-format -msgid "Dwarf Error: Could not find abbrev number %d." +msgid "Dwarf Error: Could not find abbrev number %u." msgstr "" -#: dwarf2.c:1490 +#: dwarf2.c:1581 #, c-format msgid "" -"Dwarf Error: found dwarf version '%hu', this reader only handles version 2 " +"Dwarf Error: found dwarf version '%u', this reader only handles version 2 " "information." msgstr "" -#: dwarf2.c:1497 +#: dwarf2.c:1588 #, c-format msgid "" "Dwarf Error: found address size '%u', this reader can not handle sizes " "greater than '%u'." msgstr "" -#: dwarf2.c:1520 +#: dwarf2.c:1611 #, c-format -msgid "Dwarf Error: Bad abbrev number: %d." +msgid "Dwarf Error: Bad abbrev number: %u." msgstr "" -#: ecoff.c:1328 +#: ecoff.c:1337 #, c-format msgid "Unknown basic type %d" msgstr "" @@ -568,1349 +592,1714 @@ msgid "" " Type: %s" msgstr "" -#: elf-hppa.h:1366 elf-hppa.h:1399 elf32-ppc.c:3062 elf32-sh.c:4286 -#: elf64-sh64.c:1640 elf64-x86-64.c:1275 -#, c-format -msgid "" -"%s: warning: unresolvable relocation against symbol `%s' from %s section" -msgstr "" - -#: elf-m10200.c:463 elf-m10300.c:673 elf32-arm.h:2074 elf32-avr.c:835 -#: elf32-cris.c:1406 elf32-d10v.c:482 elf32-fr30.c:653 elf32-h8300.c:547 -#: elf32-i860.c:1048 elf32-m32r.c:1280 elf32-openrisc.c:455 elf32-v850.c:1691 -#: elf32-xstormy16.c:976 elf64-mmix.c:1302 -msgid "internal error: out of range error" -msgstr "" - -#: elf-m10200.c:467 elf-m10300.c:677 elf32-arm.h:2078 elf32-avr.c:839 -#: elf32-cris.c:1410 elf32-d10v.c:486 elf32-fr30.c:657 elf32-h8300.c:551 -#: elf32-i860.c:1052 elf32-m32r.c:1284 elf32-mips.c:7600 elf32-openrisc.c:459 -#: elf32-v850.c:1695 elf32-xstormy16.c:980 elf64-mips.c:4464 elf64-mmix.c:1306 -msgid "internal error: unsupported relocation error" -msgstr "" - -#: elf-m10200.c:471 elf-m10300.c:681 elf32-arm.h:2082 elf32-d10v.c:490 -#: elf32-h8300.c:555 elf32-m32r.c:1288 -msgid "internal error: dangerous error" -msgstr "" - -#: elf-m10200.c:475 elf-m10300.c:685 elf32-arm.h:2086 elf32-avr.c:847 -#: elf32-cris.c:1418 elf32-d10v.c:494 elf32-fr30.c:665 elf32-h8300.c:559 -#: elf32-i860.c:1060 elf32-m32r.c:1292 elf32-openrisc.c:467 elf32-v850.c:1715 -#: elf32-xstormy16.c:988 elf64-mmix.c:1314 -msgid "internal error: unknown error" -msgstr "" - -#: elf.c:343 -#, c-format -msgid "%s: invalid string offset %u >= %lu for section `%s'" -msgstr "" - -#: elf.c:448 -#, c-format -msgid "%s: invalid SHT_GROUP entry" -msgstr "" - -#: elf.c:529 -#, c-format -msgid "%s: no group info for section %s" -msgstr "" - -#: elf.c:840 -msgid "" -"\n" -"Program Header:\n" -msgstr "" - -#: elf.c:889 -msgid "" -"\n" -"Dynamic Section:\n" -msgstr "" - -#: elf.c:1018 -msgid "" -"\n" -"Version definitions:\n" -msgstr "" - -#: elf.c:1041 -msgid "" -"\n" -"Version References:\n" -msgstr "" - -#: elf.c:1046 -#, c-format -msgid " required from %s:\n" -msgstr "" - -#: elf.c:1682 +#: elf32-arm.h:1228 #, c-format -msgid "%s: invalid link %lu for reloc section %s (index %u)" +msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." msgstr "" -#: elf.c:3296 +#: elf32-arm.h:1424 #, c-format -msgid "%s: Not enough room for program headers (allocated %u, need %u)" +msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." msgstr "" -#: elf.c:3400 +#: elf32-arm.h:1918 elf32-sh.c:4703 elf64-sh64.c:1613 #, c-format -msgid "%s: Not enough room for program headers, try linking with -N" +msgid "%s(%s+0x%lx): %s relocation against SEC_MERGE section" msgstr "" -#: elf.c:3525 +#: elf32-arm.h:2012 #, c-format msgid "" -"Error: First section in segment (%s) starts at 0x%x whereas the segment " -"starts at 0x%x" -msgstr "" - -#: elf.c:3811 -#, c-format -msgid "%s: warning: allocated section `%s' not in segment" -msgstr "" - -#: elf.c:4142 -#, c-format -msgid "%s: symbol `%s' required but not present" -msgstr "" - -#: elf.c:4395 -#, c-format -msgid "%s: warning: Empty loadable segment detected\n" -msgstr "" - -#: elf.c:5808 -#, c-format -msgid "%s: unsupported relocation type %s" +"%s: warning: unresolvable relocation %d against symbol `%s' from %s section" msgstr "" -#: elf32-arm.h:1224 -#, c-format -msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." +#: elf-m10200.c:442 elf-m10300.c:655 elf32-arm.h:2088 elf32-avr.c:812 +#: elf32-cris.c:1383 elf32-d10v.c:481 elf32-fr30.c:633 elf32-frv.c:815 +#: elf32-h8300.c:528 elf32-i860.c:1028 elf32-ip2k.c:1586 elf32-iq2000.c:699 +#: elf32-m32r.c:1283 elf32-m68hc1x.c:1305 elf32-msp430.c:510 +#: elf32-openrisc.c:436 elf32-v850.c:1753 elf32-xstormy16.c:976 +#: elf64-mmix.c:1332 +msgid "internal error: out of range error" msgstr "" -#: elf32-arm.h:1420 -#, c-format -msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." +#: elf-m10200.c:446 elf-m10300.c:659 elf32-arm.h:2092 elf32-avr.c:816 +#: elf32-cris.c:1387 elf32-d10v.c:485 elf32-fr30.c:637 elf32-frv.c:819 +#: elf32-h8300.c:532 elf32-i860.c:1032 elf32-iq2000.c:703 elf32-m32r.c:1287 +#: elf32-m68hc1x.c:1309 elf32-msp430.c:514 elf32-openrisc.c:440 +#: elf32-v850.c:1757 elf32-xstormy16.c:980 elf64-mmix.c:1336 elfxx-mips.c:6533 +msgid "internal error: unsupported relocation error" msgstr "" -#: elf32-arm.h:1904 elf32-i386.c:1782 elf32-sh.c:4198 -#, c-format -msgid "%s(%s+0x%lx): %s relocation against SEC_MERGE section" +#: elf-m10200.c:450 elf-m10300.c:663 elf32-arm.h:2096 elf32-d10v.c:489 +#: elf32-h8300.c:536 elf32-m32r.c:1291 elf32-m68hc1x.c:1313 +msgid "internal error: dangerous error" msgstr "" -#: elf32-arm.h:1998 -#, c-format -msgid "" -"%s: warning: unresolvable relocation %d against symbol `%s' from %s section" +#: elf-m10200.c:454 elf-m10300.c:667 elf32-arm.h:2100 elf32-avr.c:824 +#: elf32-cris.c:1395 elf32-d10v.c:493 elf32-fr30.c:645 elf32-frv.c:827 +#: elf32-h8300.c:540 elf32-i860.c:1040 elf32-ip2k.c:1601 elf32-iq2000.c:711 +#: elf32-m32r.c:1295 elf32-m68hc1x.c:1317 elf32-msp430.c:522 +#: elf32-openrisc.c:448 elf32-v850.c:1777 elf32-xstormy16.c:988 +#: elf64-mmix.c:1344 +msgid "internal error: unknown error" msgstr "" -#: elf32-arm.h:2166 +#: elf32-arm.h:2202 #, c-format msgid "" "Warning: Clearing the interworking flag of %s because non-interworking code " "in %s has been linked with it" msgstr "" -#: elf32-arm.h:2261 +#: elf32-arm.h:2302 #, c-format msgid "" "ERROR: %s is compiled for EABI version %d, whereas %s is compiled for " "version %d" msgstr "" -#: elf32-arm.h:2275 +#: elf32-arm.h:2316 #, c-format msgid "ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d" msgstr "" -#: elf32-arm.h:2303 +#: elf32-arm.h:2344 +#, c-format +msgid "ERROR: %s uses VFP instructions, whereas %s does not" +msgstr "" + +#: elf32-arm.h:2349 #, c-format -msgid "ERROR: %s uses VFP instructions, whereas %s uses FPA instructions" +msgid "ERROR: %s uses FPA instructions, whereas %s does not" msgstr "" -#: elf32-arm.h:2308 +#: elf32-arm.h:2360 elf32-arm.h:2365 #, c-format -msgid "ERROR: %s uses FPA instructions, whereas %s uses VFP instructions" +msgid "ERROR: %s uses Maverick instructions, whereas %s does not" msgstr "" -#: elf32-arm.h:2328 +#: elf32-arm.h:2385 #, c-format msgid "ERROR: %s uses software FP, whereas %s uses hardware FP" msgstr "" -#: elf32-arm.h:2333 +#: elf32-arm.h:2390 #, c-format msgid "ERROR: %s uses hardware FP, whereas %s uses software FP" msgstr "" #. Ignore init flag - it may not be set, despite the flags field #. containing valid data. -#: elf32-arm.h:2386 elf32-cris.c:2991 elf32-m68k.c:410 elf32-mips.c:3255 +#: elf32-arm.h:2443 elf32-cris.c:2968 elf32-m68hc1x.c:1459 elf32-m68k.c:397 +#: elf32-vax.c:546 elfxx-mips.c:9379 #, c-format msgid "private flags = %lx:" msgstr "" -#: elf32-arm.h:2395 +#: elf32-arm.h:2452 msgid " [interworking enabled]" msgstr "" -#: elf32-arm.h:2403 +#: elf32-arm.h:2460 msgid " [VFP float format]" msgstr "" -#: elf32-arm.h:2405 +#: elf32-arm.h:2462 +msgid " [Maverick float format]" +msgstr "" + +#: elf32-arm.h:2464 msgid " [FPA float format]" msgstr "" -#: elf32-arm.h:2414 +#: elf32-arm.h:2473 msgid " [new ABI]" msgstr "" -#: elf32-arm.h:2417 +#: elf32-arm.h:2476 msgid " [old ABI]" msgstr "" -#: elf32-arm.h:2420 +#: elf32-arm.h:2479 msgid " [software FP]" msgstr "" -#: elf32-arm.h:2428 +#: elf32-arm.h:2488 msgid " [Version1 EABI]" msgstr "" -#: elf32-arm.h:2431 elf32-arm.h:2442 +#: elf32-arm.h:2491 elf32-arm.h:2502 msgid " [sorted symbol table]" msgstr "" -#: elf32-arm.h:2433 elf32-arm.h:2444 +#: elf32-arm.h:2493 elf32-arm.h:2504 msgid " [unsorted symbol table]" msgstr "" -#: elf32-arm.h:2439 +#: elf32-arm.h:2499 msgid " [Version2 EABI]" msgstr "" -#: elf32-arm.h:2447 +#: elf32-arm.h:2507 msgid " [dynamic symbols use segment index]" msgstr "" -#: elf32-arm.h:2450 +#: elf32-arm.h:2510 msgid " [mapping symbols precede others]" msgstr "" -#: elf32-arm.h:2457 +#: elf32-arm.h:2517 msgid " " msgstr "" -#: elf32-arm.h:2464 +#: elf32-arm.h:2524 msgid " [relocatable executable]" msgstr "" -#: elf32-arm.h:2467 +#: elf32-arm.h:2527 msgid " [has entry point]" msgstr "" -#: elf32-arm.h:2472 +#: elf32-arm.h:2532 msgid "" msgstr "" -#: elf32-avr.c:843 elf32-cris.c:1414 elf32-fr30.c:661 elf32-i860.c:1056 -#: elf32-openrisc.c:463 elf32-v850.c:1699 elf32-xstormy16.c:984 -#: elf64-mmix.c:1310 +#: elf32-avr.c:820 elf32-cris.c:1391 elf32-fr30.c:641 elf32-frv.c:823 +#: elf32-i860.c:1036 elf32-ip2k.c:1597 elf32-iq2000.c:707 elf32-msp430.c:518 +#: elf32-openrisc.c:444 elf32-v850.c:1761 elf32-xstormy16.c:984 +#: elf64-mmix.c:1340 msgid "internal error: dangerous relocation" msgstr "" -#: elf32-cris.c:949 +#: elf32-cris.c:931 #, c-format msgid "%s: unresolvable relocation %s against symbol `%s' from %s section" msgstr "" -#: elf32-cris.c:1012 +#: elf32-cris.c:993 #, c-format msgid "" "%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section" msgstr "" -#: elf32-cris.c:1015 elf32-cris.c:1142 +#: elf32-cris.c:996 elf32-cris.c:1122 msgid "[whose name is lost]" msgstr "" -#: elf32-cris.c:1131 +#: elf32-cris.c:1111 #, c-format msgid "" "%s: relocation %s with non-zero addend %d against local symbol from %s " "section" msgstr "" -#: elf32-cris.c:1138 +#: elf32-cris.c:1118 #, c-format msgid "" "%s: relocation %s with non-zero addend %d against symbol `%s' from %s section" msgstr "" -#: elf32-cris.c:1156 +#: elf32-cris.c:1136 #, c-format msgid "" "%s: relocation %s is not allowed for global symbol: `%s' from %s section" msgstr "" -#: elf32-cris.c:1171 +#: elf32-cris.c:1151 #, c-format msgid "%s: relocation %s in section %s with no GOT created" msgstr "" -#: elf32-cris.c:1289 +#: elf32-cris.c:1270 #, c-format msgid "%s: Internal inconsistency; no relocation section %s" msgstr "" -#: elf32-cris.c:2523 +#: elf32-cris.c:2493 #, c-format msgid "" "%s, section %s:\n" " relocation %s should not be used in a shared object; recompile with -fPIC" msgstr "" -#: elf32-cris.c:2994 +#: elf32-cris.c:2971 msgid " [symbols have a _ prefix]" msgstr "" -#: elf32-cris.c:3033 +#: elf32-cris.c:3010 #, c-format msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols" msgstr "" -#: elf32-cris.c:3034 +#: elf32-cris.c:3011 #, c-format msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols" msgstr "" -#: elf32-gen.c:82 elf64-gen.c:82 +#: elf32-frv.c:1223 +#, c-format +msgid "" +"%s: compiled with %s and linked with modules that use non-pic relocations" +msgstr "" + +#: elf32-frv.c:1273 elf32-iq2000.c:895 +#, c-format +msgid "%s: compiled with %s and linked with modules compiled with %s" +msgstr "" + +#: elf32-frv.c:1285 +#, c-format +msgid "" +"%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%" +"lx)" +msgstr "" + +#: elf32-frv.c:1321 elf32-iq2000.c:933 +#, c-format +msgid "private flags = 0x%lx:" +msgstr "" + +#: elf32-gen.c:83 elf64-gen.c:82 #, c-format msgid "%s: Relocations in generic ELF (EM: %d)" msgstr "" -#: elf32-hppa.c:646 +#: elf32-hppa.c:672 elf32-m68hc1x.c:176 elf64-ppc.c:3147 #, c-format msgid "%s: cannot create stub entry %s" msgstr "" -#: elf32-hppa.c:937 elf32-hppa.c:3549 +#: elf32-hppa.c:957 elf32-hppa.c:3538 #, c-format msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections" msgstr "" -#: elf32-hppa.c:1312 +#: elf32-hppa.c:1340 elf64-x86-64.c:751 elf64-x86-64.c:876 #, c-format msgid "" "%s: relocation %s can not be used when making a shared object; recompile " "with -fPIC" msgstr "" -#: elf32-hppa.c:1332 +#: elf32-hppa.c:1360 #, c-format msgid "" "%s: relocation %s should not be used when making a shared object; recompile " "with -fPIC" msgstr "" -#: elf32-hppa.c:1525 +#: elf32-hppa.c:1553 #, c-format msgid "Could not find relocation section for %s" msgstr "" -#: elf32-hppa.c:2871 +#: elf32-hppa.c:2828 #, c-format msgid "%s: duplicate export stub %s" msgstr "" -#: elf32-hppa.c:3433 +#: elf32-hppa.c:3416 #, c-format msgid "%s(%s+0x%lx): fixing %s" msgstr "" -#: elf32-hppa.c:4073 +#: elf32-hppa.c:4039 #, c-format msgid "%s(%s+0x%lx): cannot handle %s for %s" msgstr "" -#: elf32-hppa.c:4412 +#: elf32-hppa.c:4357 msgid ".got section not immediately after .plt section" msgstr "" -#: elf32-i386.c:298 +#: elf32-i386.c:390 #, c-format msgid "%s: invalid relocation type %d" msgstr "" -#: elf32-i386.c:718 elf32-s390.c:637 elf64-s390.c:595 +#: elf32-i386.c:923 elf32-s390.c:919 elf32-sparc.c:887 elf32-xtensa.c:635 +#: elf64-s390.c:873 elf64-x86-64.c:729 #, c-format msgid "%s: bad symbol index: %d" msgstr "" -#: elf32-i386.c:863 elf32-s390.c:791 elf64-ppc.c:2198 elf64-s390.c:759 +#: elf32-i386.c:1032 elf32-s390.c:1089 elf32-sh.c:6422 elf32-sparc.c:1011 +#: elf64-s390.c:1051 +#, c-format +msgid "%s: `%s' accessed both as normal and thread local symbol" +msgstr "" + +#: elf32-i386.c:1146 elf32-s390.c:1200 elf64-ppc.c:3956 elf64-s390.c:1165 +#: elf64-x86-64.c:965 #, c-format msgid "%s: bad relocation section name `%s'" msgstr "" -#: elf32-i386.c:2073 elf32-s390.c:1956 elf64-ppc.c:4128 elf64-s390.c:1959 +#: elf32-i386.c:3003 elf32-m68k.c:1757 elf32-s390.c:2936 elf32-sparc.c:2876 +#: elf32-xtensa.c:2160 elf64-s390.c:2933 elf64-sparc.c:2664 +#: elf64-x86-64.c:2553 #, c-format msgid "%s(%s+0x%lx): unresolvable relocation against symbol `%s'" msgstr "" -#: elf32-i386.c:2111 elf32-s390.c:1994 elf64-s390.c:1997 +#: elf32-i386.c:3042 elf32-m68k.c:1796 elf32-s390.c:2974 elf64-s390.c:2971 +#: elf64-x86-64.c:2591 #, c-format msgid "%s(%s+0x%lx): reloc against `%s': error %d" msgstr "" -#: elf32-m32r.c:923 -msgid "SDA relocation when _SDA_BASE_ not defined" +#: elf32-ip2k.c:565 elf32-ip2k.c:571 elf32-ip2k.c:734 elf32-ip2k.c:740 +msgid "" +"ip2k relaxer: switch table without complete matching relocation information." msgstr "" -#: elf32-ia64.c:3537 elf32-m32r.c:1007 elf32-ppc.c:2930 elf64-ia64.c:3537 -#, c-format -msgid "%s: unknown relocation type %d" +#: elf32-ip2k.c:588 elf32-ip2k.c:767 +msgid "ip2k relaxer: switch table header corrupt." msgstr "" -#: elf32-m32r.c:1223 +#: elf32-ip2k.c:1395 #, c-format -msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)" +msgid "ip2k linker: missing page instruction at 0x%08lx (dest = 0x%08lx)." msgstr "" -#: elf32-m32r.c:2000 +#: elf32-ip2k.c:1409 #, c-format -msgid "%s: Instruction set mismatch with previous modules" +msgid "ip2k linker: redundant page instruction at 0x%08lx (dest = 0x%08lx)." msgstr "" -#: elf32-m32r.c:2023 +#. Only if it's not an unresolved symbol. +#: elf32-ip2k.c:1593 +msgid "unsupported relocation between data/insn address spaces" +msgstr "" + +#: elf32-iq2000.c:907 elf32-m68hc1x.c:1431 elf32-ppc.c:2211 elf64-sparc.c:3072 +#: elfxx-mips.c:9336 #, c-format -msgid "private flags = %lx" +msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" msgstr "" -#: elf32-m32r.c:2028 -msgid ": m32r instructions" +#: elf32-m32r.c:930 +msgid "SDA relocation when _SDA_BASE_ not defined" msgstr "" -#: elf32-m32r.c:2029 -msgid ": m32rx instructions" +#: elf32-ia64.c:3903 elf32-m32r.c:1018 elf64-alpha.c:4279 elf64-alpha.c:4407 +#: elf64-ia64.c:3903 +#, c-format +msgid "%s: unknown relocation type %d" msgstr "" -#: elf32-m68k.c:413 -msgid " [cpu32]" +#: elf32-m32r.c:1226 +#, c-format +msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)" msgstr "" -#: elf32-mcore.c:353 elf32-mcore.c:479 +#: elf32-m32r.c:1952 #, c-format -msgid "%s: Relocation %s (%d) is not currently supported.\n" +msgid "%s: Instruction set mismatch with previous modules" msgstr "" -#: elf32-mcore.c:438 +#: elf32-m32r.c:1975 #, c-format -msgid "%s: Unknown relocation type %d\n" +msgid "private flags = %lx" msgstr "" -#: elf32-mips.c:2156 elf64-mips.c:1972 -msgid "32bits gp relative relocation occurs for an external symbol" +#: elf32-m32r.c:1980 +msgid ": m32r instructions" msgstr "" -#: elf32-mips.c:2305 -#, c-format -msgid "Linking mips16 objects into %s format is not supported" +#: elf32-m32r.c:1981 +msgid ": m32rx instructions" msgstr "" -#: elf32-mips.c:3129 +#: elf32-m68hc1x.c:1217 #, c-format -msgid "%s: linking PIC files with non-PIC files" +msgid "" +"Reference to the far symbol `%s' using a wrong relocation may result in " +"incorrect execution" msgstr "" -#: elf32-mips.c:3139 +#: elf32-m68hc1x.c:1240 #, c-format -msgid "%s: linking abicalls files with non-abicalls files" +msgid "" +"banked address [%lx:%04lx] (%lx) is not in the same bank as current banked " +"address [%lx:%04lx] (%lx)" msgstr "" -#: elf32-mips.c:3168 +#: elf32-m68hc1x.c:1259 #, c-format -msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" +msgid "" +"reference to a banked address [%lx:%04lx] in the normal address space at %" +"04lx" msgstr "" -#: elf32-mips.c:3190 +#: elf32-m68hc1x.c:1396 #, c-format -msgid "%s: ISA mismatch (%d) with previous modules (%d)" +msgid "" +"%s: linking files compiled for 16-bit integers (-mshort) and others for 32-" +"bit integers" msgstr "" -#: elf32-mips.c:3213 +#: elf32-m68hc1x.c:1404 #, c-format -msgid "%s: ABI mismatch: linking %s module with previous %s modules" +msgid "" +"%s: linking files compiled for 32-bit double (-fshort-double) and others for " +"64-bit double" msgstr "" -#: elf32-mips.c:3227 elf32-ppc.c:1470 elf64-ppc.c:1556 elf64-sparc.c:3027 +#: elf32-m68hc1x.c:1414 #, c-format -msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" +msgid "%s: linking files compiled for HCS12 with others compiled for HC12" msgstr "" -#: elf32-mips.c:3258 -msgid " [abi=O32]" +#: elf32-m68hc1x.c:1462 +msgid "[abi=32-bit int, " msgstr "" -#: elf32-mips.c:3260 -msgid " [abi=O64]" +#: elf32-m68hc1x.c:1464 +msgid "[abi=16-bit int, " msgstr "" -#: elf32-mips.c:3262 -msgid " [abi=EABI32]" +#: elf32-m68hc1x.c:1467 +msgid "64-bit double, " msgstr "" -#: elf32-mips.c:3264 -msgid " [abi=EABI64]" +#: elf32-m68hc1x.c:1469 +msgid "32-bit double, " msgstr "" -#: elf32-mips.c:3266 -msgid " [abi unknown]" +#: elf32-m68hc1x.c:1472 +msgid "cpu=HC11]" msgstr "" -#: elf32-mips.c:3268 -msgid " [abi=N32]" +#: elf32-m68hc1x.c:1474 +msgid "cpu=HCS12]" msgstr "" -#: elf32-mips.c:3270 -msgid " [abi=64]" +#: elf32-m68hc1x.c:1476 +msgid "cpu=HC12]" msgstr "" -#: elf32-mips.c:3272 -msgid " [no abi set]" +#: elf32-m68hc1x.c:1479 +msgid " [memory=bank-model]" msgstr "" -#: elf32-mips.c:3275 -msgid " [mips1]" +#: elf32-m68hc1x.c:1481 +msgid " [memory=flat]" msgstr "" -#: elf32-mips.c:3277 -msgid " [mips2]" +#: elf32-m68k.c:400 +msgid " [cpu32]" msgstr "" -#: elf32-mips.c:3279 -msgid " [mips3]" +#: elf32-m68k.c:403 +msgid " [m68000]" msgstr "" -#: elf32-mips.c:3281 -msgid " [mips4]" +#: elf32-mcore.c:353 elf32-mcore.c:456 +#, c-format +msgid "%s: Relocation %s (%d) is not currently supported.\n" msgstr "" -#: elf32-mips.c:3283 -msgid " [mips5]" +#: elf32-mcore.c:441 +#, c-format +msgid "%s: Unknown relocation type %d\n" msgstr "" -#: elf32-mips.c:3285 -msgid " [mips32]" +#: elf32-mips.c:1151 elf64-mips.c:1720 elfn32-mips.c:1665 +msgid "32bits gp relative relocation occurs for an external symbol" msgstr "" -#: elf32-mips.c:3287 -msgid " [mips64]" +#: elf32-mips.c:1294 elf64-mips.c:1836 elfn32-mips.c:1781 +#, c-format +msgid "Linking mips16 objects into %s format is not supported" msgstr "" -#: elf32-mips.c:3289 -msgid " [unknown ISA]" +#: elf32-ppc.c:2176 +#, c-format +msgid "" +"%s: compiled with -mrelocatable and linked with modules compiled normally" msgstr "" -#: elf32-mips.c:3292 -msgid " [32bitmode]" +#: elf32-ppc.c:2184 +#, c-format +msgid "" +"%s: compiled normally and linked with modules compiled with -mrelocatable" msgstr "" -#: elf32-mips.c:3294 -msgid " [not 32bitmode]" +#: elf32-ppc.c:2309 +#, c-format +msgid "%s: unknown special linker type %d" msgstr "" -#: elf32-mips.c:4967 -msgid "static procedure (no name)" +#: elf32-ppc.c:3178 +#, c-format +msgid "%s: relocation %s cannot be used when making a shared object" msgstr "" -#: elf32-mips.c:5585 elf64-mips.c:6694 +#: elf32-ppc.c:4651 elf64-ppc.c:7532 #, c-format -msgid "%s: illegal section name `%s'" +msgid "%s: unknown relocation type %d for symbol %s" msgstr "" -#: elf32-mips.c:6152 elf64-mips.c:3150 -msgid "not enough GOT space for local GOT entries" +#: elf32-ppc.c:4902 +#, c-format +msgid "%s(%s+0x%lx): non-zero addend on %s reloc against `%s'" msgstr "" -#: elf32-mips.c:7263 elf64-mips.c:4203 +#: elf32-ppc.c:5190 elf32-ppc.c:5214 elf32-ppc.c:5271 #, c-format -msgid "%s: %s+0x%lx: jump to stub routine which is not jal" +msgid "" +"%s: the target (%s) of a %s relocation is in the wrong output section (%s)" msgstr "" -#: elf32-mips.c:8272 elf64-mips.c:5891 +#: elf32-ppc.c:5325 #, c-format -msgid "%s: Malformed reloc detected for section %s" +msgid "%s: relocation %s is not yet supported for symbol %s." msgstr "" -#: elf32-mips.c:8350 elf64-mips.c:5969 +#: elf32-ppc.c:5379 elf64-ppc.c:8124 #, c-format -msgid "%s: CALL16 reloc at 0x%lx not against global symbol" +msgid "%s(%s+0x%lx): unresolvable %s relocation against symbol `%s'" +msgstr "" + +#: elf32-ppc.c:5429 elf64-ppc.c:8170 +#, c-format +msgid "%s(%s+0x%lx): %s reloc against `%s': error %d" +msgstr "" + +#: elf32-ppc.c:5695 +#, c-format +msgid "corrupt or empty %s section in %s" +msgstr "" + +#: elf32-ppc.c:5702 +#, c-format +msgid "unable to read in %s section from %s" +msgstr "" + +#: elf32-ppc.c:5708 +#, c-format +msgid "corrupt %s section in %s" +msgstr "" + +#: elf32-ppc.c:5751 +#, c-format +msgid "warning: unable to set size of %s section in %s" +msgstr "" + +#: elf32-ppc.c:5804 +msgid "failed to allocate space for new APUinfo section." +msgstr "" + +#: elf32-ppc.c:5823 +msgid "failed to compute new APUinfo section." +msgstr "" + +#: elf32-ppc.c:5826 +msgid "failed to install new APUinfo section." +msgstr "" + +#: elf32-s390.c:2173 elf64-s390.c:2144 +#, c-format +msgid "%s(%s+0x%lx): invalid instruction for TLS relocation %s" +msgstr "" + +#: elf32-sh64.c:221 elf64-sh64.c:2407 +#, c-format +msgid "%s: compiled as 32-bit object and %s is 64-bit" +msgstr "" + +#: elf32-sh64.c:224 elf64-sh64.c:2410 +#, c-format +msgid "%s: compiled as 64-bit object and %s is 32-bit" +msgstr "" + +#: elf32-sh64.c:226 elf64-sh64.c:2412 +#, c-format +msgid "%s: object size does not match that of target %s" +msgstr "" + +#: elf32-sh64.c:461 elf64-sh64.c:2990 +#, c-format +msgid "%s: encountered datalabel symbol in input" +msgstr "" + +#: elf32-sh64.c:544 +msgid "PTB mismatch: a SHmedia address (bit 0 == 1)" +msgstr "" + +#: elf32-sh64.c:547 +msgid "PTA mismatch: a SHcompact address (bit 0 == 0)" +msgstr "" + +#: elf32-sh64.c:565 +#, c-format +msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16" +msgstr "" + +#: elf32-sh64.c:614 elf64-sh64.c:1748 +#, c-format +msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n" +msgstr "" + +#: elf32-sh64.c:698 +#, c-format +msgid "%s: could not write out added .cranges entries" +msgstr "" + +#: elf32-sh64.c:760 +#, c-format +msgid "%s: could not write out sorted .cranges entries" +msgstr "" + +#: elf32-sh.c:2103 +#, c-format +msgid "%s: 0x%lx: warning: bad R_SH_USES offset" +msgstr "" + +#: elf32-sh.c:2115 +#, c-format +msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" +msgstr "" + +#: elf32-sh.c:2132 +#, c-format +msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" +msgstr "" + +#: elf32-sh.c:2147 +#, c-format +msgid "%s: 0x%lx: warning: could not find expected reloc" +msgstr "" + +#: elf32-sh.c:2175 +#, c-format +msgid "%s: 0x%lx: warning: symbol in unexpected section" +msgstr "" + +#: elf32-sh.c:2300 +#, c-format +msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" +msgstr "" + +#: elf32-sh.c:2309 +#, c-format +msgid "%s: 0x%lx: warning: bad count" +msgstr "" + +#: elf32-sh.c:2712 elf32-sh.c:3088 +#, c-format +msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" +msgstr "" + +#: elf32-sh.c:4651 elf64-sh64.c:1585 +msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled" +msgstr "" + +#: elf32-sh.c:4806 +#, c-format +msgid "%s: unresolvable relocation against symbol `%s' from %s section" +msgstr "" + +#: elf32-sh.c:4878 +#, c-format +msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" +msgstr "" + +#: elf32-sh.c:6621 elf64-alpha.c:4848 +#, c-format +msgid "%s: TLS local exec code cannot be linked into shared objects" +msgstr "" + +#: elf32-sparc.c:2518 elf64-sparc.c:2314 +#, c-format +msgid "%s: probably compiled without -fPIC?" +msgstr "" + +#: elf32-sparc.c:3345 +#, c-format +msgid "%s: compiled for a 64 bit system and target is 32 bit" +msgstr "" + +#: elf32-sparc.c:3359 +#, c-format +msgid "%s: linking little endian files with big endian files" +msgstr "" + +#: elf32-v850.c:736 +#, c-format +msgid "Variable `%s' cannot occupy in multiple small data regions" +msgstr "" + +#: elf32-v850.c:739 +#, c-format +msgid "" +"Variable `%s' can only be in one of the small, zero, and tiny data regions" +msgstr "" + +#: elf32-v850.c:742 +#, c-format +msgid "" +"Variable `%s' cannot be in both small and zero data regions simultaneously" +msgstr "" + +#: elf32-v850.c:745 +#, c-format +msgid "" +"Variable `%s' cannot be in both small and tiny data regions simultaneously" +msgstr "" + +#: elf32-v850.c:748 +#, c-format +msgid "" +"Variable `%s' cannot be in both zero and tiny data regions simultaneously" +msgstr "" + +#: elf32-v850.c:1126 +msgid "FAILED to find previous HI16 reloc\n" +msgstr "" + +#: elf32-v850.c:1765 +msgid "could not locate special linker symbol __gp" +msgstr "" + +#: elf32-v850.c:1769 +msgid "could not locate special linker symbol __ep" +msgstr "" + +#: elf32-v850.c:1773 +msgid "could not locate special linker symbol __ctbp" +msgstr "" + +#: elf32-v850.c:1939 +#, c-format +msgid "%s: Architecture mismatch with previous modules" +msgstr "" + +#: elf32-v850.c:1959 +#, c-format +msgid "private flags = %lx: " +msgstr "" + +#: elf32-v850.c:1964 +msgid "v850 architecture" +msgstr "" + +#: elf32-v850.c:1965 +msgid "v850e architecture" +msgstr "" + +#: elf32-vax.c:549 +msgid " [nonpic]" +msgstr "" + +#: elf32-vax.c:552 +msgid " [d-float]" +msgstr "" + +#: elf32-vax.c:555 +msgid " [g-float]" +msgstr "" + +#: elf32-vax.c:663 +#, c-format +msgid "" +"%s: warning: GOT addend of %ld to `%s' does not match previous GOT addend of " +"%ld" +msgstr "" + +#: elf32-vax.c:1667 +#, c-format +msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored" +msgstr "" + +#: elf32-vax.c:1802 +#, c-format +msgid "%s: warning: %s relocation against symbol `%s' from %s section" +msgstr "" + +#: elf32-vax.c:1808 +#, c-format +msgid "%s: warning: %s relocation to 0x%x from %s section" +msgstr "" + +#: elf32-ia64.c:2429 elf32-xstormy16.c:462 elf64-ia64.c:2429 +msgid "non-zero addend in @fptr reloc" +msgstr "" + +#: elf64-alpha.c:1108 +msgid "GPDISP relocation did not find ldah and lda instructions" +msgstr "" + +#: elf64-alpha.c:3731 +#, c-format +msgid "%s: .got subsegment exceeds 64K (size %d)" +msgstr "" + +#: elf64-alpha.c:4602 elf64-alpha.c:4614 +#, c-format +msgid "%s: gp-relative relocation against dynamic symbol %s" +msgstr "" + +#: elf64-alpha.c:4640 elf64-alpha.c:4773 +#, c-format +msgid "%s: pc-relative relocation against dynamic symbol %s" +msgstr "" + +#: elf64-alpha.c:4668 +#, c-format +msgid "%s: change in gp: BRSGP %s" +msgstr "" + +#: elf64-alpha.c:4693 +msgid "" +msgstr "" + +#: elf64-alpha.c:4698 +#, c-format +msgid "%s: !samegp reloc against symbol without .prologue: %s" +msgstr "" + +#: elf64-alpha.c:4749 +#, c-format +msgid "%s: unhandled dynamic relocation against %s" +msgstr "" + +#: elf64-alpha.c:4832 +#, c-format +msgid "%s: dtp-relative relocation against dynamic symbol %s" +msgstr "" + +#: elf64-alpha.c:4855 +#, c-format +msgid "%s: tp-relative relocation against dynamic symbol %s" +msgstr "" + +#: elf64-hppa.c:2086 +#, c-format +msgid "stub entry for %s cannot load .plt, dp offset = %ld" +msgstr "" + +#: elf64-mmix.c:1032 +#, c-format +msgid "" +"%s: Internal inconsistency error for value for\n" +" linker-allocated global register: linked: 0x%lx%08lx != relaxed: 0x%lx%" +"08lx\n" +msgstr "" + +#: elf64-mmix.c:1416 +#, c-format +msgid "" +"%s: base-plus-offset relocation against register symbol: (unknown) in %s" +msgstr "" + +#: elf64-mmix.c:1421 +#, c-format +msgid "%s: base-plus-offset relocation against register symbol: %s in %s" +msgstr "" + +#: elf64-mmix.c:1465 +#, c-format +msgid "%s: register relocation against non-register symbol: (unknown) in %s" +msgstr "" + +#: elf64-mmix.c:1470 +#, c-format +msgid "%s: register relocation against non-register symbol: %s in %s" +msgstr "" + +#: elf64-mmix.c:1507 +#, c-format +msgid "%s: directive LOCAL valid only with a register or absolute value" +msgstr "" + +#: elf64-mmix.c:1535 +#, c-format +msgid "" +"%s: LOCAL directive: Register $%ld is not a local register. First global " +"register is $%ld." +msgstr "" + +#: elf64-mmix.c:1994 +#, c-format +msgid "" +"%s: Error: multiple definition of `%s'; start of %s is set in a earlier " +"linked file\n" +msgstr "" + +#: elf64-mmix.c:2053 +msgid "Register section has contents\n" +msgstr "" + +#: elf64-mmix.c:2216 +#, c-format +msgid "" +"Internal inconsistency: remaining %u != max %u.\n" +" Please report this bug." +msgstr "" + +#: elf64-ppc.c:2362 libbfd.c:887 +#, c-format +msgid "%s: compiled for a big endian system and target is little endian" +msgstr "" + +#: elf64-ppc.c:2364 libbfd.c:889 +#, c-format +msgid "%s: compiled for a little endian system and target is big endian" +msgstr "" + +#: elf64-ppc.c:4903 +#, c-format +msgid "%s: unexpected reloc type %u in .opd section" msgstr "" -#: elf32-ppc.c:1436 elf64-ppc.c:1521 +#: elf64-ppc.c:4923 #, c-format -msgid "" -"%s: compiled with -mrelocatable and linked with modules compiled normally" +msgid "%s: .opd is not a regular array of opd entries" msgstr "" -#: elf32-ppc.c:1444 elf64-ppc.c:1529 +#: elf64-ppc.c:4943 #, c-format -msgid "" -"%s: compiled normally and linked with modules compiled with -mrelocatable" +msgid "%s: undefined sym `%s' in .opd section" msgstr "" -#: elf32-ppc.c:1568 +#: elf64-ppc.c:6131 #, c-format -msgid "%s: Unknown special linker type %d" +msgid "can't find branch stub `%s'" msgstr "" -#: elf32-ppc.c:2218 elf32-ppc.c:2252 elf32-ppc.c:2287 +#: elf64-ppc.c:6170 elf64-ppc.c:6220 #, c-format -msgid "%s: relocation %s cannot be used when making a shared object" +msgid "linkage table error against `%s'" msgstr "" -#: elf32-ppc.c:3097 elf64-ppc.c:3720 +#: elf64-ppc.c:6301 #, c-format -msgid "%s: unknown relocation type %d for symbol %s" +msgid "can't build branch stub `%s'" msgstr "" -#: elf32-ppc.c:3452 elf32-ppc.c:3473 elf32-ppc.c:3523 -#, c-format -msgid "" -"%s: The target (%s) of a %s relocation is in the wrong output section (%s)" +#: elf64-ppc.c:6934 +msgid "stubs don't match calculated size" msgstr "" -#: elf32-ppc.c:3589 +#: elf64-ppc.c:8009 #, c-format -msgid "%s: Relocation %s is not yet supported for symbol %s." +msgid "%s: relocation %s is not supported for symbol %s." msgstr "" -#: elf32-sh.c:1971 +#: elf64-ppc.c:8078 #, c-format -msgid "%s: 0x%lx: warning: bad R_SH_USES offset" +msgid "%s: error: relocation %s not a multiple of 4" msgstr "" -#: elf32-sh.c:1983 +#: elf-hppa.h:1458 elf-hppa.h:1491 elf64-sh64.c:1704 #, c-format -msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" +msgid "" +"%s: warning: unresolvable relocation against symbol `%s' from %s section" msgstr "" -#: elf32-sh.c:2000 +#: elf64-sparc.c:1370 #, c-format -msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" +msgid "%s: check_relocs: unhandled reloc type %d" msgstr "" -#: elf32-sh.c:2015 +#: elf64-sparc.c:1407 #, c-format -msgid "%s: 0x%lx: warning: could not find expected reloc" +msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER" msgstr "" -#: elf32-sh.c:2072 +#: elf64-sparc.c:1427 #, c-format -msgid "%s: 0x%lx: warning: symbol in unexpected section" +msgid "Register %%g%d used incompatibly: %s in %s, previously %s in %s" msgstr "" -#: elf32-sh.c:2193 +#: elf64-sparc.c:1450 #, c-format -msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" +msgid "Symbol `%s' has differing types: REGISTER in %s, previously %s in %s" msgstr "" -#: elf32-sh.c:2202 +#: elf64-sparc.c:1496 #, c-format -msgid "%s: 0x%lx: warning: bad count" +msgid "Symbol `%s' has differing types: %s in %s, previously REGISTER in %s" msgstr "" -#: elf32-sh.c:2611 elf32-sh.c:3002 +#: elf64-sparc.c:3053 #, c-format -msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" +msgid "%s: linking UltraSPARC specific with HAL specific code" msgstr "" -#: elf32-sh.c:4146 elf64-sh64.c:1557 -msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled" +#: elf64-x86-64.c:818 +#, c-format +msgid "%s: %s' accessed both as normal and thread local symbol" msgstr "" -#: elf32-sh.c:4357 +#: elf.c:372 #, c-format -msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" +msgid "%s: invalid string offset %u >= %lu for section `%s'" msgstr "" -#: elf32-sh64.c:211 elf64-sh64.c:2391 +#: elf.c:624 #, c-format -msgid "%s: compiled as 32-bit object and %s is 64-bit" +msgid "%s: invalid SHT_GROUP entry" msgstr "" -#: elf32-sh64.c:214 elf64-sh64.c:2394 +#: elf.c:695 #, c-format -msgid "%s: compiled as 64-bit object and %s is 32-bit" +msgid "%s: no group info for section %s" msgstr "" -#: elf32-sh64.c:216 elf64-sh64.c:2396 -#, c-format -msgid "%s: object size does not match that of target %s" +#: elf.c:1055 +msgid "" +"\n" +"Program Header:\n" msgstr "" -#: elf32-sh64.c:447 elf64-sh64.c:2973 -#, c-format -msgid "%s: encountered datalabel symbol in input" +#: elf.c:1105 +msgid "" +"\n" +"Dynamic Section:\n" msgstr "" -#: elf32-sh64.c:530 -msgid "PTB mismatch: a SHmedia address (bit 0 == 1)" +#: elf.c:1234 +msgid "" +"\n" +"Version definitions:\n" msgstr "" -#: elf32-sh64.c:533 -msgid "PTA mismatch: a SHcompact address (bit 0 == 0)" +#: elf.c:1257 +msgid "" +"\n" +"Version References:\n" msgstr "" -#: elf32-sh64.c:551 +#: elf.c:1262 #, c-format -msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16" +msgid " required from %s:\n" msgstr "" -#: elf32-sh64.c:600 elf64-sh64.c:1684 +#: elf.c:1944 #, c-format -msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n" +msgid "%s: invalid link %lu for reloc section %s (index %u)" msgstr "" -#: elf32-sh64.c:684 +#: elf.c:3668 #, c-format -msgid "%s: could not write out added .cranges entries" +msgid "%s: Not enough room for program headers (allocated %u, need %u)" msgstr "" -#: elf32-sh64.c:745 +#: elf.c:3773 #, c-format -msgid "%s: could not write out sorted .cranges entries" +msgid "%s: Not enough room for program headers, try linking with -N" msgstr "" -#: elf32-sparc.c:1554 elf64-sparc.c:2280 +#: elf.c:3904 #, c-format -msgid "%s: probably compiled without -fPIC?" +msgid "" +"Error: First section in segment (%s) starts at 0x%x whereas the segment " +"starts at 0x%x" msgstr "" -#: elf32-sparc.c:2007 +#: elf.c:4218 #, c-format -msgid "%s: compiled for a 64 bit system and target is 32 bit" +msgid "%s: warning: allocated section `%s' not in segment" msgstr "" -#: elf32-sparc.c:2021 +#: elf.c:4542 #, c-format -msgid "%s: linking little endian files with big endian files" +msgid "%s: symbol `%s' required but not present" msgstr "" -#: elf32-v850.c:682 +#: elf.c:4830 #, c-format -msgid "Variable `%s' cannot occupy in multiple small data regions" +msgid "%s: warning: Empty loadable segment detected, is this intentional ?\n" msgstr "" -#: elf32-v850.c:685 +#: elf.c:5461 #, c-format msgid "" -"Variable `%s' can only be in one of the small, zero, and tiny data regions" +"Unable to find equivalent output section for symbol '%s' from section '%s'" msgstr "" -#: elf32-v850.c:688 +#: elf.c:6274 #, c-format -msgid "" -"Variable `%s' cannot be in both small and zero data regions simultaneously" +msgid "%s: unsupported relocation type %s" msgstr "" -#: elf32-v850.c:691 +#: elfcode.h:1117 #, c-format -msgid "" -"Variable `%s' cannot be in both small and tiny data regions simultaneously" +msgid "%s: version count (%ld) does not match symbol count (%ld)" msgstr "" -#: elf32-v850.c:694 +#: elfcode.h:1346 #, c-format -msgid "" -"Variable `%s' cannot be in both zero and tiny data regions simultaneously" +msgid "%s(%s): relocation %d has invalid symbol index %ld" msgstr "" -#: elf32-v850.c:1072 -msgid "FAILED to find previous HI16 reloc\n" +#: elflink.c:1456 +#, c-format +msgid "%s: warning: unexpected redefinition of indirect versioned symbol `%s'" msgstr "" -#: elf32-v850.c:1703 -msgid "could not locate special linker symbol __gp" +#: elflink.c:1807 +#, c-format +msgid "%s: undefined versioned symbol name %s" msgstr "" -#: elf32-v850.c:1707 -msgid "could not locate special linker symbol __ep" +#: elflink.c:1956 +#, c-format +msgid "%s: Section %s is too large to add hole of %ld bytes" msgstr "" -#: elf32-v850.c:1711 -msgid "could not locate special linker symbol __ctbp" +#: elflink.c:2315 +#, c-format +msgid "%s: relocation size mismatch in %s section %s" msgstr "" -#: elf32-v850.c:1877 +#: elflink.c:2607 #, c-format -msgid "%s: Architecture mismatch with previous modules" +msgid "warning: type and size of dynamic symbol `%s' are not defined" msgstr "" -#: elf32-v850.c:1897 +#: elflink.h:1022 #, c-format -msgid "private flags = %lx: " +msgid "%s: %s: invalid version %u (max %d)" msgstr "" -#: elf32-v850.c:1902 -msgid "v850 architecture" +#: elflink.h:1063 +#, c-format +msgid "%s: %s: invalid needed version %d" msgstr "" -#: elf32-v850.c:1903 -msgid "v850e architecture" +#: elflink.h:1238 +#, c-format +msgid "Warning: alignment %u of symbol `%s' in %s is smaller than %u in %s" msgstr "" -#: elf32-v850.c:1904 -msgid "v850ea architecture" +#: elflink.h:1252 +#, c-format +msgid "Warning: size of symbol `%s' changed from %lu in %s to %lu in %s" msgstr "" -#: elf32-ia64.c:2247 elf32-xstormy16.c:414 elf64-ia64.c:2247 -msgid "non-zero addend in @fptr reloc" +#: elflink.h:2123 +#, c-format +msgid "%s: undefined version: %s" msgstr "" -#: elf64-alpha.c:858 -msgid "GPDISP relocation did not find ldah and lda instructions" +#: elflink.h:2189 +#, c-format +msgid "%s: .preinit_array section is not allowed in DSO" msgstr "" -#: elf64-alpha.c:2934 -#, c-format -msgid "%s: .got subsegment exceeds 64K (size %d)" +#: elflink.h:3040 +msgid "Not enough memory to sort relocations" msgstr "" -#: elf64-alpha.c:3518 elf64-alpha.c:3530 +#: elflink.h:3922 elflink.h:3965 #, c-format -msgid "%s: gp-relative relocation against dynamic symbol %s" +msgid "%s: could not find output section %s" msgstr "" -#: elf64-hppa.c:2070 +#: elflink.h:3928 #, c-format -msgid "stub entry for %s cannot load .plt, dp offset = %ld" +msgid "warning: %s section has zero size" msgstr "" -#: elf64-mmix.c:1002 +#: elflink.h:4447 #, c-format -msgid "" -"%s: Internal inconsistency error for value for\n" -" linker-allocated global register: linked: 0x%lx%08lx != relaxed: 0x%lx%" -"08lx\n" +msgid "%s: %s symbol `%s' in %s is referenced by DSO" msgstr "" -#: elf64-mmix.c:1386 +#: elflink.h:4528 #, c-format -msgid "" -"%s: base-plus-offset relocation against register symbol: (unknown) in %s" +msgid "%s: could not find output section %s for input section %s" msgstr "" -#: elf64-mmix.c:1391 +#: elflink.h:4630 #, c-format -msgid "%s: base-plus-offset relocation against register symbol: %s in %s" +msgid "%s: %s symbol `%s' isn't defined" msgstr "" -#: elf64-mmix.c:1435 +#: elflink.h:5033 #, c-format -msgid "%s: register relocation against non-register symbol: (unknown) in %s" +msgid "local symbols in discarded section %s" msgstr "" -#: elf64-mmix.c:1440 -#, c-format -msgid "%s: register relocation against non-register symbol: %s in %s" +#: elfxx-mips.c:901 +msgid "static procedure (no name)" msgstr "" -#: elf64-mmix.c:1477 -#, c-format -msgid "%s: directive LOCAL valid only with a register or absolute value" +#: elfxx-mips.c:1935 +msgid "not enough GOT space for local GOT entries" msgstr "" -#: elf64-mmix.c:1505 +#: elfxx-mips.c:3755 #, c-format -msgid "" -"%s: LOCAL directive: Register $%ld is not a local register. First global " -"register is $%ld." +msgid "%s: %s+0x%lx: jump to stub routine which is not jal" msgstr "" -#: elf64-mmix.c:1967 +#: elfxx-mips.c:5266 #, c-format -msgid "" -"%s: Error: multiple definition of `%s'; start of %s is set in a earlier " -"linked file\n" +msgid "%s: Malformed reloc detected for section %s" msgstr "" -#: elf64-mmix.c:2026 -msgid "Register section has contents\n" +#: elfxx-mips.c:5340 +#, c-format +msgid "%s: CALL16 reloc at 0x%lx not against global symbol" msgstr "" -#: elf64-ppc.c:1484 libbfd.c:1436 +#: elfxx-mips.c:8833 #, c-format -msgid "%s: compiled for a big endian system and target is little endian" +msgid "%s: illegal section name `%s'" msgstr "" -#: elf64-ppc.c:1486 libbfd.c:1438 +#: elfxx-mips.c:9166 #, c-format -msgid "%s: compiled for a little endian system and target is big endian" +msgid "%s: endianness incompatible with that of the selected emulation" msgstr "" -#: elf64-ppc.c:3354 +#: elfxx-mips.c:9178 #, c-format -msgid "linkage table error against `%s'" +msgid "%s: ABI is incompatible with that of the selected emulation" msgstr "" -#: elf64-ppc.c:3436 -msgid "stub section size doesn't match calculated size" +#: elfxx-mips.c:9245 +#, c-format +msgid "%s: warning: linking PIC files with non-PIC files" msgstr "" -#: elf64-ppc.c:4065 +#: elfxx-mips.c:9262 #, c-format -msgid "%s: Relocation %s is not supported for symbol %s." +msgid "%s: linking 32-bit code with 64-bit code" msgstr "" -#: elf64-ppc.c:4109 +#: elfxx-mips.c:9290 #, c-format -msgid "%s: error: relocation %s not a multiple of 4" +msgid "%s: linking %s module with previous %s modules" msgstr "" -#: elf64-sparc.c:1277 +#: elfxx-mips.c:9313 #, c-format -msgid "%s: check_relocs: unhandled reloc type %d" +msgid "%s: ABI mismatch: linking %s module with previous %s modules" msgstr "" -#: elf64-sparc.c:1314 -#, c-format -msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER" +#: elfxx-mips.c:9382 +msgid " [abi=O32]" msgstr "" -#: elf64-sparc.c:1334 -#, c-format -msgid "Register %%g%d used incompatibly: %s in %s, previously %s in %s" +#: elfxx-mips.c:9384 +msgid " [abi=O64]" msgstr "" -#: elf64-sparc.c:1357 -#, c-format -msgid "Symbol `%s' has differing types: REGISTER in %s, previously %s in %s" +#: elfxx-mips.c:9386 +msgid " [abi=EABI32]" msgstr "" -#: elf64-sparc.c:1404 -#, c-format -msgid "Symbol `%s' has differing types: %s in %s, previously REGISTER in %s" +#: elfxx-mips.c:9388 +msgid " [abi=EABI64]" msgstr "" -#: elf64-sparc.c:3008 -#, c-format -msgid "%s: linking UltraSPARC specific with HAL specific code" +#: elfxx-mips.c:9390 +msgid " [abi unknown]" msgstr "" -#: elfcode.h:1218 -#, c-format -msgid "%s: version count (%ld) does not match symbol count (%ld)" +#: elfxx-mips.c:9392 +msgid " [abi=N32]" msgstr "" -#: elflink.c:434 -#, c-format -msgid "%s: Section %s is too large to add hole of %ld bytes" +#: elfxx-mips.c:9394 +msgid " [abi=64]" msgstr "" -#: elflink.h:1113 -#, c-format -msgid "%s: warning: unexpected redefinition of `%s'" +#: elfxx-mips.c:9396 +msgid " [no abi set]" msgstr "" -#: elflink.h:1784 -#, c-format -msgid "%s: %s: invalid version %u (max %d)" +#: elfxx-mips.c:9399 +msgid " [mips1]" msgstr "" -#: elflink.h:1825 -#, c-format -msgid "%s: %s: invalid needed version %d" +#: elfxx-mips.c:9401 +msgid " [mips2]" msgstr "" -#: elflink.h:1945 -#, c-format -msgid "Warning: size of symbol `%s' changed from %lu to %lu in %s" +#: elfxx-mips.c:9403 +msgid " [mips3]" msgstr "" -#: elflink.h:4014 -#, c-format -msgid "warning: type and size of dynamic symbol `%s' are not defined" +#: elfxx-mips.c:9405 +msgid " [mips4]" msgstr "" -#: elflink.h:4320 -#, c-format -msgid "%s: undefined versioned symbol name %s" +#: elfxx-mips.c:9407 +msgid " [mips5]" msgstr "" -#: elflink.h:4544 elflink.h:4552 elflink.h:6203 elflink.h:7280 -msgid "Error: out of memory" +#: elfxx-mips.c:9409 +msgid " [mips32]" msgstr "" -#: elflink.h:4714 -msgid "Not enough memory to sort relocations" +#: elfxx-mips.c:9411 +msgid " [mips64]" msgstr "" -#: elflink.h:5980 -#, c-format -msgid "%s: could not find output section %s for input section %s" +#: elfxx-mips.c:9413 +msgid " [mips32r2]" msgstr "" -#: elflink.h:6553 -msgid "warning: relocation against removed section; zeroing" +#: elfxx-mips.c:9415 +msgid " [unknown ISA]" msgstr "" -#: elflink.h:6583 -msgid "warning: relocation against removed section" +#: elfxx-mips.c:9418 +msgid " [mdmx]" msgstr "" -#: elflink.h:6596 -#, c-format -msgid "local symbols in discarded section %s" +#: elfxx-mips.c:9421 +msgid " [mips16]" +msgstr "" + +#: elfxx-mips.c:9424 +msgid " [32bitmode]" +msgstr "" + +#: elfxx-mips.c:9426 +msgid " [not 32bitmode]" msgstr "" -#: i386linux.c:455 m68klinux.c:459 sparclinux.c:456 +#: i386linux.c:457 m68klinux.c:461 sparclinux.c:458 #, c-format msgid "Output file requires shared library `%s'\n" msgstr "" -#: i386linux.c:463 m68klinux.c:467 sparclinux.c:464 +#: i386linux.c:465 m68klinux.c:469 sparclinux.c:466 #, c-format msgid "Output file requires shared library `%s.so.%s'\n" msgstr "" -#: i386linux.c:653 i386linux.c:703 m68klinux.c:660 m68klinux.c:708 -#: sparclinux.c:655 sparclinux.c:705 +#: i386linux.c:654 i386linux.c:704 m68klinux.c:661 m68klinux.c:709 +#: sparclinux.c:656 sparclinux.c:706 #, c-format msgid "Symbol %s not defined for fixups\n" msgstr "" -#: i386linux.c:727 m68klinux.c:732 sparclinux.c:729 +#: i386linux.c:728 m68klinux.c:733 sparclinux.c:730 msgid "Warning: fixup count mismatch\n" msgstr "" -#: ieee.c:235 +#: ieee.c:293 #, c-format msgid "%s: string too long (%d chars, max 65535)" msgstr "" -#: ieee.c:365 +#: ieee.c:428 #, c-format msgid "%s: unrecognized symbol `%s' flags 0x%x" msgstr "" -#: ieee.c:877 +#: ieee.c:938 #, c-format msgid "%s: unimplemented ATI record %u for symbol %u" msgstr "" -#: ieee.c:902 +#: ieee.c:963 #, c-format msgid "%s: unexpected ATN type %d in external part" msgstr "" -#: ieee.c:924 +#: ieee.c:985 #, c-format msgid "%s: unexpected type after ATN" msgstr "" -#: ihex.c:258 +#: ihex.c:264 #, c-format msgid "%s:%d: unexpected character `%s' in Intel Hex file\n" msgstr "" -#: ihex.c:368 +#: ihex.c:372 #, c-format msgid "%s:%u: bad checksum in Intel Hex file (expected %u, found %u)" msgstr "" -#: ihex.c:422 +#: ihex.c:426 #, c-format msgid "%s:%u: bad extended address record length in Intel Hex file" msgstr "" -#: ihex.c:439 +#: ihex.c:443 #, c-format msgid "%s:%u: bad extended start address length in Intel Hex file" msgstr "" -#: ihex.c:456 +#: ihex.c:460 #, c-format msgid "%s:%u: bad extended linear address record length in Intel Hex file" msgstr "" -#: ihex.c:473 +#: ihex.c:477 #, c-format msgid "%s:%u: bad extended linear start address length in Intel Hex file" msgstr "" -#: ihex.c:490 +#: ihex.c:494 #, c-format msgid "%s:%u: unrecognized ihex type %u in Intel Hex file\n" msgstr "" -#: ihex.c:610 +#: ihex.c:619 #, c-format msgid "%s: internal error in ihex_read_section" msgstr "" -#: ihex.c:645 +#: ihex.c:654 #, c-format msgid "%s: bad section length in ihex_read_section" msgstr "" -#: ihex.c:863 +#: ihex.c:872 #, c-format msgid "%s: address 0x%s out of range for Intel Hex file" msgstr "" -#: libbfd.c:492 -#, c-format -msgid "not mapping: data=%lx mapped=%d\n" -msgstr "" - -#: libbfd.c:495 -msgid "not mapping: env var not set\n" -msgstr "" - -#: libbfd.c:1467 +#: libbfd.c:918 #, c-format msgid "Deprecated %s called at %s line %d in %s\n" msgstr "" -#: libbfd.c:1470 +#: libbfd.c:921 #, c-format msgid "Deprecated %s called\n" msgstr "" -#: linker.c:1849 +#: linker.c:1877 #, c-format msgid "%s: indirect symbol `%s' to `%s' is a loop" msgstr "" -#: linker.c:2745 +#: linker.c:2780 #, c-format msgid "Attempt to do relocateable link with %s input and %s output" msgstr "" -#: merge.c:897 +#: merge.c:896 #, c-format msgid "%s: access beyond end of merged section (%ld + %ld)" msgstr "" -#: mmo.c:459 +#: mmo.c:503 #, c-format msgid "%s: No core to allocate section name %s\n" msgstr "" -#: mmo.c:535 +#: mmo.c:579 #, c-format msgid "%s: No core to allocate a symbol %d bytes long\n" msgstr "" -#: mmo.c:1188 +#: mmo.c:1287 #, c-format msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n" msgstr "" -#: mmo.c:1334 +#: mmo.c:1433 #, c-format msgid "" "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name " "starting with `%s'\n" msgstr "" -#: mmo.c:1569 +#: mmo.c:1674 #, c-format msgid "%s: invalid mmo file: unsupported lopcode `%d'\n" msgstr "" -#: mmo.c:1579 +#: mmo.c:1684 #, c-format msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n" msgstr "" -#: mmo.c:1615 +#: mmo.c:1720 #, c-format msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n" msgstr "" -#: mmo.c:1661 +#: mmo.c:1766 #, c-format msgid "" "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n" msgstr "" -#: mmo.c:1700 +#: mmo.c:1805 #, c-format msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n" msgstr "" -#: mmo.c:1709 +#: mmo.c:1814 #, c-format msgid "" "%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n" msgstr "" -#: mmo.c:1732 +#: mmo.c:1837 #, c-format msgid "" "%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d " "for lop_fixrx\n" msgstr "" -#: mmo.c:1755 +#: mmo.c:1860 #, c-format msgid "%s: cannot allocate file name for file number %d, %d bytes\n" msgstr "" -#: mmo.c:1775 +#: mmo.c:1880 #, c-format msgid "" "%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n" msgstr "" -#: mmo.c:1788 +#: mmo.c:1893 #, c-format msgid "" "%s: invalid mmo file: file name for number %d was not specified before use\n" msgstr "" -#: mmo.c:1894 +#: mmo.c:1999 #, c-format msgid "" "%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n" msgstr "" -#: mmo.c:1930 +#: mmo.c:2035 #, c-format msgid "%s: invalid mmo file: lop_end not last item in file\n" msgstr "" -#: mmo.c:1943 +#: mmo.c:2048 #, c-format msgid "" "%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras " "to the preceding lop_stab (%ld)\n" msgstr "" -#: mmo.c:2608 +#: mmo.c:2698 #, c-format msgid "%s: invalid symbol table: duplicate symbol `%s'\n" msgstr "" -#: mmo.c:2896 +#: mmo.c:2949 #, c-format msgid "" "%s: Bad symbol definition: `Main' set to %s rather than the start address %" "s\n" msgstr "" -#: mmo.c:2930 +#: mmo.c:3039 #, c-format msgid "" "%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: " "%d. Only `Main' will be emitted.\n" msgstr "" -#: mmo.c:2975 +#: mmo.c:3084 #, c-format msgid "%s: internal error, symbol table changed size from %d to %d words\n" msgstr "" -#: mmo.c:3030 +#: mmo.c:3139 #, c-format msgid "%s: internal error, internal register section %s had contents\n" msgstr "" -#: mmo.c:3082 +#: mmo.c:3191 #, c-format msgid "%s: no initialized registers; section length 0\n" msgstr "" -#: mmo.c:3088 +#: mmo.c:3197 #, c-format msgid "%s: too many initialized registers; section length %ld\n" msgstr "" -#: mmo.c:3093 +#: mmo.c:3202 #, c-format msgid "" "%s: invalid start address for initialized registers of length %ld: 0x%lx%" "08lx\n" msgstr "" -#: oasys.c:1036 +#: oasys.c:1052 #, c-format msgid "%s: can not represent section `%s' in oasys" msgstr "" -#: osf-core.c:132 +#: osf-core.c:137 #, c-format msgid "Unhandled OSF/1 core file section type %d\n" msgstr "" -#: pe-mips.c:658 +#. XXX code yet to be written. +#: peicode.h:787 #, c-format -msgid "%s: `ld -r' not supported with PE MIPS objects\n" +msgid "%s: Unhandled import type; %x" msgstr "" -#. OK, at this point the following variables are set up: -#. src = VMA of the memory we're fixing up -#. mem = pointer to memory we're fixing up -#. val = VMA of what we need to refer to -#. -#: pe-mips.c:794 +#: peicode.h:792 #, c-format -msgid "%s: unimplemented %s\n" +msgid "%s: Unrecognised import type; %x" msgstr "" -#: pe-mips.c:820 +#: peicode.h:806 #, c-format -msgid "%s: jump too far away\n" +msgid "%s: Unrecognised import name type; %x" msgstr "" -#: pe-mips.c:847 +#: peicode.h:1164 #, c-format -msgid "%s: bad pair/reflo after refhi\n" +msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive" msgstr "" -#. XXX code yet to be written. -#: peicode.h:785 +#: peicode.h:1176 #, c-format -msgid "%s: Unhandled import type; %x" +msgid "" +"%s: Recognised but unhandled machine type (0x%x) in Import Library Format " +"archive" msgstr "" -#: peicode.h:790 +#: peicode.h:1193 #, c-format -msgid "%s: Unrecognised import type; %x" +msgid "%s: size field is zero in Import Library Format header" msgstr "" -#: peicode.h:804 +#: peicode.h:1224 #, c-format -msgid "%s: Unrecognised import name type; %x" +msgid "%s: string not null terminated in ILF object file." msgstr "" -#: peicode.h:1162 +#: pe-mips.c:659 #, c-format -msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive" +msgid "%s: `ld -r' not supported with PE MIPS objects\n" msgstr "" -#: peicode.h:1174 +#. OK, at this point the following variables are set up: +#. src = VMA of the memory we're fixing up +#. mem = pointer to memory we're fixing up +#. val = VMA of what we need to refer to +#. +#: pe-mips.c:795 #, c-format -msgid "" -"%s: Recognised but unhandled machine type (0x%x) in Import Library Format " -"archive" +msgid "%s: unimplemented %s\n" msgstr "" -#: peicode.h:1191 +#: pe-mips.c:821 #, c-format -msgid "%s: size field is zero in Import Library Format header" +msgid "%s: jump too far away\n" msgstr "" -#: peicode.h:1219 +#: pe-mips.c:848 #, c-format -msgid "%s: string not null terminated in ILF object file." +msgid "%s: bad pair/reflo after refhi\n" msgstr "" #: ppcboot.c:416 @@ -1961,16 +2350,21 @@ msgstr "" msgid "Partition[%d] length = 0x%.8lx (%ld)\n" msgstr "" -#: som.c:5402 +#: som.c:5422 msgid "som_sizeof_headers unimplemented" msgstr "" -#: srec.c:301 +#: srec.c:302 #, c-format msgid "%s:%d: Unexpected character `%s' in S-record file\n" msgstr "" -#: syms.c:998 +#: stabs.c:319 +#, c-format +msgid "%s(%s+0x%lx): Stabs entry has invalid string index." +msgstr "" + +#: syms.c:1042 msgid "Unsupported .stab relocation" msgstr "" @@ -1994,28 +2388,28 @@ msgstr "" msgid "unknown gsd/egsd subtype %d" msgstr "" -#: vms-hdr.c:406 +#: vms-hdr.c:408 msgid "Object module NOT error-free !\n" msgstr "" -#: vms-misc.c:543 +#: vms-misc.c:541 #, c-format msgid "Stack overflow (%d) in _bfd_vms_push" msgstr "" -#: vms-misc.c:561 +#: vms-misc.c:559 msgid "Stack underflow in _bfd_vms_pop" msgstr "" -#: vms-misc.c:919 +#: vms-misc.c:918 msgid "_bfd_vms_output_counted called with zero bytes" msgstr "" -#: vms-misc.c:924 +#: vms-misc.c:923 msgid "_bfd_vms_output_counted called with too many bytes" msgstr "" -#: vms-misc.c:1055 +#: vms-misc.c:1054 #, c-format msgid "Symbol %s replaced by %s\n" msgstr "" @@ -2025,26 +2419,26 @@ msgstr "" msgid "failed to enter %s" msgstr "" -#: vms-tir.c:81 +#: vms-tir.c:102 msgid "No Mem !" msgstr "" -#: vms-tir.c:362 +#: vms-tir.c:383 #, c-format msgid "bad section index in %s" msgstr "" -#: vms-tir.c:375 +#: vms-tir.c:396 #, c-format msgid "unsupported STA cmd %s" msgstr "" -#: vms-tir.c:380 vms-tir.c:1240 +#: vms-tir.c:401 vms-tir.c:1261 #, c-format msgid "reserved STA cmd %d" msgstr "" -#: vms-tir.c:491 vms-tir.c:514 +#: vms-tir.c:512 vms-tir.c:535 #, c-format msgid "%s: no symbol \"%s\"" msgstr "" @@ -2053,39 +2447,39 @@ msgstr "" #. rotate #. Redefine symbol to current location. #. Define a literal. -#: vms-tir.c:581 vms-tir.c:693 vms-tir.c:803 vms-tir.c:821 vms-tir.c:829 -#: vms-tir.c:838 vms-tir.c:1563 +#: vms-tir.c:602 vms-tir.c:714 vms-tir.c:824 vms-tir.c:842 vms-tir.c:850 +#: vms-tir.c:859 vms-tir.c:1584 #, c-format msgid "%s: not supported" msgstr "" -#: vms-tir.c:586 vms-tir.c:1418 +#: vms-tir.c:607 vms-tir.c:1439 #, c-format msgid "%s: not implemented" msgstr "" -#: vms-tir.c:590 vms-tir.c:1422 +#: vms-tir.c:611 vms-tir.c:1443 #, c-format msgid "reserved STO cmd %d" msgstr "" -#: vms-tir.c:708 vms-tir.c:1568 +#: vms-tir.c:729 vms-tir.c:1589 #, c-format msgid "reserved OPR cmd %d" msgstr "" -#: vms-tir.c:776 vms-tir.c:1632 +#: vms-tir.c:797 vms-tir.c:1653 #, c-format msgid "reserved CTL cmd %d" msgstr "" #. stack byte from image #. arg: none. -#: vms-tir.c:1148 +#: vms-tir.c:1169 msgid "stack-from-image not implemented" msgstr "" -#: vms-tir.c:1166 +#: vms-tir.c:1187 msgid "stack-entry-mask not fully implemented" msgstr "" @@ -2096,341 +2490,340 @@ msgstr "" #. #. compare argument descriptor with symbol argument (ARG$V_PASSMECH) #. and stack TRUE (args match) or FALSE (args dont match) value. -#: vms-tir.c:1180 +#: vms-tir.c:1201 msgid "PASSMECH not fully implemented" msgstr "" -#: vms-tir.c:1199 +#: vms-tir.c:1220 msgid "stack-local-symbol not fully implemented" msgstr "" -#: vms-tir.c:1212 +#: vms-tir.c:1233 msgid "stack-literal not fully implemented" msgstr "" -#: vms-tir.c:1233 +#: vms-tir.c:1254 msgid "stack-local-symbol-entry-point-mask not fully implemented" msgstr "" -#: vms-tir.c:1510 vms-tir.c:1522 vms-tir.c:1534 vms-tir.c:1546 vms-tir.c:1611 -#: vms-tir.c:1619 vms-tir.c:1627 +#: vms-tir.c:1531 vms-tir.c:1543 vms-tir.c:1555 vms-tir.c:1567 vms-tir.c:1632 +#: vms-tir.c:1640 vms-tir.c:1648 #, c-format msgid "%s: not fully implemented" msgstr "" -#: vms-tir.c:1684 +#: vms-tir.c:1705 #, c-format msgid "obj code %d not found" msgstr "" -#: vms-tir.c:2019 +#: vms-tir.c:2043 #, c-format msgid "SEC_RELOC with no relocs in section %s" msgstr "" -#: vms-tir.c:2307 +#: vms-tir.c:2331 #, c-format msgid "Unhandled relocation %s" msgstr "" -#: xcofflink.c:1241 +#: xcofflink.c:1244 #, c-format msgid "%s: `%s' has line numbers but no enclosing section" msgstr "" -#: xcofflink.c:1294 +#: xcofflink.c:1297 #, c-format msgid "%s: class %d symbol `%s' has no aux entries" msgstr "" -#: xcofflink.c:1317 +#: xcofflink.c:1320 #, c-format msgid "%s: symbol `%s' has unrecognized csect type %d" msgstr "" -#: xcofflink.c:1329 +#: xcofflink.c:1332 #, c-format msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d" msgstr "" -#: xcofflink.c:1365 +#: xcofflink.c:1368 #, c-format msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d" msgstr "" -#: xcofflink.c:1517 +#: xcofflink.c:1520 #, c-format msgid "%s: csect `%s' not in enclosing section" msgstr "" -#: xcofflink.c:1624 +#: xcofflink.c:1627 #, c-format msgid "%s: misplaced XTY_LD `%s'" msgstr "" -#: xcofflink.c:1948 +#: xcofflink.c:1958 #, c-format msgid "%s: reloc %s:%d not in csect" msgstr "" -#: xcofflink.c:2083 +#: xcofflink.c:2095 #, c-format msgid "%s: XCOFF shared object when not producing XCOFF output" msgstr "" -#: xcofflink.c:2104 +#: xcofflink.c:2116 #, c-format msgid "%s: dynamic object with no .loader section" msgstr "" -#: xcofflink.c:2749 +#: xcofflink.c:2761 #, c-format msgid "%s: no such symbol" msgstr "" -#: xcofflink.c:2890 +#: xcofflink.c:2894 msgid "error: undefined symbol __rtinit" msgstr "" -#: xcofflink.c:3458 +#: xcofflink.c:3455 #, c-format msgid "warning: attempt to export undefined symbol `%s'" msgstr "" -#: xcofflink.c:4452 +#: xcofflink.c:4448 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" msgstr "" -#: xcofflink.c:5292 xcofflink.c:5754 xcofflink.c:5816 xcofflink.c:6117 +#: xcofflink.c:5288 xcofflink.c:5755 xcofflink.c:5817 xcofflink.c:6119 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" msgstr "" -#: xcofflink.c:5314 xcofflink.c:6128 +#: xcofflink.c:5310 xcofflink.c:6130 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" msgstr "" -#: xcofflink.c:5329 +#: xcofflink.c:5325 #, c-format msgid "%s: loader reloc in read-only section %s" msgstr "" -#: elf32-ia64.c:2189 elf64-ia64.c:2189 +#: elf32-ia64.c:2371 elf64-ia64.c:2371 msgid "@pltoff reloc against local symbol" msgstr "" -#: elf32-ia64.c:3413 elf64-ia64.c:3413 +#: elf32-ia64.c:3749 elf64-ia64.c:3749 #, c-format msgid "%s: short data segment overflowed (0x%lx >= 0x400000)" msgstr "" -#: elf32-ia64.c:3424 elf64-ia64.c:3424 +#: elf32-ia64.c:3760 elf64-ia64.c:3760 #, c-format msgid "%s: __gp does not cover short data segment" msgstr "" -#: elf32-ia64.c:3728 elf64-ia64.c:3728 +#: elf32-ia64.c:4076 elf64-ia64.c:4076 #, c-format msgid "%s: linking non-pic code in a shared library" msgstr "" -#: elf32-ia64.c:3761 elf64-ia64.c:3761 +#: elf32-ia64.c:4109 elf64-ia64.c:4109 #, c-format msgid "%s: @gprel relocation against dynamic symbol %s" msgstr "" -#: elf32-ia64.c:3900 elf64-ia64.c:3900 +#: elf32-ia64.c:4285 elf64-ia64.c:4285 +#, c-format +msgid "%s: @internal branch to dynamic symbol %s" +msgstr "" + +#: elf32-ia64.c:4287 elf64-ia64.c:4287 #, c-format -msgid "%s: dynamic relocation against speculation fixup" +msgid "%s: speculation fixup to dynamic symbol %s" msgstr "" -#: elf32-ia64.c:3908 elf64-ia64.c:3908 +#: elf32-ia64.c:4289 elf64-ia64.c:4289 #, c-format -msgid "%s: speculation fixup against undefined weak symbol" +msgid "%s: @pcrel relocation against dynamic symbol %s" msgstr "" -#: elf32-ia64.c:4092 elf64-ia64.c:4092 +#: elf32-ia64.c:4501 elf64-ia64.c:4501 msgid "unsupported reloc" msgstr "" -#: elf32-ia64.c:4372 elf64-ia64.c:4372 +#: elf32-ia64.c:4780 elf64-ia64.c:4780 #, c-format msgid "%s: linking trap-on-NULL-dereference with non-trapping files" msgstr "" -#: elf32-ia64.c:4381 elf64-ia64.c:4381 +#: elf32-ia64.c:4789 elf64-ia64.c:4789 #, c-format msgid "%s: linking big-endian files with little-endian files" msgstr "" -#: elf32-ia64.c:4390 elf64-ia64.c:4390 +#: elf32-ia64.c:4798 elf64-ia64.c:4798 #, c-format msgid "%s: linking 64-bit files with 32-bit files" msgstr "" -#: elf32-ia64.c:4399 elf64-ia64.c:4399 +#: elf32-ia64.c:4807 elf64-ia64.c:4807 #, c-format msgid "%s: linking constant-gp files with non-constant-gp files" msgstr "" -#: elf32-ia64.c:4409 elf64-ia64.c:4409 +#: elf32-ia64.c:4817 elf64-ia64.c:4817 #, c-format msgid "%s: linking auto-pic files with non-auto-pic files" msgstr "" -#: peigen.c:962 pepigen.c:962 +#: peigen.c:985 pepigen.c:985 #, c-format msgid "%s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: peigen.c:979 pepigen.c:979 +#: peigen.c:1002 pepigen.c:1002 #, c-format msgid "%s: reloc overflow 1: 0x%lx > 0xffff" msgstr "" -#: peigen.c:993 pepigen.c:993 +#: peigen.c:1016 pepigen.c:1016 msgid "Export Directory [.edata (or where ever we found it)]" msgstr "" -#: peigen.c:994 pepigen.c:994 +#: peigen.c:1017 pepigen.c:1017 msgid "Import Directory [parts of .idata]" msgstr "" -#: peigen.c:995 pepigen.c:995 +#: peigen.c:1018 pepigen.c:1018 msgid "Resource Directory [.rsrc]" msgstr "" -#: peigen.c:996 pepigen.c:996 +#: peigen.c:1019 pepigen.c:1019 msgid "Exception Directory [.pdata]" msgstr "" -#: peigen.c:997 pepigen.c:997 +#: peigen.c:1020 pepigen.c:1020 msgid "Security Directory" msgstr "" -#: peigen.c:998 pepigen.c:998 +#: peigen.c:1021 pepigen.c:1021 msgid "Base Relocation Directory [.reloc]" msgstr "" -#: peigen.c:999 pepigen.c:999 +#: peigen.c:1022 pepigen.c:1022 msgid "Debug Directory" msgstr "" -#: peigen.c:1000 pepigen.c:1000 +#: peigen.c:1023 pepigen.c:1023 msgid "Description Directory" msgstr "" -#: peigen.c:1001 pepigen.c:1001 +#: peigen.c:1024 pepigen.c:1024 msgid "Special Directory" msgstr "" -#: peigen.c:1002 pepigen.c:1002 +#: peigen.c:1025 pepigen.c:1025 msgid "Thread Storage Directory [.tls]" msgstr "" -#: peigen.c:1003 pepigen.c:1003 +#: peigen.c:1026 pepigen.c:1026 msgid "Load Configuration Directory" msgstr "" -#: peigen.c:1004 pepigen.c:1004 +#: peigen.c:1027 pepigen.c:1027 msgid "Bound Import Directory" msgstr "" -#: peigen.c:1005 pepigen.c:1005 +#: peigen.c:1028 pepigen.c:1028 msgid "Import Address Table Directory" msgstr "" -#: peigen.c:1006 pepigen.c:1006 +#: peigen.c:1029 pepigen.c:1029 msgid "Delay Import Directory" msgstr "" -#: peigen.c:1007 peigen.c:1008 pepigen.c:1007 pepigen.c:1008 +#: peigen.c:1030 peigen.c:1031 pepigen.c:1030 pepigen.c:1031 msgid "Reserved" msgstr "" -#: peigen.c:1071 pepigen.c:1071 +#: peigen.c:1094 pepigen.c:1094 msgid "" "\n" "There is an import table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1076 pepigen.c:1076 +#: peigen.c:1099 pepigen.c:1099 #, c-format msgid "" "\n" "There is an import table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1113 pepigen.c:1113 +#: peigen.c:1136 pepigen.c:1136 #, c-format msgid "" "\n" "Function descriptor located at the start address: %04lx\n" msgstr "" -#: peigen.c:1116 pepigen.c:1116 +#: peigen.c:1139 pepigen.c:1139 #, c-format msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n" msgstr "" -#: peigen.c:1122 pepigen.c:1122 +#: peigen.c:1145 pepigen.c:1145 msgid "" "\n" "No reldata section! Function descriptor not decoded.\n" msgstr "" -#: peigen.c:1127 pepigen.c:1127 +#: peigen.c:1150 pepigen.c:1150 #, c-format msgid "" "\n" "The Import Tables (interpreted %s section contents)\n" msgstr "" -#: peigen.c:1130 pepigen.c:1130 +#: peigen.c:1153 pepigen.c:1153 msgid "" " vma: Hint Time Forward DLL First\n" " Table Stamp Chain Name Thunk\n" msgstr "" -#: peigen.c:1180 pepigen.c:1180 +#: peigen.c:1204 pepigen.c:1204 #, c-format msgid "" "\n" "\tDLL Name: %s\n" msgstr "" -#: peigen.c:1184 peigen.c:1247 pepigen.c:1184 pepigen.c:1247 -msgid "\tvma: Hint/Ord Member-Name\n" +#: peigen.c:1215 pepigen.c:1215 +msgid "\tvma: Hint/Ord Member-Name Bound-To\n" msgstr "" -#: peigen.c:1246 pepigen.c:1246 -msgid "\tThe Import Address Table (difference found)\n" -msgstr "" - -#: peigen.c:1253 pepigen.c:1253 -msgid "\t>>> Ran out of IAT members!\n" -msgstr "" - -#: peigen.c:1271 pepigen.c:1271 -msgid "\tThe Import Address Table is identical\n" +#: peigen.c:1240 pepigen.c:1240 +msgid "" +"\n" +"There is a first thunk, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1343 pepigen.c:1343 +#: peigen.c:1380 pepigen.c:1380 msgid "" "\n" "There is an export table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1348 pepigen.c:1348 +#: peigen.c:1385 pepigen.c:1385 #, c-format msgid "" "\n" "There is an export table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1379 pepigen.c:1379 +#: peigen.c:1416 pepigen.c:1416 #, c-format msgid "" "\n" @@ -2438,129 +2831,129 @@ msgid "" "\n" msgstr "" -#: peigen.c:1383 pepigen.c:1383 +#: peigen.c:1420 pepigen.c:1420 #, c-format msgid "Export Flags \t\t\t%lx\n" msgstr "" -#: peigen.c:1386 pepigen.c:1386 +#: peigen.c:1423 pepigen.c:1423 #, c-format msgid "Time/Date stamp \t\t%lx\n" msgstr "" -#: peigen.c:1389 pepigen.c:1389 +#: peigen.c:1426 pepigen.c:1426 #, c-format msgid "Major/Minor \t\t\t%d/%d\n" msgstr "" -#: peigen.c:1392 pepigen.c:1392 +#: peigen.c:1429 pepigen.c:1429 msgid "Name \t\t\t\t" msgstr "" -#: peigen.c:1398 pepigen.c:1398 +#: peigen.c:1435 pepigen.c:1435 #, c-format msgid "Ordinal Base \t\t\t%ld\n" msgstr "" -#: peigen.c:1401 pepigen.c:1401 +#: peigen.c:1438 pepigen.c:1438 msgid "Number in:\n" msgstr "" -#: peigen.c:1404 pepigen.c:1404 +#: peigen.c:1441 pepigen.c:1441 #, c-format msgid "\tExport Address Table \t\t%08lx\n" msgstr "" -#: peigen.c:1408 pepigen.c:1408 +#: peigen.c:1445 pepigen.c:1445 #, c-format msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" msgstr "" -#: peigen.c:1411 pepigen.c:1411 +#: peigen.c:1448 pepigen.c:1448 msgid "Table Addresses\n" msgstr "" -#: peigen.c:1414 pepigen.c:1414 +#: peigen.c:1451 pepigen.c:1451 msgid "\tExport Address Table \t\t" msgstr "" -#: peigen.c:1419 pepigen.c:1419 +#: peigen.c:1456 pepigen.c:1456 msgid "\tName Pointer Table \t\t" msgstr "" -#: peigen.c:1424 pepigen.c:1424 +#: peigen.c:1461 pepigen.c:1461 msgid "\tOrdinal Table \t\t\t" msgstr "" -#: peigen.c:1439 pepigen.c:1439 +#: peigen.c:1476 pepigen.c:1476 #, c-format msgid "" "\n" "Export Address Table -- Ordinal Base %ld\n" msgstr "" -#: peigen.c:1458 pepigen.c:1458 +#: peigen.c:1495 pepigen.c:1495 msgid "Forwarder RVA" msgstr "" -#: peigen.c:1469 pepigen.c:1469 +#: peigen.c:1506 pepigen.c:1506 msgid "Export RVA" msgstr "" -#: peigen.c:1476 pepigen.c:1476 +#: peigen.c:1513 pepigen.c:1513 msgid "" "\n" "[Ordinal/Name Pointer] Table\n" msgstr "" -#: peigen.c:1531 pepigen.c:1531 +#: peigen.c:1568 pepigen.c:1568 #, c-format msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" msgstr "" -#: peigen.c:1535 pepigen.c:1535 +#: peigen.c:1572 pepigen.c:1572 msgid "" "\n" "The Function Table (interpreted .pdata section contents)\n" msgstr "" -#: peigen.c:1538 pepigen.c:1538 +#: peigen.c:1575 pepigen.c:1575 msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" msgstr "" -#: peigen.c:1540 pepigen.c:1540 +#: peigen.c:1577 pepigen.c:1577 msgid "" " vma:\t\tBegin End EH EH PrologEnd Exception\n" " \t\tAddress Address Handler Data Address Mask\n" msgstr "" -#: peigen.c:1610 pepigen.c:1610 +#: peigen.c:1647 pepigen.c:1647 msgid " Register save millicode" msgstr "" -#: peigen.c:1613 pepigen.c:1613 +#: peigen.c:1650 pepigen.c:1650 msgid " Register restore millicode" msgstr "" -#: peigen.c:1616 pepigen.c:1616 +#: peigen.c:1653 pepigen.c:1653 msgid " Glue code sequence" msgstr "" -#: peigen.c:1668 pepigen.c:1668 +#: peigen.c:1705 pepigen.c:1705 msgid "" "\n" "\n" "PE File Base Relocations (interpreted .reloc section contents)\n" msgstr "" -#: peigen.c:1698 pepigen.c:1698 +#: peigen.c:1735 pepigen.c:1735 #, c-format msgid "" "\n" "Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" msgstr "" -#: peigen.c:1711 pepigen.c:1711 +#: peigen.c:1748 pepigen.c:1748 #, c-format msgid "\treloc %4d offset %4x [%4lx] %s" msgstr "" @@ -2568,7 +2961,7 @@ msgstr "" #. The MS dumpbin program reportedly ands with 0xff0f before #. printing the characteristics field. Not sure why. No reason to #. emulate it here. -#: peigen.c:1751 pepigen.c:1751 +#: peigen.c:1788 pepigen.c:1788 #, c-format msgid "" "\n" diff --git a/bfd/reloc.c b/bfd/reloc.c index 6aea881f385..09155b2757e 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -606,7 +606,7 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, return bfd_reloc_ok; } - /* If we are not producing relocateable output, return an error if + /* If we are not producing relocatable output, return an error if the symbol is not defined. An undefined weak symbol is considered to have a value of zero (SVR4 ABI, p. 4-27). */ if (bfd_is_und_section (symbol->section) @@ -675,7 +675,7 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, include the position of the location; for example, m88kbcs, or ELF. For those targets, pcrel_offset is TRUE. - If we are producing relocateable output, then we must ensure + If we are producing relocatable output, then we must ensure that this reloc will be correctly computed when the final relocation is done. If pcrel_offset is FALSE we want to wind up with the negative of the location within the section, @@ -684,7 +684,7 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, we do not want to adjust the existing addend at all. FIXME: This seems logical to me, but for the case of - producing relocateable output it is not what the code + producing relocatable output it is not what the code actually does. I don't want to change it, because it seems far too likely that something will break. */ @@ -739,7 +739,7 @@ Hmmm. The first obvious point is that bfd_perform_relocation should not have any tests that depend upon the flavour. It's seem like entirely the wrong place for such a thing. The second obvious point is that the current code ignores the reloc addend when producing -relocateable output for COFF. That's peculiar. In fact, I really +relocatable output for COFF. That's peculiar. In fact, I really have no idea what the point of the line you want to remove is. A typical COFF reloc subtracts the old value of the symbol and adds in @@ -754,9 +754,9 @@ different story (we can't change it without losing backward compatibility with old object files) (coff-i386 does subtract the old value, to be compatible with existing coff-i386 targets, like SCO). -So everything works fine when not producing relocateable output. When -we are producing relocateable output, logically we should do exactly -what we do when not producing relocateable output. Therefore, your +So everything works fine when not producing relocatable output. When +we are producing relocatable output, logically we should do exactly +what we do when not producing relocatable output. Therefore, your patch is correct. In fact, it should probably always just set reloc_entry->addend to 0 for all cases, since it is, in fact, going to add the value into the object file. This won't hurt the COFF code, @@ -764,7 +764,7 @@ which doesn't use the addend; I'm not sure what it will do to other formats (the thing to check for would be whether any formats both use the addend and set partial_inplace). -When I wanted to make coff-i386 produce relocateable output, I ran +When I wanted to make coff-i386 produce relocatable output, I ran into the problem that you are running into: I wanted to remove that line. Rather than risk it, I made the coff-i386 relocs use a special function; it's coff_i386_reloc in coff-i386.c. The function @@ -1067,7 +1067,7 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, include the position of the location; for example, m88kbcs, or ELF. For those targets, pcrel_offset is TRUE. - If we are producing relocateable output, then we must ensure + If we are producing relocatable output, then we must ensure that this reloc will be correctly computed when the final relocation is done. If pcrel_offset is FALSE we want to wind up with the negative of the location within the section, @@ -1076,7 +1076,7 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, we do not want to adjust the existing addend at all. FIXME: This seems logical to me, but for the case of - producing relocateable output it is not what the code + producing relocatable output it is not what the code actually does. I don't want to change it, because it seems far too likely that something will break. */ @@ -1128,7 +1128,7 @@ Hmmm. The first obvious point is that bfd_install_relocation should not have any tests that depend upon the flavour. It's seem like entirely the wrong place for such a thing. The second obvious point is that the current code ignores the reloc addend when producing -relocateable output for COFF. That's peculiar. In fact, I really +relocatable output for COFF. That's peculiar. In fact, I really have no idea what the point of the line you want to remove is. A typical COFF reloc subtracts the old value of the symbol and adds in @@ -1143,9 +1143,9 @@ different story (we can't change it without losing backward compatibility with old object files) (coff-i386 does subtract the old value, to be compatible with existing coff-i386 targets, like SCO). -So everything works fine when not producing relocateable output. When -we are producing relocateable output, logically we should do exactly -what we do when not producing relocateable output. Therefore, your +So everything works fine when not producing relocatable output. When +we are producing relocatable output, logically we should do exactly +what we do when not producing relocatable output. Therefore, your patch is correct. In fact, it should probably always just set reloc_entry->addend to 0 for all cases, since it is, in fact, going to add the value into the object file. This won't hurt the COFF code, @@ -1153,7 +1153,7 @@ which doesn't use the addend; I'm not sure what it will do to other formats (the thing to check for would be whether any formats both use the addend and set partial_inplace). -When I wanted to make coff-i386 produce relocateable output, I ran +When I wanted to make coff-i386 produce relocatable output, I ran into the problem that you are running into: I wanted to remove that line. Rather than risk it, I made the coff-i386 relocs use a special function; it's coff_i386_reloc in coff-i386.c. The function @@ -1331,7 +1331,7 @@ space consuming. For each target: function than to try to deal with it. This routine does a final relocation. Whether it is useful for a - relocateable link depends upon how the object format defines + relocatable link depends upon how the object format defines relocations. FIXME: This routine ignores any special_function in the HOWTO, @@ -4066,7 +4066,7 @@ SYNOPSIS struct bfd_link_info *link_info, struct bfd_link_order *link_order, bfd_byte *data, - bfd_boolean relocateable, + bfd_boolean relocatable, asymbol **symbols); DESCRIPTION @@ -4077,12 +4077,12 @@ DESCRIPTION bfd_byte * bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data, - relocateable, symbols) + relocatable, symbols) bfd *abfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - bfd_boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { /* Get enough memory to hold the stuff. */ @@ -4131,10 +4131,10 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data, *parent, (PTR) data, input_section, - relocateable ? abfd : (bfd *) NULL, + relocatable ? abfd : (bfd *) NULL, &error_message); - if (relocateable) + if (relocatable) { asection *os = input_section->output_section; diff --git a/bfd/reloc16.c b/bfd/reloc16.c index 39f36e7b11f..3a4c3d3c936 100644 --- a/bfd/reloc16.c +++ b/bfd/reloc16.c @@ -1,6 +1,6 @@ /* 8 and 16 bit COFF relocation functions, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, - 2002 Free Software Foundation, Inc. + 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -240,13 +240,13 @@ bfd_coff_reloc16_get_relocated_section_contents (in_abfd, link_info, link_order, data, - relocateable, + relocatable, symbols) bfd *in_abfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - bfd_boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { /* Get enough memory to hold the stuff. */ @@ -259,11 +259,11 @@ bfd_coff_reloc16_get_relocated_section_contents (in_abfd, if (reloc_size < 0) return NULL; - /* If producing relocateable output, don't bother to relax. */ - if (relocateable) + /* If producing relocatable output, don't bother to relax. */ + if (relocatable) return bfd_generic_get_relocated_section_contents (in_abfd, link_info, link_order, - data, relocateable, + data, relocatable, symbols); /* Read in the section. */ diff --git a/bfd/section.c b/bfd/section.c index 04f439e9b4e..44edb073caa 100644 --- a/bfd/section.c +++ b/bfd/section.c @@ -399,8 +399,10 @@ CODE_FRAGMENT . {* Nonzero if this section needs the relax finalize pass. *} . unsigned int need_finalize_relax:1; . +. {* Nonzero if this section has a gp reloc. *} +. unsigned int has_gp_reloc:1; +. . {* Usused bits. *} -. unsigned int flag12:1; . unsigned int flag13:1; . unsigned int flag14:1; . unsigned int flag15:1; @@ -491,6 +493,10 @@ CODE_FRAGMENT . {* Optional information about a COMDAT entry; NULL if not COMDAT. *} . struct bfd_comdat_info *comdat; . +. {* Points to the kept section if this section is a link-once section, +. and is discarded. *} +. struct sec *kept_section; +. . {* When a section is being output, this value changes as more . linenumbers are written out. *} . file_ptr moving_line_filepos; @@ -617,8 +623,11 @@ static const asymbol global_syms[] = /* linker_mark, linker_has_input, gc_mark, segment_mark, */ \ 0, 0, 1, 0, \ \ - /* sec_info_type, use_rela_p, has_tls_reloc, need_finalize_relax, flag12, */ \ - 0, 0, 0, 0, 0, \ + /* sec_info_type, use_rela_p, has_tls_reloc, */ \ + 0, 0, 0, \ + \ + /* need_finalize_relax, has_gp_reloc, */ \ + 0, 0, \ \ /* flag13, flag14, flag15, flag16, flag20, flag24, */ \ 0, 0, 0, 0, 0, 0, \ @@ -635,8 +644,8 @@ static const asymbol global_syms[] = /* line_filepos, userdata, contents, lineno, lineno_count, */ \ 0, NULL, NULL, NULL, 0, \ \ - /* entsize, comdat, moving_line_filepos, */ \ - 0, NULL, 0, \ + /* entsize, comdat, kept_section, moving_line_filepos, */ \ + 0, NULL, NULL, 0, \ \ /* target_index, used_by_bfd, constructor_chain, owner, */ \ 0, NULL, NULL, NULL, \ diff --git a/bfd/simple.c b/bfd/simple.c index a247f1153ba..0042e60a3f5 100644 --- a/bfd/simple.c +++ b/bfd/simple.c @@ -243,7 +243,7 @@ bfd_simple_get_relocated_section_contents (abfd, sec, outbuf, symbol_table) if (symbol_table == NULL) { - bfd_link_add_symbols (abfd, &link_info); + _bfd_generic_link_add_symbols (abfd, &link_info); storage_needed = bfd_get_symtab_upper_bound (abfd); symbol_table = (asymbol **) bfd_malloc (storage_needed); diff --git a/bfd/sparclinux.c b/bfd/sparclinux.c index 40e49c85e3e..0a936b1966b 100644 --- a/bfd/sparclinux.c +++ b/bfd/sparclinux.c @@ -354,7 +354,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, insert = FALSE; - if (! info->relocateable + if (! info->relocatable && linux_hash_table (info)->dynobj == NULL && strcmp (name, SHARABLE_CONFLICTS) == 0 && (flags & BSF_CONSTRUCTOR) != 0 diff --git a/bfd/sunos.c b/bfd/sunos.c index 4569e8065c6..fb8e17bcfd1 100644 --- a/bfd/sunos.c +++ b/bfd/sunos.c @@ -1,6 +1,6 @@ /* BFD backend for SunOS binaries. Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2001, - 2002 Free Software Foundation, Inc. + 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -884,7 +884,7 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) { if (! sunos_create_dynamic_sections (abfd, info, ((abfd->flags & DYNAMIC) != 0 - && !info->relocateable))) + && !info->relocatable))) return FALSE; } @@ -911,7 +911,7 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) /* The native linker seems to just ignore dynamic objects when -r is used. */ - if (info->relocateable) + if (info->relocatable) return TRUE; /* There's no hope of using a dynamic object which does not exactly @@ -1326,7 +1326,7 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, *sneedptr = NULL; *srulesptr = NULL; - if (info->relocateable) + if (info->relocatable) return TRUE; if (output_bfd->xvec != &MY(vec)) diff --git a/bfd/syms.c b/bfd/syms.c index d65a8689ca7..d0ffcc727e3 100644 --- a/bfd/syms.c +++ b/bfd/syms.c @@ -619,6 +619,9 @@ decode_section_type (section) } if (section->flags & SEC_DEBUGGING) return 'N'; + if ((section->flags & SEC_HAS_CONTENTS) && + (section->flags & SEC_READONLY)) + return 'n'; return '?'; } @@ -1002,7 +1005,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, (bfd_vma) 0, strsize)) return FALSE; - /* If this is a relocateable object file, we have to relocate + /* If this is a relocatable object file, we have to relocate the entries in .stab. This should always be simple 32 bit relocations against symbols defined in this object file, so this should be no big deal. */ diff --git a/bfd/versados.c b/bfd/versados.c index 1301c5880a4..ee0897a55ab 100644 --- a/bfd/versados.c +++ b/bfd/versados.c @@ -1,5 +1,5 @@ /* BFD back-end for VERSAdos-E objects. - Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002 + Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . @@ -23,11 +23,11 @@ /* SUBSECTION - VERSAdos-E relocateable object file format + VERSAdos-E relocatable object file format DESCRIPTION - This module supports reading of VERSAdos relocateable + This module supports reading of VERSAdos relocatable object files. A VERSAdos file looks like contains diff --git a/bfd/version.h b/bfd/version.h index f9de765b097..ae8bcf18aaf 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,3 +1,3 @@ -#define BFD_VERSION_DATE 20030523 +#define BFD_VERSION_DATE 20030627 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_string@ diff --git a/bfd/vms.c b/bfd/vms.c index c98e483e637..175dae0eba7 100644 --- a/bfd/vms.c +++ b/bfd/vms.c @@ -1,6 +1,6 @@ /* vms.c -- BFD back-end for VAX (openVMS/VAX) and EVAX (openVMS/Alpha) files. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Klaus K"ampf (kkaempf@rmi.de) @@ -132,7 +132,7 @@ static int vms_sizeof_headers static bfd_byte *vms_bfd_get_relocated_section_contents PARAMS ((bfd *abfd, struct bfd_link_info *link_info, struct bfd_link_order *link_order, bfd_byte *data, - bfd_boolean relocateable, asymbol **symbols)); + bfd_boolean relocatable, asymbol **symbols)); static bfd_boolean vms_bfd_relax_section PARAMS ((bfd *abfd, asection *section, struct bfd_link_info *link_info, bfd_boolean *again)); @@ -1691,17 +1691,17 @@ vms_sizeof_headers (abfd, reloc) static bfd_byte * vms_bfd_get_relocated_section_contents (abfd, link_info, link_order, data, - relocateable, symbols) + relocatable, symbols) bfd *abfd ATTRIBUTE_UNUSED; struct bfd_link_info *link_info ATTRIBUTE_UNUSED; struct bfd_link_order *link_order ATTRIBUTE_UNUSED; bfd_byte *data ATTRIBUTE_UNUSED; - bfd_boolean relocateable ATTRIBUTE_UNUSED; + bfd_boolean relocatable ATTRIBUTE_UNUSED; asymbol **symbols ATTRIBUTE_UNUSED; { #if VMS_DEBUG vms_debug (1, "vms_bfd_get_relocated_section_contents(%p, %p, %p, %p, %s, %p)\n", - abfd, link_info, link_order, data, (relocateable)?"True":"False", symbols); + abfd, link_info, link_order, data, (relocatable)?"True":"False", symbols); #endif return 0; } diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 0505c86c999..6f94029914b 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -1,5 +1,5 @@ /* POWER/PowerPC XCOFF linker support. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor , Cygnus Support. @@ -2932,7 +2932,7 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, } /* Garbage collect unused sections. */ - if (info->relocateable + if (info->relocatable || ! gc || hentry == NULL || (hentry->root.type != bfd_link_hash_defined @@ -5294,7 +5294,7 @@ xcoff_link_input_bfd (finfo, input_bfd) } else { - if (! finfo->info->relocateable + if (! finfo->info->relocatable && (h->flags & XCOFF_DEF_DYNAMIC) == 0 && (h->flags & XCOFF_IMPORT) == 0) { diff --git a/config.guess b/config.guess index 6bdac8d7b61..fa58459974e 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-05-09' +timestamp='2003-06-12' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -106,6 +106,7 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; @@ -282,6 +283,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; + Alpha*:OpenVMS:*:*) + echo alpha-hp-vms + exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -320,6 +324,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; @@ -767,8 +774,8 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; - x86:Interix*:3*) - echo i586-pc-interix3 + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks @@ -797,6 +804,9 @@ EOF arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; diff --git a/config.sub b/config.sub index fe4f1edf3c0..725707f709a 100755 --- a/config.sub +++ b/config.sub @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2003-05-09' +timestamp='2003-06-13' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -229,7 +229,7 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | clipper \ + | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ @@ -261,7 +261,7 @@ case $basic_machine in | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ - | tahoe | thumb | tic80 | tron \ + | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ @@ -771,18 +771,24 @@ case $basic_machine in pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; - pentiumii | pentium2) + pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; + pentium4) + basic_machine=i786-pc + ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumii-* | pentium2-*) + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; pn) basic_machine=pn-gould ;; @@ -922,10 +928,6 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - tic4x | c4x*) - basic_machine=tic4x-unknown - os=-coff - ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff @@ -1131,7 +1133,7 @@ case $os in | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix*) + | -powermax* | -dnix* | -nx6 | -nx7) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1277,6 +1279,9 @@ case $basic_machine in arm*-semi) os=-aout ;; + c4x-* | tic4x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 diff --git a/configure b/configure index e0d5acfb6b2..1d28c641877 100755 --- a/configure +++ b/configure @@ -12,10 +12,10 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help - --disable-serial-[{host,target,build}-]configure - Don't force sequential configuration of + --enable-serial-[{host,target,build}-]configure + Force sequential configuration of sub-packages for the host, target or build - machine, or of any sub-packages at all" + machine, or all sub-packages" ac_help="$ac_help --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer" @@ -801,7 +801,7 @@ libgcj="target-libffi \ # these libraries are built for the target environment, and are built after # the host libraries and the host tools (which may be a cross compiler) # -target_libs="target-libiberty \ +target_libraries="target-libiberty \ target-libgloss \ target-newlib \ target-libstdc++-v3 \ @@ -809,10 +809,10 @@ target_libs="target-libiberty \ ${libgcj} \ target-libobjc" -# these tools are built using the target libs, and are intended to run only -# in the target environment +# these tools are built using the target libraries, and are intended to +# run only in the target environment # -# note: any program that *uses* libraries that are in the "target_libs" +# note: any program that *uses* libraries that are in the "target_libraries" # list belongs in this list. those programs are also very likely # candidates for the "native_only" list which follows # @@ -827,7 +827,7 @@ target_tools="target-examples target-groff target-gperf target-rda" ## ${target_configdirs} is directories we build using the target tools. # configdirs=`echo ${host_libs} ${host_tools}` -target_configdirs=`echo ${target_libs} ${target_tools}` +target_configdirs=`echo ${target_libraries} ${target_tools}` # Only make build modules if build != host. # This should be done more generally, but at the moment it doesn't matter. @@ -1140,22 +1140,22 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib" ;; cris-*-*) - noconfigdirs="$noconfigdirs ${libgcj}" + noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" ;; d10v-*-*) noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" ;; d30v-*-*) - noconfigdirs="$noconfigdirs ${libgcj}" + noconfigdirs="$noconfigdirs ${libgcj} gdb" ;; fr30-*-elf*) - noconfigdirs="$noconfigdirs ${libgcj}" + noconfigdirs="$noconfigdirs ${libgcj} gdb" ;; frv-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; h8300*-*-*) - noconfigdirs="$noconfigdirs target-libgloss" + noconfigdirs="$noconfigdirs target-libgloss ${libgcj} target-libf2c" ;; h8500-*-*) noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c" @@ -1179,6 +1179,9 @@ case "${target}" in # build on HP-UX 10.20. noconfigdirs="$noconfigdirs ld shellutils ${libgcj}" ;; + i960-*-*) + noconfigdirs="$noconfigdirs ${libgcj} gdb" + ;; ia64*-*-elf*) # No gdb support yet. noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb" @@ -1256,6 +1259,9 @@ case "${target}" in i[3456789]86-*-beos*) noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" ;; + m32r-*-*) + noconfigdirs="$noconfigdirs ${libgcj} gdb" + ;; m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; @@ -1485,7 +1491,7 @@ do *) 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 @@ -1916,10 +1922,6 @@ fi # Default to using --with-stabs for certain targets. if test x${with_stabs} = x ; then case "${target}" in - mips*-*-irix6*o32) - with_stabs=yes; - extra_host_args="${extra_host_args} --with-stabs" - ;; mips*-*-irix6*) ;; mips*-*-* | alpha*-*-osf*) @@ -2341,7 +2343,8 @@ rm -f maybedep.tmp echo '# maybedep.tmp' > maybedep.tmp # Make-targets which may need maybe dependencies. -mts="configure all install check" +mts="configure all install check clean distclean dvi info install-info" +mts="${mts} installcheck mostlyclean maintainer-clean TAGS" # Loop over modules and make-targets. for module in ${build_modules} ; do @@ -2389,13 +2392,20 @@ if test "${enable_serial_configure+set}" = set; then fi +case ${enable_serial_configure} in + yes) + enable_serial_build_configure=yes + enable_serial_host_configure=yes + enable_serial_target_configure=yes + ;; +esac + # These force 'configure's to be done one at a time, to avoid problems # with contention over a shared config.cache. rm -f serdep.tmp echo '# serdep.tmp' > serdep.tmp olditem= -test "x${enable_serial_configure}" = xno || -test "x${enable_serial_build_configure}" = xno || +test "x${enable_serial_build_configure}" = xyes && for item in ${build_configdirs} ; do case ${olditem} in "") ;; @@ -2404,8 +2414,7 @@ for item in ${build_configdirs} ; do olditem=${item} done olditem= -test "x${enable_serial_configure}" = xno || -test "x${enable_serial_host_configure}" = xno || +test "x${enable_serial_host_configure}" = xyes && for item in ${configdirs} ; do case ${olditem} in "") ;; @@ -2414,8 +2423,7 @@ for item in ${configdirs} ; do olditem=${item} done olditem= -test "x${enable_serial_configure}" = xno || -test "x${enable_serial_target_configure}" = xno || +test "x${enable_serial_target_configure}" = xyes && for item in ${target_configdirs} ; do case ${olditem} in "") ;; @@ -2593,7 +2601,7 @@ fi GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)' # Don't use libstdc++-v3's flags to configure/build itself. -libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' +libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' if test "x${CXX_FOR_TARGET+set}" = xset; then @@ -2691,7 +2699,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:2695: checking for $ac_word" >&5 +echo "configure:2703: 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 @@ -2724,7 +2732,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:2728: checking for $ac_word" >&5 +echo "configure:2736: 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 @@ -2763,7 +2771,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:2767: checking for $ac_word" >&5 +echo "configure:2775: 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 @@ -2796,7 +2804,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:2800: checking for $ac_word" >&5 +echo "configure:2808: 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 @@ -2835,7 +2843,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:2839: checking for $ac_word" >&5 +echo "configure:2847: 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 @@ -2868,7 +2876,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:2872: checking for $ac_word" >&5 +echo "configure:2880: 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 @@ -2907,7 +2915,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:2911: checking for $ac_word" >&5 +echo "configure:2919: 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 @@ -2940,7 +2948,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:2944: checking for $ac_word" >&5 +echo "configure:2952: 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 @@ -2979,7 +2987,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:2983: checking for $ac_word" >&5 +echo "configure:2991: 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 @@ -3012,7 +3020,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:3016: checking for $ac_word" >&5 +echo "configure:3024: 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 @@ -3051,7 +3059,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:3055: checking for $ac_word" >&5 +echo "configure:3063: 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 @@ -3084,7 +3092,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:3088: checking for $ac_word" >&5 +echo "configure:3096: 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 @@ -3123,7 +3131,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:3127: checking for $ac_word" >&5 +echo "configure:3135: 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 @@ -3156,7 +3164,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:3160: checking for $ac_word" >&5 +echo "configure:3168: 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 @@ -3195,7 +3203,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:3199: checking for $ac_word" >&5 +echo "configure:3207: 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 @@ -3228,7 +3236,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:3232: checking for $ac_word" >&5 +echo "configure:3240: 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 @@ -3267,7 +3275,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:3271: checking for $ac_word" >&5 +echo "configure:3279: 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 @@ -3300,7 +3308,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:3304: checking for $ac_word" >&5 +echo "configure:3312: 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 @@ -3348,7 +3356,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:3352: checking for $ac_word" >&5 +echo "configure:3360: 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 @@ -3381,7 +3389,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:3385: checking for $ac_word" >&5 +echo "configure:3393: 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 @@ -3420,7 +3428,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:3424: checking for $ac_word" >&5 +echo "configure:3432: 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 @@ -3453,7 +3461,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:3457: checking for $ac_word" >&5 +echo "configure:3465: 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 @@ -3492,7 +3500,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:3496: checking for $ac_word" >&5 +echo "configure:3504: 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 @@ -3525,7 +3533,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:3529: checking for $ac_word" >&5 +echo "configure:3537: 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 @@ -3564,7 +3572,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:3568: checking for $ac_word" >&5 +echo "configure:3576: 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 @@ -3597,7 +3605,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:3601: checking for $ac_word" >&5 +echo "configure:3609: 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 @@ -3636,7 +3644,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:3640: checking for $ac_word" >&5 +echo "configure:3648: 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 @@ -3669,7 +3677,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:3673: checking for $ac_word" >&5 +echo "configure:3681: 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 @@ -3708,7 +3716,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:3712: checking for $ac_word" >&5 +echo "configure:3720: 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 @@ -3741,7 +3749,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:3745: checking for $ac_word" >&5 +echo "configure:3753: 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 @@ -3780,7 +3788,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:3784: checking for $ac_word" >&5 +echo "configure:3792: 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 @@ -3813,7 +3821,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:3817: checking for $ac_word" >&5 +echo "configure:3825: 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 @@ -3880,7 +3888,7 @@ 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:3884: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:3892: 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" diff --git a/configure.in b/configure.in index 87ab222891f..463db7a9cea 100644 --- a/configure.in +++ b/configure.in @@ -136,7 +136,7 @@ libgcj="target-libffi \ # these libraries are built for the target environment, and are built after # the host libraries and the host tools (which may be a cross compiler) # -target_libs="target-libiberty \ +target_libraries="target-libiberty \ target-libgloss \ target-newlib \ target-libstdc++-v3 \ @@ -144,10 +144,10 @@ target_libs="target-libiberty \ ${libgcj} \ target-libobjc" -# these tools are built using the target libs, and are intended to run only -# in the target environment +# these tools are built using the target libraries, and are intended to +# run only in the target environment # -# note: any program that *uses* libraries that are in the "target_libs" +# note: any program that *uses* libraries that are in the "target_libraries" # list belongs in this list. those programs are also very likely # candidates for the "native_only" list which follows # @@ -162,7 +162,7 @@ target_tools="target-examples target-groff target-gperf target-rda" ## ${target_configdirs} is directories we build using the target tools. # configdirs=`echo ${host_libs} ${host_tools}` -target_configdirs=`echo ${target_libs} ${target_tools}` +target_configdirs=`echo ${target_libraries} ${target_tools}` # Only make build modules if build != host. # This should be done more generally, but at the moment it doesn't matter. @@ -454,22 +454,22 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib" ;; cris-*-*) - noconfigdirs="$noconfigdirs ${libgcj}" + noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" ;; d10v-*-*) noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" ;; d30v-*-*) - noconfigdirs="$noconfigdirs ${libgcj}" + noconfigdirs="$noconfigdirs ${libgcj} gdb" ;; fr30-*-elf*) - noconfigdirs="$noconfigdirs ${libgcj}" + noconfigdirs="$noconfigdirs ${libgcj} gdb" ;; frv-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; h8300*-*-*) - noconfigdirs="$noconfigdirs target-libgloss" + noconfigdirs="$noconfigdirs target-libgloss ${libgcj} target-libf2c" ;; h8500-*-*) noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c" @@ -493,6 +493,9 @@ case "${target}" in # build on HP-UX 10.20. noconfigdirs="$noconfigdirs ld shellutils ${libgcj}" ;; + i960-*-*) + noconfigdirs="$noconfigdirs ${libgcj} gdb" + ;; ia64*-*-elf*) # No gdb support yet. noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb" @@ -570,6 +573,9 @@ case "${target}" in i[[3456789]]86-*-beos*) noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" ;; + m32r-*-*) + noconfigdirs="$noconfigdirs ${libgcj} gdb" + ;; m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; @@ -799,7 +805,7 @@ do *) 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 @@ -1230,10 +1236,6 @@ fi # Default to using --with-stabs for certain targets. if test x${with_stabs} = x ; then case "${target}" in - mips*-*-irix6*o32) - with_stabs=yes; - extra_host_args="${extra_host_args} --with-stabs" - ;; mips*-*-irix6*) ;; mips*-*-* | alpha*-*-osf*) @@ -1655,7 +1657,8 @@ rm -f maybedep.tmp echo '# maybedep.tmp' > maybedep.tmp # Make-targets which may need maybe dependencies. -mts="configure all install check" +mts="configure all install check clean distclean dvi info install-info" +mts="${mts} installcheck mostlyclean maintainer-clean TAGS" # Loop over modules and make-targets. for module in ${build_modules} ; do @@ -1697,18 +1700,25 @@ AC_SUBST_FILE(maybe_dependencies) # Create the serialization dependencies. This uses a temporary file. AC_ARG_ENABLE([serial-configure], -[ --disable-serial-[{host,target,build}-]configure - Don't force sequential configuration of +[ --enable-serial-[{host,target,build}-]configure + Force sequential configuration of sub-packages for the host, target or build - machine, or of any sub-packages at all]) + machine, or all sub-packages]) + +case ${enable_serial_configure} in + yes) + enable_serial_build_configure=yes + enable_serial_host_configure=yes + enable_serial_target_configure=yes + ;; +esac # These force 'configure's to be done one at a time, to avoid problems # with contention over a shared config.cache. rm -f serdep.tmp echo '# serdep.tmp' > serdep.tmp olditem= -test "x${enable_serial_configure}" = xno || -test "x${enable_serial_build_configure}" = xno || +test "x${enable_serial_build_configure}" = xyes && for item in ${build_configdirs} ; do case ${olditem} in "") ;; @@ -1717,8 +1727,7 @@ for item in ${build_configdirs} ; do olditem=${item} done olditem= -test "x${enable_serial_configure}" = xno || -test "x${enable_serial_host_configure}" = xno || +test "x${enable_serial_host_configure}" = xyes && for item in ${configdirs} ; do case ${olditem} in "") ;; @@ -1727,8 +1736,7 @@ for item in ${configdirs} ; do olditem=${item} done olditem= -test "x${enable_serial_configure}" = xno || -test "x${enable_serial_target_configure}" = xno || +test "x${enable_serial_target_configure}" = xyes && for item in ${target_configdirs} ; do case ${olditem} in "") ;; @@ -1906,7 +1914,7 @@ fi GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)' # Don't use libstdc++-v3's flags to configure/build itself. -libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' +libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' if test "x${CXX_FOR_TARGET+set}" = xset; then diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f25e81b00b3..a55b4546856 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,2877 @@ +2003-06-27 David Carlton + + * Merge with mainline; tag is carlton_dictionary-20030627-merge. + +2003-06-27 Elena Zannoni + + * symfile.c (syms_from_objfile): Move variables to inner block. + Move the checks for the non-mainline case a bit earlier to avoid + doing some useless computations. + +2003-06-27 Elena Zannoni + + * dwarfread.c (decode_modified_type): Gag new compiler warning. + +2003-06-26 Elena Zannoni + + * dwarf2read.c (dwarf2_locate_sections): Ignore empty .eh_frame + sections. + +2003-06-26 Michael Chastain + + * config/djgpp/fnchange.lst: Add gdb/testsuite/gdb.c++/pr-1210.cc, + gdb/testsuite/gdb.c++/pr-1210.exp. + +2003-06-26 Andrew Cagney + + * config/djgpp/fnchange.lst: Fix 8.3 problem with sim/ppc's + altivec_expression.h and altivec_registers.h. + +2003-06-26 Andrew Cagney + + * mips-tdep.c (gdb_print_insn_mips): Only explicitly set + info->mach when MIPS16. Patch suggested by Fred Fish. + +2003-06-26 Andrew Cagney + + * utils.c (internal_vproblem): Print the problem to a reason + buffer and then pass to query. Make the msg variable more local. + +2003-06-26 Andrew Cagney + + * gdbarch.sh (FRAME_ARGS_ADDRESS): Add predicate. Deprecate. + (FRAME_LOCALS_ADDRESS): Add predicate. Deprecate. + * gdbarch.h, gdbarch.c: Re-generate. + * frame-base.c (default_frame_args_address): Update. Use + default_frame_base_address when DEPRECATED_FRAME_ARGS_ADDRESS is + not available. + (default_frame_locals_address): Ditto for + DEPRECATED_FRAME_LOCALS_ADDRESS. + * vax-tdep.c (vax_sigtramp_saved_pc): Update. + (vax_frame_num_args): Update. + (vax_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init): Update. + * mcore-tdep.c (mcore_gdbarch_init): Update. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * symtab.h (address_class): Update comments. + * ns32k-tdep.c (ns32k_sigtramp_saved_pc): Update. + * config/sparc/tm-sparc.h (DEPRECATED_FRAME_ARGS_ADDRESS): Update. + (DEPRECATED_FRAME_LOCALS_ADDRESS): Update. + * config/pa/tm-hppa64.h (DEPRECATED_FRAME_ARGS_ADDRESS): Update. + (DEPRECATED_FRAME_LOCALS_ADDRESS): Update. + (DEPRECATED_FRAME_LOCALS_ADDRESS): Update. + * config/m68k/tm-delta68.h (DEPRECATED_FRAME_ARGS_ADDRESS): Update. + * alpha-mdebug-tdep.c: Update. + * ada-lang.c (add_symbols_from_enclosing_procs): Update. + +2003-06-26 Andreas Jaeger + + * x86-64-tdep.c (x86_64_push_arguments): Always set %rax to number + of SSE registers so that varargs functions work. Rework handling + of passing arguments on the stack. + (x86_64_store_return_value): Return double and float values in SSE + register. + +2003-06-24 Michael Chastain + + * PROBLEMS: Document pr gdb/1091 and pr gdb/1193, + the "constructor breakpoints ignored" bug. + +2003-06-25 David Carlton + + * MAINTAINERS: Update e-mail address. + +2003-06-24 Jim Blandy + + * ppc-linux-tdep.c: More "Linux" -> "GNU/Linux". + + * ppc-linux-tdep.c (ppc64_linux_convert_from_func_ptr_addr): New + function. + (ppc_linux_init_abi): Register it as the + CONVERT_FROM_FUNC_PTR_ADDR method under the PPC64 Linux ABI. + + * ppc-linux-tdep.c (ppc64_call_dummy_address): New function. + (ppc_linux_init_abi): Set it as the gdbarch's call_dummy_address + method. + + * ppc-linux-tdep.c (ppc64_desc_entry_point): New function. + (ppc64_standard_linkage_target): Use it. + +2003-06-23 Andrew Cagney + + * rs6000-tdep.c (rs6000_register_virtual_type): Add explict cases + for 0 "int0" and 4 "int32" sized registers. + * gdbtypes.c (builtin_type_int0): Define. + (build_gdbtypes): Initialize builtin_type_int0. + * gdbtypes.h (builtin_type_int0): Declare. + +2003-06-23 Stephane Carrez + + * m68hc11-tdep.c (m68hc11_gdbarch_init): Clear gdb_arch_char_signed + as characters are unsigned. + +2003-06-22 Daniel Jacobowitz + + PR gdb/1179 + * dwarfread.c (struct_type): Skip static fields without crashing. + +2003-06-22 Andrew Cagney + + GDB 6.0 branch created. + * README: Update. + * PROBLEMS: Update. Empty. + * NEWS: Update. + +2003-06-22 Daniel Jacobowitz + + * symfile.c (add_symbol_file_command): Use parse_and_eval_address. + Suggested by Nick Hibma . + +2003-06-22 Andrew Cagney + + * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Handle + GNU_ABI_TAG_FREEBSD and GNU_ABI_TAG_NETBSD. Suggested by Momchil + Velikov. + +2003-06-22 Daniel Jacobowitz + + * cli/cli-cmds.c (shell_escape): Silence warnings from old + compilers. + +2003-06-21 Daniel Jacobowitz + + * c-valprint.c (c_value_print): Add VALUE_OFFSET to the address + argument of val_print. + * cp-valprint.c (cp_print_value): Don't add the offset parameter + to the address argument of baseclass_offset or target_read_memory. + Do add it to the argument of cp_print_value_fields. + +2003-06-21 Andrew Cagney + + * mips-tdep.c: Include "reggroups.h" and "sim-regno.h". + (mips_register_name): Return names for NUM_REGS..2*NUM_REGS + instead of 0..NUM_REGS. + (mips_register_reggroup_p): New function. + (mips_pseudo_register_write): New function. + (mips_pseudo_register_read): New function. + (mips_register_raw_size): For NUM_REGS..2*NUM_REGS return the size + based on the register's type. + (read_next_frame_reg): Simplify. Assert that REGNO is a pseudo / + cooked. + (mips_get_saved_register): Simplify. Assert that REGNO is a + pseudo / cooked. + (mips_register_byte): New function. Use MIPS_REGISTER_BYTE. + (mips_register_type): Replace mips_register_virtual_type. Map + NUM_REGS..2*NUM_REGS onto 0..NUM_REGS. Use MIPS_REGISTER_TYPE + when available. + (read_next_frame_reg): Simplify, but handle SP_REGNUM. Assert + that the register is cooked / virtual. + (mips_frame_saved_pc): Fetch the cooked PC, and not the raw PC. + Only get the extra info when needed. + (set_reg_offset): Save the offset in NUM_REGS..2*NUM_REGS as well. + (mips32_heuristic_proc_desc): Fetch the cooked register. + (heuristic_proc_desc, mips_pop_frame, get_frame_pointer): Ditto. + (mips_init_extra_frame_info, get_frame_pointer): Ditto. + (mips_print_register): Use gdbarch_register_type, instead of + REGISTER_VIRTUAL_TYPE. + (print_gp_register_row): Use gdbarch_register_type, instead of + REGISTER_VIRTUAL_TYPE. Allow for a pseudo / cooked REGNUM. + (mips_print_registers_info): Assert REGNO is pseodo / cooked. + Print the pseudo / cooked registers. + (mips_print_registers_info): Assert REGNO is pseodo / cooked. + Print the pseudo / cooked registers. + (mips_xfer_register): Use regcache_cooked_read_part. Assert that + REG_NUM is pseudo / cooked. + (mips_o32_xfer_return_value): Xfer the pseudo / cooked register. + (mips_n32n64_xfer_return_value): Ditto. + (mips_stab_reg_to_regnum): Map onto NUM_REGS..2*NUM_REGS. + (mips_dwarf_dwarf2_ecoff_reg_to_regnum): Ditto. + (mips_register_sim_regno): New function. + (mips_gdbarch_init): Set deprecated_register_byte, + register_group_p, pseudo_register_write, pseudo_register_read, + register_sim_regno, and num_pseudo_regs. Set register_type, + instead of register_virtual_type. + * Makefile.in (mips-tdep.o): Update dependencies. + * config/mips/tm-mips64.h (MIPS_REGISTER_TYPE): Rename + REGISTER_VIRTUAL_TYPE. + * config/mips/tm-mips.h (MIPS_REGISTER_TYPE): Ditto. + * config/mips/tm-irix5.h (MIPS_REGISTER_TYPE): Ditto. + * config/mips/tm-mips.h (MIPS_REGISTER_BYTE): Rename REGISTER_BYTE. + * config/mips/tm-irix6.h (MIPS_REGISTER_BYTE): Ditto. + * config/mips/tm-irix5.h (MIPS_REGISTER_BYTE): Ditto. + +2003-06-21 Daniel Jacobowitz + + * Makefile.in (cli-cmds.o): Depend on $(gdb_vfork_h) + * cli/cli-cmds.c: Include "gdb_vfork.h". + (shell_escape): Use vfork. + +2003-06-21 Andrew Cagney + + * mips-tdep.c (mips_find_saved_regs): Rewrite mdebug code handling + 32 bit floating-point register saves. + + * frame.h (deprecated_unwind_get_saved_register): Delete. + * frame.c (deprecated_unwind_get_saved_register): Delete function. + * mips-tdep.c (mips_get_saved_register): Use frame_register_unwind + and deprecated_get_next_frame_hack instead of + deprecated_unwind_get_saved_register. + + * mips-tdep.c (mips_dump_tdep): Do not print + REGISTER_CONVERT_FROM_TYPE or REGISTER_CONVERT_TO_TYPE. + + * frame.c (get_frame_register): New function. + (frame_unwind_register_signed): New function. + (get_frame_register_signed): New function. + (frame_unwind_register_unsigned): New function. + (get_frame_register_unsigned): New function. + * frame.h: Add comments on naming schema. + (get_frame_register, frame_unwind_register_signed): Declare. + (get_frame_register_signed, get_frame_register_signed): Declare. + (frame_unwind_register_unsigned): Declare. + (get_frame_register_unsigned): Declare. + +2003-06-20 Theodore A. Roth + + * avr-tdep.c (avr_gdbarch_init): Don't call set_gdbarch_bfd_vma_bit. + +2003-06-20 Theodore A. Roth + + * avr-tdep.c (avr_read_pc): Use regcache instead of read_register. + (avr_read_sp): Ditto. + +2003-06-20 Daniel Jacobowitz + + * config/arm/linux.mt: Remove code protected by GDBSERVER define. + * config/arm/nm-linux.h: Likewise. + * config/arm/tm-linux.h: Likewise. + * config/ia64/nm-linux.h: Likewise. + * config/ia64/tm-ia64.h: Likewise. + * config/s390/tm-linux.h: Likewise. + * config/s390/tm-s390.h: Likewise. + * s390-nat.c: Likewise. + * s390-tdep.c: Likewise. + + * config/i386/linux.mt: Don't set GDBSERVER_DEPFILES. + * config/ia64/linux.mt: Likewise. + * config/m68k/linux.mh: Likewise. + * config/mips/linux.mt: Likewise. + * config/powerpc/linux.mh: Likewise. + * config/sh/linux.mt: Likewise. + +2003-06-19 Kris Warkentin + + * solib.c (solib_open): Change tests for whether to search + LD_LIBRARY_PATH and PATH to better deal with remotes. Update + comments. + +2003-06-19 Theodore A. Roth + + * avr-tdep.c (avr_frame_address): Delete function. + (avr_gdbarch_init): Don't call set_gdbarch_frame_args_address, + set_gdbarch_frame_args_address. + +2003-06-19 Andrew Cagney + + * config/mips/tm-mips.h (REGISTER_CONVERT_TO_TYPE): Delete. + (REGISTER_CONVERT_FROM_TYPE): Delete. + (mips_register_convert_to_type): Delete declaration. + (mips_register_convert_from_type): Delete declaration. + * linux-nat.h (struct target_ops): Declare opaque. s/Linux/Linux + kernel/. + +2003-06-19 Michael Snyder + + * linux-nat.h: New file. + * linux-nat.c: Include linux-nat.h. + * lin-lwp.c: Include linux-nat.h. + Move struct lwp_info def to linux-nat.h. + * linux-proc.c: Include linux-nat.h. + (linux_make_note_section): Iterate over lwps instead of threads. + (linux_do_thread_registers): Use lwp instead of merged pid. + * config/nm-linux.h: Move miscelaneous def'ns to linux-nat.h. + * Makefile.in (lin-lwp.o, linux-proc.o, linux-nat.o): + Add dependency on linux_nat_h. + +2003-06-19 Theodore A. Roth + + * avr-tdep.c (avr_extract_return_value): Delete debugging fprintf. + +2003-06-19 Daniel Jacobowitz + + * varobj.c (get_type, get_target_type): Use check_typedef. + +2003-06-19 Daniel Jacobowitz + + * breakpoint.c (insert_catchpoint): Call internal_error. + +2003-06-19 Theodore A. Roth + + * avr-tdep.c (avr_push_dummy_code): Delete function. + (avr_gdbarch_init): Don't call set_gdbarch_push_dummy_code. + +2003-06-19 Daniel Jacobowitz + + * arch-utils.c (default_prepare_to_proceed): Remove. + (generic_prepare_to_proceed): Remove. + * arch-utils.h (default_prepare_to_proceed): Remove prototype. + (generic_prepare_to_proceed): Remove prototype. + * gdbarch.sh (PREPARE_TO_PROCEED): Remove. + * gdbarch.c: Regenerate. + * gdbarch.h: Regenerate. + * hppa-tdep.c (hppa_prepare_to_proceed): Remove dangling prototype. + * hppah-nat.c (hppa_switched_threads): Remove. + * infrun.c (prepare_to_proceed): New static function, copied from + generic_prepare_to_proceed. Remove select_it argument. + (proceed): Call prepare_to_proceed. + * infttrace.c (old_gdb_pid, reported_pid, reported_bpt): Remove + variables. + (ptrace_wait): Don't set the removed variables. + (hppa_switched_threads): Remove. + * lin-lwp.c (lin_lwp_prepare_to_proceed): Remove. + * config/nm-linux.h (PREPARE_TO_PROCEED): Don't define. + (lin_lwp_prepare_to_proceed): Remove prototype. + * config/i386/nm-x86-64linux.h (PREPARE_TO_PROCEED): Don't undefine. + * config/pa/nm-hppah.h (PREPARE_TO_PROCEED): Don't define. + +2003-06-18 Theodore A. Roth + + * avr-tdep.c: Include frame.h, frame-unwind.h, frame-base.h, and + trad-frame.h. + (AVR_MAX_PROLOGUE_SIZE): Increase from 56 to 64. + (AVR_ARG1_REGNUM, AVR_ARGN_REGNUM): Define. + (AVR_RET1_REGNUM, AVR_RETN_REGNUM): Define. + (AVR_PROLOGUE_*): Enumerate prologue types. + (struct frame_extra_info): Remove. + (struct avr_unwind_cache): Define. + (avr_write_sp): Delete function. + (avr_read_fp): Ditto. + (avr_init_extra_frame_info): Ditto. + (avr_pop_frame): Ditto. + (avr_frame_saved_pc): Ditto. + (avr_saved_pc_after_call): Ditto. + (avr_push_return_address): Ditto. + (avr_frame_chain): Ditto. + (avr_store_struct_return): Ditto. + (avr_push_arguments): Ditto. + (avr_scan_prologue): Update comments. Changed to set up the info for + cache unwinding. Now returns end of prologue PC. + (avr_skip_prologue): Better handling of functions lacking a prologue + by using avr_scan_prologue. + (avr_scan_arg_moves): New function. + (avr_saved_regs_unwinder): Ditto. + (avr_frame_unwind_cache): Ditto. + (avr_unwind_pc): Ditto. + (avr_frame_this_id): Ditto. + (avr_frame_prev_register): Ditto. + (avr_frame_p): Ditto. + (avr_frame_base_address ): Ditto. + (avr_unwind_dummy_id): Ditto. + (avr_push_dummy_code): Ditto. + (push_stack_item): Ditto. + (pop_stack_item): Ditto. + (avr_push_dummy_call): Ditto. + (struct stack_item): Define. + (avr_frame_unwind): Declare structure. + (avr_frame_base): Ditto. + (avr_gdbarch_init): Remove calls to + set_gdbarch_deprecated_init_frame_pc, + set_gdbarch_deprecated_target_read_fp, + set_gdbarch_deprecated_dummy_write_sp, + set_gdbarch_deprecated_fp_regnum, + set_gdbarch_deprecated_push_arguments, + set_gdbarch_deprecated_push_return_address, + set_gdbarch_deprecated_pop_frame, + set_gdbarch_deprecated_store_struct_return, + set_gdbarch_deprecated_frame_init_saved_regs, + set_gdbarch_deprecated_init_extra_frame_info, + set_gdbarch_deprecated_frame_chain, + set_gdbarch_deprecated_frame_saved_pc, + set_gdbarch_deprecated_saved_pc_after_call. + Add calls to set_gdbarch_push_dummy_call, + set_gdbarch_push_dummy_code, + frame_unwind_append_predicate, + frame_base_set_default, + set_gdbarch_unwind_dummy_id, + set_gdbarch_unwind_pc. + Wrap a long line. + +2003-06-18 Corinna Vinschen + + * h8300-tdep.c (h8300s_register_name): Enable MACH and MACL + registers for H8/300S. + (h8300_print_registers_info): Ditto. + (h8300_gdbarch_init): Accommodate register count for H8/300S. + +2003-06-18 Daniel Jacobowitz + + * config/nm-linux.h (linux_record_stopped_pid): New prototype. + * lin-lwp.c (child_wait): Call linux_record_stopped_pid. + (lin_lwp_wait): Likewise. Update comments. + * linux-nat.c (struct simple_pid_list, add_to_pid_list) + (pull_pid_from_list, linux_record_stopped_pid): New. + +2003-06-17 Stephane Carrez + + * ada-lang.c (scan_discrim_bound): Name first argument. + (ada_add_block_symbols): Remove BLOCK_SYM to use local variable + declared by ALL_BLOCK_SYMBOLS. + +2003-06-17 Stephane Carrez + + * ada-tasks.c (find_function_in_inferior): Don't declare it. + ("regcache.h"): Include it. + * ada-lex.l (block_lookup): Replace VAR_NAMESPACE with VAR_DOMAIN. + +2003-06-17 Daniel Jacobowitz + + * NEWS: Mention gdbserver detach change and "disconnect" command. + * infcmd.c (disconnect_command): New function. + (_initialize_infcmd): Add ``disconnect'' command. + * remote.c (remote_async_detach): Delete. + (remote_detach): Merge remote_async_detach. + (remote_disconnect): New. + (init_remote_ops): Set to_disconnect. + (init_remote_cisco_ops): Likewise. + (init_remote_async_ops): Likewise. Use remote_detach. + * target.c (cleanup_target): Default to_disconnect. + (update_current_target): Inherit to_disconnect. + (target_disconnect, debug_to_disconnect): New functions. + (setup_target_debug): Set to_disconnect. + * target.h (struct target_ops): Add to_disconnect. + (target_disconnect): Add prototype. + +2003-06-17 Daniel Jacobowitz + + * breakpoint.c (insert_catchpoint): New function. + (insert_breakpoints): Use catch_exceptions to call + insert_catchpoint. Disable catchpoints if they fail to insert. + +2003-06-17 Daniel Jacobowitz + + * symfile.c (reread_symbols): Clear sym_private. + +2003-06-17 Andrew Cagney + + * trad-frame.h (struct frame_info): Add opaque declaration. + * remote-fileio.h (struct cmd_list_element): Add opaque + declaration. + * h8300-tdep.c (h8300s_register_name): Avoid C++ // style + comments. + +2003-06-17 Daniel Jacobowitz + + * remote.c (remote_prepare_to_store): Replace call to + deprecated_read_register_bytes with multiple regcache_raw_read + calls. + +2003-06-17 Kris Warkentin + + * nto-tdep.c (nto_map_arch_to_cputype): Recognize "powerpc". + (nto_find_and_open_solib): Likewise. + (nto_init_solib_absolute_prefix): Likewise. + (_initialize_nto_tdep): Fix indentation. + +2003-06-17 Kris Warkentin + + * i386-nto-tdep.c (i386nto_sigcontext_addr): Make sp a CORE_ADDR. + +2003-06-17 Kris Warkentin + + * i386-nto-tdep.c (i386nto_sigcontext_addr): Declare sp before using. + +2003-06-17 Jim Blandy + + * ppc-linux-tdep.c: "Linux" -> "GNU/Linux" + +2003-06-16 Theodore A. Roth + + * avr-tdep.c (avr_extract_return_value): New function. + (avr_gdbarch_init): Set extract_return_value method. + +2003-06-16 Andrew Cagney + + * frame.h (deprecated_get_next_frame_hack): Declare. + * frame.c (legacy_saved_regs_prev_register): Only require + DEPRECATED_FRAME_INIT_SAVED_REGS when it is needed. Assert that + there are always saved regs. + (deprecated_generic_get_saved_register): Do not require + DEPRECATED_FRAME_INIT_SAVED_REGS. + (legacy_get_prev_frame): Do not require DEPRECATED_FRAME_CHAIN, + use frame ID unwind instead. + (deprecated_get_next_frame_hack): New function. + +2003-06-16 Corinna Vinschen + + * h8300-tdep.c (h8300_push_arguments): Remove. Substitute by... + (h8300_push_dummy_call): ...this function. Some minor optimization. + (h8300_push_return_address): Remove. + (h8300_gdbarch_init): Remove calls to + set_gdbarch_deprecated_dummy_write_sp, + set_gdbarch_deprecated_push_arguments and + set_gdbarch_deprecated_push_return_address. + Add call to set_gdbarch_push_dummy_call. + +2003-06-16 Corinna Vinschen + + * h8300-tdep.c (E_PSEUDO_CCR_REGNUM): New define. + (E_PSEUDO_EXR_REGNUM): Ditto. + (h8300_is_argument_spill): Check for instructions moving argument + registers into safe registers. + (h8300_skip_prologue): Check for stm instruction to push registers + used for register variables onto stack. + (gdb_print_insn_h8300): Remove. + (h8300_examine_prologue): Add a comment. + (h8300_register_name): Take pseudo registers into account. + (h8300s_register_name): Ditto. + (h8300sx_register_name): Ditto. + (h8300_print_register): Ditto. + (h8300_print_registers_info): Define "nice" printing order. + (h8300_saved_pc_after_call): Take pseudo registers into account. + (h8300_register_type): Ditto. Return type used for remote connection + when requesting real CCR or EXR register, return actual type when + requesting pseudo CCR or EXR. + (h8300_pseudo_register_read): New function. + (h8300_pseudo_register_write): Ditto. + (h8300_dbg_reg_to_regnum): Ditto. + (h8300s_dbg_reg_to_regnum): Ditto. + (h8300_gdbarch_init): Call set_gdbarch_num_pseudo_regs, + set_gdbarch_ecoff_reg_to_regnum, set_gdbarch_dwarf_reg_to_regnum, + set_gdbarch_dwarf2_reg_to_regnum, set_gdbarch_stab_reg_to_regnum and + set_gdbarch_print_insn architecture dependent. + Call set_gdbarch_pseudo_register_read and + set_gdbarch_pseudo_register_write. + (_initialize_h8300_tdep): Remove assignment to deprecated_tm_print_insn. + +2003-06-16 Andrew Cagney + + * gdbarch.sh (SAVE_DUMMY_FRAME_TOS): Deprecate. + * gdbarch.h, gdbarch.c: Re-generate. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * mcore-tdep.c (mcore_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * infcall.c (call_function_by_hand): Update. + * ia64-tdep.c (ia64_push_arguments): Update comment. + * frame.c (legacy_get_prev_frame): Do not assume + SAVE_DUMMY_FRAME_TOS_P. + * dummy-frame.c (find_dummy_frame): Update comment. + +2003-06-16 Andrew Cagney + + * regcache.c (do_cooked_read): Do not use register_valid_p. + +2003-06-15 Theodore A. Roth + + * avr-tdep.c (avr_register_type): Remove a blank line. + (avr_scan_prologue): Correct some comments. + +2003-06-15 Theodore A. Roth + + * avr-tdep.c (avr_scan_prologue): Update comment describing the various + prologue types. + Properly scan prologues generated by gcc with the -mcall-prologues + option. + Add code to scan -mcall-prologues for mega devices. + +2003-06-15 Theodore A. Roth + + * avr-tdep.c (avr_register_byte): Delete function. + (avr_register_raw_size): Delete function. + (avr_register_virtual_size): Delete function. + (avr_register_virtual_type): Delete function. + (avr_register_type): New function. + (avr_address_to_pointer): Remove unused code. + (avr_read_fp): Need to read FP as two separate bytes due to change to + avr_register_type() usage. + (avr_gdbarch_init): Don't set deprecated_register_size. + Don't set deprecated_register_bytes. + Don't set deprecated_register_byte. + Don't set deprecated_register_raw_size. + Don't set deprecated_max_register_raw_size. + Don't set deprecated_register_virtual_size. + Don't set deprecated_max_register_virtual_size. + Don't set deprecated_register_virtual_type. + Set register_type method. + +2003-06-15 Daniel Jacobowitz + + * Makefile.in (linux-nat.o): Add rule. + * linux-nat.c: New file. + * config/nm-linux.h (CHILD_INSERT_FORK_CATCHPOINT): Define. + (CHILD_INSERT_VFORK_CATCHPOINT): Define. + (CHILD_INSERT_EXEC_CATCHPOINT): Define. + * config/alpha/alpha-linux.mh (NATDEPFILES): Add linux-nat.o. + * config/arm/linux.mh (NATDEPFILES): Likewise. + * config/i386/linux.mh (NATDEPFILES): Likewise. + * config/i386/x86-64linux.mh (NATDEPFILES): Likewise. + * config/ia64/linux.mh (NATDEPFILES): Likewise. + * config/m68k/linux.mh (NATDEPFILES): Likewise. + * config/mips/linux.mh (NATDEPFILES): Likewise. + * config/powerpc/linux.mh (NATDEPFILES): Likewise. + * config/s390/s390.mh (NATDEPFILES): Likewise. + * config/sparc/linux.mh (NATDEPFILES): Likewise. + +2003-06-15 Mark Kettenis + + * i387-tdep.c: Reorder includes, fix some whitespace issues and + replace out-of-date comment. + +2003-06-15 Andrew Cagney + + * rdi-share/host.h (Fail): Change to a varargs function. + * remote-rdi.c (Fail): Update. + +2003-06-15 Mark Kettenis + + * i386-tdep.c (i386_next_regnum): Fix bounds checking. + (i386_convert_register_p, i386_register_to_value, + i386_register_from_value): Handle types longer than 8 bytes. + +2003-06-15 Mark Kettenis + + * i386-tdep.c (i386_register_to_value, i386_value_to_register): + Move floating-point code to new function in i387-tdep.c. + * i387-tdep.c (i387_register_to_value, i387_value_to_register): + New functions containing code moved here from i386-tdep.c. + * i387-tdep.h: Add opaque declaration for `struct type'. + (i387_register_to_value, i387_value_to_register): New prototypes. + * x86-64-tdep.c (x86_64_convert_register_p): New function. + (x86_64_init_abi): Set convert_register_p, register_to_value and + value_to_register here. + +2003-06-14 Andrew Cagney + + * mips-tdep.c (mips_register_to_value): Make static. + (mips_value_to_register): Make static. + * i386-tdep.c (i386_fetch_pointer_argument): Make static. + * ia64-tdep.c (ia64_register_raw_size): Make static. + (ia64_register_virtual_size): Make static. + (ia64_register_byte): Make static. + * i387-tdep.c: Include "i387-tdep.h". + (print_387_control_word): Delete function. + (print_387_status_word): Delete function. + (print_387_status_bits): Delete function. + (print_387_control_bits): Delete function. + * Makefile.in (i387-tdep.o): Update dependencies. + * rdi-share/host.h (Fail): Declare. + * remote-rdi.c (Fail): Update to match declaration. + +2003-06-14 Andrew Cagney + + * config/mips/embedl64.mt (TDEPFILES): Delete "remote-array.o". + * config/mips/embedl.mt (TDEPFILES): Delete "remote-array.o". + * config/mips/embed64.mt (TDEPFILES): Delete "remote-array.o". + * config/djgpp/fnchange.lst: Delete "remote-array.c". + * README: Delete reference to remote-array. + * Makefile.in (ALLDEPFILES): Remove "remote-array.c". + (remote-array.o): Delete target. + * config/mips/embed.mt (TDEPFILES): Delete "remote-array.o". + * remote-array.c: Delete file. + +2003-06-14 Andrew Cagney + Mark Kettenis + + * gdbarch.sh (CONVERT_REGISTER_P): Add "type" parameter. + (REGISTER_TO_VALUE, VALUE_TO_REGISTER): Replace raw buffer + parameter with "frame". + * gdbarch.h, gdbarch.c: Re-generate. + * frame.h (put_frame_register): Declare. + * frame.c (put_frame_register): New function. + * arch-utils.c (legacy_convert_register_p): Add "type" parameter. + (legacy_register_to_value): Rewrite, use "frame" to get the + register value. + (legacy_value_to_register): Rewrite, use "frame" to find the + register's location before storing. + * arch-utils.h (legacy_convert_register_p): Update. + (legacy_register_to_value, legacy_value_to_register): Update. + * findvar.c (value_from_register): Rewrite, eliminate use of + REGISTER_CONVERT_TO_TYPE, pass "type" to CONVERT_REGISTER_P, pass + "frame" to REGISTER_TO_VALUE. + * valops.c (value_assign): Move the CONVERT_REGISTER code to the + lval_reg_frame_relative + lval_register branch of the switch. Do + not use REGISTER_CONVERT_FROM_TYPE. Use put_frame_register. + * i386-tdep.c (I386_EBX_REGNUM, I386_ECX_REGNUM, I386_ESI_REGNUM, + I386_EDI_REGNUM): New defines. + (i386_next_regnum, i386_convert_register_p, + i386_register_to_value, i386_value_to_register): New functions. + (i386_register_convertible, i386_register_convert_to_virtual, + i386_convert_to_raw): Remove functions. + (i386_gdbarch_init): Set convert_register_p, register_to_value and + value_to_register instead of register_convertible, + register_convert_to_virtual and register_convert_to_raw. + * mips-tdep.c (mips_convert_register_p): New function. + (mips_value_to_register): Replace mips_register_convert_from_type. + (mips_register_to_value): Replace mips_register_convert_to_type. + (mips_gdbarch_init): Set conver_register_p, value_to_register and + register_to_value. + * alpha-tdep.c (alpha_convert_register_p): Update. + (alpha_value_to_register): Update, store the register. + (alpha_register_to_value): Update, fetch the register. + +2003-06-14 Theodore A. Roth + + * avr-tdep.c (avr_remote_translate_xfer_address): Delete function. + (avr_gdbarch_init): Remove avr_call_dummy_words variable. + Don't set deprecated_call_dummy_words. + Remove commented out set_gdbarch_believe_pcc_promotion() call. + Don't set remote_translate_xfer_address. + (avr_io_reg_read_command): Remove commented out debug printf. + Wrap a long line. + +2003-06-14 Theodore A. Roth + + * avr-tdep.c (avr_scan_prologue): Fix to avoid a buffer over run which + causes gdb to seg fault. + +2003-06-14 Daniel Jacobowitz + + * sparc-nat.c (fetch_inferior_registers): Correct + a reference to "registers". + +2003-06-14 Jeroen Dekkers + + * Makefile.in (exc_request_U_h): Define + (exc_request_S_h): Likewise. + (msg_reply_S_h): Likewise. + (msg_U_h): Likewise. + (notify_S_h): Likewise. + (process_reply_S_h): Likewise. + (gnu-nat.o): Depend on gdb_obstack_h + * gnu-nat.c: Include "gdb_obstack.h". + +2003-06-13 Andrew Cagney + + * gdbarch.sh: Document what PUSH_DUMMY_CALL replaces. + * gdbarch.h, gdbarch.c: Re-generate. + +2003-06-13 Andrew Cagney + + * gdbarch.sh: Document what UNWIND_DUMMY_ID replaces. Clarify + when deprecated REGISTER macros can be deleted. + * gdbarch.h, gdbarch.c: Re-generate. + +2003-06-13 Jim Blandy + + * solib-svr4.c (solib_break_names): Recognize the 64-bit PowerPC + Linux entry point symbols for _dl_debug_state, too. + +2003-06-13 Andrew Cagney + + * infcall.c (call_function_by_hand): When UNWIND_DUMMY_ID is + available, do not use the FP register, and always save the TOS. + * dummy-frame.c (dummy_frame_this_id): Do not assert + SAVE_DUMMY_FRAME_TOS. + * i386-tdep.c (i386_save_dummy_frame_tos): Delete function. + (i386_gdbarch_init): Do not set save_dummy_frame_tos. + (i386_push_dummy_call): Add 8 to the returned SP. + * frame.c (legacy_frame_p): Do not require SAVE_DUMMY_FRAME_TOS. + * d10v-tdep.c (d10v_unwind_dummy_id): Use d10v_unwind_sp. + (d10v_gdbarch_init): Do not set save_dummy_frame_tos. + * x86-64-tdep.c (x86_64_save_dummy_frame_tos): Delete function. + (x86_64_push_dummy_call): Return "sp + 16". + (x86_64_init_abi): Do not set save_dummy_frame_tos. + * alpha-tdep.c (alpha_gdbarch_init): Do not set + save_dummy_frame_tos. + +2003-06-13 Jim Blandy + + * frv-tdep.c (frv_use_struct_convention): Delete static + declaration for function deleted in my change of 2003-06-12. + +2003-06-13 Theodore A. Roth + + * avr-tdep.c (avr_address_to_pointer): Shift code addrs right 1 bit. + (avr_pointer_to_address): Shift code addrs left 1 bit. + (avr_convert_from_func_ptr_addr): Delete function since operation is + better handled by avr_address_to_pointer and avr_pointer_to_address. + (avr_gdbarch_init): Don't set convert_from_func_ptr_add method. + +2003-06-13 Mark Kettenis + + From Kelley Cook : + * configure.host: Accept i[34567]86 variants. + * configure.tgt: Likewise. + * nlm/configure.in: Likewise. + * nlm/configure: Regenerated. + +2003-06-13 Richard Earnshaw + + * arm-tdep.c (solib-svr4.h): Dont' include it. + (arm_linux_svr4_fetch_link_map_offsets): Move to ... + * arm-linux-tdep.c: ... here. Make static. + (arm_linux_init_abi): Register it. + (solib-svr4.h): Include it. + * Makefile.in: Update dependencies. + * config/arm/tm-linux.h (SVR4_FETCH_LINK_MAP_OFFSETS): Delete. + (arm_linux_svr4_fetch_link_map_offsets): Delete declaration. + +2003-06-13 Corinna Vinschen + + * h8300-tdep.c: Add definitions E_RET0_REGNUM and E_RET1_REGNUM to + indicate registers used for return values. + (struct frame_extra_info): Drop args_pointer and locals_pointer. + (h8300_examine_prologue): Remove initializing dropped frame_extra_info + members. + (h8300_init_extra_frame_info): Ditto. + (h8300_frame_locals_address): Removed. + (h8300_frame_args_address): Removed. + (h8300_extract_return_value): Use new regcache structure. Only care + for 16 bit CPUs. + (h8300h_extract_return_value): Same function for 32 bit CPUs. + (h8300_store_return_value): Use new regcache structure. Only care + for 16 bit CPUs. + (h8300h_store_return_value): Same function for 32 bit CPUs. + (h8300_store_struct_return): Removed. + (h8300_extract_struct_value_address): Use new regcache structure. + (h8300h_extract_struct_value_address): Removed. + (h8300_push_dummy_code): New function. + (h8300_gdbarch_init): Slightly rearranged to stress deprecated calls. + Remove call_dummy_words. Call set_gdbarch_extract_return_value and + set_gdbarch_store_return_value architecture dependent. + Call set_gdbarch_push_dummy_code and + set_gdbarch_extract_struct_value_address. + Remove calls to set_gdbarch_frame_args_address, + set_gdbarch_frame_locals_address, + set_gdbarch_deprecated_store_struct_return, + set_gdbarch_deprecated_extract_return_value, + set_gdbarch_deprecated_extract_struct_value_address, + set_gdbarch_deprecated_call_dummy_words and + set_gdbarch_deprecated_sizeof_call_dummy_words. + +2003-06-13 Corinna Vinschen + + * h8300-tdep.c (h8300_register_byte): Remove. + (h8300h_register_byte): Remove. + (h8300_register_virtual_type): Remove. Substitute by... + (h8300_register_type): New function. + (h8300_extract_struct_value_address): Drop usage of h8300_register_byte. + (h8300h_extract_struct_value_address): Ditto. + (h8300_gdbarch_init): Drop calls to + set_gdbarch_deprecated_register_byte and + set_gdbarch_deprecated_register_virtual_type. + Add call to set_gdbarch_register_type. + +2003-06-13 Andrew Cagney + + * gdbarch.sh: Update comments on registers. + (deprecated_register_byte): Rename register_byte. + (deprecated_register_raw_size): Rename register_raw_size. + (deprecated_register_virtual_size): Rename register_virtual_size. + (deprecated_register_virtual_type): Rename register_virtual_type. + * gdbarch.h, gdbarch.c: Re-generate. + * 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: 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. + * 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. + * alpha-tdep.c (alpha_gdbarch_init): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + +2003-06-13 Andrew Cagney + + * mips-tdep.c (mips_gdbarch_init): Replace remaining instances of + mips_o32_use_struct_convention with always_use_struct_convention. + +2003-06-12 David Carlton + + * cp-namespace.c (cp_set_block_scope): Comment out + processing_has_namespace_info branch. + +2003-06-12 Jim Blandy + + Recognize and skip 64-bit PowerPC Linux linkage functions. + * ppc-linux-tdep.c (insn_d, insn_ds, insn_xfx, read_insn, struct + insn_pattern, insns_match_pattern, d_field, ds_field): New + functions, macros, and types for working with PPC instructions. + (ppc64_standard_linkage, PPC64_STANDARD_LINKAGE_LEN, + ppc64_in_solib_call_trampoline, ppc64_standard_linkage_target, + ppc64_skip_trampoline_code): New functions, variables, and macros + for recognizing and skipping linkage functions. + (ppc_linux_init_abi): Use ppc64_in_solib_call_trampoline and + ppc64_skip_trampoline_code for the 64-bit PowerPC Linux ABI. + + * ppc-linux-nat.c (ppc_register_u_addr): Correctly compute u-area + register offsets for both the 32- and 64-bit interfaces. + + Actually finish the job started by my change of 2003-05-29. + * config/powerpc/tm-linux.h (SKIP_TRAMPOLINE_CODE): Remove the + other #definition of this. + (ppc_linux_skip_trampoline_code): Remove declaration. + * ppc-linux-tdep.c (ppc_linux_skip_trampoline_code): Make this + static. + (ppc_linux_init_abi): Register it as the skip_trampoline_code + method for GDBARCH. + + * config/powerpc/nm-ppc64-linux.h (PTRACE_XFER_TYPE): This is + 'long' on ppc64-*-linux*. + + * ppc-linux-nat.c (ppc_register_u_addr, fill_gregset): If PT_MQ + isn't #defined, assume the register doesn't exist: act as if + tdep->ppc_mq_regnum were -1. + + * configure.host, configure.tgt: Add entries for + powerpc64-*-linux, selecting powerpc/ppc64-linux.mh and + powerpc/linux.mt. + * config/powerpc/ppc64-linux.mh, config/powerpc/nm-ppc64-linux.mh: + New files. + + * arch-utils.c (always_use_struct_convention): New function. + * arch-utils.h (always_use_struct_convention): New prototype. + * alpha-tdep.c (alpha_use_struct_convention): Delete. + (alpha_gdbarch_init): Register always_use_struct_convention, + instead of alpha_use_struct_convention. + * cris-tdep.c (cris_use_struct_convention): Delete. + (cris_gdbarch_init): Register always_use_struct_convention, + instead of cris_use_struct_convention. + * frv-tdep.c (frv_use_struct_convention): Delete. + (frv_gdbarch_init): Register always_use_struct_convention, + instead of frv_use_struct_convention. + * h8300-tdep.c (h8300_use_struct_convention): Delete. + (h8300_gdbarch_init): Register always_use_struct_convention, + instead of h8300_use_struct_convention. + * mips-tdep.c (mips_o32_use_struct_convention): Delete. + (mips_o32_gdbarch_init): Register always_use_struct_convention, + instead of mips_o32_use_struct_convention. + +2003-06-12 Andrew Cagney + + * wince.c: Include "mips-tdep.h". + * mips-tdep.h (mips_next_pc): Declare. + * mcore-tdep.c: Make more local functions static. + * Makefile.in (wince.o): Update dependencies. + +2003-06-12 David Carlton + + * symtab.c (lookup_symbol_aux_minsyms): Replace + DEPRECATED_SYMBOL_NAME by SYMBOL_LINKAGE_NAME. + (find_pc_sect_line, search_symbols, rbreak_command): Ditto. + (COMPLETION_LIST_ADD_SYMBOL): Rewrite in terms of + SYMBOL_NATURAL_NAME. + +2003-06-12 Andreas Schwab + + * Makefile.in (tuiDisassem.o): Update dependencies. + +2003-06-12 David Carlton + + * symtab.h: Delete declaration of make_symbol_overload_list. + Add declaration of lookup_partial_symbol. + * symtab.c (remove_params): Move to cp-support.c. + (overload_list_add_symbol, make_symbol_overload_list) + (sym_return_val_size, sym_return_val_index): Ditto. + (lookup_partial_symbol): Make extern. + * cp-support.h: Add declaration of make_symbol_overload_list. + * cp-support.c: Include dictionary.h, objfiles.h, frame.h, + symtab.h, and block.h. + (remove_params): Move here from symtab.c. + (overload_list_add_symbol, make_symbol_overload_list) + (sym_return_val_size, sym_return_val_index): Ditto. + * valops.c: Include cp-support.h. + * Makefile.in (cp-support.o): Depend on dictionary_h, objfiles_h, + frame_h, and block_h. + (valops.o): Depend on cp_support_h. + +2003-06-12 Corinna Vinschen + + * h8300-tdep.c: Add H8SX registers. Drop E_NUM_REGS entirely, + substitute by NUM_REGS throughout. + (h8300_register_name): Only care for H8/300 and H8/300H registers. + (h8300s_register_name): New function for H8S registers. + (h8300sx_register_name): Ditto for H8SX registers. + (h8300_print_register): Revise register printing, avoid depending + on 32 bit long. + (h8300_register_byte): Only care for H8/300 registers. + (h8300h_register_byte): New function for any other architecture. + (h8300_register_raw_size): Remove. + (h8300_register_virtual_type): Revise to return actually useful + type. + (h8300_extract_struct_value_address): Only care for H8/300 registers. + (h8300h_extract_struct_value_address): New function for any other + architecture. + (h8300_gdbarch_init): Add h8300sxn. Call set_gdbarch_num_regs, + set_gdbarch_register_name, set_gdbarch_register_byte, + set_gdbarch_ptr_bit and set_gdbarch_addr_bit architecture dependent. + Remove calls to set_gdbarch_deprecated_register_size, + set_gdbarch_deprecated_register_bytes, set_gdbarch_register_raw_size, + set_gdbarch_deprecated_max_register_raw_size, + set_gdbarch_register_virtual_size and + set_gdbarch_deprecated_max_register_virtual_size entirely. + Call set_gdbarch_long_long_bit, set_gdbarch_double_bit and + set_gdbarch_long_double_bit. + +2003-06-11 Jeff Johnston + + * doublest.c (convert_doublest_to_floatformat): When dealing + with the implied integer bit, only alter mant_bits if we are + processing a full 32 bits of mantissa. + +2003-06-11 David Carlton + + * dictionary.h: New. + * dictionary.c: New. + * block.h: Add opaque declaration for struct dictionary. + (struct block): Add 'dict' member; delete 'hashtable', 'nsyms', + 'sym' members. + (BLOCK_DICT): New macro. + Delete macros BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM, + BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE, + BLOCK_SHOULD_SORT. + (ALL_BLOCK_SYMBOLS): Update definition. + * Makefile.in (SFILES): Add dictionary.c. + (dictionary_h): New. + (COMMON_OBS): Add dictionary.o. + (dictionary.o): New. + (ada-lang.o): Depend on dictionary_h. + (buildsym.o, coffread.o, jv-lang.o, mdebugread.o, objfiles.o) + (stack.o, symmisc.o, symtab.o, tracepoint.o, valops.o) + (mi-cmd-stack.o): Ditto. + (gdbtk-cmds.o): Update dependencies. + (gdbtk-stack.o): Ditto. + * ada-lang.c: Include dictionary.h. + (symtab_for_sym): Update uses of ALL_BLOCK_SYMBOLS. + (fill_in_ada_prototype, debug_print_block): Ditto. + (ada_add_block_symbols): Update uses of ALL_BLOCK_SYMBOLS; replace + explicit iteration by use of ALL_BLOCK_SYMBOLS. Delete variable + 'is_sorted'. + * mdebugread.c: Include dictionary.h. + (struct parse_stack): Delete 'maxsyms' member. + (parse_symbol): Update calls to new_block. Delete calls to + shrink_block. Use dictionary methods. + (psymtab_to_symtab_1): Delete calls to sort_symtab_syms. + Update calls to new_symtab. Don't maintain maxsyms data. + (mylookup_symbol): Update use of ALL_BLOCK_SYMBOLS. + (add_symbol): Just call dict_add_symbol. + (new_symtab): Delete 'maxsyms' argument. + (new_symtab): Update calls to new_block. + (new_block): Delete 'maxsyms' argument; add 'function' argument. + (shrink_block): Delete function. + (fixup_sigtramp): Update call to new_block. Add symbol via + dict_add_symbol. + * jv-lang.c: Include dictionary.h. + (get_java_class_symtab): Set the BLOCK_DICT of the blocks + appropriately. Set class_symtab->free_func. Make sure the + blockvector is big enough to hold two blocks. + (add_class_symtab_symbol): Use dictionary methods. + (free_class_block): New function. + (type_from_class): Replace explicit iteration by + ALL_BLOCK_SYMBOLS. + * symtab.h (struct symtab): Replace 'free_ptr' method by + 'free_func'. + * dwarf2read.c (psymtab_to_symtab_1): Delete call to + sort_symtab_syms. + * dwarfread.c (psymtab_to_symtab_1): Delete call to + sort_symtab_syms. + * coffread.c (coff_symfile_read): Delete call to sort_symtab_syms. + Include dictionary.h. + (patch_opaque_types): Update use of ALL_BLOCK_SYMBOLS. + * dbxread.c (dbx_psymtab_to_symtab_1): Delete call to + sort_symtab_syms. + * objfiles.c: Include dictionary.h. + (objfile_relocate): Update use of ALL_BLOCK_SYMBOLS. + * buildsym.c: Include dictionary.h. + (finish_block): Use dictionary methods. + (end_symtab): Set free_func to NULL, not free_ptr. + * tracepoint.c: Include dictionary.h. + (add_local_symbols): Update use of ALL_BLOCK_SYMBOLS. + (scope_info): Ditto. + * stack.c: Include dictionary.h. + (print_block_frame_locals): Update use of ALL_BLOCK_SYMBOLS. + (print_block_frame_labels, print_frame_arg_vars) + (print_frame_args): Ditto. + * symmisc.c (free_symtab_block): Use dictionary methods. + (dump_symtab): Ditto. + (free_symtab): Replace use of 'free_ptr' by 'free_func'. + Include dictionary.h. + * symfile.h: Delete declarations of sort_block_syms, + sort_symtab_syms. + * symfile.c (sort_block_syms): Delete. + (sort_symtab_syms): Delete. + * symtab.c: Include dictionary.h. + (lookup_block_symbol): Use dictionary iterators. + (find_pc_sect_symtab): Update use of ALL_BLOCK_SYMBOLS. + (search_symbols, make_symbol_completion_list): Ditto. + (make_symbol_overload_list): Ditto. + * valops.c (value_of_local): Use dict_empty. + Include dictionary.h. + +2003-06-11 J. Brobecker + + * win32-nat.c (solib_symbols_add): Fix a small compilation error. + +2003-06-11 David Carlton + + * block.h (BLOCK_SHOULD_SORT): Delete. + * symtab.c (lookup_block_symbol): Don't worry about sorted linear + blocks. + * ada-lang.c (ada_add_block_symbols): Ditto. + * symfile.c (sort_block_syms): Delete. + (sort_symtab_syms): Ditto. + * symfile.h: Delete sort_symtabs_syms and sort_block_syms + declarations. + * coffread.c (coff_symfile_read): Don't call sort_symtab_syms. + * dbxread.c (dbx_psymtab_to_symtab_1): Ditto. + * dwarf2read.c (psymtab_to_symtab_1): Ditto. + * dwarfread.c (psymtab_to_symtab_1): Ditto. + * hpread.c (hpread_psymtab_to_symtab_1): Ditto. + * mdebugread.c (psymtab_to_symtab_1): Ditto. + * xcoffread.c (xcoff_psymtab_to_symtab_1): Ditto. + +2003-06-11 Jeff Johnston + + * ia64-tdep.c (ia64_gdbarch_init): Set number of long double + bits to 128. + +2003-06-11 Andrew Cagney + + * gdbarch.sh (DEPRECATED_REGISTER_CONVERTIBLE): Deprecate + REGISTER_CONVERTIBLE. + (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL): Same. + (DEPRECATED_REGISTER_CONVERT_TO_RAW): Same, make "from" constant. + * gdbarch.h, gdbarch.c: Re-generate. + * arch-utils.h (deprecated_register_convertible_not): Rename + generic_register_convertible_not. + * arch-utils.c (deprecated_register_convertible_not): Rename + generic_register_convertible. + (legacy_convert_register_p, legacy_register_to_value): Update. + * sh-tdep.c (sh64_push_arguments): Update. + * m68klinux-tdep.c (m68k_linux_extract_return_value): Update. + * config/m68k/tm-delta68.h (DEPRECATED_EXTRACT_RETURN_VALUE): Update. + * m68klinux-tdep.c (m68k_linux_store_return_value): Update. + * config/m68k/tm-delta68.h (DEPRECATED_STORE_RETURN_VALUE): Update. + * arch-utils.c (legacy_value_to_register): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + (rs6000_register_convert_to_raw): Make parameter "from" const. + * mips-tdep.c (mips_gdbarch_init): Update. + (mips_register_convert_to_raw): Make parameter"virt_buf" const. + * infcmd.c (default_print_registers_info): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + (ia64_register_convert_to_raw): Make parameter "from" const. + * i386-tdep.c (i386_gdbarch_init): Update. + (i386_register_convert_to_raw): Update. + +2003-06-11 Andrew Cagney + + * remote-fileio.c: Include "remote-fileio.h". + * Makefile.in (remote-fileio.o): Update dependencies. + (remote_fileio_h): Fix typo. + +2003-06-11 Andrew Cagney + + * xstormy16-tdep.c (xstormy16_push_return_address): Make static. + (xstormy16_save_dummy_frame_tos): Make static. + (_initialize_xstormy16_tdep): Add declaration. + * vax-tdep.c (_initialize_vax_tdep): Add declaration. + * v850-tdep.c: Make local functions static. + (_initialize_v850_tdep): Add declaration. + * sparc-tdep.c: Make local functions static. + (_initialize_sparc_tdep): Add declaration. + * sh-tdep.c: Make local functions static. + (_initialize_sh_tdep): Add declaration. + * sh3-rom.c (_initialize_sh3_rom): Add declaration. + * s390-tdep.c: Make local functions static. + (_initialize_s390_tdep): Add declaration. + * dbxread.c (find_stab_function_addr): Make static. + * ppc-bdm.c (_initialize_bdm_ppc): Add declaration. + * ocd.c (_initialize_remote_ocd): Add declaration. + * dink32-rom.c (_initialize_dink32_rom): Add declaration. + * ppcbug-rom.c (_initialize_ppcbug_rom): Add declaration. + * ns32k-tdep.c (_initialize_ns32k_tdep): Add declaration. + * ns32knbsd-tdep.c (_initialize_ns32knbsd_tdep): Add declaration. + * mips-tdep.c (_initialize_mips_tdep): Add declaration. + * remote-array.c (_initialize_array): Add declaration. + (_initialize_remote_monitors): Add declaration. + * remote-mips.c: Make local functions static. + (_initialize_remote_mips): Add declaration. + * mcore-tdep.c: Make all local functions static. + (_initialize_mcore_tdep): Add declaration. + * dbug-rom.c (_initialize_dbug_rom): Add declaration. + * abug-rom.c (_initialize_abug_rom): Add declaration. + * rom68k-rom.c (_initialize_rom68k): Add declaration. + * cpu32bug-rom.c (_initialize_cpu32bug_rom): Add declaration. + * m68k-tdep.c (_initialize_m68k_tdep): Add declaration. + * remote-est.c (_initialize_est): Add declaration. + * m68hc11-tdep.c (_initialize_m68hc11_tdep): Add declaration. + (m68hc11_call_dummy_address): Make static. + * ia64-tdep.c: Make local functions static. + (_initialize_ia64_tdep): Add declaration. + * solib-legacy.c (_initialize_svr4_lm): Add declaration. + * monitor.c (monitor_wait_filter): Make static. + (_initialize_remote_monitors): Add declaration. + * remote-hms.c (_initialize_remote_hms): Add declaration. + * remote-e7000.c (fetch_regs_from_dump): Make static. + (expect_n): Make static. + (_initialize_remote_e7000): Add declaration. + * ser-e7kpc.c: Always include "defs.h". + (_initialize_ser_e7000pc): Add declaration. + * h8300-tdep.c (_initialize_h8300_tdep): Add declaration. + * cris-tdep.c: Make all but one function static. + (_initialize_cris_tdep): Add declaration. + * solib-svr4.c (_initialize_svr4_solib): Add declaration. + * solib.c (update_solib_list): Make static. + (_initialize_solib): Add declaration. + * avr-tdep.c (avr_breakpoint_from_pc): Make static. + (_initialize_avr_tdep): Add declaration. + * remote-rdi.c (voiddummy): Make static. + (_initialize_remote_rdi): Add declaration. + * arm-tdep.c (_initialize_arm_tdep): Add declaration. + * remote-rdp.c (send_rdp): Make static. + (_initialize_remote_rdp): Add declaration. + * alpha-tdep.c (_initialize_alpha_tdep): Add declaration. + +2003-06-11 Corinna Vinschen + + * remote-fileio.c: Make ari happy. + +2003-06-10 J. Brobecker + + * rs6000-nat.c (child_xfer_memory): Compute the right address when + fetching the trailing bytes of the buffer we are about to write. + +2003-06-10 Andrew Cagney + + * remote-fileio.h (REMOTE_FILEIO_H): Replace FILEIO_H. + * Makefile.in (remote-fileio.o): Update dependencies. + * remote-fileio.c: Include "gdb_wait.h" and "gdb_stat.h". Do not + include , or conditional on USG. + (remote_fio_jmp_buf): Delete global variable. + +2003-06-10 Corinna Vinschen + Martin M. Hunt + + * Makefile.in (REMOTE_OBS): Add remote-fileio.o + (SFILES): Add remote-fileio.c. + Add dependencies for building remote-fileio.o. Add remote-fileio.h to + dependencies for building remote.o. + * remote-fileio.c: New file implementing the remote File-I/O protocol. + * remote-fileio.h: New header file defining remote File-I/O interface. + * remote.c (remote_write_bytes, remote_read_bytes): Remove + static storage class. + (remote_wait, remote_async_wait): Call remote_fileio_request() on + 'F' packet. + (_initialize_remote): Call initialize_remote_fileio(). + * remote.h: Declare remote_write_bytes() and remote_read_bytes(). + * defs.h: Declare gdb_stdin, gdb_stdtargerr and gdb_stdtargin. + * main.c: New ui_file gdb_stdin, gdb_stdtargerr and gdb_stdtargin. + (captured_main): Initialize new ui_files. + * ui-file.c: Add read and fgets input functions. + (ui_file_new): set ui_file_fputs and ui_file_read to null functions. + (null_file_read): New function. + (ui_file_read): New function. + (set_ui_file_read): New function. + (stdio_file_read): New function. + * ui-file.h: New type ui_file_read_ftype. + (set_ui_file_read): Declare. + (ui_file_read): Declare. + +2003-06-09 Andrew Cagney + + * frame.h (deprecated_unwind_get_saved_register): Rename + generic_unwind_get_saved_register, update comments. + * mips-tdep.c (mips_get_saved_register): Update. + * frame.c (deprecated_unwind_get_saved_register): Update. + +2003-06-09 Andrew Cagney + + * vax-tdep.c (vax_frame_locals_address): Delete function. + (vax_gdbarch_init): Do not set frame_locals_address. + * m68hc11-tdep.c (m68hc11_frame_locals_address): Delete function. + (m68hc11_gdbarch_init): Do not set frame_locals_address. + * s390-tdep.c (s390_frame_args_address): Delete function. + (s390_gdbarch_init): Do not set frame_args_address or + frame_locals_address. + * ns32k-tdep.c (ns32k_frame_locals_address): Delete. + (ns32k_gdbarch_init): Do not set frame_locals_address. + * hppa-tdep.c (hppa_frame_args_address): Delete function. + (hppa_frame_locals_address): Delete function. + (hppa_gdbarch_init): Do not set frame_args_address, or + frame_locals_address. + * arm-tdep.c (arm_frame_args_address): Delete. + (arm_frame_locals_address): Delete. + (arm_gdbarch_init): Do not set frame_args_address, or + frame_locals_address. + +2003-06-09 Andrew Cagney + + * gdbarch.sh (FRAME_NUM_ARGS): Change to function with predicate. + * gdbarch.h, gdbarch.c: Re-generate. + * arch-utils.h (frame_num_args_unknown): Delete both declarations. + * arch-utils.c (frame_num_args_unknown): Delete function. + * stack.c (print_args_stub): Use FRAME_NUM_ARGS_P. + (frame_info): Use FRAME_NUM_ARGS_P. + * arm-tdep.c (arm_frame_num_args): Delete function. + (arm_gdbarch_init): Do not set frame_num_args. + * config/pa/tm-hppa64.h (FRAME_NUM_ARGS): Delete. + * hppa-tdep.c (hppa_frame_num_args): Delete function. + (hppa_gdbarch_init): Do not set frame_num_args. + * config/sparc/tm-sparc.h (FRAME_NUM_ARGS): Delete. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Do not set + frame_num_args to default frame_num_args_unknown. + * 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. + * 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. + * m68k-tdep.c (m68k_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. + * alpha-tdep.c (alpha_gdbarch_init): Ditto. + +2003-06-09 Andrew Cagney + + * printcmd.c (print_frame_nameless_args): Moved to "stack.c". + (print_frame_args): Moved to "stack.c". + * stack.c: Include "gdb_assert.h". + (print_frame_nameless_args): Moved from "printcmd.c", made static. + (print_frame_args): Moved from "printcmd.c". + * frame.h (print_frame_args): Delete declaration. + * Makefile.in (stack.o): Update dependencies. + +2003-06-08 Andrew Cagney + + * frame.c (get_prev_frame): Remove reference to + frame_args_address_correct in comments. + * frame-base.c (default_frame_args_address): Delete code + conditional on FRAME_ARGS_ADDRESS_CORRECT. + * vax-tdep.c (vax_frame_args_address_correct): Delete. + (vax_frame_args_address): Merge in vax_frame_args_address_correct. + * config/vax/tm-vax.h (FRAME_ARGS_ADDRESS_CORRECT): Delete + (vax_frame_args_address_correct): Delete declaration. + +2003-06-08 Andrew Cagney + + * gdbarch.sh (UNWIND_SP): Add. + * gdbarch.h, gdbarch.c: Re-generate. + * frame.c (frame_sp_unwind): New function. + (get_frame_sp): New function. + * frame.h (get_frame_sp, frame_sp_unwind): Declare. + * regcache.c (read_sp): Rewrite, try each of TARGET_READ_SP, + gdbarch_unwind_sp and SP_REGNUM when looking for the SP register + value. + * d10v-tdep.c (d10v_unwind_sp): Replace d10v_read_sp. + (d10v_gdbarch_init): Set unwind_sp instead of read_sp. + +2003-06-08 Andrew Cagney + + Deprecate BIG_REMOTE_BREAKPOINT, LITTLE_REMOTE_BREAKPOINT and + REMOTE_BREAKPOINT. + * remote.c: Update. + * config/sh/tm-sh.h (DEPRECATED_BIG_REMOTE_BREAKPOINT): Update. + (DEPRECATED_LITTLE_REMOTE_BREAKPOINT): Update. + * config/m68k/tm-sun3.h: Update. + * config/m68k/tm-m68klynx.h: Update. + * config/h8300/tm-h8300.h (DEPRECATED_REMOTE_BREAKPOINT): Update. + + * trad-frame.h (struct trad_frame_saved_reg): Rename "struct + trad_frame". Update comments. + * d10v-tdep.c (struct d10v_unwind_cache): Update. + * trad-frame.c (trad_frame_alloc_saved_regs): Update. + (trad_frame_register_value, trad_frame_prev_register): Update. + +2003-06-08 Andrew Cagney + + * acinclude.m4 (gcc_AC_CHECK_DECL, (gcc_AC_CHECK_DECL): Stolen + from GCC's acinclude.m4. + * configure.in: Check for getopt's delcaration. + * aclocal.m4, config.in, configure: Re-generate. + * main.c (error_init): Delete declaration. + * defs.h (error_init): Declare. + * rs6000-tdep.c (rs6000_fetch_pointer_argument): Make static. + (rs6000_convert_from_func_ptr_addr): Make static. + (_initialize_rs6000_tdep): Add declaration. + * cli/cli-cmds.c (dont_repeat): Delete declaration. + (show_commands, set_verbose, show_history): Delete declaration. + * top.h (set_verbose): Add declaration. + (show_history, set_history, show_commands): Add declaration. + (do_restore_instream_cleanup): Add declaration. + * objc-lang.c (specialcmp): Make static. + (print_object_command): Make static. + (find_objc_msgsend): Make static. + (find_objc_msgcall_submethod_helper): Make static. + (find_objc_msgcall_submethod): Make static. + (_initialize_objc_language): Add declaration. + (find_implementation_from_class): Make static. + (find_implementation): Make static. + * objc-exp.y (yylex): Delete lookup_struct_typedef declaration. + * objc-lang.h (lookup_struct_typedef): Add declaration. + * cli/cli-interp.c (_initialize_cli_interp): Add declaration. + * cli/cli-script.c (clear_hook_in_cleanup): Make static. + (do_restore_user_call_depth): Make static. + (do_restore_instream_cleanup): Delete declaration. + (dont_repeat): Delete declaration. + * cli/cli-decode.c (add_abbrev_cmd): Delete function. + * cli/cli-dump.c (_initialize_cli_dump): Add declaration. + * reggroups.c (_initialize_reggroup): Add declaration. + * cp-support.c (_initialize_cp_support): Add declaration. + * cp-abi.c (_initialize_cp_abi): Add declaration. + * hpacc-abi.c (_initialize_hpacc_abi): Add declaration. + * gnu-v3-abi.c (gnuv3_baseclass_offset): Make static. + (_initialize_gnu_v3_abi): Add declaration. + * gnu-v2-abi.c (gnuv2_value_rtti_type): Make static. + (_initialize_gnu_v2_abi): Add declaration. + * frame-base.c (_initialize_frame_base): Add declaration. + * doublest.c (floatformat_from_length): Make static. + * frame-unwind.c (_initialize_frame_unwind): Add declaration. + * frame.c (create_sentinel_frame): Make static. + (_initialize_frame): Add declaration. + * top.c (do_catch_errors): Make static. + (gdb_rl_operate_and_get_next_completion): Make static. + * typeprint.c: Include "typeprint.h". + * sentinel-frame.c (sentinel_frame_prev_register): Make static. + (sentinel_frame_this_id): Make static. + * p-valprint.c (_initialize_pascal_valprint): Add declaration. + * ui-out.c (make_cleanup_ui_out_begin_end): Delete function. + * dwarf2-frame.c (dwarf2_frame_cache): Make static. + * p-exp.y (push_current_type, pop_current_type): ISO C declaration. + * dwarf2expr.h (dwarf_expr_context): ISO C declaration. + * maint.c (maintenance_print_architecture): Make static. + * signals/signals.c (_initialize_signals): Add declaration. + * std-regs.c (_initialize_frame_reg): Add declaration. + * jv-exp.y (push_variable): ISO C definition. + (push_qualified_expression_name): Ditto. + * memattr.c (_initialize_mem): Add declaration. + * remote.c (remote_check_watch_resources): Make static. + (remote_stopped_by_watchpoint): Make static. + (remote_stopped_data_address): Make static. + * d10v-tdep.c (nr_dmap_regs): Make static. + (a0_regnum): Make static. + (d10v_frame_unwind_cache): Make static. + (d10v_frame_p): Make static. + * osabi.c (show_osabi): Make static. + (_initialize_gdb_osabi): Add extern declaration. + * gdbtypes.c (make_qualified_type): Make static. + (safe_parse_type): Make static. + * macrocmd.c (_initialize_macrocmd): Add extern declaration. + * macrotab.c (macro_bcache_free): Make static. + * interps.c (interp_set_quiet): Make static. + (interpreter_exec_cmd): Make static. + * stack.h (select_frame_command): New file. + * stack.c: Include "stack.h". + (select_frame_command_wrapper): Delete function. + (select_frame_command): Make global. + * infcall.c: Include "infcall.h". + * linespec.c: Include "linespec.h". + * symfile.c (sections_overlap): Make static. + * cp-support.h (cp_initialize_namespace): ISO C declaration. + * charset.c (_initialize_charset): Add missing prototype. + * regcache.c (init_legacy_regcache_descr): Make static. + (do_regcache_xfree): Make static. + (regcache_xfer_part): Make static. + (_initialize_regcache): Add missing prototype. + * breakpoint.c (parse_breakpoint_sals): Make static. + (breakpoint_sals_to_pc): Make static. + * interps.h (clear_interpreter_hooks): ISO C declaration. + * Makefile.in (stack_h): Define. + (stack.o, typeprint.o, mi-main.o): Update dependencies. + (mi-cmd-stack.o, infcall.o, linespec.o): Update dependencies. + +2003-06-08 Andrew Cagney + + * Makefile.in (d10v-tdep.o): Update dependencies. + (SFILES): Add trad-frame.c. + (trad_frame_h): Define. + (COMMON_OBS): Add trad-frame.o. + (trad-frame.o): Specify dependencies. + * d10v-tdep.c: Include "trad-frame.h". + (saved_regs_unwinder): Delete function. + (d10v_frame_prev_register): Use trad_frame_prev_register. + (struct d10v_unwind_cache): Change type of "saved_regs" to "struct + trad_frame", delete "regs" and "prev_sp". + (prologue_find_regs): Use trad-frame. + * trad-frame.h, trad-frame.c: New files. + +2003-06-08 Mark Kettenis + + * dwarf2cfi.c, dwarf2cfi.h: Remove. + +2003-06-07 Adam Fedor + + * gdb/objc-lang.c (FETCH_ARGUMENT): Remove macro. + (OBJC_FETCH_POINTER_ARGUMENT): Shorthand macro for + using FETCH_POINTER_ARGUMENT with Objective-C method arguments. + (find_implementation, resolve_msgsend, resolve_msgsend_stret, + resolve_msgsend_super, resolve_msgsend_super_stret): + Use it. + +2003-06-07 Andrew Cagney + + * symfile.h: Re-indent, clean up comments. + +2003-06-07 Andrew Cagney + + * inferior.h (deprecated_write_sp): Replace + generic_target_write_sp. + * regcache.c (deprecated_write_sp): Replace + generic_target_write_sp. + * 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. + * 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. + * h8300-tdep.c (h8300_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * config/pa/tm-hppa.h (DEPRECATED_DUMMY_WRITE_SP): Update. + +2003-06-07 Andrew Cagney + + * dwarf2-frame.c (dwarf2_frame_cache): Add comments on PC_REGNUM. + Assert that PC_REGNUM is valid. + (dwarf2_frame_prev_register): Add comments on SP_REGNUM. + +2003-06-07 Andrew Cagney + + * gdbarch.sh (TARGET_READ_SP): Add predicate, delete default. + * gdbarch.h, gdbarch.c: Regenerate. + * mn10300-tdep.c: Include "gdb_assert.h". + (mn10300_read_fp): New function. + (mn10300_gdbarch_init): Set deprecated_target_read_fp to + mn10300_read_fp. Do not set read_sp to generic_target_read_sp. + * ia64-tdep.c: Include "gdb_assert.h". + (ia64_read_fp): New function. + (ia64_gdbarch_init): Set deprecated_target_read_fp to + ia64_read_sp. Do not set read_sp to generic_target_read_sp. + * regcache.c (generic_target_read_sp): Delete function. + (read_sp): Try TARGET_READ_SP and SP_REGNUM for the SP register. + * inferior.h (generic_target_read_sp): Delete declaration. + * frv-tdep.c (frv_gdbarch_init): Do not set read_sp to + generic_target_read_sp. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * sparc-tdep.c (sparc_gdbarch_init): Ditto + * sh-tdep.c (sh_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + * Makefile.in (mn10300-tdep.o, ia64-tdep.o): Update dependencies. + +2003-06-07 Andrew Cagney + + * gdbarch.sh: Comment each field of startup_gdbarch. + * gdbarch.h, gdbarch.c: Re-generate. + +2003-06-07 Andrew Cagney + + * gdbarch.sh (TARGET_READ_PC): Add predicate, remove default. + * gdbarch.h, gdbarch.c: Re-generate. + * regcache.c: Update comments on read_pc et.al. + (generic_target_read_pc): Delete function. + (read_pc_pid): Try TARGET_READ_PC and PC_REGNUM for a PC register. + * inferior.h (generic_target_read_pc): Delete declaration. + * frv-tdep.c (frv_gdbarch_init): Do not set read_pc to + generic_target_read_pc. + * sparc-tdep.c (sparc_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + +2003-06-07 Andrew Cagney + + * elfread.c (elf_symtab_read): Replace "special_local_sym_p" and + "index" with "special_local_sect". Use strcmp instead of STREQ. + Append period to coments. + +2003-06-06 Mark Mitchell + + * elfread.c (elf_symtab_read): Avoid use of SECT_OFF_MAX. + (elfstab_offset_sections): Likewise. + * gdb-stabs.h (stab_section_info): Likewise. + * i386-interix-tdep.c (pei_adjust_objfile_offsets): Likewise. + * objfiles.c (objfile_relocate): Likewise. + * pa64solib.c (pa64_solib_add_solib_objfile): Likewise. + * remote.c (get_offsets): Likewise. + (remote_cisco_objfile_relocate): Likewise. + * somread.c (som_symfile_offsets): Likewise. + * symfile.c (alloc_section_addr_info): New function. + (build_section_addr_info_from_section_tab): Use it. + (free_section_addr_info): Adjust. + (default_symfile_offsets): Avoid use of SECT_OFF_MAX. + (syms_from_objfile): Allocate local_addr dynamically. + (symbol_file_add_with_addrs_or_offsets): Allocate orig_addrs + dynamically. + (add_symbol_file_command): Allocate sect_opts dynamically. + (reread_symbols): Avoid use of SECT_OFF_MAX. + * symfile.h (section_addr_info): Do not use MAX_SECTIONS. + (alloc_section_addr_info): Declare it. + * symtab.h (SIZEOF_SECTION_OFFSETS): Remove. + * win32-nat.c (solib_symbols_add): Allocate section_addrs + dynamically. + * xcoffread.c (xcoff_symfile_offsets): Avoid use of SECT_OFF_MAX. + +2003-06-06 Andrew Cagney + + * d10v-tdep.c (struct d10v_unwind_cache): Delete "return_pc". + (d10v_frame_unwind_cache): Do not set "return_pc". + +2003-06-06 Michael Snyder + + * h8300-tdep.c: Make tidy (long lines). + +2003-06-06 Michal Ludvig + + * x86-64-tdep.c (x86_64_fill_fxsave): Pass correct regnums + to regcache_collect(). + +2003-06-05 J. Brobecker + + * hppa-hpux-tdep.c (hppa_hpux_init_abi): New function, setting + pc_in_sigtramp multiarch method. + (hppa_hpux_som_init_abi): Use it. + (hppa_hpux_elf_init_abi): Likewise. + * config/pa/tm-hppah.h (PC_IN_SIGTRAMP): Remove, now that this + macro has been multiarched. + * config/pa/tm-hppa64.h (PC_IN_SIGTRAMP): Temporarily set this + macro here, as hppa64 isn't multiarched yet. + +2003-06-05 Andrew Cagney + + * Makefile.in (value_h): Add $(frame_h). + * value.h: Include "frame.h". + (struct value): Replace "frame_addr" with "frame_id". + (VALUE_FRAME_ID): Replace VALUE_FRAME. + * values.c (allocate_value): Use VALUE_FRAME_ID. + (value_copy): Use VALUE_FRAME_ID. + * findvar.c (value_from_register): Use VALUE_FRAME_ID. + * valops.c (value_assign): Update. Use frame_find_by_id. + +2003-06-05 Michal Ludvig + + * x86-64-tdep.c (x86_64_push_arguments): Don't clear offset + in each pass. + +2003-06-05 Jeff Johnston + + * thread-db.c (check_event): For create/death event breakpoints, + loop through all messages to ensure that we read the message + corresponding to the breakpoint we are at. + +2003-06-04 Michael Snyder + + * h8300-tdep.c (h8300_gdbarch_init): Add h8300hn, h8300sn. + +2003-06-04 Mark Kettenis + + * dwarf2-frame.c (struct comp_unit): Add member `dbase'. + (read_encoded_value): Handle DW_EH_PE_datarel encoding. + (dwarf2_build_frame_info): Set base for DW_EH_PE_datarel encodings + when handling .eh_frame sections. + +2003-06-04 J. Brobecker + + * config/pa/nm-hppah.h (PREPARE_TO_PROCEED): Use the generic + prepare_to_proceed procedure instead of the hppa-specific one. + * hppa-tdep.c (hppa_prepare_to_proceed): Remove, no longer used. + +2003-06-04 Jeff Johnston + + * acconfig.h: Add HAVE_TKILL_SYSCALL definition check. + * config.in: Regenerated. + * configure.in: Add test for syscall function and check for + __NR_tkill macro in to set HAVE_TKILL_SYSCALL. + * configure: Regenerated. + * lin-lwp.c [HAVE_TKILL_SYSCALL]: Include and + . + (kill_lwp): New function that uses tkill syscall or + uses kill, depending on whether threading model is nptl or not. + All callers of kill() changed to use kill_lwp(). + (lin_lwp_wait): Make special check when WIFEXITED occurs to + see if all threads have already exited in the nptl model. + (stop_and_resume_callback): New callback function used by the + lin_lwp_wait thread exit handling code. + (stop_wait_callback): Check for threads already having exited and + delete such threads fromt the lwp list when discovered. + (stop_callback): Don't assert retcode of kill call. + + Roland McGrath + * i386-linux-nat.c (ps_get_thread_area): New function needed by + nptl libthread_db. + +2003-06-03 Richard Henderson + + * alpha-tdep.c (alpha_next_pc): Use alpha_read_insn. + (alpha_sigtramp_frame_this_id): Use get_frame_memory. + (alpha_sigtramp_frame_prev_register): Likewise. + (alpha_heuristic_frame_prev_register): Likewise. + * alpha-mdebug-tdep.c (alpha_mdebug_frame_prev_register): Likewise. + + * alpha-mdebug-tdep.c (alpha_mdebug_after_prologue): Use + alpha-specific register id names. + (alpha_mdebug_frame_unwind_cache): Likewise. + (alpha_mdebug_frame_prev_register): Likewise. + +2003-06-03 Richard Henderson + + * alpha-tdep.c (alpha_dwarf2_init_abi): New. + * alpha-tdep.h (alpha_dwarf2_init_abi): Declare it. + * alpha-linux-tdep.c (alpha_linux_init_abi): Use it. + * alphafbsd-tdep.c (alphafbsd_init_abi): Register dwarf2 and mdebug + unwind routines. + * alphanbsd-tdep.c (alphanbsd_init_abi): Likewise. + * config/alpha/fbsd.mt (TDEPFILES): Add alpha-mdebug-tdep.o. + * config/alpha/nbsd.mt (TDEPFILES): Likewise. + + * alpha-linux-tdep.c: Remove unnecessary includes. + * Makefile.in (alpha-linux-tdep.o): Update. + +2003-06-03 Richard Henderson + + * alphabsd-tdep.c (alphabsd_supply_fpreg): Fix typo last change. + (alphabsd_fill_fpreg): Likewise. + +2003-06-03 J. Brobecker + + * alphanbsd-tdep.c (alphanbsd_sigcontext_addr): Replace + references to struct frame_info fields by calls to the equivalent + accessors. Necessary now that frame_info is opaque. + +2003-06-03 J. Brobecker + + * alphanbsd-tdep.c (alphanbsd_skip_sigtramp_frame): Delete. + (alphanbsd_init_abi): Do not set skip_sigtramp_frame in tdep + structure, field no longer exists. + +2003-06-03 J. Brobecker + + * config/alpha/alpha-osf1.mt (TDEPFILES): Add alpha-mdebug-tdep.o. + * alpha-osf1-tdep.c (alpha_osf1_init_abi): Enable the mdebug module. + +2003-06-03 J. Brobecker + + * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Replace + references to struct frame_info fields by calls to the equivalent + accessors. Necessary now that frame_info is opaque. + +2003-06-03 J. Brobecker + + * alpha-osf1-tdep.c (alpha_osf1_skip_sigtramp_frame): Delete. + (alpha_osf1_init_abi): Do not set skip_sigtramp_frame in tdep + structure, field no longer exists. + +2003-06-03 Theodore A. Roth + + * remote.c (init_remote_state): Compute sizeof_g_packet by + accumulation of the size of all registers instead of blindly using + DEPRECATED_REGISTER_BYTES. + +2003-06-03 Michael Snyder + + * config/h8300/tm-h8300.h (h8300sxmode): Declare. + * h8300-tdep.c (h8300_gdbarch_init): Set machine mode + for h8300sx. + +2003-06-03 J. Brobecker + + * alpha-osf1-tdep.c (objfiles.h): #include, needed for symfile_objfile. + * Makefile.in (alpha-osf1-tdep.o): Update dependencies. + +2003-06-03 Andrew Cagney + + * sparc-tdep.c (sparc_convert_to_virtual): Delete function. + (sparc_convert_to_raw): Delete function. + (sparc_gdbarch_init): Do not set register_convert_to_raw or + register_convert_to_virtual. + +2003-06-03 Jeff Johnston + + * thread-db.c (thread_db_mourn_inferior): Unpush thread target + layer if not dealing with a statically-linked threaded program. + +2003-06-03 Kris Warkentin + + * solib.c (solib_open): Update comment to reflect actual search order. + +2003-06-03 Andrew Cagney + + * frame.c (get_frame_memory_signed): New function. + (get_frame_memory, get_frame_memory_unsigned): New function. + (get_frame_arch): New function. + * frame.h (get_frame_signed_memory, get_frame_arch): Declare. + (get_frame_memory, get_frame_unsigned_memory): Declare. + * d10v-tdep.c (d10v_frame_unwind_cache): Use + get_frame_memory_unsigned and get_frame_arch. + (d10v_frame_unwind_cache, saved_regs_unwinder): Ditto. + +2003-06-03 Raoul Gough + + * MAINTAINERS (write after approval): Add myself. + +2003-06-03 Jim Blandy + + * s390-nat.c (supply_gregset, fill_gregset): On the s390x, the + elements of gregset_t are 64 bits each, but access registers + are still 32 bits, so they're packed two per gregset_t + element. Unpack/pack them properly. + +2003-06-02 David Carlton + + * linespec.c (find_methods): Break out code into + add_matching_methods and add_constructors. + (add_matching_methods): New. + (add_constructors): Ditto. + +2003-06-02 Andrew Cagney + + * sparc-tdep.c (sparc_print_registers): Delete call to + REGISTER_CONVERTIBLE. + (sparc_gdbarch_init): Do not set register_convertible. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + +2003-06-02 Elena Zannoni + + * target.h (TARGET_SYMFILE_POSTREAD): Delete unused macro. + * symfile.c (reread_symbols): Delete call to TARGET_SYMFILE_POSTREAD. + (syms_from_objfile): Ditto. + +2003-06-03 Andreas Schwab + + * m68k-tdep.c (m68k_gdbarch_init): Use set_gdbarch_print_insn ... + (_initialize_m68k_tdep): ... instead of deprecated_tm_print_insn. + +2003-06-02 Richard Henderson + + * alpha-tdep.c (alpha_register_reggroup_p): Zero is only + a member of all_reggroup. + +2003-06-02 Richard Henderson + + * alpha-tdep.c (alpha_register_type): Change from _virtual_type. + (alpha_convert_flt_dbl, alpha_convert_dbl_flt): Remove. + (alpha_lds, alpha_sts): New. + (alpha_convert_register_p): Change from _register_convertible. + (alpha_register_to_value): Change from _convert_to_virtual; + restructure and fail for type sizes other than 4 or 8. + (alpha_value_to_register): Similarly. + (alpha_extract_return_value): Use alpha_sts. + (alpha_store_return_value): Use alpha_lds. + (alpha_gdbarch_init): Update hooks. + +2003-06-02 Richard Henderson + + * alpha-tdep.c (alpha_register_virtual_type): Use alpha-specific + regnum identifiers. + (alpha_sigtramp_register_address): Likewise. + +2003-06-02 Richard Henderson + + * alpha-tdep.c (alpha_supply_int_regs, alpha_fill_int_regs): New. + (alpha_supply_fp_regs, alpha_fill_fp_regs): New. + * alpha-tdep.h: Declare them. + + * alpha-nat.c (fetch_osf_core_registers): Constify core_reg_mapping. + Remove zerobuf. Don't error on UNIQUE. + (fetch_elf_core_registers): Use alpha_supply_{int,fp}_regs. + (ALPHA_REGSET_UNIQUE): Provide default. + (supply_gregset): Use alpha_supply_int_regs. + (fill_gregset): Use alpha_fill_int_regs. + (supply_fpregset): Use alpha_supply_fp_regs. + (fill_fpregset): Use alpha_fill_fp_regs. + * alphabsd-tdep.c (NUM_GREGS, NUM_FPREGS): Remove. + (alphabsd_supply_reg): Use alpha_supply_int_regs. + (alphabsd_fill_reg): Use alpha_fill_int_regs. + (alphabsd_supply_fpreg): Use alpha_supply_fp_regs. + (alphabsd_fill_fpreg): Use alpha_fill_fp_regs. + * config/alpha/nm-linux.h (ALPHA_REGSET_UNIQUE): New. + +2003-06-02 Richard Henderson + + * alpha-tdep.c (alpha_store_return_value): Avoid switch fallthru. + + * alpha-tdep.c (alpha_extract_return_value): Use internal_error. + (alpha_store_return_value): Likewise. + +2003-06-02 David Carlton + + * block.c (contained_in): Add 'const' to arguments. + (block_function): Ditto. + * block.h: Update declarations for block_function and + contained_in. + +2003-06-02 David Carlton + + * objc-lang.c (find_imps): Delete unneeded variable 'sym_symtab'. + * c-valprint.c (c_val_print): Delete unneeded variable 's'. + * p-valprint.c (pascal_val_print): Ditto. + * ada-lang.c (standard_lookup): Delete unneded variable 'symtab'. + +2003-06-02 Richard Henderson + + * alpha-tdep.c (alpha_push_dummy_call): Use + builtin_type_ieee_double_little instead of builtin_type_double. + + * alpha-tdep.c (alpha_push_dummy_call): Handle ABI mandated + sign-extension of 32-bit values. + (alpha_store_return_value): Similarly. + + * alpha-tdep.c (alpha_push_dummy_call): Handle COMPLEX types. + (alpha_extract_return_value): Likewise. + (alpha_store_return_value): Likewise. + + * alpha-tdep.c (alpha_extract_return_value): Handle IEEE Quad floats. + (alpha_store_return_value): Error on IEEE Quad floats. + + * alpha-tdep.c (alpha_extract_return_value): Convert to regcache. + (alpha_extract_struct_value_address): Likewise. + (alpha_store_return_value): Likewise. + (alpha_store_struct_return): Remove. + (alpha_gdbarch_init): Update hook registration to match. + + * alpha-tdep.c (alpha_register_convert_to_virtual): Tidy use of + deprecated interfaces; use ALPHA_REGISTER_SIZE instead of gdbarch + macros where appropriate. + (alpha_register_convert_to_raw): Similarly. Use unpack_long. + (alpha_convert_flt_dbl, alpha_convert_dbl_flt): New. + + * alpha-tdep.c (alpha_register_virtual_type): Use void_data_ptr + for SP, GP; void_func_ptr for PC; non-language-specific types + for all others. + * alpha-tdep.h (ALPHA_GP_REGNUM): New. + +2003-06-02 Richard Henderson + + * top.h (lim_at_start): Declare. + * main.c (captured_main): Set it. + * top.c (lim_at_start): Define. + (command_loop): Use it instead of &environ. + * event-top.c (command_handler): Likewise. + +2003-06-01 Jason Thorpe + + * mipsnbsd-tdep.c: Update copyright years. + (fetch_core_registers): Correct arguments to mipsnbsd_supply_fpreg. + +2003-06-01 Richard Henderson + + * Makefile.in (ALLDEPFILES): Add alpha-mdebug-tdep.c. + (alpha-linux-tdep.o): Update dependencies. + (alpha-nat.o, alpha-tdep.o, alpha-mdebug-tdep.o): Likewise. + * alpha-mdebug-tdep.c: Remove unneeded includes. + +2003-06-01 Richard Henderson + + * alpha-tdep.c (alpha_register_reggroup_p): New. + (alpha_gdbarch_init): Register it. + +2003-06-02 Andrew Cagney + + * dwarfread.c: Eliminate "register" + (decode_die_type): Eliminate assignment within "if". + (struct_type, decode_array_element_type): Ditto. + (dwarf_read_array_type, read_tag_pointer_type): Ditto. + (read_subroutine_type, enum_type, add_enum_psymbol): Ditto. + (decode_modified_type, completedieinfo): Ditto. + * block.c: Eliminate "register". + (blockvector_for_pc_sect): Eliminate assignment within "if". + * cp-support.h (struct symbol): Opaque declaration. + * breakpoint.c (handle_gnu_v3_exceptions): Use xfree, not free. + +2003-06-01 Richard Henderson + + * alpha-tdep.c (alpha_gdbarch_init): Use set_gdbarch_print_insn ... + (_initialize_alpha_tdep): ... not deprecated_tm_print_insn. + +2003-06-01 Adam Fedor + + * gdbarch.sh (function_list): Add FETCH_POINTER_ARGUMENT. + * gdbarch.[ch]: Regenerate. + * hppa-tdep.c (hppa_fetch_pointer_argument): New function. + (hppa_gdbarch_init): Set it in the gdbarch vector. + * i386-tdep.c (i386_fetch_pointer_argument): New + (i386_gdbarch_init): Set it into gdbarch. + * rs6000-tdep.c (rs6000_fetch_pointer_argument): New. + (rs6000_gdbarch_init): Set it in gdbarch. + * sparc-tdep.c (sparc_fetch_pointer_argument): New + (sparc_gdbarch_init): Set it in gdbarch. + +2003-06-01 Andrew Cagney + + * defs.h (extract_address): Delete declaration. + * findvar.c (extract_address): Delete function. + * xstormy16-tdep.c (xstormy16_extract_return_value): Replace + extract_address with the inline equivalent, + extract_unsigned_integer. + (xstormy16_extract_struct_value_address): Ditto. + (xstormy16_pointer_to_address): Ditto. + * vax-tdep.c (vax_extract_struct_value_address): Ditto. + * v850-tdep.c (v850_push_arguments): Ditto. + (v850_extract_return_value): Ditto. + (v850_extract_struct_value_address): Ditto. + * sparcnbsd-tdep.c (sparcnbsd_get_longjmp_target_32): Ditto. + (sparcnbsd_get_longjmp_target_64): Ditto. + * sparc-tdep.c (sparc_frame_saved_pc): Ditto. + (get_longjmp_target): Ditto. + * sh-tdep.c (sh_extract_struct_value_address): Ditto. + (sh64_extract_struct_value_address): Ditto. + (sh_push_arguments): Ditto. + (sh64_push_arguments): Ditto. + * remote-vxsparc.c (vx_read_register): Ditto. + * ppc-linux-tdep.c (ppc_linux_skip_trampoline_code): Ditto. + * ns32k-tdep.c (ns32k_extract_struct_value_address): Ditto. + * mn10300-tdep.c (mn10300_extract_struct_value_address): Ditto. + * mipsv4-nat.c (get_longjmp_target): Ditto. + * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Ditto. + * mips-nat.c (get_longjmp_target): Ditto. + * mips-linux-tdep.c (mips_linux_get_longjmp_target): Ditto. + * mcore-tdep.c (mcore_extract_struct_value_address): Ditto. + * m68k-tdep.c (m68k_get_longjmp_target): Ditto. + * m68hc11-tdep.c (m68hc11_extract_struct_value_address): Ditto. + * irix5-nat.c (get_longjmp_target): Ditto. + * irix4-nat.c (get_longjmp_target): Ditto. + * ia64-tdep.c (generic_elf_find_global_pointer): Ditto. + (ia64_push_arguments): Ditto. + * hpux-thread.c (hpux_thread_store_registers): Ditto. + * h8300-tdep.c (h8300_push_arguments): Ditto. + (h8300_store_return_value): Ditto. + (h8300_extract_struct_value_address): Ditto. + * frv-tdep.c (frv_extract_struct_value_address): Ditto. + (frv_push_arguments): Ditto. + * avr-tdep.c (avr_pointer_to_address): Ditto. + (avr_push_arguments): Ditto. + * arm-tdep.c (arm_push_dummy_call): Ditto. + (arm_get_longjmp_target): Ditto. + * arm-linux-tdep.c (arm_linux_push_arguments): Ditto. + * alpha-tdep.c (alpha_extract_struct_value_address): Ditto. + (alpha_get_longjmp_target): Ditto. + + * solib-irix.c (extract_mips_address): Inline extract_address, + replacing it with extract_signed_integer. + * solib-svr4.c (SOLIB_EXTRACT_ADDRESS): Ditto. + (LM_NAME, IGNORE_FIRST_LINK_MAP_ENTRY): Ditto. + (first_link_map_member, open_symbol_file_object): Ditto. + (svr4_fetch_objfile_link_map, svr4_fetch_objfile_link_map): Ditto. + * solib-sunos.c (SOLIB_EXTRACT_ADDRESS): Ditto. + (LM_NEXT, LM_NAME): Ditto. + +2003-06-01 Richard Henderson + + * alpha-tdep.h (ALPHA_FP_REGNUM): Remove. + * alpha-tdep.c (alpha_register_name): Remove vfp entry. + (alpha_cannot_fetch_register): Remove ALPHA_FP_REGNUM. + (alpha_cannot_store_register): Likewise. + * alphabsd-nat.c (fetch_inferior_registers): Don't set FP_REGNUM. + * alpha-nat.c (supply_gregset): Likewise. + * alphanbsd-tdep.c (fetch_core_registers): Likewise. + +2003-06-01 Andrew Cagney + + * infcall.c (call_function_by_hand): Update comment on + DEPRECATED_DUMMY_WRITE_SP. + + * mips-tdep.c (mips_gdbarch_init): Do not set + deprecated_dummy_write_sp. + (mips_eabi_push_dummy_call): Set the SP register. + (mips_o64_push_dummy_call): Set the SP register. + (mips_o32_push_dummy_call): Set the SP register. + (mips_n32n64_push_dummy_call): Set the SP register. + +2003-06-01 Richard Henderson + + * alpha-nat.c (fetch_osf_core_registers): Use ALPHA_REGISTER_SIZE + instead of ALPHA_MAX_REGISTER_RAW_SIZE. + (supply_gregset): Likewise. + * alpha-tdep.c (alpha_store_return_value): Likewise. + (alpha_get_longjmp_target): Likewise. + (alpha_register_name): Constify array. + (alpha_gdbarch_init): Remove deprecated_fp_regnum, + deprecated_register_size, deprecated_register_bytes, + deprecated_max_register_raw_size, deprecated_max_register_virtual_size. + * alpha-tdep.h (ALPHA_MAX_REGISTER_RAW_SIZE): Remove. + (ALPHA_MAX_REGISTER_VIRTUAL_SIZE): Remove. + +2003-06-01 Richard Henderson + + * alpha-tdep.c (alpha_push_dummy_call): Store sp. Tidy copies + from arg_reg_buffer to regcache to avoid double conversion. + +2003-06-01 Mark Kettenis + + * i386-linux-nat.c (child_resume): Use I386_ESP_REGNUM instead of + SP_REGNUM. + * i386-linux-tdep.c (i386_linux_sigcontext_addr): Likewise. + * i386bsd-tdep.c (i386bsd_sigcontext_addr): Likewise. + +2003-06-01 Richard Henderson + + * dwarf2-frame.c (struct dwarf2_cie): Add saw_z_augmentation. + (decode_frame_entry): Set it. Skip FDE augmentation. + +2003-06-01 Richard Henderson + + * dwarf2-frame.c (dwarf2_frame_cache): Handle retaddr_column + not overlapping PC_REGNUM. + +2003-06-01 Richard Henderson + + * alpha-tdep.c (alpha_push_dummy_call): Transmography from + alpha_push_arguments. Don't dump argument register data to + the target stack. Fix float and 128-bit long double semantics. + Store $t12 and $ra as specified by the ABI. Use regcache everywhere. + (alpha_fix_call_dummy): Remove. + (alpha_call_dummy_words): Remove. + (alpha_gdbarch_init): Kill deprecated call hooks; add push_dummy_call. + +2003-06-01 Richard Henderson + + * alpha-linux-tdep.c (alpha_linux_init_abi): Install dwarf2 unwinder. + +2003-06-01 Andrew Cagney + + * mips-tdep.c (is_mips16_addr): New function. + (make_mips16_addr, unmake_mips16_addr): New functions. + (pc_is_mips16, mips_fetch_instruction): Use. + (gdb_print_insn_mips, mips_breakpoint_from_pc): Use. + (gdb_print_insn_mips): Eliminate TM_PRINT_INSN_MACH. + (mips_dump_tdep): Delete print of TM_PRINT_INSN_MACH, + UNMAKE_MIPS16_ADDR, MAKE_MIPS16_ADDR, IS_MIPS16_ADDR and + TARGET_MIPS. + * config/mips/tm-mips.h: Update copyright. + (TARGET_MIPS, TM_PRINT_INSN_MACH): Delete. + (DEPRECATED_REGISTER_SIZE, DEPRECATED_REGISTER_BYTES): Delete. + (IS_MIPS16_ADDR, MAKE_MIPS16_ADDR, UNMAKE_MIPS16_ADDR): Delete. + * config/mips/tm-irix6.h (DEPRECATED_REGISTER_BYTES): Delete. + (TM_PRINT_INSN_MACH): Delete. + * config/mips/tm-irix5.h (DEPRECATED_REGISTER_BYTES): Delete. + + * configure.tgt: Replace mips64*vr4xxx*el-*-elf*, + mips64*vr4xxx*-*-elf*, mips64*vr4300*el-*-elf*, + mips64*vr4300*-*-elf*, mips64*vr4100*el-*-elf*, + mips64*vr4100*-*-elf*, mips64*vr5000*el-*-elf*, and + mips64*vr5000*-*-elf* with mips64 mips64*vr*-*-elf*. Delete + mips*tx39*el*-elf*. Map mips*-sony-* and mips64*-big-* onto + mips64. Map mips*-dec-*, mips*-big-*, mips*-little-*, + mips*-*-riscos* and mips*-*-sysv* onto mips. + * config/mips/mips64.mt: New file. + * config/mips/mips.mt: New file. + * config/mips/littlemips.mt: Delete file. + * config/mips/decstation.mt: Delete file. + * config/mips/vr4300el.mt: Delete file. + * config/mips/vr5000el.mt: Delete file. + * config/mips/vr5000.mt: Delete file. + * config/mips/vr4100.mt: Delete file. + * config/mips/vr4xxxel.mt: Delete file. + * config/mips/vr4300.mt: Delete file. + * config/mips/vr4xxx.mt: Delete file. + * config/mips/bigmips.mt: Delete file. + * config/mips/bigmips64.mt: Delete file. + * config/mips/tx39l.mt (TM_FILE): Set to "tm-tx39.h". + * config/mips/embedl64.mt (TM_FILE): Set to "tm-mips64.h". + * config/mips/embed64.mt (TM_FILE): Set to "tm-mips64.h" + * config/mips/embedl.mt (TM_FILE): Set to "tm-mips.h". + * config/mips/tm-tx39.h: Include "tm-mips.h" instead of + "tm-bigmips.h". + * config/mips/tm-irix3.h: Ditto. + * config/mips/tm-mipsv4.h: Ditto. + * config/mips/tm-embed.h: Ditto. + * config/mips/tm-irix6.h: Include "tm-mips64.h" instead of + "tm-bigmips64.h". + * config/mips/tm-vr5000el.h: Delete file. + * config/mips/tm-tx39l.h: Delete file. + * config/mips/tm-vr4300el.h: Delete file. + * config/mips/tm-vr4xxxel.h: Delete file. + * config/mips/tm-vr4300.h: Delete file. + * config/mips/tm-vr4100.h: Delete file. + * config/mips/tm-vr4xxx.h: Delete file. + * config/mips/tm-vr5000.h: Delete file. + * config/mips/tm-embedl64.h: Delete file. + * config/mips/tm-embedl.h: Delete file. + * config/mips/tm-embed64.h: Delete file. + * config/mips/tm-bigmips64.h: Delete file. + * config/mips/tm-bigmips.h: Delete file. + +2003-06-01 Mark Kettenis + + Fix gdb/1216. + * shnbsd-nat.c: Include "sh-tdep.h". + + From Richard Henderson : + * dwarf2-frame.c (dwarf2_frame_state_alloc_regs): Fix ptr arithmetic. + +2003-05-31 Andrew Cagney + + * mips-tdep.c (set_reg_offset): Add saved_regs parameter. Add + forward declaration. + (mips16_heuristic_proc_desc): Pass temp_saved_regs. + (mips16_heuristic_proc_desc): Pass temp_saved_regs. + (mips_find_saved_regs): Use set_reg_offset. + (mips_frame_init_saved_regs): Delete function. + (mips_pop_frame): Call mips_find_saved_regs instead of + DEPRECATED_FRAME_INIT_SAVED_REGS. + +2003-05-31 Andrew Cagney + + * mips-tdep.c (mips_gdbarch_init): Do not set + deprecated_max_register_raw_size, register_virtual_size, and + deprecated_max_register_virtual_size. + +2003-05-31 Mark Kettenis + + * i386-tdep.c: Include "dwarf2-frame.h". + (i386_gdbarch_init): Hook in the DWARF CFI frame unwinder. + * Makefile.in (i386-tdep.o): Update dependencies. + + * dwarf2-frame.c, dwarf2-frame.h: New files. + * Makefile.in (SFILES): Add dwarf2-frame.c. + (dwarf2_frame_h): Define. + (COMMON_OBS): Add dwarf2-frame.o. + (dwarf2-frame.o): Add dependencies. + +2003-05-31 Andreas Jaeger + + * x86-64-linux-nat.c: Fix comment. + +2003-05-31 Mark Kettenis + + * x86-64-tdep.c (x86_64_push_dummy_call): Adjust for changed + function signature. + + * i386-tdep.c (i386_sigtramp_frame_p): Only handle frames if we + have a sigcontext_addr handler. + * x86-64-tdep.c (x86_64_sigtramp_frame_p): Assert that we have a + sigcontext_addr handler. + +2003-05-31 Andrew Cagney + + * mips-tdep.c (print_gp_register_row): Replace do_gp_register_row. + (print_fp_register_row): Replace do_fp_register_row. + (mips_print_fp_register): Add "file" and "frame" parameters. + (mips_print_register): Add "file" and "frame" parameters. + (mips_print_registers_info): Replace mips_do_registers_info. + (mips_gdbarch_init): Set print_registers_info instead of + deprecated_do_registers_info. + (mips_read_fp_register_single): Add "frame" parameter. + (mips_read_fp_register_double): Add "frame" parameter. + +2003-05-31 Mark Kettenis + + * i386-tdep.c (i386_register_name): Check for MMX registers first. + Fixes a bug where GDB would print the wrong register names for + targets without SSE. + + * x86-64-tdep.c (X86_64_NUM_SAVED_REGS): Set to X86_64_NUM_GREGS. + (x86_64_sigtramp_frame_cache): Use `sc_reg_offset' to find saved + registers. + + * x86-64-linux-tdep.c (x86_64_linux_sc_reg_offset): New variable. + (x86_64_linux_init_abi): Initialize TDEP->sc_reg_offset and + TDEP->sc_num_regs instead of TDEP->sc_pc_offset and + TDEP->sc_sp_offset. + + From Michal Ludvig : + * i386-tdep.h (struct gdbarch_tdep): Add members `sc_reg_offset' + and `sc_num_regs'. + (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, + I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, + I386_ST0_REGNUM): Move here from... + * i386-tdep.c: ... here. + (I386_NUM_SAVED_REGS): Define to I386_NUM_REGS. + (i386_sigtramp_frame_cache): Use `sc_reg_offset' to find saved + registers if possible. + (i386_gdbarch_init): Initialize TDEP->sc_reg_offset. + * i386bsd-tdep.c (i386bsd_sc_pc_offset, i386bsd_sc_sp_offset): + Remove variables. + (i386bsd_sc_reg_offset): New variable. + (i386bsd_init_abi): Initialize TDEP->sc_reg_offset and + TDEP->sc_num_regs instead of TDEP->sc_pc_offset and + TDEP->sc_sp_offset. + (i386fbsd_sc_reg_offset): New variable. + (i386fbsdaout_init_abi): Initialize TDEP->sc_reg_offset and + TDEP->sc_num_regs. + (i386fbsd4_sc_pc_offset, i386fbsd4_sc_sp_offset): Remove + variables. + (i386fbsd4_sc_reg_offset): New variable. + (i3864bsd4_init_abi): Initialize TDEP->sc_reg_offset and + TDEP->sc_num_regs instead of TDEP->sc_pc_offset and + TDEP->sc_sp_offset. + * i386-linux-tdep.c (i386_linux_sc_reg_offset): New variable. + (i386_linux_init_abi): Set TDEP->sc_reg_offset and TDEP->sc_num_regs. + * i386nbsd-tdep.c (i386nbsd_sc_pc_offset, i386nbsd_sc_sp_offset): + Remove variables. + (i386nbsd_sc_reg_offset): New variable. + (i386nbsd_init_abi): Initialize TDEP->sc_reg_offset and + TDEP->sc_num_regs instead of TDEP->sc_pc_offset and + TDEP->sc_sp_offset. + * i386obsd-tdep.c (i386obsd_sc_pc_offset, i386obsd_sc_sp_offset): + Remove variables. + (i386obsd_sc_reg_offset): New variable. + (i386obsd_init_abi): Initialize TDEP->sc_reg_offset and + TDEP->sc_num_regs instead of TDEP->sc_pc_offset and + TDEP->sc_sp_offset. + * i386bsd-nat.c (_initialize_i386bsd_nat): Adjust for changes in + i386bsd-tdep.c, i386nbsd-tdep.c and i386obsd-tdep.c. Add check + for frame pointer offset in `struct sigcontext'. + +2003-05-31 Andrew Cagney + + * mips-tdep.c (mips_gdbarch_init): Do not set the deprecated + architecture methods call_dummy_words, sizeof_call_dummy_words, + push_return_address, store_struct_return, and fix_call_dummy. Set + push_dummy_call instead of deprecated_push_arguments. + (mips_store_struct_return): Delete function. + (mips_fix_call_dummy): Delete function. + (mips_push_return_address): Delete function. + (mips_eabi_push_dummy_call): Replace mips_eabi_push_arguments, set + RA_REGNUM and T9_REGNUM. + (mips_n32n64_push_dummy_call): Ditto for + mips_n32n64_push_arguments. + (mips_o32_push_dummy_call): Ditto for mips_o32_push_arguments. + (mips_o64_push_dummy_call): Ditto for mips_o64_push_arguments. + +2003-05-31 Andrew Cagney + + * gdbarch.sh (PUSH_DUMMY_CALL): Add "func_addr" parameter. Rename + "dummy_addr" to "bp_addr". + * infcall.c (call_function_by_hand): Pass "funaddr" to + gdbarch_push_dummy_call. + * gdbarch.h, gdbarch.c: Re-generate. + * i386-tdep.c (i386_push_dummy_call): Update. + * arm-tdep.c (arm_push_dummy_call): Update. + * d10v-tdep.c (d10v_push_dummy_call): Update. + +2003-05-31 Mark Kettenis + + * x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove + variable declarations. + (x86_64_register_number, x86_64_register_name): Remove prototypes. + (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, + x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, + x86_64_init_frame_pc, x86_64_init_frame_pc, + x86_64_function_has_prologue): Remove prototypes. + (X86_64_NUM_GREGS): New define. + (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. + * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include + "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". + (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, + XMM1_REGNUM): Remove defines. + (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, + X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, + X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, + X86_64_XMM1_REGNUM): New defines. + (struct x86_64_register_info): Renamed from `struct + register_info'. Remove `size' member. + (x86_64_register_info_table): Remove variable. + (x86_64_register_info): New variable. + (X86_64_NUM_REGS): New define. + (X86_64_NUM_GREGS): Remove define. + (x86_64_num_regs, x86_64_num_gregs): Remove variables. + (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): + Remove variables. + (x86_54_dwarf2_reg_to_regnum): Remove function. + (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. + (x86_64_dwarf_reg_to_regnum): New function. + (x86_64_register_name): Rewrite. + (x86_64_register_raw_size): Remove function. + (x86_64_register_byte_table): Remove variable. + (x86_64_register_byte): Remove function. + (x86_64_register_virtual_type): Remove function. + (x86_64_register_type): New function. + (x86_64_register_convertible, x86_64_register_convert_to_virtual, + x86_64_register_convert_to_raw): Remove functions. + (x86_64_push_return_address, x86_64_pop_frame): Remove functon. + (x86_64_use_struct_convention): Make static. Adjust for renamed + defines. + (x86_64_frame_init_saved_regs): Remove function. + (x86_64_push_arguments): Make static. Change to accept a regcache + as argument. + (x86_64_store_return_value, x86_64_extract_return_value): Make + static. Rewrite based on i386 counterparts. + (x86_64_push_dummy_call): New function. + (X86_64_NUM_SAVED_REGS): New define. + (x86_64_register_number): Remove function. + (x86_64_store_struct_return): Remove function. + (x86_64_frameless_function_invocation, + x86_64_function_has_prologue): Remove functions. + (PROLOG_BUFSIZE): Remove define. + (struct x86_64_frame_cache): New structure. + (x86_64_alloc_frame_cache, x86_64_analyze_prologue, + x86_64_frame_cache, x86_64_frame_this_id, + x86_64_frame_prev_register, x86_64_frame_p, + x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, + x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New + functions. + (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New + variables. + (x86_64_skip_prologue): Rewrite in terms of + x86_64_analyze_prologue. + (x86_64_frame_base_address): New function. + (x86_64_frame_base): New variable. + (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. + (x86_64_init_abi): Set register_type and push_dummy_call. Don't + set deprecated_fp_regnum, deprecated_register_size, + deprecated_register_bytes, register_raw_size, register_byte, + register_virtual_type, register_convertiable, + register_convert_to_virtual, convert_to_raw, + deprecated_get_saved_register, deprecated_target_read_fp, + deprecated_push_arguments, deprecated_push_return_address, + deprecated_pop_frame, deprecated_store_struct_return, + deprecated_frame_init_saved_regs, deprecated_frame_chain, + frameless_function_invocation, deprecated_frame_saved_pc, + deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, + dwarf2_build_frame_info, deprecated_init_extra_frame_info, + deprecated_init_frame_pc and virtual_frame_pointer. Call + frame_unwind_append_predicate to register x86_64_sigtramp_frame_p + and x86_64_frame_p. Call frame_base_set_default to register + x86_64_frame_base. + (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. + (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. + (_initialize_x86_64_tdep): Remove function. + * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". + (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, + LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't + define. + (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. + (x86_64_linux_sigcontext_addr): Rewrite. + (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, + x86_64_linux_frame_saved_pc): Remove functions. + (x86_64_linux_pc_in_sigtramp): Renamed from + x86_64_linux_in_sigtramp. Try harder to recognize a signal + trampoline. + (x86_64_linux_frame_chain, x86_64_init_frame_pc): + Remove_functions. + (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize + TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. + * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. + (x86_64_regmap): Rename to regmap. + (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of + x86_64_num_gregs. + (supply_gregset, fill_gregset): Likewise. Use regmap instead of + x86_64_regmap. + (x86_64_fxsave_offset): Remove function. + (supply_fpregset): Simply call x86_64_supply_fxsave. + (fill_fpregset): Simply call x86_64_fill_fxsave. + (fetch_inferior_registers, store_inferior_registers): Avoid + asignment in if-statement. + (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, + SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, + LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. + (fetch_core_registers): Remove function. + (linux_elf_core_fns): Remove. + (offsetoff): Don't define. + (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. + * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. + * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, + add core-regset.o. + * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for + protection against multiple includes instead of NM_X86_64_h. Add + various comments. Include "config/nm-linux.h". Don't include + . + (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, + GET_THREAD_SIGNALS): Remove defines. + (x86_64_register_u_addr, kernel_u_size, + lin_thread_get_thread_signals): Remove prototypes. + (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. + [HAVE_LINK_H]: Don't include "solib.h". + [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. + * config/i386/tm-x86-64linux.h: Fix comments. + * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, + x86-64-tdep.o): Update dependencies. + +2003-05-30 Andrew Cagney + + * config/sparc/tm-sparc.h (sparc_extract_struct_value_address): + Change parameter type to a "struct regcache *". + + * gdbarch.sh: Regardless of the multi-arch level, always define + the macro when not already defined. + * gdbarch.h, gdbarch.c: Re-generate. + +2003-05-30 Richard Henderson + + * alpha-mdebug-tdep.c (alpha_mdebug_frame_p): Reject prologues. + (alpha_mdebug_frame_unwind_cache): Don't call the heuristic unwinder. + (alpha_mdebug_frame_this_id): Likewise. + (alpha_mdebug_frame_prev_register): Likewise. + (alpha_mdebug_frame_base_address): Likewise. + (alpha_mdebug_frame_locals_address): Likewise. + (alpha_mdebug_frame_args_address): Likewise. + (struct alpha_mdebug_unwind_cache): Remove in_prologue_cache. + * alpha-tdep.c (alpha_heuristic_proc_start): Use get_pc_function_start. + (alpha_heuristic_frame_unwind_cache): Make static; add missing + loop increment. + (alpha_heuristic_frame_this_id): Make static. + (alpha_heuristic_frame_prev_register): Likewise. + (alpha_heuristic_frame_base_address): Likewise. + * alpha-tdep.h: Update. + +2003-05-30 Mark Kettenis + + * i386-tdep.h (i386bsd_sigcontext_addr): Remove prototype. + (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS): Remove + defenitions. + (IS_FP_REGNUM, IS_SSE_REGNUM): Remove definitions. + * i386-tdep.c: Mark functions that are 64-bit safe as such. + (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, + I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, + I386_ST0_REGNUM): New defines. + (CODESTREAM_BUFSIZ, codestream_tell, codestream_peek, + codestream_get): Remove define. + (codestream_next_addr, condestream_addr, condestream_buf, + codestream_off, codestream_cnt): Remove variables. + (codestream_fill, codestream_seek, codestream_read): Remove + functions. + (i386_follow_jump): Rewrite to avoid usage of removed codestream + functionality. + (i386_get_frame_setup, i386_frameless_signal_p, i386_frame_chain, + i386_sigtramp_saved_pc, i386_sigtramp_saved_sp, + i386_frame_saved_pc, i386_saved_pc_after_call, + i386_frame_num_args, i386_frame_init_saved_regs, + i386_push_return_address, i386_do_pop_frame, i386_pop_frame, + i386_push_arguments): Remove functions. + (i386_skip_prologue): Rewrite to avoid usage of removed codestream + functionality. Use i386_analyze_prologue instead of + i386_get_frame_setup. + (I386_NUM_SAVED_REGS): New define. + (struct i386_frame_cache): New structure. + (i386_alloc_frame_cache, i386_analyze_struct_return, + i386_skip_probe, i386_analyze_frame_setup, + i386_analyze_register_saves, i386_analyze_prologue, + i386_unwind_pc, i386_frame_cache, i386_frame_this_id, + i386_frame_prev_register, i386_sigtramp_frame_cache, + i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register, + i386_frame_p, i386_sigtramp_frame_p, i386_frame_base_address, + i386_unwind_dummy_id, i386_save_dummy_tos, i386_push_dummy_call): + New functions. + (i386_frame_unwind, i386_sigtramp_frame_unwind, i386_frame_base): + New variables. + (LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM): Define in terms of + I386_EAX_REGNUM and I386_EDX_REGNUM. + (i386_extract_return_value, i386_store_return_value): Use + I386_ST0_REGNUM where appropriate. + (i386_extract_struct_value_address): Rewrite to use extract_address. + (i386_svr4_pc_in_sigtramp): Add comment. + (i386_svr4_sigcontext_addr): Rewrite. + (i386_svr4_init_abi): Adjust TDEP->sc_pc_offset and + TDEP->sc_sp_offset. + (i386_gdbarch_init): Don't set deprecated_init_frame_pc. Set + sp_regnum, fp_regnum, pc_regnum, ps_regnum and fp0_regnum in terms + of new defines. Set push_dummy_call, don't set + deprecated_push_arguments, deprecated_push_return_address, + deprecated_pop_frame. Don't set parm_boundary. Don't set + deprecated_frame_chain, deprecated_frame_saved_pc, + deprecated_saved_pc_after_call. Set unwind_dummy_id, + save_dummy_frame_tos, unwind_pc. Call + frame_unwind_append_predicate and frame_base_set_default. Don't + set deprecated_dummy_write_pc. Don't set deprecated_fp_regnum. + Don't set frameless_function_invocation. Don't set + deprecated_register_bytes, deprecated_register_size, + deprecated_call_dummy_words and deprecated_sizeof_call_dummy. + * i386-linux-tdep.c: Fix formatting in some comments. + (LINUX_SIGTRAMP_INSN0, LINUX_SIGTRAMP_OFFSET0, + LINUX_SIGTRAMP_INSN1, LINUX_SIGTRAMP_OFFSET1, + LINUX_SIGTRAMP_INSN2, LINUX_SIGTRAMP_OFFSET2, + LINUX_RT_SIGTRAMP_INSN0, LINUX_RT_SIGTRAMP_OFFSET0, + LINUX_RT_SIGTRAMP_INSN1, LINUX_RT_SIGTRAMP_OFFSET1): Drop + redundant parentheses. + (I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): New define. + (i386_linux_sigcontext_addr): Use it. Rewrite. + (find_minsym_and_objfile): Change name of second argument. + (skip_gnu_resolver): Renamed from skip_hurd_resolver. All callers + changed. Use frame_pc_unwind instead of + DEPRECATED_SAVED_PC_AFTER_CALL. + (i386_linux_init_abi): Don't set deprecated_register_bytes. + * i386bsd-tdep.c (i386bsd_sigcontext_addr): Rewrite. + * i386-nto-tdep.c (i386nto_sigcontext_addr): Adapt for new frame + unwinder. + * i386-cygwin-tdep.c: Don't include "gdbcore.h", "frame.h" and + "dummy-frame.h". + (i386_cygwin_frame_chain_valid, i386_cygwin_frame_chain): Removed. + (_initialize_i386_cygwin_tdep): New prototype. + (i386_cygwin_init_abi): Don't set deprecated_frame_chain and + deprecated_frame_chain_valid. + * i386-sol2-tdep.c (i386_sol2_init_abi): Don't set + TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. + Rely on the SVR4 defaults. + * config/i386/i386sol2.mt (TDEPFILES): Remove i386bsd-tdep.o. + * Makefile.in (i386-tdep.o, i386-cygwin-tdep.o): Update dependencies. + +2003-05-30 Andrew Cagney + + * infcall.c (call_function_by_hand): Always call + DEPRECATED_FIX_CALL_DUMMY, even for AT_ENTRY_POINT case. + +2003-05-30 Richard Henderson + + * alpha-tdep.c (alpha_heuristic_frame_unwind_cache): Fix loop + increment. + +2003-05-29 Jim Blandy + + Use gdbarch methods for solib stuff on PowerPC Linux. + * config/powerpc/tm-linux.h (IN_SOLIB_CALL_TRAMPOLINE, + SKIP_TRAMPOLINE_CODE): #undef these, so the gdbarch methods will + show through. + * ppc-linux-tdep.c (ppc_linux_init_abi): Register + IN_SOLIB_CALL_TRAMPOLINE and SKIP_TRAMPOLINE_CODE methods here, + giving the same effect as the #definitions above. + +2003-05-29 Adam Fedor + + * objc-lang.c (CONVERT_FUNCPTR): Remove macro + (find_implementation_from_class): Replace it with the standard + case i.e. do nothing. + +2003-05-29 Richard Henderson + + * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): New. + (alpha_linux_sigtramp_offset): Use it. Make static. + (alpha_linux_sigcontext_addr): Handle __NR_rt_sigreturn; + update for new frame model. + * alpha-mdebug-tdep.c: New file. + * alpha-osf1-tdep.c (alpha_call_dummy_address): Move from alpha-tdep.c. + (alpha_osf1_init_abi): Install it. + * alpha-tdep.c (PROC_*): Move to alpha-mdebug-tdep.c. + (linked_proc_desc_table): Remove. + (alpha_frame_past_sigtramp_frame): Remove. + (alpha_dynamic_sigtramp_offset): Remove. + (ALPHA_PROC_SIGTRAMP_MAGIC): Remove. + (alpha_proc_desc_is_dyn_sigtramp): Remove. + (alpha_set_proc_desc_is_dyn_sigtramp): Remove. + (push_sigtramp_desc): Remove. + (alpha_cannot_fetch_register): Use ALPHA_FP_REGNUM. + (alpha_cannot_store_register): Likewise. + (alpha_sigcontext_addr): Remove. + (alpha_find_saved_regs): Remove. + (alpha_frame_init_saved_regs): Remove. + (alpha_init_frame_pc_first): Remove. + (read_next_frame_reg): Remove. + (alpha_frame_saved_pc): Remove. + (alpha_saved_pc_after_call): Remove. + (temp_proc_desc, temp_saved_regs): Remove. + (alpha_about_to_return): Remove. + (cached_proc_desc): Remove. + (alpha_frame_chain): Remove. + (alpha_print_extra_frame_info): Remove. + (alpha_init_extra_frame_info): Remove. + (alpha_frame_locals_address): Remove. + (alpha_frame_args_address): Remove. + (alpha_push_arguments): Use ALPHA_REGISTER_BYTES not sizeof CORE_ADDR. + (alpha_push_dummy_frame): Remove. + (alpha_pop_frame): Remove. + (alpha_after_prologue): Rename from after_prologue; remove mdebug bits. + (alpha_read_insn): New. + (alpha_skip_prologue): Merge alpha_skip_prologue_internal; adjust + for different insn encodings. + (alpha_in_lenient_prologue): Remove. + (struct alpha_sigtramp_unwind_cache): New. + (alpha_sigtramp_frame_unwind_cache): New. + (alpha_sigtramp_register_address): New. + (alpha_sigtramp_frame_this_id): New. + (alpha_sigtramp_frame_prev_register): New. + (alpha_sigtramp_frame_unwind): New. + (alpha_sigtramp_frame_p): New. + (struct alpha_heuristic_unwind_cache): New. + (alpha_heuristic_proc_start): Rename from heuristic_proc_start; + don't count nop insns that occur between functions. + (alpha_heuristic_frame_unwind_cache): New; incorporate much of + heuristic_proc_desc, but without the mdebug wrapping. + (alpha_heuristic_frame_this_id): New. + (alpha_heuristic_frame_prev_register): New. + (alpha_heuristic_frame_unwind): New. + (alpha_heuristic_frame_p): New. + (alpha_heuristic_frame_base_address): New. + (alpha_heuristic_frame_base): New. + (alpha_unwind_dummy_id): New. + (alpha_unwind_pc): New. + (alpha_gdbarch_init): Don't set skip_sigtramp_frame. Kill use of + frame related deprecated initializations; install replacements. + (alpha_dump_tdep): Remove. + * alpha-tdep.h (struct gdbarch_tdep): Remove skip_sigtramp_frame. + (alpha_read_insn, alpha_after_prologue, + alpha_heuristic_frame_unwind_cache, alpha_heuristic_frame_this_id, + alpha_heuristic_frame_prev_register, + alpha_heuristic_frame_base_address, alpha_mdebug_init_abi): Declare. + * config/alpha/alpha-linux.mt (TDEPFILES): Add alpha-mdebug-tdep.o. + * config/alpha/tm-alpha.h (PRINT_EXTRA_FRAME_INFO): Remove. + * config/alpha/tm-alphalinux.h (SIGTRAMP_START, SIGTRAMP_END): Remove. + +2003-05-29 Andrew Cagney + + * gdb_assert.h (gdb_assert_fail): Provide different definitions + dependant on the availability of ASSERT_FUNCTION. + (ASSERT_FUNCTION): Do not define when there is no function name. + +2003-05-29 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (skip_prologue): Improve support for 64-bit code. + +2003-05-28 Jim Blandy + + * ppc-linux-nat.c (store_altivec_registers): Don't cast fourth + argument to ptrace to int; the system headers should give it the + right type, and pointers don't fit in ints on powerpc64-*-*. + +2003-05-28 H.J. Lu + + * dwarf2read.c (process_die): Handle DW_TAG_try_block and + DW_TAG_catch_block. + +2003-05-26 Elena Zannoni + + * stabsread.c (dbx_lookup_type): Make static. + (read_type): Ditto. + (add_undefined_type): Ditto. + * stabsread.h (dbx_lookup_type, read_type, add_undefined_type): Do + not export. + +2003-05-26 Elena Zannoni + + * hpread.c (hpread_has_name): Make static. + (hpread_psymtab_to_symtab): Ditto. + (file_exists): Ditto. + (hpread_call_pxdb): Ditto. + (hpread_pxdb_needed): Ditto. + (hpread_quick_traverse): Ditto. + (hpread_get_header): Ditto. + (hpread_get_lntt): Ditto. + (hpread_get_slt): Ditto. + (class_of): Ditto. + +2003-05-25 Andreas Schwab + + * m68k-tdep.c (m68k_gdbarch_init): Set parm_boundary instead of + stack_align and deprecated_extra_stack_alignment_needed. + (m68k_stack_align): Delete. + + * m68k-tdep.c (m68k_register_raw_size): Remove cast. + (m68k_register_virtual_size): Likewise. + (altos_skip_prologue): Remove obsolete function. + (isi_frame_num_args): Likewise. + (news_frame_num_args): Likewise. + (m68k_fix_call_dummy): Make static. + (m68k_push_dummy_frame): Likewise. + (m68k_pop_frame): Likewise. + (m68k_skip_prologue): Likewise. + (m68k_frame_init_saved_regs): Likewise. + (m68k_saved_pc_after_call): Likewise. + (m68k_get_longjmp_target): Make multi-arch. + (m68k_gdbarch_init): Allocate and initialize gdbarch_tdep + structure. Register m68k_get_longjmp_target if enabled. + * m68k-tdep.h (struct gdbarch_tdep): Define. + * config/m68k/tm-m68k.h: Don't include "regcache.h". + + * Makefile.in (config.status): Also depend on configure.tgt + and configure.host. + (m68klinux-tdep.o): Update dependencies. + * configure.tgt (m68*-*-linux*): Set gdb_multi_arch to 1. + * m68klinux-tdep.c (M68K_LINUX_JB_ELEMENT_SIZE): Define. + (M68K_LINUX_JB_PC): Define. + (m68k_linux_pc_in_sigtramp): Renamed from m68k_linux_in_sigtramp + and take additional parameter. + (m68k_linux_sigtramp_saved_pc): Update. + (m68k_linux_init_abi): Set jb_pc and jb_elt_size. Register + m68k_linux_pc_in_sigtramp, in_plt_section, + find_solib_trampoline_target. + * config/m68k/tm-linux.h: Don't include any tm headers. + (START_INFERIOR_TRAPS_EXPECTED): Remove definition. + (JB_ELEMENT_SIZE): Likewise. + (JB_PC): Likewise. + (GET_LONGJMP_TARGET): Likewise. + (IN_SIGTRAMP): Likewise. + (SVR4_SHARED_LIBS): Define this and include "solib.h". + +2003-05-25 Mark Kettenis + + * sparc-tdep.c (sparc32_do_push_arguments): New function. + (sparc32_push_arguments): Re-implement by calling + sparc32_do_push_arguments. + +2003-05-25 Mark Kettenis + + * sparc-tdep.c (SPARC_F0_REGNUM, SPARC_F1_REGNUM, SPARC_O0_REGNUM, + SPARC_O1_REGNUM): New defines. + (sparc32_extract_return_value): Rewrite to operate on a regcache. + (sparc32_store_return_value): New function. + (sparc_extract_struct_value_address): Rewrite to operate on a + regcache. + (sparc_gdbarch_init): Don't set + deprecated_extract_struct_value_address. Set + extract_struct_value_address instead. Don't set + deprecated_extract_return_value and deprecated_store_return_value + for 32-bit targets. Set extract_return_value and + store_return_value instead. + * config/sparc/tm-sparc.h (DEPRECATED_STORE_RETURN_VALUE, + DEPRECTAED_EXTRACT_RETURN_VALUE, + DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Don't define these. + (STORE_RETURN_VALUE, EXTRACT_RETURN_VALUE, + EXTRACT_STRUCT_VALUE_ADDRESS): Define these instead. + (sparc_store_return_value): Remove prototype. + (sparc32_store_return_value): New prototype. + (sparc32_extract_return_value, sparc_extract_struct_value_address): + Adjust prototypes. + +2003-05-24 Mark Kettenis + + * sparcnbsd-tdep.c: Include "gdb_string.h". + +2003-05-23 Andrew Cagney + + * p-valprint.c (pascal_val_print): Replace extract_address with + the inline equivalent extract_unsigned_integer. + * jv-valprint.c (java_value_print): Ditto. + * ada-valprint.c (ada_val_print_1): Ditto. + * ada-lang.h (EXTRACT_ADDRESS): Ditto. + +2003-05-23 Theodore A. Roth + + * blockframe.c (frameless_look_for_prologue): Remove unused + after_prologue variable. + +2003-05-23 Mark Kettenis + + * blockframe.c (get_pc_function_start): Rewrite to avoid + asignments in if-statements. + +2003-05-23 Raoul Gough + + Committed by Elena Zannoni . + * coffread.c(coff_symtab_read): Do relocate static symbols from PE + files, don't relocate absolute symbols (and do use mst_abs). + +2003-05-23 Andrew Cagney + + * objc-lang.c: Include "gdb_assert.h". + (objc_op_print_tab): Use OP_NULL and PREC_NULL instead of 0. + (CHECK, CHECK_FATAL, __CHECK_FUNCTION): Delete macros. + (gdb_check, gdb_check_fatal): Delete functions. + (read_objc_methlist_method): Replace CHECK and CHECK_FATAL with + gdb_assert. + (parse_selector, parse_method, find_methods, find_imps): Ditto. + * Makefile.in (objc-lang.o): Update dependencies. + 2003-06-16 David Carlton * symfile.h: Change formatting. @@ -213,7 +3087,7 @@ * c-exp.y (typebase): Remove duplicate occurence of `SIGNED_KEYWORD LONG LONG'. Use builtin_type_long_long instead - of lookup_signed_typename. + of lookup_signed_typename. 2003-05-18 Mark Kettenis @@ -360,13 +3234,13 @@ * Makefile.in (cp-valprint.o): Update dependencies. 2003-05-15 Jeff Johnston - + * ia64-tdep.c: Increase max_skip_non_prologue_insns to 40. (examine_prologue): Support looking through leaf functions, knowing - they start with mov r2,r12. Support skipping over indirect stores - of the input registers. Upon hitting a non-nop branch instruction - or predicated instruction, bail out by setting lim_pc to the current - pc value in the loop. At the end, if the lim_pc value is still + they start with mov r2,r12. Support skipping over indirect stores + of the input registers. Upon hitting a non-nop branch instruction + or predicated instruction, bail out by setting lim_pc to the current + pc value in the loop. At the end, if the lim_pc value is still beyond our calculated value and we have trust_limit set, use the lim_pc value. @@ -393,12 +3267,12 @@ declaration. 2003-05-15 David Carlton - - Committed by Elena Zannoni - * symtab.c (lookup_symbol_aux): Delete calls to - lookup_symbol_aux_minsyms. - (lookup_symbol_aux_minsyms): Comment out function and - prototype. Delete lookup by mangled name. + + Committed by Elena Zannoni + * symtab.c (lookup_symbol_aux): Delete calls to + lookup_symbol_aux_minsyms. + (lookup_symbol_aux_minsyms): Comment out function and + prototype. Delete lookup by mangled name. 2003-05-14 Kevin Buettner @@ -595,9 +3469,9 @@ * avr-tdep.c (avr_remote_translate_xfer_address): Ditto. 2003-05-07 Jeff Johnston - - * dwarf2read.c (dwarf_decode_lines): Only use output of - check_cu_functions() when calling record_line(). Do not update + + * dwarf2read.c (dwarf_decode_lines): Only use output of + check_cu_functions() when calling record_line(). Do not update the current address. 2003-05-07 Andrew Cagney @@ -637,7 +3511,7 @@ * gdbarch.h, gdbarch.c: Re-generate. * remote.c (remote_xfer_memory): Use gdbarch_remote_translate_xfer_address. - + 2003-05-07 Jeff Johnston * infrun.c (prev_pc): Move declaration ahead of proceed(). @@ -703,7 +3577,7 @@ * config/tm-qnxnto.h: New file. * config/i386/i386nto.mt: New file. * config/i386/tm-i386nto.h: New file. - + 2003-05-04 Andrew Cagney * gdbthread.h (save_infrun_state): Drop prev_func_name parameter. @@ -726,7 +3600,7 @@ that REGISTER_BYTE is consistent with the regcache. * gdbarch.sh (REGISTER_BYTE): Add a predicate. * gdbarch.h, gdbarch.c: Regenerate. - + 2003-05-04 Mark Kettenis * i387-tdep.c (fxsave_offset): Add entries for %xmm8-%xmm15. @@ -775,7 +3649,7 @@ (print_formatted): Call gdb_print_insn, instead of print_insn. * Makefile.in (printcmd.o): Update dependencies. (mcore-tdep.o, d10v-tdep.o): Ditto. - + 2003-05-02 Andrew Cagney * std-regs.c (value_of_builtin_frame_pc_reg): Delete #ifdef @@ -1174,7 +4048,7 @@ 2003-04-24 Adam Fedor - * objc-lang.c (FETCH_ARGUMENT, CONVERT_FUNCPTR): Remove + * objc-lang.c (FETCH_ARGUMENT, CONVERT_FUNCPTR): Remove architecture dependant compilation and mark as unimplemented (until they get put in the gdbarch vector). @@ -1188,7 +4062,7 @@ * infcall.c (call_function_by_hand): Eliminate redundant indentation. Move "saved_async" and "old_cleanups" to where they are needed. - + 2003-04-23 Andrew Cagney * infcall.c (call_function_by_hand): Eliminate the variables "rc" @@ -1199,7 +4073,7 @@ * infcall.c (call_function_by_hand): Move variables "start_sp", "dummy", "sizeof_dummy1" and "dummy1" and corresponding dummy call code to ON_STACK switch branch. - + 2003-04-23 Andrew Cagney * infcall.c (call_function_by_hand): Make declaration of "i", @@ -1230,7 +4104,7 @@ * config/pa/tm-hppa.h (SOFT_FLOAT): Delete this macro. Update all the tests using SOFT_FLOAT considering the fact that - this macro was always set to 0. + this macro was always set to 0. * config/pa/tm-hppa64.h: Update all the tests using SOFT_FLOAT considering the fact that this macro was always set to 0. * hppa-tdep.h (hppa_store_return_value): Likewise. @@ -1312,7 +4186,7 @@ (i386_fp_regnum_p, i386_fpc_regnum_p, i386_sse_regnum_p, i386_mxcsr_regnum_p): Remove redundant parentheses. (i386_register_name): Use i386_num_register_names. - + * i386-tdep.c (i386_extract_return_value, i386_store_return_value): Correct check for availability of floating-point registers. @@ -1338,7 +4212,7 @@ 2003-04-18 Jim Blandy * s390-tdep.c (s390_frame_align): New function. - (s390_gdbarch_init): Register it with the gdbarch object. + (s390_gdbarch_init): Register it with the gdbarch object. 2003-04-17 Richard Henderson @@ -1349,22 +4223,46 @@ Committed by Elena Zannoni * gdb_gcore.sh: New script to create a core dump of a process. - + 2003-04-17 Elena Zannoni * values.c (value_being_returned): Don't fetch the return - value if the return type is void. + value if the return type is void. 2003-04-17 Jeff Johnston * thread-db.c: Reindented. - + 2003-04-17 Jeff Johnston - - * gdb_indent.sh: Recognize td_thrhandle_t, td_event_msg_t, - td_thr_events_t, td_notify_t, td_thr_iter_f, and td_thrinfo_t + + * gdb_indent.sh: Recognize td_thrhandle_t, td_event_msg_t, + td_thr_events_t, td_notify_t, td_thr_iter_f, and td_thrinfo_t as types. + + + + + + + + + + + + + + + + + + + + + + + + 2003-04-16 Kevin Buettner * rs6000-tdep.c (rs6000_gdbarch_init): For the SysV ABI, set @@ -1737,7 +4635,7 @@ * alpha-tdep.c (alpha_init_frame_pc_first): Update. * x86-64-tdep.h (x86_64_linux_saved_pc_after_call): Update declaration. - + 2003-04-11 Andrew Cagney * i387-tdep.c: Update copyright. @@ -1913,7 +4811,7 @@ 2003-04-08 Elena Zannoni - * infrun.c (stop_soon): Rename from stop_soon_quietly. + * infrun.c (stop_soon): Rename from stop_soon_quietly. (struct inferior_status): Rename stop_soon_quietly field to stop_soon. (clear_proceed_status): Rename stop_soon_quietly to stop_soon. (start_remote): Ditto. @@ -1922,7 +4820,7 @@ (restore_inferior_status): Ditto. * infcmd.c (attach_command): Ditto. * fork-child.c (startup_inferior): Ditto. - * inferior.h (stop_soon): Rename from stop_soon_quietly. + * inferior.h (stop_soon): Rename from stop_soon_quietly. * alpha-tdep.c (heuristic_proc_start): Ditto. * mips-tdep.c (heuristic_proc_start): Ditto. * solib-svr4.c (svr4_solib_create_inferior_hook): Ditto. @@ -1956,11 +4854,11 @@ 2003-04-07 Elena Zannoni * disasm.c (dump_insns): Move variables inside loop, or they will - be freed more than once, causing wild memory corruptions. + be freed more than once, causing wild memory corruptions. (gdb_disassembly): Look for the substring "-thread", - instead of "-threads" in the target name, to make sure to find - the 'multi-thread' target. Also, make sure we do the right thing - with the "core" target. + instead of "-threads" in the target name, to make sure to find + the 'multi-thread' target. Also, make sure we do the right thing + with the "core" target. 2003-04-07 Kevin Buettner @@ -2100,7 +4998,7 @@ * frame-unwind.h: Include "frame.h". (struct frame_unwind): Add "type" field. * Makefile.in (frame_unwind_h): Add $(frame_h). - + 2003-04-04 Andrew Cagney * x86-64-tdep.c (x86_64_unwind_dummy_id): Use frame_id_build. @@ -2121,9 +5019,9 @@ 2003-04-04 Elena Zannoni - * x86-64-tdep.c (x86_64_push_arguments): Handle correctly the - signed integer case. - (classify_argument): Handle enumerations and references. + * x86-64-tdep.c (x86_64_push_arguments): Handle correctly the + signed integer case. + (classify_argument): Handle enumerations and references. 2003-04-04 Andrew Cagney @@ -2161,15 +5059,15 @@ * language.c (language_demangle): New function. (unk_lang_demangle): Likewise. (unknown_language_defn, auto_language_defn, local_language_defn): - Add ukn_lang_demangle. + Add ukn_lang_demangle. * ada-lang.c (ada_language_defn): Add NULL for la_demangle element. - * f-lang.c, m2-lang.c, p-lang.c, scm-lang.c: Likewise. + * f-lang.c, m2-lang.c, p-lang.c, scm-lang.c: Likewise. * c-lang.c (c_language_defn, asm_language_defn): Likewise. (cplus_language_defn): Add cplus_demangle for la_demangle element. * jv-lang.c (java_demangle): New function (java_language_defn): Use it for la_demangle element. - * objc-lang.c (objc_demangle): Add options argument - (objc_language_defn): Use objc_demangle for la_demangle element. + * objc-lang.c (objc_demangle): Add options argument + (objc_language_defn): Use objc_demangle for la_demangle element. * maint.c (maintenance_demangle): Replace switch with call to language_demangle. * utils.c (fprintf_symbol_filtered): Likewise. @@ -2196,13 +5094,13 @@ (d10v_frame_this_id): Use the previous frame's inner most stack address and this frame's func address for the frame ID. Use frame_id_build. Don't analyze beyond the current instruction. - + 2003-04-01 Andrew Cagney * frame.h (get_frame_locals_address, get_frame_args_address): Refer to the base address, instead of the address of the first local or parameter. - + 2003-04-01 Andrew Cagney Add frame debug info addresses: @@ -2403,7 +5301,7 @@ 2003-03-30 Andrew Cagney 2002-11-10 Klee Dienes - * value.h (struct value): Update comment. + * value.h (struct value): Update comment. 2003-03-30 Andrew Cagney @@ -2452,7 +5350,7 @@ * valops.c (hand_function_call): Replace TARGET_WRITE_SP with DEPRECATED_DUMMY_WRITE_SP. Call when the method is available, instead of when push_dummy_call is not available. - + 2003-03-30 Andrew Cagney * infttrace.c: Include "gdbthread.h". @@ -2492,7 +5390,7 @@ * gdbarch.sh (CALL_DUMMY_WORDS, SIZEOF_CALL_DUMMY_WORDS): Always define. * gdbarch.h: Regenerate. - + 2003-03-29 Andrew Cagney * infttrace.h: New file. @@ -2562,7 +5460,7 @@ 2003-03-28 Bob Rossi - * MAINTAINERS (write after approval): Add myself. + * MAINTAINERS (write after approval): Add myself. 2003-03-27 Theodore A. Roth @@ -2576,7 +5474,7 @@ TARGET_WRITE_SP. * sparc-tdep.c (sparc_push_dummy_frame): Ditto. (sparc_pop_frame): Ditto. - + 2003-03-27 Andrew Cagney * NEWS: Mention removal of support for hppa*-*-bsd* and @@ -2718,7 +5616,7 @@ * cris-tdep.c (cris_gdbarch_init): Ditto. * m68k-tdep.c (m68k_gdbarch_init): Ditto. * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. - + 2003-03-25 Andrew Cagney * gdbarch.sh (DEPRECATED_STORE_STRUCT_RETURN): Replace @@ -2750,7 +5648,7 @@ * avr-tdep.c (avr_gdbarch_init): Update. * arm-tdep.c (arm_gdbarch_init): Update. * alpha-tdep.c (alpha_gdbarch_init): Update. - + 2003-03-25 Andrew Cagney * gdbarch.sh (CALL_DUMMY_STACK_ADJUST_P): Delete. @@ -2884,7 +5782,7 @@ * arm-tdep.c (show_arm_command): Don't print out help. Instead, show the current setting of each value. (_initialize_arm_tdep): Delete variable new_cmd and add new vars - new_set and new_show. Use add_setshow_cmd_full and + new_set and new_show. Use add_setshow_cmd_full and add_setshow_boolean_cmd as appropriate. Deprecate "set/show apcs32" commands and add new version as subcommands of "set/show arm". @@ -2896,7 +5794,7 @@ (num_disassembly_options): Renamed from num_flavor_options. (valid_disassembly_styles): Renamed from valid_flavors. (disassembly_style): Renamed from disassembly_flavor. - (set_disassembly_style_sfunc): Renamed from + (set_disassembly_style_sfunc): Renamed from set_disassembly_flavor_sfunc. (set_disassembly_style): Renamed from set_disassembly_flavor. (arm_othernames): Updated. @@ -3150,7 +6048,7 @@ * frame.c (frame_register): Update. (get_saved_register): Update. * config/sparc/tm-sparc.h (DEPRECATED_GET_SAVED_REGISTER): Update. - + 2003-03-13 Andrew Cagney * gdbarch.sh (DEPRECATED_POP_FRAME): Replace POP_FRAME. @@ -3191,12 +6089,12 @@ 2003-03-13 D. Venkatasubramanian - * MAINTAINERS (write after approval): Alphabetically + * MAINTAINERS (write after approval): Alphabetically listing corrected. 2003-03-13 D. Venkatasubramanian - * MAINTAINERS (write after approval): Add myself. + * MAINTAINERS (write after approval): Add myself. 2003-03-12 Andrew Cagney @@ -3297,7 +6195,7 @@ * config/pa/tm-hppa.h (DEPRECATED_FRAME_SAVED_PC): Update. * config/m68k/tm-delta68.h (DEPRECATED_FRAME_SAVED_PC): Update. * config/m68k/tm-linux.h (DEPRECATED_FRAME_SAVED_PC): Update. - + 2003-03-12 Andrew Cagney Eliminate the need for POP_FRAME. @@ -3442,7 +6340,7 @@ * config/pa/tm-hppa.h (DEPRECATED_FRAME_SAVED_PC): Update. * config/m68k/tm-delta68.h (DEPRECATED_FRAME_SAVED_PC): Update. * config/m68k/tm-linux.h (DEPRECATED_FRAME_SAVED_PC): Update. - + 2003-03-10 Andrew Cagney * gdbarch.sh (gdbarch_unwind_pc): New method. @@ -3490,7 +6388,7 @@ * gdbarch.sh: Don't generate two macro definitions when an undefined macro taking no arguments. * gdbarch.h: Regenerate. - + 2002-03-07 Michal Ludvig * x86-64-tdep.c (x86_64_save_dummy_frame_tos) @@ -3500,7 +6398,7 @@ 2003-03-07 Michal Ludvig * x86-64-tdep.c (x86_64_function_has_prologue): New function. - (x86_64_skip_prologue): Move prologue detection to + (x86_64_skip_prologue): Move prologue detection to separate function. * x86-64-tdep.h (x86_64_function_has_prologue): New prototype. @@ -3513,7 +6411,7 @@ * gdbarch.sh (unwind_dummy_id): New multi-arch method with predicate. * gdbarch.h, gdbarch.c: Regneerate. - + 2003-03-05 Andrew Cagney * d10v-tdep.c (struct d10v_unwind_cache): Add field "base". @@ -3761,7 +6659,7 @@ 2003-03-02 Stephane Carrez - * arch-utils.c (generic_register_byte): Fix to use the loop index + * 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 @@ -3810,13 +6708,13 @@ * 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 * 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 * main.c (captured_main): Replace magic option characters with an @@ -3985,7 +6883,7 @@ * 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 * mips-tdep.c (show_mips_abi): New function. @@ -3993,9 +6891,9 @@ command ``show mips abi''. 2003-02-26 Jeff Johnston - + From Elena Zannoni - * dbxread.c (process_one_symbol): Only record line 0 if one or + * 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 @@ -4194,7 +7092,7 @@ 2003-02-20 Adam Fedor * objc-lang.h (find_methods): Remove declaration. - * objc-lang.c (find_methods): Make static. + * objc-lang.c (find_methods): Make static. 2003-02-20 Christopher Faylor @@ -4248,24 +7146,24 @@ * 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. + * 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. + * 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. + (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. + (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. @@ -4390,10 +7288,10 @@ 2003-02-18 Elena Zannoni From Jim Ingham : - * 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. + * 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 @@ -4405,10 +7303,10 @@ instead of the absence of the "nm.h" file, to determine of the configuration non-native. * configure: Regenerate. - + 2003-02-14 Elena Zannoni - From Brian Ford + From Brian Ford * cli/cli-decode.c (lookup_cmd_composition) [TUI]: Properly conditionalize tui_active test. @@ -4446,8 +7344,8 @@ 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. + * symmisc.c (print_objfile_statistics): Include information about + the number of psymtabs and symtabs in each object file. 2003-02-13 Keith R Seitz @@ -4675,7 +7573,7 @@ * sol-thread.c, hpux-thread.c: Include "gdb_stat.h" instead of . * Makefile.in (sol-thread.o, hpux-thread.o): Update dependencies. - + 2003-02-06 Andrew Cagney * Makefile.in (symm-nat.o): Update dependencies. @@ -4731,11 +7629,11 @@ * infttrace.c (threads_continue_all_but_one): Fix precedence problem with '&' and '!='. (threads_continue_all_with_signals): Ditto. - + 2003-02-05 Jim Ingham - Keith Seitz - Elena Zannoni - Andrew Cagney + Keith Seitz + Elena Zannoni + Andrew Cagney * Makefile.in (SUBDIR_CLI_OBS): Add "cli-interp.o". (SUBDIR_CLI_SRCS): Add "cli/cli-interp.c". @@ -4826,7 +7724,7 @@ 2003-02-04 Andrew Cagney - * NEWS: Note that the m32r-*-elf* is obsolete. + * NEWS: Note that the m32r-*-elf* is obsolete. * monitor.c (monitor_expect): Obsolete reference to m32r. * configure.tgt: Mark m32r-*-elf* as obsolete. * MAINTAINERS: Mark m32k as obsolete. @@ -4950,7 +7848,7 @@ (allocate_objfile): Call it. * objfiles.h (terminate_minimal_symbol_table): New declaration. (ALL_MSYMBOLS): No need to test whether (objfile)->msymbols is - non-NULL. + non-NULL. * minsyms.c (lookup_minimal_symbol_by_pc_section): To see whether objfile has minimal symbols, compare minimal_symbol_count to zero, instead of comparing msymbols with NULL. @@ -4958,7 +7856,7 @@ * solib-sunos.c (solib_add_common_symbols): Call terminate_minimal_symbol_table. * symfile.c (reread_symbols): Same. - + 2003-02-03 Kevin Buettner * s390-tdep.c (s390_address_class_type_flags) @@ -4975,7 +7873,7 @@ * dwarf2cfi.c (pointer_encoding): Added new parameter. * dwarf2cfi.c, dwarf2read.c: Changed all warnings and - error messages to contain BFD filename. + error messages to contain BFD filename. 2003-02-02 Elena Zannoni @@ -4994,14 +7892,14 @@ From Kevin Buettner : * ui-out.h (make_cleanup_ui_out_table_begin_end): New function. - * ui-out.c (make_cleanup_ui_out_table_begin_end) - (do_cleanup_table_end): New functions. - * breakpoint.c (print_it_typical, print_one_breakpoint, mention): - Use cleanups to invoke_ui_out_tuple_end(). - (breakpoint_1): Use cleanup to invoke ui_out_table_end(). + * ui-out.c (make_cleanup_ui_out_table_begin_end) + (do_cleanup_table_end): New functions. + * breakpoint.c (print_it_typical, print_one_breakpoint, mention): + Use cleanups to invoke_ui_out_tuple_end(). + (breakpoint_1): Use cleanup to invoke ui_out_table_end(). * cli/cli-setshow.c (cmd_show_list): Use make_cleanup_ui_out_tuple_begin_end. - + 2003-02-02 Andrew Cagney * frame.c (frame_unwind_register): New function. @@ -5035,8 +7933,8 @@ 2003-02-01 Andrew Cagney From 2002-11-09 Jason Molenda (jason-cl@molenda.com) - * stack.c (print_frame_info_base): Output complete FRAME tuple - for synthesized frames. + * stack.c (print_frame_info_base): Output complete FRAME tuple + for synthesized frames. 2003-02-02 Andrew Cagney @@ -5088,7 +7986,7 @@ (som_solib_add): Use. * hppa-tdep.c (hppa_pointer_to_address_hack): New function. * hppa-tdep.c (unwind_command): Use. - + 2003-02-01 Andrew Cagney * gdb_dirent.h: Mark up valid uses of , d_namelen and @@ -5140,7 +8038,7 @@ * objc-exp.y, c-exp.y, f-exp.y: Remove PTR casts. * utils.c: Update comments documenting legitimate uses of PTR. - + * utils.c: Re-indent. * config/djgpp/fnchange.lst: Delete nindy files. @@ -5185,7 +8083,7 @@ elfstab_build_psymtabs. * gdb-stabs.h (struct dbx_symfile_info): Add stab_section. (DBX_STAB_SECTION): New macro. - * stabsread.h (elfstab_build_psymtabs): Update prototype. + * stabsread.h (elfstab_build_psymtabs): Update prototype. * symfile.c (symfile_dummy_outputs): New function. (symfile_relocate_debug_section): New function. * symfile.h (symfile_relocate_debug_section): Add prototype. @@ -5270,7 +8168,7 @@ Daniel Jacobowitz Fix PR gdb/961. - * dwarf2read.c (dwarf_ranges_offset, dwarf_ranges_size): New + * dwarf2read.c (dwarf_ranges_offset, dwarf_ranges_size): New variables. (RANGES_SECTION): New. (dwarf_ranges_buffer): New variable. @@ -5423,7 +8321,7 @@ now pass in either a `struct section_addr_info' list to say where each section is loaded, or a `struct section_offsets' table. Pass these new arguments through to syms_from_objfile as appropriate. - (symbol_file_add): Just call symbol_file_add_with_addrs_or_offsets, + (symbol_file_add): Just call symbol_file_add_with_addrs_or_offsets, with the appropriate quiescent values for the new arguments. * symfile.c: #include "gdb_assert.h". @@ -5573,7 +8471,7 @@ (COMMON_OBS): Add frame-unwind.o. (frame-unwind.o): Specify dependencies. (frame.o, dummy-frame.o): Update dependencies. - + 2003-01-18 Andrew Cagney * ada-valprint.c: Eliminate PTR. @@ -5584,7 +8482,7 @@ * remote-mips.c, remote-sds.c, remote-vx.c: Ditto. * solib-svr4.c, solib.c, stack.c, symfile.c, symfile.h: Ditto. * symmisc.c, v850ice.c, xcoffread.c, cli/cli-script.c: Ditto. - + 2003-01-17 Andrew Cagney * main.c (captured_main): Don't use PTR. @@ -5629,7 +8527,7 @@ * breakpoint.c (until_break_command): Add new argument. Use it to decide whether to stop only at the current frame or not. * breakpoint.h (until_break_command): Update prototype. - * infcmd.c (until_command): Add new argument to until_break_command + * infcmd.c (until_command): Add new argument to until_break_command call. (advance_command): New function. (_initialize_infcmd): Update help string for 'until' command. @@ -5670,7 +8568,7 @@ * buildsym.c (start_subfile): Obsolete comment pertinent to Cfront. Update copyright year. * dbxread.c(struct cont_elem): Obsolete. - (process_later, process_now): Obsolete functions. + (process_later, process_now): Obsolete functions. (read_dbx_symtab, read_ofile_symtab): Obsolete cfront support. Update copyright year. * gdbtypes.c (INIT_EXTRA, ADD_EXTRA): Obsolete macros. @@ -5960,7 +8858,7 @@ * ns32k-tdep.c, s390-tdep.c, sh-tdep.c, sparc-tdep.c: Ditto. * v850-tdep.c, vax-tdep.c, x86-64-linux-tdep.c: Ditto. * xstormy16-tdep.c: Ditto. - + 2003-01-07 Andrew Cagney * alpha-tdep.c: Use get_frame_base. @@ -5972,7 +8870,7 @@ * x86-64-linux-tdep.c, xstormy16-tdep.c: Ditto. * config/h8500/tm-h8500.h, config/mn10200/tm-mn10200.h: Ditto. * config/sparc/tm-sparc.h: Ditto. - + 2003-01-07 Andrew Cagney * frame.c (deprecated_get_frame_context): New function. @@ -5981,7 +8879,7 @@ (deprecated_set_frame_context): Declare. * dwarf2cfi.c (UNWIND_CONTEXT): Use deprecated_get_frame_context. (cfi_init_extra_frame_info): Use deprecated_set_frame_context. - + 2003-01-07 Andrew Cagney * frame.c (deprecated_set_frame_next_hack): New function. @@ -6087,7 +8985,7 @@ 2003-01-06 Michal Ludvig - * x86-64-linux-nat.c (i386_sse_regnum_p): Deleted. Not needed anymore + * x86-64-linux-nat.c (i386_sse_regnum_p): Deleted. Not needed anymore since it is in i386-tdep.c. 2003-01-06 J. Brobecker @@ -6418,7 +9316,7 @@ * avr-tdep.c, cris-tdep.c: Ditto. * mcore-tdep.c, mips-tdep.c, mn10200-tdep.c: Ditto. * sh-tdep.c, sparc-tdep.c, v850-tdep.c: Ditto. - + 2003-01-03 Mark Kettenis * configure.in: Remove --enable-netrom option. @@ -6441,7 +9339,7 @@ subscripts. Remove evil changequotes here. * acconfig.h (TARGET_CPU_DEFAULT): Remove. * config.in, configure: Regenerated. - + * acconfig.h (DEFAULT_BFD_ARCH, DEFAULT_BFD_VEC): Remove. * configure.in: Cleanup section that sources GDB and BFD configure subscripts. Remove evil changequotes here. @@ -6458,7 +9356,7 @@ * s390-tdep.c, sh-tdep.c, sparc-tdep.c, v850-tdep.c: Ditto. * vax-tdep.c, x86-64-linux-tdep.c, xstormy16-tdep.c: Ditto. * z8k-tdep.c: Ditto. - + 2003-01-02 Mark Kettenis * configure.in: Remove UI_OUT configuration code. diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS index 08af70eac6f..078038eb081 100644 --- a/gdb/MAINTAINERS +++ b/gdb/MAINTAINERS @@ -252,7 +252,7 @@ testsuite (Global Maintainers) Mark Salter msalter@redhat.com gdbtk (gdb.gdbtk) Keith Seitz keiths@redhat.com c++ (gdb.c++) Michael Chastain mec@shout.net - David Carlton carlton@math.stanford.edu + David Carlton carlton@kealia.com mi tests (gdb.mi) Elena Zannoni ezannoni@redhat.com Andrew Cagney cagney@redhat.com stabs (gdb.stabs) Elena Zannoni ezannoni@redhat.com @@ -315,7 +315,7 @@ Joel Brobecker brobecker@act-europe.fr Dave Brolley brolley@redhat.com Kevin Buettner kevinb@redhat.com Andrew Cagney ac131313@redhat.com -David Carlton carlton@math.stanford.edu +David Carlton carlton@kealia.com Stephane Carrez stcarrez@nerim.fr Michael Chastain mec@shout.net Eric Christopher echristo@redhat.com @@ -327,6 +327,7 @@ Klee Dienes kdienes@apple.com Richard Earnshaw rearnsha@arm.com Frank Ch. Eigler fche@redhat.com Ben Elliston bje@redhat.com +Raoul Gough RaoulGough@yahoo.co.uk Anthony Green green@redhat.com Matthew Green mrg@eterna.com.au Chris Faylor cgf@redhat.com @@ -351,6 +352,7 @@ Mark Kettenis kettenis@gnu.org Jim Kingdon jkingdon@engr.sgi.com ++ Jonathan Larmour jlarmour@redhat.co.uk Jeff Law law@redhat.com +David Lecomber david@streamline-computing.com Robert Lipe rjl@sco.com H.J. Lu hjl@lucon.org Michal Ludvig mludvig@suse.cz diff --git a/gdb/Makefile.in b/gdb/Makefile.in index efa3a7ba1e5..bd09ea57b37 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -400,7 +400,7 @@ SER_HARDWIRE = @SER_HARDWIRE@ # The `remote' debugging target is supported for most architectures, # but not all (e.g. 960) -REMOTE_OBS = remote.o dcache.o remote-utils.o tracepoint.o ax-general.o ax-gdb.o +REMOTE_OBS = remote.o dcache.o remote-utils.o tracepoint.o ax-general.o ax-gdb.o remote-fileio.o # This is remote-sim.o if a simulator is to be linked in. SIM_OBS = @@ -513,8 +513,8 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.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-namespace.c cp-valprint.c \ - dbxread.c demangle.c dictionary.c disasm.c doublest.c \ - dummy-frame.c dwarfread.c dwarf2expr.c dwarf2loc.c dwarf2read.c \ + dbxread.c demangle.c dictionary.c disasm.c doublest.c dummy-frame.c \ + dwarfread.c dwarf2expr.c dwarf2loc.c dwarf2read.c dwarf2-frame.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-base.c \ @@ -535,12 +535,14 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ objc-exp.y objc-lang.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 \ + regcache.c reggroups.c remote.c remote-fileio.c \ scm-exp.c scm-lang.c scm-valprint.c \ sentinel-frame.c \ serial.c ser-unix.c source.c \ stabsread.c stack.c std-regs.c symfile.c symmisc.c symtab.c \ - target.c thread.c top.c tracepoint.c typeprint.c \ + target.c thread.c top.c tracepoint.c \ + trad-frame.c \ + typeprint.c \ tui/tui.c tui/tui.h tui/tuiCommand.c tui/tuiCommand.h \ tui/tuiData.c tui/tuiData.h tui/tuiDataWin.c tui/tuiDataWin.h \ tui/tuiDisassem.c tui/tuiDisassem.h tui/tuiGeneralWin.c \ @@ -639,9 +641,12 @@ dummy_frame_h = dummy-frame.h dwarf2cfi_h = dwarf2cfi.h dwarf2expr_h = dwarf2expr.h dwarf2loc_h = dwarf2loc.h +dwarf2_frame_h = dwarf2-frame.h environ_h = environ.h event_loop_h = event-loop.h event_top_h = event-top.h +exc_request_U_h = exc_request_U.h +exc_request_S_h = exc_request_S.h expression_h = expression.h $(symtab_h) $(doublest_h) f_lang_h = f-lang.h frame_h = frame.h @@ -680,6 +685,7 @@ jv_lang_h = jv-lang.h kod_h = kod.h language_h = language.h linespec_h = linespec.h +linux_nat_h = linux-nat.h m2_lang_h = m2-lang.h m68k_tdep_h = m68k-tdep.h macroexp_h = macroexp.h @@ -691,7 +697,10 @@ minimon_h = minimon.h mips_tdep_h = mips-tdep.h mipsnbsd_tdep_h = mipsnbsd-tdep.h monitor_h = monitor.h +msg_reply_S_h = msg_reply_S.h +msg_U_h = msg_U.h nbsd_tdep_h = nbsd-tdep.h +notify_S_h = notify_S.h ns32k_tdep_h = ns32k-tdep.h objc_lang_h = objc-lang.h objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h) @@ -704,10 +713,12 @@ parser_defs_h = parser-defs.h $(doublest_h) ppc_tdep_h = ppc-tdep.h ppcnbsd_tdep_h = ppcnbsd-tdep.h proc_utils_h = proc-utils.h +process_reply_S_h = process_reply_S.h regcache_h = regcache.h reggroups_h = reggroups.h remote_utils_h = remote-utils.h $(target_h) remote_h = remote.h +remote_fileio_h = remote-fileio.h scm_lang_h = scm-lang.h $(scm_tags_h) scm_tags_h = scm-tags.h sentinel_frame_h = sentinel-frame.h @@ -724,18 +735,20 @@ source_h = source.h sparcnbsd_tdep_h = sparcnbsd-tdep.h srec_h = srec.h stabsread_h = stabsread.h +stack_h = stack.h symfile_h = symfile.h symtab_h = symtab.h target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h) terminal_h = terminal.h top_h = top.h +trad_frame_h = trad-frame.h infttrace_h = infttrace.h tracepoint_h = tracepoint.h typeprint_h = typeprint.h ui_file_h = ui-file.h ui_out_h = ui-out.h valprint_h = valprint.h -value_h = value.h $(doublest_h) $(symtab_h) $(gdbtypes_h) $(expression_h) +value_h = value.h $(doublest_h) $(frame_h) $(symtab_h) $(gdbtypes_h) $(expression_h) varobj_h = varobj.h $(symtab_h) $(gdbtypes_h) vax_tdep_h = vax-tdep.h version_h = version.h @@ -838,7 +851,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 \ - block.o symtab.o symfile.o symmisc.o linespec.o \ + block.o symtab.o symfile.o symmisc.o linespec.o dictionary.o \ infcall.o \ infcmd.o infrun.o \ expprint.o environ.o stack.o thread.o \ @@ -854,7 +867,7 @@ COMMON_OBS = version.o block.o blockframe.o breakpoint.o findvar.o regcache.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 \ + dwarf2expr.o dwarf2loc.o dwarf2-frame.o \ c-lang.o f-lang.o objc-lang.o \ ui-out.o cli-out.o \ varobj.o wrapper.o \ @@ -871,7 +884,8 @@ COMMON_OBS = version.o block.o blockframe.o breakpoint.o findvar.o regcache.o \ frame-base.o \ gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o cp-support.o \ cp-namespace.o \ - reggroups.o + reggroups.o \ + trad-frame.o OBS = $(COMMON_OBS) $(ANNOTATE_OBS) @@ -1158,7 +1172,7 @@ config.h: stamp-h ; @true stamp-h: config.in config.status CONFIG_HEADERS=config.h:config.in $(SHELL) config.status -config.status: configure +config.status: configure configure.tgt configure.host $(SHELL) config.status --recheck force: @@ -1356,7 +1370,7 @@ ALLDEPFILES = \ aix-thread.c \ alpha-nat.c alphabsd-nat.c \ alpha-tdep.c alpha-linux-tdep.c alphabsd-tdep.c alphanbsd-tdep.c \ - alpha-osf1-tdep.c alphafbsd-tdep.c \ + alpha-osf1-tdep.c alphafbsd-tdep.c alpha-mdebug-tdep.c \ arm-linux-nat.c arm-linux-tdep.c arm-tdep.c \ armnbsd-nat.c armnbsd-tdep.c \ avr-tdep.c \ @@ -1389,7 +1403,7 @@ ALLDEPFILES = \ ppc-sysv-tdep.o ppc-linux-nat.c ppc-linux-tdep.c \ ppcnbsd-nat.o ppcnbsd-tdep.o \ procfs.c \ - remote-array.c remote-e7000.c \ + remote-e7000.c \ remote-hms.c remote-mips.c \ remote-rdp.c remote-sim.c \ remote-st.c remote-utils.c dcache.c \ @@ -1509,17 +1523,21 @@ ada-valprint.o: ada-valprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ aix-thread.o: aix-thread.c $(defs_h) $(gdb_assert_h) $(gdbthread_h) \ $(target_h) $(inferior_h) $(regcache_h) $(gdbcmd_h) $(language_h) \ $(ppc_tdep_h) -alpha-linux-tdep.o: alpha-linux-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ - $(value_h) $(alpha_tdep_h) $(osabi_h) -alpha-nat.o: alpha-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ - $(regcache_h) $(alpha_tdep_h) $(gregset_h) $(gdb_string_h) +alpha-linux-tdep.o: alpha-linux-tdep.c $(defs_h) $(frame_h) $(gdb_assert_h) \ + $(osabi_h) $(alpha_tdep_h) +alpha-nat.o: alpha-nat.c $(defs_h) $(gdb_string_h) $(inferior_h) $(gdbcore_h) \ + $(target_h) $(regcache_h) $(alpha_tdep_h) $(gregset_h) alpha-osf1-tdep.o: alpha-osf1-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ - $(value_h) $(osabi_h) $(gdb_string_h) $(alpha_tdep_h) -alpha-tdep.o: alpha-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ + $(value_h) $(osabi_h) $(gdb_string_h) $(alpha_tdep_h) $(objfiles_h) +alpha-tdep.o: alpha-tdep.c $(defs_h) $(doublest_h) $(frame_h) \ + $(frame_unwind_h) $(frame_base_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) \ - $(osabi_h) $(block_h) + $(reggroups_h) $(arch_utils_h) $(osabi_h) $(block_h) $(gdb_assert_h) \ + $(elf_bfd_h) $(alpha_tdep_h) $(dwarf2_frame_h) +alpha-mdebug-tdep.o: alpha-mdebug-tdep.c $(defs_h) $(frame_h) \ + $(frame_unwind_h) $(frame_base_h) $(symtab_h) $(gdbcore_h) \ + $(block_h) $(gdb_assert_h) $(alpha_tdep_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) \ @@ -1541,10 +1559,10 @@ arm-linux-nat.o: arm-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \ $(gdbtypes_h) $(floatformat_h) $(gdbcore_h) $(frame_h) $(regcache_h) \ $(doublest_h) $(arm_tdep_h) $(symtab_h) $(symfile_h) $(objfiles_h) \ - $(osabi_h) + $(solib_svr4_h) $(osabi_h) arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \ $(gdbcore_h) $(symfile_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) \ - $(doublest_h) $(value_h) $(arch_utils_h) $(solib_svr4_h) $(osabi_h) \ + $(doublest_h) $(value_h) $(arch_utils_h) $(osabi_h) \ $(arm_tdep_h) $(sim_arm_h) $(elf_bfd_h) $(coff_internal_h) \ $(elf_arm_h) $(gdb_assert_h) armnbsd-nat.o: armnbsd-nat.c $(defs_h) $(arm_tdep_h) $(inferior_h) \ @@ -1576,7 +1594,7 @@ 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) $(block_h) $(dictionary_h) $(cp_support_h) + $(stabsread_h) $(block_h) $(cp_support_h) $(dictionary_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) \ @@ -1600,8 +1618,8 @@ 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) $(block_h) $(coff_pe_read_h) \ - $(dictionary_h) + $(target_h) $(gdb_assert_h) $(block_h) $(dictionary_h) \ + $(coff_pe_read_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) \ @@ -1627,7 +1645,8 @@ cp-namespace.o: cp-namespace.c $(defs_h) $(cp_support_h) $(gdb_obstack_h) \ $(symtab_h) $(symfile_h) $(gdb_assert_h) $(block_h) $(objfiles_h) \ $(gdbtypes_h) $(dictionary_h) $(command_h) $(frame_h) cp-support.o: cp-support.c $(defs_h) $(cp_support_h) $(gdb_string_h) \ - $(demangle_h) $(gdb_assert_h) $(symtab_h) $(gdbcmd_h) + $(demangle_h) $(gdb_assert_h) $(gdbcmd_h) $(dictionary_h) \ + $(objfiles_h) $(frame_h) $(block_h) cp-valprint.o: cp-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(command_h) $(gdbcmd_h) \ $(demangle_h) $(annotate_h) $(gdb_string_h) $(c_lang_h) $(target_h) \ @@ -1641,9 +1660,9 @@ cris-tdep.o: cris-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(inferior_h) \ d10v-tdep.o: d10v-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \ $(frame_base_h) $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) \ $(gdb_string_h) $(value_h) $(inferior_h) $(dis_asm_h) $(symfile_h) \ - $(objfiles_h) $(language_h) $(arch_utils_h) $(regcache_h) \ - $(remote_h) $(floatformat_h) $(gdb_sim_d10v_h) $(sim_regno_h) \ - $(gdb_assert_h) $(disasm_h) + $(objfiles_h) $(language_h) $(arch_utils_h) $(regcache_h) $(remote_h) \ + $(floatformat_h) $(gdb_sim_d10v_h) $(sim_regno_h) $(disasm_h) \ + $(trad_frame_h) $(gdb_assert_h) dbug-rom.o: dbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(serial_h) $(regcache_h) $(m68k_tdep_h) dbxread.o: dbxread.c $(defs_h) $(gdb_string_h) $(gdb_obstack_h) \ @@ -1656,8 +1675,8 @@ dcache.o: dcache.c $(defs_h) $(dcache_h) $(gdbcmd_h) $(gdb_string_h) \ delta68-nat.o: delta68-nat.c $(defs_h) demangle.o: demangle.c $(defs_h) $(command_h) $(gdbcmd_h) $(demangle_h) \ $(gdb_string_h) -dictionary.o: dictionary.c $(defs_h) $(dictionary_h) $(gdb_obstack_h) \ - $(symtab_h) $(buildsym_h) $(gdb_assert_h) +dictionary.o: dictionary.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \ + $(buildsym_h) $(gdb_assert_h) $(dictionary_h) dink32-rom.o: dink32-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(serial_h) $(symfile_h) $(inferior_h) $(regcache_h) disasm.o: disasm.c $(defs_h) $(gdb_string_h) $(target_h) $(value_h) \ @@ -1679,6 +1698,10 @@ dwarf2expr.o: dwarf2expr.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(value_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) +dwarf2-frame.o: $(defs_h) $(dwarf2expr_h) $(elf_dwarf2_h) $(frame_h) \ + $(frame_base_h) $(frame_unwind_h) $(gdbcore_h) $(gdbtypes_h) \ + $(symtab_h) $(objfiles_h) $(regcache_h) $(gdb_assert_h) \ + $(gdb_string_h) $(dwarf2_frame_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) \ @@ -1752,7 +1775,7 @@ gnu-nat.o: gnu-nat.c $(gdb_string_h) $(defs_h) $(inferior_h) $(symtab_h) \ $(value_h) $(language_h) $(target_h) $(gdb_wait_h) $(gdbcmd_h) \ $(gdbcore_h) $(gdbthread_h) $(gdb_assert_h) $(gnu_nat_h) \ $(exc_request_S_h) $(notify_S_h) $(process_reply_S_h) \ - $(msg_reply_S_h) $(exc_request_U_h) $(msg_U_h) + $(msg_reply_S_h) $(exc_request_U_h) $(msg_U_h) $(gdb_obstack_h) gnu-v2-abi.o: gnu-v2-abi.c $(defs_h) $(gdb_string_h) $(symtab_h) \ $(gdbtypes_h) $(value_h) $(demangle_h) $(cp_abi_h) gnu-v3-abi.o: gnu-v3-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(demangle_h) \ @@ -1797,11 +1820,12 @@ i386-nat.o: i386-nat.c $(defs_h) $(breakpoint_h) $(command_h) $(gdbcmd_h) i386-sol2-tdep.o: i386-sol2-tdep.c $(defs_h) $(value_h) $(i386_tdep_h) \ $(osabi_h) i386-stub.o: i386-stub.c -i386-tdep.o: i386-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ - $(gdbcore_h) $(objfiles_h) $(target_h) $(floatformat_h) $(symfile_h) \ - $(symtab_h) $(gdbcmd_h) $(command_h) $(arch_utils_h) $(regcache_h) \ - $(doublest_h) $(value_h) $(gdb_assert_h) $(i386_tdep_h) \ - $(i387_tdep_h) $(osabi_h) +i386-tdep.o: i386-tdep.c $(defs_h) $(arch_utils_h) $(command_h) \ + $(dummy_frame_h) $(dwarf2_frame_h) $(doublest_h) $(floatformat_h) \ + $(frame_h) $(frame_base_h) $(frame_unwind_h) $(inferior_h) \ + $(gdbcmd_h) $(gdbcore_h) $(objfiles_h) $(osabi_h) $(regcache_h) \ + $(reggroups_h) $(symfile_h) $(symtab_h) $(target_h) $(value_h) \ + $(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) $(i387_tdep_h) i386b-nat.o: i386b-nat.c $(defs_h) i386bsd-nat.o: i386bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ $(gdb_assert_h) $(gregset_h) $(i386_tdep_h) $(i387_tdep_h) \ @@ -1816,7 +1840,7 @@ i386gnu-tdep.o: i386gnu-tdep.c $(defs_h) $(i386_tdep_h) $(osabi_h) i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ $(regcache_h) $(target_h) $(i386_tdep_h) $(osabi_h) i386-cygwin-tdep.o: i386-cygwin-tdep.c $(defs_h) $(gdb_string_h) \ - $(i386_tdep_h) $(osabi_h) $(gdbcore_h) $(frame_h) $(dummy_frame_h) + $(i386_tdep_h) $(osabi_h) i386nbsd-tdep.o: i386nbsd-tdep.c $(defs_h) $(gdbtypes_h) $(gdbcore_h) \ $(regcache_h) $(arch_utils_h) $(i386_tdep_h) $(i387_tdep_h) \ $(nbsd_tdep_h) $(solib_svr4_h) $(osabi_h) @@ -1829,7 +1853,8 @@ i386v4-nat.o: i386v4-nat.c $(defs_h) $(value_h) $(inferior_h) $(regcache_h) \ $(i386_tdep_h) $(i387_tdep_h) $(gregset_h) i387-tdep.o: i387-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(language_h) \ $(value_h) $(gdbcore_h) $(floatformat_h) $(regcache_h) \ - $(gdb_assert_h) $(gdb_string_h) $(doublest_h) $(i386_tdep_h) + $(gdb_assert_h) $(gdb_string_h) $(doublest_h) $(i386_tdep_h) \ + $(i387_tdep_h) ia64-aix-nat.o: ia64-aix-nat.c $(defs_h) $(inferior_h) $(target_h) \ $(gdbcore_h) $(regcache_h) $(symtab_h) $(bfd_h) $(symfile_h) \ $(objfiles_h) $(gdb_stat_h) @@ -1839,7 +1864,7 @@ ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(gdb_string_h) $(inferior_h) \ ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(arch_utils_h) ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \ $(arch_utils_h) $(floatformat_h) $(regcache_h) $(doublest_h) \ - $(value_h) $(objfiles_h) $(elf_common_h) $(elf_bfd_h) + $(value_h) $(gdb_assert_h) $(objfiles_h) $(elf_common_h) $(elf_bfd_h) inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(target_h) $(event_loop_h) \ $(event_top_h) $(inf_loop_h) $(remote_h) infcall.o: infcall.c $(defs_h) $(breakpoint_h) $(target_h) $(regcache_h) \ @@ -1875,7 +1900,7 @@ irix5-nat.o: irix5-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ jv-lang.o: jv-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ $(parser_defs_h) $(language_h) $(gdbtypes_h) $(symtab_h) \ $(symfile_h) $(objfiles_h) $(gdb_string_h) $(value_h) $(c_lang_h) \ - $(jv_lang_h) $(gdbcore_h) $(dictionary_h) $(block_h) $(demangle_h) + $(jv_lang_h) $(gdbcore_h) $(block_h) $(demangle_h) $(dictionary_h) jv-typeprint.o: jv-typeprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ $(value_h) $(demangle_h) $(jv_lang_h) $(gdb_string_h) $(typeprint_h) \ $(c_lang_h) $(cp_abi_h) @@ -1889,14 +1914,17 @@ language.o: language.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(value_h) $(gdbcmd_h) $(expression_h) $(language_h) $(target_h) \ $(parser_defs_h) $(jv_lang_h) $(demangle_h) 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) + $(gdbthread_h) $(inferior_h) $(target_h) $(regcache_h) $(gdbcmd_h) \ + $(linux_nat_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) $(parser_defs_h) $(block_h) $(objc_lang_h) \ + $(symfile_h) $(objfiles_h) $(source_h) $(demangle_h) $(value_h) \ + $(completer_h) $(cp_abi_h) $(parser_defs_h) $(block_h) $(objc_lang_h) \ $(cp_support_h) +linux-nat.o: linux-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdb_wait_h) \ + $(linux_nat_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) + $(cli_decode_h) $(gdb_string_h) $(linux_nat_h) lynx-nat.o: lynx-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ $(gdbcore_h) $(regcache_h) m2-lang.o: m2-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ @@ -1929,7 +1957,8 @@ m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ $(language_h) $(gdbcore_h) $(gdb_string_h) $(regcache_h) \ $(m68k_tdep_h) $(gdb_stat_h) $(floatformat_h) $(target_h) m68klinux-tdep.o: m68klinux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \ - $(target_h) $(gdb_string_h) $(gdbtypes_h) $(osabi_h) $(m68k_tdep_t) + $(target_h) $(gdb_string_h) $(gdbtypes_h) $(osabi_h) $(regcache_h) \ + $(objfiles_h) $(symtab_h) $(m68k_tdep_t) m68knbsd-nat.o: m68knbsd-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ $(regcache_h) m68knbsd-tdep.o: m68knbsd-tdep.c $(defs_h) $(gdbtypes_h) $(regcache_h) @@ -1956,7 +1985,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) \ + $(block_h) $(dictionary_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) \ @@ -1975,10 +2004,10 @@ mips-linux-tdep.o: mips-linux-tdep.c $(defs_h) $(gdbcore_h) $(target_h) \ 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) $(gdb_assert_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) $(block_h) $(opcode_mips_h) \ - $(elf_mips_h) $(elf_bfd_h) $(symcat_h) + $(language_h) $(gdbcore_h) $(symfile_h) $(objfiles_h) $(gdbtypes_h) \ + $(target_h) $(arch_utils_h) $(regcache_h) $(osabi_h) $(mips_tdep_h) \ + $(block_h) $(reggroups_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) @@ -1994,9 +2023,9 @@ mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ mn10200-tdep.o: mn10200-tdep.c $(defs_h) $(frame_h) $(inferior_h) \ $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) \ $(symfile_h) $(regcache_h) -mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(frame_h) $(inferior_h) \ - $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) \ - $(symfile_h) $(regcache_h) $(arch_utils_h) +mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \ + $(regcache_h) $(arch_utils_h) $(gdb_assert_h) monitor.o: monitor.c $(defs_h) $(gdbcore_h) $(target_h) $(gdb_string_h) \ $(command_h) $(serial_h) $(monitor_h) $(gdbcmd_h) $(inferior_h) \ $(gdb_regex_h) $(srec_h) $(regcache_h) @@ -2014,11 +2043,11 @@ 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) $(block_h) $(infcall_h) $(valprint_h) + $(regcache_h) $(block_h) $(infcall_h) $(valprint_h) $(gdb_assert_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) + $(block_h) $(dictionary_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) \ @@ -2086,9 +2115,6 @@ regcache.o: regcache.c $(defs_h) $(inferior_h) $(target_h) $(gdbarch_h) \ $(gdb_string_h) $(gdbcmd_h) reggroups.o: reggroups.c $(defs_h) $(reggroups_h) $(gdbtypes_h) \ $(gdb_assert_h) $(regcache_h) $(command_h) $(gdbcmd_h) -remote-array.o: remote-array.c $(defs_h) $(gdbcore_h) $(target_h) \ - $(gdb_string_h) $(command_h) $(serial_h) $(monitor_h) \ - $(remote_utils_h) $(inferior_h) $(version_h) $(regcache_h) remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) $(gdbarch_h) \ $(inferior_h) $(target_h) $(value_h) $(command_h) $(gdb_string_h) \ $(gdbcmd_h) $(serial_h) $(remote_utils_h) $(symfile_h) $(regcache_h) @@ -2144,7 +2170,10 @@ remote.o: remote.c $(defs_h) $(gdb_string_h) $(inferior_h) $(bfd_h) \ $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) $(gdb_stabs_h) \ $(gdbthread_h) $(remote_h) $(regcache_h) $(value_h) $(gdb_assert_h) \ $(event_loop_h) $(event_top_h) $(inf_loop_h) $(serial_h) \ - $(gdbcore_h) $(solib_h) + $(gdbcore_h) $(solib_h) $(remote-fileio_h) +remote-fileio.o: remote-fileio.c $(defs_h) $(gdb_string_h) $(gdbcmd_h) \ + $(remote_h) $(gdb_fileio_h) $(gdb_wait_h) $(gdb_stat_h) \ + $(remote_fileio_h) rom68k-rom.o: rom68k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(serial_h) $(regcache_h) $(value_h) $(m68k_tdep_h) rs6000-nat.o: rs6000-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ @@ -2255,8 +2284,9 @@ stabsread.o: stabsread.c $(defs_h) $(gdb_string_h) $(bfd_h) $(gdb_obstack_h) \ $(doublest_h) $(stabsread_h) $(cp_abi_h) $(cp_support_h) stack.o: stack.c $(defs_h) $(gdb_string_h) $(value_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(language_h) $(frame_h) $(gdbcmd_h) \ - $(gdbcore_h) $(target_h) $(breakpoint_h) $(demangle_h) $(inferior_h) \ - $(annotate_h) $(ui_out_h) $(source_h) $(dictionary_h) $(block_h) + $(gdbcore_h) $(target_h) $(source_h) $(breakpoint_h) $(demangle_h) \ + $(inferior_h) $(annotate_h) $(ui_out_h) $(block_h) $(stack_h) \ + $(gdb_assert_h) $(dictionary_h) standalone.o: standalone.c $(gdb_stat_h) $(defs_h) $(symtab_h) $(frame_h) \ $(inferior_h) $(gdb_wait_h) std-regs.o: std-regs.c $(defs_h) $(builtin_regs_h) $(frame_h) $(gdbtypes_h) \ @@ -2305,10 +2335,12 @@ 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) \ - $(block_h) $(ax_h) $(ax_gdb_h) $(readline_h) + $(block_h) $(ax_h) $(ax_gdb_h) $(readline_h) $(dictionary_h) +trad-frame.o: trad-frame.c $(defs_h) $(frame_h) $(trad_frame_h) $(regcache_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) + $(gdbcmd_h) $(target_h) $(language_h) $(cp_abi_h) $(typeprint_h) \ + $(gdb_string_h) ui-file.o: ui-file.c $(defs_h) $(ui_file_h) $(gdb_string_h) ui-out.o: ui-out.c $(defs_h) $(gdb_string_h) $(expression_h) $(language_h) \ $(ui_out_h) $(gdb_assert_h) @@ -2351,18 +2383,19 @@ win32-nat.o: win32-nat.c $(defs_h) $(tm_h) $(frame_h) $(inferior_h) \ $(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) wince-stub.o: wince-stub.c $(wince_stub_h) wince.o: wince.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) \ - $(command_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \ - $(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) $(wince_stub_h) \ - $(regcache_h) + $(command_h) $(buildsym_h) $(symfile_h) $(objfiles_h) $(gdb_string_h) \ + $(gdbthread_h) $(gdbcmd_h) $(wince_stub_h) $(regcache_h) $(mips_tdep_h) wrapper.o: wrapper.c $(defs_h) $(value_h) $(wrapper_h) x86-64-linux-nat.o: x86-64-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ - $(regcache_h) $(gdb_assert_h) $(x86_64_tdep_h) + $(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(gregset_h) \ + $(x86_64_tdep_h) x86-64-linux-tdep.o: x86-64-linux-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) \ - $(gdb_string_h) $(regcache_h) $(x86_64_tdep_h) $(dwarf2cfi_h) \ - $(osabi_h) -x86-64-tdep.o: x86-64-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) \ - $(gdbcmd_h) $(arch_utils_h) $(regcache_h) $(symfile_h) $(objfiles_h) \ - $(x86_64_tdep_h) $(dwarf2cfi_h) $(gdb_assert_h) $(block_h) + $(regcache_h) $(osabi_h) $(gdb_string_h) $(x86_64_tdep_h) +x86-64-tdep.o: x86-64-tdep.c $(defs_h) \ + $(inferior_h) $(gdbcore_h) $(arch_utils_h) $(block_h) \ + $(dummy_frame_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \ + $(inferior_h) $(gdbcmd_h) $(gdbcode_h) $(objfiles_h) $(regcache_h) \ + $(symfile_h) $(gdb_assert_h) $(x86_64_tdep_h) $(i387_tdep_h) xcoffread.o: xcoffread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(gdb_stat_h) \ $(coff_internal_h) $(libcoff_h) $(coff_xcoff_h) $(libxcoff_h) \ $(coff_rs6000_h) $(symtab_h) $(gdbtypes_h) $(symfile_h) \ @@ -2387,7 +2420,7 @@ cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(defs_h) $(completer_h) $(target_h) \ $(gdb_wait_h) $(gdb_regex_h) $(gdb_string_h) $(filenames_h) \ $(ui_out_h) $(top_h) $(cli_decode_h) $(cli_script_h) \ $(cli_setshow_h) $(cli_cmds_h) $(source_h) $(linespec_h) \ - $(expression_h) $(language_h) $(objfiles_h) + $(expression_h) $(language_h) $(objfiles_h) $(gdb_vfork_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \ $(gdb_regex_h) $(gdb_string_h) $(ui_out_h) $(cli_cmds_h) \ @@ -2497,9 +2530,10 @@ gdbtk-bp.o: $(srcdir)/gdbtk/generic/gdbtk-bp.c \ gdbtk-cmds.o: $(srcdir)/gdbtk/generic/gdbtk-cmds.c \ $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \ - $(defs_h) $(symtab_h) $(inferior_h) \ - $(command_h) $(bfd_h) $(top_h) $(symfile_h) $(objfiles_h) $(target_h) \ - $(gdb_string_h) $(tracepoint_h) $(source_h) $(regcache_h) + $(defs_h) $(inferior_h) $(source_h) $(symfile_h) $(objfiles_h) \ + $(gdbcore_h) $(demangle_h) $(linespec_h) $(tui_file_h) $(top_h) \ + $(annotate_h) $(block_h) $(dictionary_h) $(gdb_string_h) \ + $(dis_asm_h) $(gdbcmd_h) $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-cmds.c \ @@ -2540,8 +2574,8 @@ gdbtk-register.o: $(srcdir)/gdbtk/generic/gdbtk-register.c \ gdbtk-stack.o: $(srcdir)/gdbtk/generic/gdbtk-stack.c \ $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \ $(srcdir)/gdbtk/generic/gdbtk-wrapper.h \ - $(defs_h) $(frame_h) $(value_h) $(target_h) $(breakpoint_h) \ - $(linespec_h) + $(defs_h) $(target_h) $(breakpoint_h) $(linespec_h) \ + $(block_h) $(dictionary_h) $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-stack.c \ @@ -2582,8 +2616,8 @@ mi-cmd-env.o: $(srcdir)/mi/mi-cmd-env.c $(defs_h) $(inferior_h) $(value_h) \ $(environ_h) $(command_h) $(ui_out_h) $(top_h) $(gdb_string_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-env.c mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(target_h) $(frame_h) \ - $(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h) $(dictionary_h) \ - $(block_h) + $(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h) $(block_h) $(stack_h) \ + $(dictionary_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \ $(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h) @@ -2681,7 +2715,7 @@ tuiDataWin.o: $(srcdir)/tui/tuiDataWin.c $(config_h) $(defs_h) $(tui_h) \ tuiDisassem.o: $(srcdir)/tui/tuiDisassem.c $(config_h) $(defs_h) $(symtab_h) \ $(breakpoint_h) $(frame_h) $(value_h) $(tui_h) $(tuiData_h) \ $(tuiWin_h) $(tuiLayout_h) $(tuiSourceWin_h) $(tuiStack_h) \ - $(tui_file_h) + $(tui_file_h) $(disasm_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiDisassem.c tuiGeneralWin.o: $(srcdir)/tui/tuiGeneralWin.c $(config_h) $(defs_h) \ $(tui_h) $(tuiData_h) $(tuiGeneralWin_h) $(tuiWin_h) diff --git a/gdb/NEWS b/gdb/NEWS index 98aab4fe1e8..604f085cc9d 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -1,7 +1,16 @@ What has changed in GDB? (Organized release by release) -*** Changes since GDB 5.3: +*** Changes since GDB 6.0: + + +*** Changes in GDB 6.0: + +* The meaning of "detach" has changed for gdbserver + +The "detach" command will now resume the application, as documented. To +disconnect from gdbserver and leave it stopped, use the new "disconnect" +command. * d10v `regs' command deprecated diff --git a/gdb/PROBLEMS b/gdb/PROBLEMS index 85112637828..74806333035 100644 --- a/gdb/PROBLEMS +++ b/gdb/PROBLEMS @@ -1,80 +1,21 @@ - Known problems in GDB 5.3 + Known problems in GDB 6.0 See also: http://www.gnu.org/software/gdb/bugs/ - -*-*-freebsd* ---------------- - -Due to a kernel bug (kern/35175), detaching from an attached process -will very likely cause the process to be stop or die with a Trace/BPT -trap. - - -i386-*-freebsd[34]* -------------------- - -There is a bug (bin/41671) in FreeBSD's gcc that causes it to emit bad -debug information when using the stabs format (which is the default). -As a result GDB tends to place breakpoints on functions before the -function prologue, and information about function parameters and local -variables is lost. In earlier versions of GDB the effects were rather -limited, but starting with GDB 5.3 the influence is much more -prominent. As a workaround, compile your code with -gdwarf-2. - - -hppa2.0-hp-hpux10.20 --------------------- - -gdb/487: The top level make files used to build GDB are not compatible -with HP/UX make. As a workaround, use GNU make. - -gdb/486: The HP/UX C compiler defaults to K&R mode but GDB only builds -with an ISO C compiler. The top level configuration incorrectly sets -CC to `cc' instead of `cc -Ae'. As a workaround, the correct compiler -can be specified as part of the configuration vis: - - $ 'CC=cc -Ae' ./configure - - -s390*-*-* ---------- - -gdb/513: GDB does not build on s390 GNU/Linux. The problem should be -fixed in more recent sources. - - -i386-*-freebsd4.4* ------------------- - -gdb/455: GDB doesn't build on a FreeBSD 4.4-STABLE system. The -problem is still being investigated. - -alpha*-*-osf* -------------- - -gdb/816: When building GDB with GCC 3.0.1, GDB is unable to load a core -file properly. It generates several errors and warnings regarding -unhandled core file section types, incorrect endianness, the failure to -load the registers. Are also incorrectly reported: The program name, the -cause of the program death, and the call stack at the moment of the -death. This problem has been reported on alpha-osf4.0f and alpha-osf5.1a. -To work-around the problem, add -D__digital__ to the CFLAGS when -building GDB vis: - - $ make CFLAGS='-O2 -D__digital__' - - -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: - - $ ld --version +gdb/1091: Constructor breakpoints ignored +gdb/1193: g++ 3.3 creates multiple constructors: gdb 5.3 can't set breakpoints + +When gcc 3.x compiles a C++ constructor or C++ destructor, it generates +2 or 3 different versions of the object code. These versions have +unique mangled names (they have to, in order for linking to work), but +they have identical source code names, which leads to a great deal of +confusion. Specifically, if you set a breakpoint in a constructor or a +destructor, gdb will put a breakpoint in one of the versions, but your +program may execute the other version. This makes it impossible to set +breakpoints reliably in constructors or destructors. + +gcc 3.x generates these multiple object code functions in order to +implement virtual base classes. gcc 2.x generated just one object code +function with a hidden parameter, but gcc 3.x conforms to a multi-vendor +ABI for C++ which requires multiple object code functions. diff --git a/gdb/README b/gdb/README index a8b4b82f3ef..bae1a2e37b9 100644 --- a/gdb/README +++ b/gdb/README @@ -1,5 +1,5 @@ - README for gdb-5.3 release - Updated 5th September, 2002 by Andrew Cagney + README for gdb-6.0 release + Updated 23th June, 2003 by Andrew Cagney This is GDB, the GNU source-level debugger. @@ -20,7 +20,7 @@ Unpacking and Installation -- quick overview In this release, the GDB debugger sources, the generic GNU include files, the BFD ("binary file description") library, the readline library, and other libraries all have directories of their own -underneath the gdb-5.3 directory. The idea is that a variety of GNU +underneath the gdb-6.0 directory. The idea is that a variety of GNU tools can share a common copy of these things. Be aware of variation over time--for example don't try to build gdb with a copy of bfd from a release other than the gdb release (such as a binutils release), @@ -29,8 +29,8 @@ Configuration scripts and makefiles exist to cruise up and down this directory tree and automatically build all the pieces in the right order. - When you unpack the gdb-5.3.tar.gz file, you'll find a directory -called `gdb-5.3', which contains: + When you unpack the gdb-6.0.tar.gz file, you'll find a directory +called `gdb-6.0', which contains: COPYING config.sub intl missing opcodes COPYING.LIB configure libiberty mkinstalldirs readline @@ -44,7 +44,7 @@ called `gdb-5.3', which contains: You can build GDB right in the source directory: - cd gdb-5.3 + cd gdb-6.0 ./configure make cp gdb/gdb /usr/local/bin/gdb (or wherever you want) @@ -58,25 +58,25 @@ You can build GDB in any empty build directory: mkdir build cd build - /gdb-5.3/configure + /gdb-6.0/configure make cp gdb/gdb /usr/local/bin/gdb (or wherever you want) (Building GDB with DJGPP tools for MS-DOS/MS-Windows is slightly -different; see the file gdb-5.3/gdb/config/djgpp/README for details.) +different; see the file gdb-6.0/gdb/config/djgpp/README for details.) This will configure and build all the libraries as well as GDB. If `configure' can't determine your system type, specify one as its argument, e.g., `./configure sun4' or `./configure decstation'. - Make sure that your 'configure' line ends in 'gdb-5.3/configure': + Make sure that your 'configure' line ends in 'gdb-6.0/configure': - /berman/migchain/source/gdb-5.3/configure # RIGHT - /berman/migchain/source/gdb-5.3/gdb/configure # WRONG + /berman/migchain/source/gdb-6.0/configure # RIGHT + /berman/migchain/source/gdb-6.0/gdb/configure # WRONG The gdb package contains several subdirectories, such as 'gdb', 'bfd', and 'readline'. If your 'configure' line ends in -'gdb-5.3/gdb/configure', then you are configuring only the gdb +'gdb-6.0/gdb/configure', then you are configuring only the gdb subdirectory, not the whole gdb package. This leads to build errors such as: @@ -107,7 +107,7 @@ documentation and TeX (or `texi2roff') to typeset the printed version. GDB includes an already formatted copy of the on-line Info version of this manual in the `gdb/doc' subdirectory. The main Info file is -`gdb-5.3/gdb/doc/gdb.info', and it refers to subordinate files +`gdb-6.0/gdb/doc/gdb.info', and it refers to subordinate files matching `gdb.info*' in the same directory. If necessary, you can print out these files, or read them with any editor; but they are easier to read using the `info' subsystem in GNU Emacs or the @@ -119,7 +119,7 @@ Info formatting programs, such as `texinfo-format-buffer' or `makeinfo'. If you have `makeinfo' installed, and are in the top level GDB -source directory (`gdb-5.3', in the case of version 5.3), you can make +source directory (`gdb-6.0', in the case of version 6.0), you can make the Info file by typing: cd gdb/doc @@ -128,7 +128,7 @@ the Info file by typing: If you want to typeset and print copies of this manual, you need TeX, a program to print its DVI output files, and `texinfo.tex', the Texinfo definitions file. This file is included in the GDB -distribution, in the directory `gdb-5.3/texinfo'. +distribution, in the directory `gdb-6.0/texinfo'. TeX is a typesetting program; it does not print files directly, but produces output files called DVI files. To print a typeset document, @@ -142,11 +142,11 @@ without any extension or a `.dvi' extension. This file tells TeX how to typeset a document written in Texinfo format. On its own, TeX cannot read, much less typeset a Texinfo file. `texinfo.tex' is distributed with GDB and is located in the -`gdb-5.3/texinfo' directory. +`gdb-6.0/texinfo' directory. If you have TeX and a DVI printer program installed, you can typeset and print this manual. First switch to the the `gdb' subdirectory of -the main source directory (for example, to `gdb-5.3/gdb') and then type: +the main source directory (for example, to `gdb-6.0/gdb') and then type: make doc/gdb.dvi @@ -169,55 +169,55 @@ preparing GDB for installation; you can then use `make' to build the a single directory, whose name is usually composed by appending the version number to `gdb'. - For example, the GDB version 5.3 distribution is in the `gdb-5.3' + For example, the GDB version 6.0 distribution is in the `gdb-6.0' directory. That directory contains: -`gdb-5.3/{COPYING,COPYING.LIB}' +`gdb-6.0/{COPYING,COPYING.LIB}' Standard GNU license files. Please read them. -`gdb-5.3/bfd' +`gdb-6.0/bfd' source for the Binary File Descriptor library -`gdb-5.3/config*' +`gdb-6.0/config*' script for configuring GDB, along with other support files -`gdb-5.3/gdb' +`gdb-6.0/gdb' the source specific to GDB itself -`gdb-5.3/include' +`gdb-6.0/include' GNU include files -`gdb-5.3/libiberty' +`gdb-6.0/libiberty' source for the `-liberty' free software library -`gdb-5.3/mmalloc' +`gdb-6.0/mmalloc' source for the GNU memory-mapped malloc package -`gdb-5.3/opcodes' +`gdb-6.0/opcodes' source for the library of opcode tables and disassemblers -`gdb-5.3/readline' +`gdb-6.0/readline' source for the GNU command-line interface NOTE: The readline library is compiled for use by GDB, but will not be installed on your system when "make install" is issued. -`gdb-5.3/sim' +`gdb-6.0/sim' source for some simulators (ARM, D10V, SPARC, M32R, MIPS, PPC, V850, etc) -`gdb-5.3/intl' +`gdb-6.0/intl' source for the GNU gettext library, for internationalization. This is slightly modified from the standalone gettext distribution you can get from GNU. -`gdb-5.3/texinfo' +`gdb-6.0/texinfo' The `texinfo.tex' file, which you need in order to make a printed manual using TeX. -`gdb-5.3/etc' +`gdb-6.0/etc' Coding standards, useful files for editing GDB, and other miscellanea. -`gdb-5.3/utils' +`gdb-6.0/utils' A grab bag of random utilities. Note: the following instructions are for building GDB on Unix or @@ -226,14 +226,14 @@ MS-DOS/MS-Windows are in the file gdb/config/djgpp/README. The simplest way to configure and build GDB is to run `configure' from the `gdb-VERSION-NUMBER' source directory, which in this example -is the `gdb-5.3' directory. +is the `gdb-6.0' directory. First switch to the `gdb-VERSION-NUMBER' source directory if you are not already in it; then run `configure'. For example: - cd gdb-5.3 + cd gdb-6.0 ./configure make @@ -249,8 +249,8 @@ you may need to run `sh' on it explicitly: sh configure If you run `configure' from a directory that contains source -directories for multiple libraries or programs, such as the `gdb-5.3' -source directory for version 5.3, `configure' creates configuration +directories for multiple libraries or programs, such as the `gdb-6.0' +source directory for version 6.0, `configure' creates configuration files for every directory level underneath (unless you tell it not to, with the `--norecursion' option). @@ -258,10 +258,10 @@ with the `--norecursion' option). directories in the GDB distribution, if you only want to configure that subdirectory; but be sure to specify a path to it. - For example, with version 5.3, type the following to configure only + For example, with version 6.0, type the following to configure only the `bfd' subdirectory: - cd gdb-5.3/bfd + cd gdb-6.0/bfd ../configure You can install `gdb' anywhere; it has no hardwired paths. However, @@ -290,13 +290,13 @@ directory. If the path to `configure' would be the same as the argument to `--srcdir', you can leave out the `--srcdir' option; it will be assumed.) - For example, with version 5.3, you can build GDB in a separate + For example, with version 6.0, you can build GDB in a separate directory for a Sun 4 like this: - cd gdb-5.3 + cd gdb-6.0 mkdir ../gdb-sun4 cd ../gdb-sun4 - ../gdb-5.3/configure + ../gdb-6.0/configure make When `configure' builds a configuration using a remote source @@ -317,8 +317,8 @@ called `configure' (or one of its subdirectories). The `Makefile' that `configure' generates in each source directory also runs recursively. If you type `make' in a source directory such -as `gdb-5.3' (or in a separate configured directory configured with -`--srcdir=PATH/gdb-5.3'), you will build all the required libraries, +as `gdb-6.0' (or in a separate configured directory configured with +`--srcdir=PATH/gdb-6.0'), you will build all the required libraries, and then build GDB. When you have multiple hosts or targets configured in separate @@ -361,7 +361,7 @@ you can use it to test your guesses on abbreviations--for example: Invalid configuration `i786v': machine `i786v' not recognized `config.sub' is also distributed in the GDB source directory -(`gdb-5.3', for version 5.3). +(`gdb-6.0', for version 6.0). `configure' options @@ -462,7 +462,6 @@ Linux. There are a number of remote interfaces for talking to existing ROM monitors and other hardware: - remote-array.c Array Tech RAID controller remote-e7000.c Hitachi E7000 ICE remote-est.c EST emulator remote-hms.c Hitachi Micro Systems H8/300 monitor @@ -492,7 +491,7 @@ As an alternative, the bug report can be submitted, via e-mail, to the address "bug-gdb@gnu.org". When submitting a bug, please include the GDB version number (e.g., -gdb-5.3), and how you configured it (e.g., "sun4" or "mach386 host, +gdb-6.0), and how you configured it (e.g., "sun4" or "mach386 host, i586-intel-synopsys target"). Since GDB now supports so many different configurations, it is important that you be precise about this. If at all possible, you should include the actual banner that @@ -547,17 +546,17 @@ ftp://sources.redhat.com/pub/dejagnu/ will contain a recent snapshot. Once DejaGNU is installed, you can run the tests in one of the following ways: - (1) cd gdb-5.3 + (1) cd gdb-6.0 make check-gdb or - (2) cd gdb-5.3/gdb + (2) cd gdb-6.0/gdb make check or - (3) cd gdb-5.3/gdb/testsuite + (3) cd gdb-6.0/gdb/testsuite make site.exp (builds the site specific file) runtest -tool gdb GDB=../gdb (or GDB= as appropriate) diff --git a/gdb/abug-rom.c b/gdb/abug-rom.c index d3a9c2e82df..543f70213f4 100644 --- a/gdb/abug-rom.c +++ b/gdb/abug-rom.c @@ -164,6 +164,8 @@ abug_open (char *args, int from_tty) monitor_open (args, &abug_cmds, from_tty); } +extern initialize_file_ftype _initialize_abug_rom; /* -Wmissing-prototypes */ + void _initialize_abug_rom (void) { diff --git a/gdb/acconfig.h b/gdb/acconfig.h index a9bf0a48048..a7d25e84bd5 100644 --- a/gdb/acconfig.h +++ b/gdb/acconfig.h @@ -95,6 +95,9 @@ /* Define if using Solaris thread debugging. */ #undef HAVE_THREAD_DB_LIB +/* Define if you support the tkill syscall. */ +#undef HAVE_TKILL_SYSCALL + /* Define on a GNU/Linux system to work around problems in sys/procfs.h. */ #undef START_INFERIOR_TRAPS_EXPECTED #undef sys_quotactl diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4 index d3c00aeca26..a85ce024f2f 100644 --- a/gdb/acinclude.m4 +++ b/gdb/acinclude.m4 @@ -943,3 +943,56 @@ AC_DEFUN([AC_DEFINE_DIR], [ AC_DEFINE_UNQUOTED($1, "$ac_define_dir", $3)) ]) +dnl See whether we need a declaration for a function. +dnl The result is highly dependent on the INCLUDES passed in, so make sure +dnl to use a different cache variable name in this macro if it is invoked +dnl in a different context somewhere else. +dnl gcc_AC_CHECK_DECL(SYMBOL, +dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]]) +AC_DEFUN(gcc_AC_CHECK_DECL, +[AC_MSG_CHECKING([whether $1 is declared]) +AC_CACHE_VAL(gcc_cv_have_decl_$1, +[AC_TRY_COMPILE([$4], +[#ifndef $1 +char *(*pfn) = (char *(*)) $1 ; +#endif], eval "gcc_cv_have_decl_$1=yes", eval "gcc_cv_have_decl_$1=no")]) +if eval "test \"`echo '$gcc_cv_have_decl_'$1`\" = yes"; then + AC_MSG_RESULT(yes) ; ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) ; ifelse([$3], , :, [$3]) +fi +])dnl + +dnl Check multiple functions to see whether each needs a declaration. +dnl Arrange to define HAVE_DECL_ to 0 or 1 as appropriate. +dnl gcc_AC_CHECK_DECLS(SYMBOLS, +dnl [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED [, INCLUDES]]]) +AC_DEFUN(gcc_AC_CHECK_DECLS, +[for ac_func in $1 +do +changequote(, )dnl + ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +changequote([, ])dnl +gcc_AC_CHECK_DECL($ac_func, + [AC_DEFINE_UNQUOTED($ac_tr_decl, 1) $2], + [AC_DEFINE_UNQUOTED($ac_tr_decl, 0) $3], +dnl It is possible that the include files passed in here are local headers +dnl which supply a backup declaration for the relevant prototype based on +dnl the definition of (or lack of) the HAVE_DECL_ macro. If so, this test +dnl will always return success. E.g. see libiberty.h's handling of +dnl `basename'. To avoid this, we define the relevant HAVE_DECL_ macro to +dnl 1 so that any local headers used do not provide their own prototype +dnl during this test. +#undef $ac_tr_decl +#define $ac_tr_decl 1 + $4 +) +done +dnl Automatically generate config.h entries via autoheader. +if test x = y ; then + patsubst(translit([$1], [a-z], [A-Z]), [\w+], + [AC_DEFINE([HAVE_DECL_\&], 1, + [Define to 1 if we found this declaration otherwise define to 0.])])dnl +fi +]) + diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 index 51e94f29ee4..40399a65d09 100644 --- a/gdb/aclocal.m4 +++ b/gdb/aclocal.m4 @@ -951,6 +951,59 @@ AC_DEFUN([AC_DEFINE_DIR], [ AC_DEFINE_UNQUOTED($1, "$ac_define_dir", $3)) ]) +dnl See whether we need a declaration for a function. +dnl The result is highly dependent on the INCLUDES passed in, so make sure +dnl to use a different cache variable name in this macro if it is invoked +dnl in a different context somewhere else. +dnl gcc_AC_CHECK_DECL(SYMBOL, +dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]]) +AC_DEFUN(gcc_AC_CHECK_DECL, +[AC_MSG_CHECKING([whether $1 is declared]) +AC_CACHE_VAL(gcc_cv_have_decl_$1, +[AC_TRY_COMPILE([$4], +[#ifndef $1 +char *(*pfn) = (char *(*)) $1 ; +#endif], eval "gcc_cv_have_decl_$1=yes", eval "gcc_cv_have_decl_$1=no")]) +if eval "test \"`echo '$gcc_cv_have_decl_'$1`\" = yes"; then + AC_MSG_RESULT(yes) ; ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) ; ifelse([$3], , :, [$3]) +fi +])dnl + +dnl Check multiple functions to see whether each needs a declaration. +dnl Arrange to define HAVE_DECL_ to 0 or 1 as appropriate. +dnl gcc_AC_CHECK_DECLS(SYMBOLS, +dnl [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED [, INCLUDES]]]) +AC_DEFUN(gcc_AC_CHECK_DECLS, +[for ac_func in $1 +do +changequote(, )dnl + ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +changequote([, ])dnl +gcc_AC_CHECK_DECL($ac_func, + [AC_DEFINE_UNQUOTED($ac_tr_decl, 1) $2], + [AC_DEFINE_UNQUOTED($ac_tr_decl, 0) $3], +dnl It is possible that the include files passed in here are local headers +dnl which supply a backup declaration for the relevant prototype based on +dnl the definition of (or lack of) the HAVE_DECL_ macro. If so, this test +dnl will always return success. E.g. see libiberty.h's handling of +dnl `basename'. To avoid this, we define the relevant HAVE_DECL_ macro to +dnl 1 so that any local headers used do not provide their own prototype +dnl during this test. +#undef $ac_tr_decl +#define $ac_tr_decl 1 + $4 +) +done +dnl Automatically generate config.h entries via autoheader. +if test x = y ; then + patsubst(translit([$1], [a-z], [A-Z]), [\w+], + [AC_DEFINE([HAVE_DECL_\&], 1, + [Define to 1 if we found this declaration otherwise define to 0.])])dnl +fi +]) + # Add --enable-maintainer-mode option to configure. # From Jim Meyering diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 5c1e9068a29..e691b2cafee 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -41,6 +41,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "ui-out.h" #include "block.h" #include "infcall.h" +#include "dictionary.h" struct cleanup *unresolved_names; @@ -3186,7 +3187,6 @@ static struct symbol * standard_lookup (const char *name, domain_enum domain) { struct symbol *sym; - sym = lookup_symbol (name, (struct block *) NULL, domain, 0, NULL); return sym; } @@ -3439,8 +3439,8 @@ symtab_for_sym (struct symbol *sym) struct objfile *objfile; struct block *b; struct symbol *tmp_sym; - int j; struct dict_iterator iter; + int j; ALL_SYMTABS (objfile, s) { @@ -3454,13 +3454,11 @@ symtab_for_sym (struct symbol *sym) case LOC_BLOCK: case LOC_CONST_BYTES: b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK); - ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) - if (sym == tmp_sym) - return s; + ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym) + return s; b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK); - ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) - if (sym == tmp_sym) - return s; + ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym) + return s; break; default: break; @@ -3483,9 +3481,8 @@ symtab_for_sym (struct symbol *sym) j < BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s)); j += 1) { b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), j); - ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) - if (sym == tmp_sym) - return s; + ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym) + return s; } break; default: @@ -3567,7 +3564,7 @@ add_symbols_from_enclosing_procs (const char *name, domain_enum domain, QUIT; frame = get_prev_frame (frame); } - while (frame != NULL && FRAME_LOCALS_ADDRESS (frame) != target_link); + while (frame != NULL && DEPRECATED_FRAME_LOCALS_ADDRESS (frame) != target_link); if (frame == NULL) break; @@ -4717,8 +4714,6 @@ debug_print_block (struct block *b) fprintf (stderr, "\t Symbols:"); ALL_BLOCK_SYMBOLS (b, iter, sym) { - if (i > 0 && i % 4 == 0) - fprintf (stderr, "\n\t\t "); fprintf (stderr, " %s", DEPRECATED_SYMBOL_NAME (sym)); } fprintf (stderr, "\n"); @@ -7718,7 +7713,7 @@ ada_vax_float_print_function (struct type *type) not alter *PX and *PNEW_K if unsuccessful. */ static int -scan_discrim_bound (char *, int k, struct value *dval, LONGEST * px, +scan_discrim_bound (char *str, int k, struct value *dval, LONGEST * px, int *pnew_k) { static char *bound_buffer = NULL; diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index ae863bd0557..54e56bb0529 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -27,9 +27,9 @@ struct partial_symbol; 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))) +/* A macro to reorder the bytes of an address depending on the + endiannes of the target. */ +#define EXTRACT_ADDRESS(x) ((void *) extract_unsigned_integer (&(x), sizeof (x))) /* A macro to reorder the bytes of an int depending on the endiannes of the target */ #define EXTRACT_INT(x) ((int) extract_signed_integer (&(x), sizeof (x))) diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l index 2252d526a52..d8bc78952bf 100644 --- a/gdb/ada-lex.l +++ b/gdb/ada-lex.l @@ -627,7 +627,7 @@ block_lookup (name, err_name) int nsyms; struct symtab *symtab; nsyms = ada_lookup_symbol_list (name, left_block_context, - VAR_NAMESPACE, &syms, &blocks); + VAR_DOMAIN, &syms, &blocks); if (left_block_context == NULL && (nsyms == 0 || SYMBOL_CLASS (syms[0]) != LOC_BLOCK)) symtab = lookup_symtab (name); @@ -652,7 +652,7 @@ block_lookup (name, err_name) } } -/* Look up NAME0 (assumed to be mangled) as a name in VAR_NAMESPACE, +/* Look up NAME0 (assumed to be mangled) as a name in VAR_DOMAIN, setting *TOKEN_TYPE to NAME or TYPENAME, depending on what is found. Try first the entire name, then the name without the last segment (i.e., after the last .id), etc., and return the number of @@ -685,10 +685,10 @@ name_lookup (name0, err_name, token_type) if (left_block_context == NULL) nsyms = ada_lookup_symbol_list (name, expression_context_block, - VAR_NAMESPACE, &syms, &blocks); + VAR_DOMAIN, &syms, &blocks); else nsyms = ada_lookup_symbol_list (name, left_block_context, - VAR_NAMESPACE, &syms, &blocks); + VAR_DOMAIN, &syms, &blocks); /* Check for a type definition. */ diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index ad67cba10fe..0cf4d832532 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -22,6 +22,7 @@ #include "inferior.h" #include "symtab.h" #include "target.h" +#include "regcache.h" #include "gdbcore.h" #if (defined(__alpha__) && defined(__osf__) && !defined(__alpha_vxworks)) @@ -90,8 +91,6 @@ extern void *GET_CURRENT_THREAD (); #define READ_MEMORY(addr, var) read_memory (addr, (char*) &var, sizeof (var)) /* external declarations */ -extern struct value *find_function_in_inferior (char *); - /* Global visible variables */ struct task_entry *task_list = NULL; diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 11c42bf9e67..f5f411898b2 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -742,9 +742,11 @@ ada_val_print_1 (struct type *type, char *valaddr0, int embedded_offset, if (addressprint) { fprintf_filtered (stream, "@"); + /* Extract an address, assume that the address is unsigned. */ print_address_numeric - (extract_address (valaddr, - TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream); + (extract_unsigned_integer (valaddr, + TARGET_PTR_BIT / HOST_CHAR_BIT), + 1, stream); if (deref_ref) fputs_filtered (": ", stream); } diff --git a/gdb/alpha-linux-tdep.c b/gdb/alpha-linux-tdep.c index c5d7481fbf9..de53b3e71b3 100644 --- a/gdb/alpha-linux-tdep.c +++ b/gdb/alpha-linux-tdep.c @@ -20,96 +20,125 @@ #include "defs.h" #include "frame.h" -#include "gdbcore.h" -#include "value.h" +#include "gdb_assert.h" #include "osabi.h" #include "alpha-tdep.h" -/* Under GNU/Linux, signal handler invocations can be identified by the - designated code sequence that is used to return from a signal +/* Under GNU/Linux, signal handler invocations can be identified by + the designated code sequence that is used to return from a signal handler. In particular, the return address of a signal handler - points to the following sequence (the first instruction is quadword - aligned): - - bis $30,$30,$16 - addq $31,0x67,$0 - call_pal callsys - - Each instruction has a unique encoding, so we simply attempt to - match the instruction the pc is pointing to with any of the above - instructions. If there is a hit, we know the offset to the start - of the designated sequence and can then check whether we really are - executing in a designated sequence. If not, -1 is returned, - otherwise the offset from the start of the desingated sequence is - returned. - - There is a slight chance of false hits: code could jump into the - middle of the designated sequence, in which case there is no - guarantee that we are in the middle of a sigreturn syscall. Don't - think this will be a problem in praxis, though. */ -LONGEST -alpha_linux_sigtramp_offset (CORE_ADDR pc) + points to a sequence that copies $sp to $16, loads $0 with the + appropriate syscall number, and finally enters the kernel. + + This is somewhat complicated in that: + (1) the expansion of the "mov" assembler macro has changed over + time, from "bis src,src,dst" to "bis zero,src,dst", + (2) the kernel has changed from using "addq" to "lda" to load the + syscall number, + (3) there is a "normal" sigreturn and an "rt" sigreturn which + has a different stack layout. +*/ + +static long +alpha_linux_sigtramp_offset_1 (CORE_ADDR pc) { - unsigned int i[3], w; - long off; + switch (alpha_read_insn (pc)) + { + case 0x47de0410: /* bis $30,$30,$16 */ + case 0x47fe0410: /* bis $31,$30,$16 */ + return 0; - if (read_memory_nobpt (pc, (char *) &w, 4) != 0) - return -1; + case 0x43ecf400: /* addq $31,103,$0 */ + case 0x201f0067: /* lda $0,103($31) */ + case 0x201f015f: /* lda $0,351($31) */ + return 4; + + case 0x00000083: /* call_pal callsys */ + return 8; - off = -1; - switch (w) - { - case 0x47de0410: - off = 0; - break; /* bis $30,$30,$16 */ - case 0x43ecf400: - off = 4; - break; /* addq $31,0x67,$0 */ - case 0x00000083: - off = 8; - break; /* call_pal callsys */ default: return -1; } +} + +static LONGEST +alpha_linux_sigtramp_offset (CORE_ADDR pc) +{ + long i, off; + + if (pc & 3) + return -1; + + /* Guess where we might be in the sequence. */ + off = alpha_linux_sigtramp_offset_1 (pc); + if (off < 0) + return -1; + + /* Verify that the other two insns of the sequence are as we expect. */ pc -= off; - if (pc & 0x7) + for (i = 0; i < 12; i += 4) { - /* designated sequence is not quadword aligned */ - return -1; + if (i == off) + continue; + if (alpha_linux_sigtramp_offset_1 (pc + i) != i) + return -1; } - if (read_memory_nobpt (pc, (char *) i, sizeof (i)) != 0) - return -1; - - if (i[0] == 0x47de0410 && i[1] == 0x43ecf400 && i[2] == 0x00000083) - return off; - return -1; + return off; } static int alpha_linux_pc_in_sigtramp (CORE_ADDR pc, char *func_name) { - return (alpha_linux_sigtramp_offset (pc) >= 0); + return alpha_linux_sigtramp_offset (pc) >= 0; } static CORE_ADDR -alpha_linux_sigcontext_addr (struct frame_info *frame) +alpha_linux_sigcontext_addr (struct frame_info *next_frame) { - return (get_frame_base (frame) - 0x298); /* sizeof(struct sigcontext) */ + CORE_ADDR pc; + ULONGEST sp; + long off; + + pc = frame_pc_unwind (next_frame); + frame_unwind_unsigned_register (next_frame, ALPHA_SP_REGNUM, &sp); + + off = alpha_linux_sigtramp_offset (pc); + gdb_assert (off >= 0); + + /* __NR_rt_sigreturn has a couple of structures on the stack. This is: + + struct rt_sigframe { + struct siginfo info; + struct ucontext uc; + }; + + offsetof (struct rt_sigframe, uc.uc_mcontext); + */ + if (alpha_read_insn (pc - off + 4) == 0x201f015f) + return sp + 176; + + /* __NR_sigreturn has the sigcontext structure at the top of the stack. */ + return sp; } static void -alpha_linux_init_abi (struct gdbarch_info info, - struct gdbarch *gdbarch) +alpha_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + struct gdbarch_tdep *tdep; + + /* Hook into the DWARF CFI frame unwinder. */ + alpha_dwarf2_init_abi (info, gdbarch); + + /* Hook into the MDEBUG frame unwinder. */ + alpha_mdebug_init_abi (info, gdbarch); set_gdbarch_pc_in_sigtramp (gdbarch, alpha_linux_pc_in_sigtramp); + tdep = gdbarch_tdep (gdbarch); tdep->dynamic_sigtramp_offset = alpha_linux_sigtramp_offset; tdep->sigcontext_addr = alpha_linux_sigcontext_addr; - tdep->jb_pc = 2; tdep->jb_elt_size = 8; } diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c index af0a336cf6a..342deff22b4 100644 --- a/gdb/alpha-nat.c +++ b/gdb/alpha-nat.c @@ -68,7 +68,7 @@ fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size, OSF/1.2 core files. OSF5 uses different names for the register enum list, need to handle two cases. The actual values are the same. */ - static int core_reg_mapping[ALPHA_NUM_REGS] = + static int const core_reg_mapping[ALPHA_NUM_REGS] = { #ifdef NCF_REGS #define EFL NCF_REGS @@ -94,19 +94,23 @@ fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size, EF_PC, -1 #endif }; - static char zerobuf[ALPHA_MAX_REGISTER_RAW_SIZE] = - {0}; - for (regno = 0; regno < NUM_REGS; regno++) + for (regno = 0; regno < ALPHA_NUM_REGS; regno++) { if (CANNOT_FETCH_REGISTER (regno)) { - supply_register (regno, zerobuf); + supply_register (regno, NULL); continue; } addr = 8 * core_reg_mapping[regno]; if (addr < 0 || addr >= core_reg_size) { + /* ??? UNIQUE is a new addition. Don't generate an error. */ + if (regno == ALPHA_UNIQUE_REGNUM) + { + supply_register (regno, NULL); + continue; + } if (bad_reg < 0) bad_reg = regno; } @@ -131,31 +135,22 @@ fetch_elf_core_registers (char *core_reg_sect, unsigned core_reg_size, return; } - if (which == 2) + switch (which) { - /* The FPU Registers. */ - memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)], - core_reg_sect, 31 * 8); - memset (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM + 31)], 0, 8); - memset (&deprecated_register_valid[FP0_REGNUM], 1, 32); - } - else - { - /* The General Registers. */ - memcpy (&deprecated_registers[REGISTER_BYTE (ALPHA_V0_REGNUM)], - core_reg_sect, 31 * 8); - memcpy (&deprecated_registers[REGISTER_BYTE (PC_REGNUM)], - core_reg_sect + 31 * 8, 8); - memset (&deprecated_registers[REGISTER_BYTE (ALPHA_ZERO_REGNUM)], 0, 8); - memset (&deprecated_register_valid[ALPHA_V0_REGNUM], 1, 32); - deprecated_register_valid[PC_REGNUM] = 1; - - if (core_reg_size >= 33 * 8) - { - memcpy (&deprecated_registers[REGISTER_BYTE (ALPHA_UNIQUE_REGNUM)], - core_reg_sect + 32 * 8, 8); - deprecated_register_valid[ALPHA_UNIQUE_REGNUM] = 1; - } + case 0: /* integer registers */ + /* PC is in slot 32; UNIQUE is in slot 33, if present. */ + alpha_supply_int_regs (-1, core_reg_sect, core_reg_sect + 31*8, + (core_reg_size >= 33 * 8 + ? core_reg_sect + 32*8 : NULL)); + break; + + case 2: /* floating-point registers */ + /* FPCR is in slot 32. */ + alpha_supply_fp_regs (-1, core_reg_sect, core_reg_sect + 31*8); + break; + + default: + break; } } @@ -193,6 +188,11 @@ kernel_u_size (void) /* Prototypes for supply_gregset etc. */ #include "gregset.h" +/* Locate the UNIQUE value within the gregset_t. */ +#ifndef ALPHA_REGSET_UNIQUE +#define ALPHA_REGSET_UNIQUE(ptr) NULL +#endif + /* * See the comment in m68k-tdep.c regarding the utility of these functions. */ @@ -200,33 +200,21 @@ kernel_u_size (void) void supply_gregset (gdb_gregset_t *gregsetp) { - register int regi; register long *regp = ALPHA_REGSET_BASE (gregsetp); - static char zerobuf[ALPHA_MAX_REGISTER_RAW_SIZE] = - {0}; + void *unique = ALPHA_REGSET_UNIQUE (gregsetp); - for (regi = 0; regi < 31; regi++) - supply_register (regi, (char *) (regp + regi)); - - supply_register (PC_REGNUM, (char *) (regp + 31)); - - /* Fill inaccessible registers with zero. */ - supply_register (ALPHA_ZERO_REGNUM, zerobuf); - supply_register (DEPRECATED_FP_REGNUM, zerobuf); + /* PC is in slot 32. */ + alpha_supply_int_regs (-1, regp, regp + 31, unique); } void fill_gregset (gdb_gregset_t *gregsetp, int regno) { - int regi; register long *regp = ALPHA_REGSET_BASE (gregsetp); + void *unique = ALPHA_REGSET_UNIQUE (gregsetp); - for (regi = 0; regi < 31; regi++) - if ((regno == -1) || (regno == regi)) - *(regp + regi) = *(long *) &deprecated_registers[REGISTER_BYTE (regi)]; - - if ((regno == -1) || (regno == PC_REGNUM)) - *(regp + 31) = *(long *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)]; + /* PC is in slot 32. */ + alpha_fill_int_regs (regno, regp, regp + 31, unique); } /* @@ -237,27 +225,19 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno) void supply_fpregset (gdb_fpregset_t *fpregsetp) { - register int regi; register long *regp = ALPHA_REGSET_BASE (fpregsetp); - for (regi = 0; regi < 32; regi++) - supply_register (regi + FP0_REGNUM, (char *) (regp + regi)); + /* FPCR is in slot 32. */ + alpha_supply_fp_regs (-1, regp, regp + 31); } void fill_fpregset (gdb_fpregset_t *fpregsetp, int regno) { - int regi; register long *regp = ALPHA_REGSET_BASE (fpregsetp); - for (regi = FP0_REGNUM; regi < FP0_REGNUM + 32; regi++) - { - if ((regno == -1) || (regno == regi)) - { - *(regp + regi - FP0_REGNUM) = - *(long *) &deprecated_registers[REGISTER_BYTE (regi)]; - } - } + /* FPCR is in slot 32. */ + alpha_fill_fp_regs (regno, regp, regp + 31); } #endif diff --git a/gdb/alpha-osf1-tdep.c b/gdb/alpha-osf1-tdep.c index 4eaa3c4013c..ca757de660f 100644 --- a/gdb/alpha-osf1-tdep.c +++ b/gdb/alpha-osf1-tdep.c @@ -24,22 +24,10 @@ #include "value.h" #include "osabi.h" #include "gdb_string.h" +#include "objfiles.h" #include "alpha-tdep.h" -/* Under OSF/1, the __sigtramp routine is frameless and has a frame - size of zero, but we are able to backtrace through it. */ -static CORE_ADDR -alpha_osf1_skip_sigtramp_frame (struct frame_info *frame, CORE_ADDR pc) -{ - char *name; - - find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL); - if (PC_IN_SIGTRAMP (pc, name)) - return frame->frame; - return 0; -} - static int alpha_osf1_pc_in_sigtramp (CORE_ADDR pc, char *func_name) { @@ -49,8 +37,36 @@ alpha_osf1_pc_in_sigtramp (CORE_ADDR pc, char *func_name) static CORE_ADDR alpha_osf1_sigcontext_addr (struct frame_info *frame) { - return (read_memory_integer (frame->next ? frame->next->frame - : frame->frame, 8)); + struct frame_info *next_frame = get_next_frame (frame); + + if (next_frame != NULL) + return (read_memory_integer (get_frame_base (next_frame), 8)); + else + return (read_memory_integer (get_frame_base (frame), 8)); +} + +/* This is the definition of CALL_DUMMY_ADDRESS. It's a heuristic that is used + to find a convenient place in the text segment to stick a breakpoint to + detect the completion of a target function call (ala call_function_by_hand). + */ + +static CORE_ADDR +alpha_call_dummy_address (void) +{ + CORE_ADDR entry; + struct minimal_symbol *sym; + + entry = entry_point_address (); + + if (entry != 0) + return entry; + + sym = lookup_minimal_symbol ("_Prelude", NULL, symfile_objfile); + + if (!sym || MSYMBOL_TYPE (sym) != mst_text) + return 0; + else + return SYMBOL_VALUE_ADDRESS (sym) + 4; } static void @@ -59,13 +75,20 @@ alpha_osf1_init_abi (struct gdbarch_info info, { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + /* Hook into the MDEBUG frame unwinder. */ + alpha_mdebug_init_abi (info, gdbarch); + set_gdbarch_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp); /* The next/step support via procfs on OSF1 is broken when running on multi-processor machines. We need to use software single stepping instead. */ set_gdbarch_software_single_step (gdbarch, alpha_software_single_step); - tdep->skip_sigtramp_frame = alpha_osf1_skip_sigtramp_frame; + /* 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 + argument handling and bp_call_dummy takes care of stopping the dummy. */ + set_gdbarch_call_dummy_address (gdbarch, alpha_call_dummy_address); + tdep->sigcontext_addr = alpha_osf1_sigcontext_addr; tdep->jb_pc = 2; diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index ad7ca747507..fb2ca1851b5 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -20,7 +20,11 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include "doublest.h" #include "frame.h" +#include "frame-unwind.h" +#include "frame-base.h" +#include "dwarf2-frame.h" #include "inferior.h" #include "symtab.h" #include "value.h" @@ -32,7 +36,7 @@ #include "gdb_string.h" #include "linespec.h" #include "regcache.h" -#include "doublest.h" +#include "reggroups.h" #include "arch-utils.h" #include "osabi.h" #include "block.h" @@ -41,234 +45,11 @@ #include "alpha-tdep.h" -static gdbarch_init_ftype alpha_gdbarch_init; - -static gdbarch_register_name_ftype alpha_register_name; -static gdbarch_register_raw_size_ftype alpha_register_raw_size; -static gdbarch_register_virtual_size_ftype alpha_register_virtual_size; -static gdbarch_register_virtual_type_ftype alpha_register_virtual_type; -static gdbarch_register_byte_ftype alpha_register_byte; -static gdbarch_cannot_fetch_register_ftype alpha_cannot_fetch_register; -static gdbarch_cannot_store_register_ftype alpha_cannot_store_register; -static gdbarch_register_convertible_ftype alpha_register_convertible; -static gdbarch_register_convert_to_virtual_ftype - alpha_register_convert_to_virtual; -static gdbarch_register_convert_to_raw_ftype alpha_register_convert_to_raw; -static gdbarch_deprecated_extract_return_value_ftype alpha_extract_return_value; -static gdbarch_deprecated_extract_struct_value_address_ftype - alpha_extract_struct_value_address; -static gdbarch_use_struct_convention_ftype alpha_use_struct_convention; - -static gdbarch_breakpoint_from_pc_ftype alpha_breakpoint_from_pc; - -static gdbarch_frame_args_address_ftype alpha_frame_args_address; -static gdbarch_frame_locals_address_ftype alpha_frame_locals_address; - -static gdbarch_skip_prologue_ftype alpha_skip_prologue; - -static gdbarch_get_longjmp_target_ftype alpha_get_longjmp_target; - -struct frame_extra_info - { - alpha_extra_func_info_t proc_desc; - int localoff; - int pc_reg; - }; - -/* FIXME: Some of this code should perhaps be merged with mips-tdep.c. */ - -/* Prototypes for local functions. */ - -static void alpha_find_saved_regs (struct frame_info *); - -static alpha_extra_func_info_t push_sigtramp_desc (CORE_ADDR low_addr); - -static CORE_ADDR read_next_frame_reg (struct frame_info *, int); - -static CORE_ADDR heuristic_proc_start (CORE_ADDR); - -static alpha_extra_func_info_t heuristic_proc_desc (CORE_ADDR, - CORE_ADDR, - struct frame_info *); - -static alpha_extra_func_info_t find_proc_desc (CORE_ADDR, - struct frame_info *); - -#if 0 -static int alpha_in_lenient_prologue (CORE_ADDR, CORE_ADDR); -#endif - -static void reinit_frame_cache_sfunc (char *, int, struct cmd_list_element *); - -static CORE_ADDR after_prologue (CORE_ADDR pc, - alpha_extra_func_info_t proc_desc); - -static int alpha_in_prologue (CORE_ADDR pc, - alpha_extra_func_info_t proc_desc); - -static int alpha_about_to_return (CORE_ADDR pc); - -void _initialize_alpha_tdep (void); - -/* Heuristic_proc_start may hunt through the text section for a long - time across a 2400 baud serial line. Allows the user to limit this - search. */ -static unsigned int heuristic_fence_post = 0; -/* *INDENT-OFF* */ -/* Layout of a stack frame on the alpha: - - | | - pdr members: | 7th ... nth arg, | - | `pushed' by caller. | - | | -----------------|-------------------------------|<-- old_sp == vfp - ^ ^ ^ ^ | | - | | | | | | - | |localoff | Copies of 1st .. 6th | - | | | | | argument if necessary. | - | | | v | | - | | | --- |-------------------------------|<-- FRAME_LOCALS_ADDRESS - | | | | | - | | | | Locals and temporaries. | - | | | | | - | | | |-------------------------------| - | | | | | - |-fregoffset | Saved float registers. | - | | | | F9 | - | | | | . | - | | | | . | - | | | | F2 | - | | v | | - | | -------|-------------------------------| - | | | | - | | | Saved registers. | - | | | S6 | - |-regoffset | . | - | | | . | - | | | S0 | - | | | pdr.pcreg | - | v | | - | ----------|-------------------------------| - | | | - frameoffset | Argument build area, gets | - | | 7th ... nth arg for any | - | | called procedure. | - v | | - -------------|-------------------------------|<-- sp - | | -*/ -/* *INDENT-ON* */ - -#define PROC_LOW_ADDR(proc) ((proc)->pdr.adr) /* least address */ -/* These next two fields are kind of being hijacked. I wonder if - iline is too small for the values it needs to hold, if GDB is - running on a 32-bit host. */ -#define PROC_HIGH_ADDR(proc) ((proc)->pdr.iline) /* upper address bound */ -#define PROC_DUMMY_FRAME(proc) ((proc)->pdr.cbLineOffset) /*CALL_DUMMY frame */ -#define PROC_FRAME_OFFSET(proc) ((proc)->pdr.frameoffset) -#define PROC_FRAME_REG(proc) ((proc)->pdr.framereg) -#define PROC_REG_MASK(proc) ((proc)->pdr.regmask) -#define PROC_FREG_MASK(proc) ((proc)->pdr.fregmask) -#define PROC_REG_OFFSET(proc) ((proc)->pdr.regoffset) -#define PROC_FREG_OFFSET(proc) ((proc)->pdr.fregoffset) -#define PROC_PC_REG(proc) ((proc)->pdr.pcreg) -#define PROC_LOCALOFF(proc) ((proc)->pdr.localoff) -#define PROC_SYMBOL(proc) (*(struct symbol**)&(proc)->pdr.isym) -#define _PROC_MAGIC_ 0x0F0F0F0F -#define PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym == _PROC_MAGIC_) -#define SET_PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym = _PROC_MAGIC_) - -struct linked_proc_info - { - struct alpha_extra_func_info info; - struct linked_proc_info *next; - } - *linked_proc_desc_table = NULL; - -static CORE_ADDR -alpha_frame_past_sigtramp_frame (struct frame_info *frame, CORE_ADDR pc) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - - if (tdep->skip_sigtramp_frame != NULL) - return (tdep->skip_sigtramp_frame (frame, pc)); - - return (0); -} - -static LONGEST -alpha_dynamic_sigtramp_offset (CORE_ADDR pc) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - - /* Must be provided by OS/ABI variant code if supported. */ - if (tdep->dynamic_sigtramp_offset != NULL) - return (tdep->dynamic_sigtramp_offset (pc)); - - return (-1); -} - -#define ALPHA_PROC_SIGTRAMP_MAGIC 0x0e0f0f0f - -/* Return TRUE if the procedure descriptor PROC is a procedure - descriptor that refers to a dynamically generated signal - trampoline routine. */ -static int -alpha_proc_desc_is_dyn_sigtramp (struct alpha_extra_func_info *proc) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - - if (tdep->dynamic_sigtramp_offset != NULL) - return (proc->pdr.isym == ALPHA_PROC_SIGTRAMP_MAGIC); - - return (0); -} - -static void -alpha_set_proc_desc_is_dyn_sigtramp (struct alpha_extra_func_info *proc) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - - if (tdep->dynamic_sigtramp_offset != NULL) - proc->pdr.isym = ALPHA_PROC_SIGTRAMP_MAGIC; -} - -/* Dynamically create a signal-handler caller procedure descriptor for - the signal-handler return code starting at address LOW_ADDR. The - descriptor is added to the linked_proc_desc_table. */ - -static alpha_extra_func_info_t -push_sigtramp_desc (CORE_ADDR low_addr) -{ - struct linked_proc_info *link; - alpha_extra_func_info_t proc_desc; - - link = (struct linked_proc_info *) - xmalloc (sizeof (struct linked_proc_info)); - link->next = linked_proc_desc_table; - linked_proc_desc_table = link; - - proc_desc = &link->info; - - proc_desc->numargs = 0; - PROC_LOW_ADDR (proc_desc) = low_addr; - PROC_HIGH_ADDR (proc_desc) = low_addr + 3 * 4; - PROC_DUMMY_FRAME (proc_desc) = 0; - PROC_FRAME_OFFSET (proc_desc) = 0x298; /* sizeof(struct sigcontext_struct) */ - PROC_FRAME_REG (proc_desc) = SP_REGNUM; - PROC_REG_MASK (proc_desc) = 0xffff; - PROC_FREG_MASK (proc_desc) = 0xffff; - PROC_PC_REG (proc_desc) = 26; - PROC_LOCALOFF (proc_desc) = 0; - alpha_set_proc_desc_is_dyn_sigtramp (proc_desc); - return (proc_desc); -} - static const char * alpha_register_name (int regno) { - static char *register_names[] = + static const char * const register_names[] = { "v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "s0", "s1", "s2", "s3", "s4", "s5", "fp", @@ -278,39 +59,83 @@ alpha_register_name (int regno) "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", "f30", "fpcr", - "pc", "vfp", "unique", + "pc", "", "unique" }; if (regno < 0) - return (NULL); + return NULL; if (regno >= (sizeof(register_names) / sizeof(*register_names))) - return (NULL); - return (register_names[regno]); + return NULL; + return register_names[regno]; } static int alpha_cannot_fetch_register (int regno) { - return (regno == DEPRECATED_FP_REGNUM || regno == ALPHA_ZERO_REGNUM); + return regno == ALPHA_ZERO_REGNUM; } static int alpha_cannot_store_register (int regno) { - return (regno == DEPRECATED_FP_REGNUM || regno == ALPHA_ZERO_REGNUM); + return regno == ALPHA_ZERO_REGNUM; } -static int -alpha_register_convertible (int regno) +static struct type * +alpha_register_type (struct gdbarch *gdbarch, int regno) { - return (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 31); + if (regno == ALPHA_SP_REGNUM || regno == ALPHA_GP_REGNUM) + return builtin_type_void_data_ptr; + if (regno == ALPHA_PC_REGNUM) + return builtin_type_void_func_ptr; + + /* Don't need to worry about little vs big endian until + some jerk tries to port to alpha-unicosmk. */ + if (regno >= ALPHA_FP0_REGNUM && regno < ALPHA_FP0_REGNUM + 31) + return builtin_type_ieee_double_little; + + return builtin_type_int64; } -static struct type * -alpha_register_virtual_type (int regno) +/* Is REGNUM a member of REGGROUP? */ + +static int +alpha_register_reggroup_p (struct gdbarch *gdbarch, int regnum, + struct reggroup *group) { - return ((regno >= FP0_REGNUM && regno < (FP0_REGNUM+31)) - ? builtin_type_double : builtin_type_long); + /* Filter out any registers eliminated, but whose regnum is + reserved for backward compatibility, e.g. the vfp. */ + if (REGISTER_NAME (regnum) == NULL || *REGISTER_NAME (regnum) == '\0') + return 0; + + if (group == all_reggroup) + return 1; + + /* Zero should not be saved or restored. Technically it is a general + register (just as $f31 would be a float if we represented it), but + there's no point displaying it during "info regs", so leave it out + of all groups except for "all". */ + if (regnum == ALPHA_ZERO_REGNUM) + return 0; + + /* All other registers are saved and restored. */ + if (group == save_reggroup || group == restore_reggroup) + return 1; + + /* All other groups are non-overlapping. */ + + /* Since this is really a PALcode memory slot... */ + if (regnum == ALPHA_UNIQUE_REGNUM) + return group == system_reggroup; + + /* Force the FPCR to be considered part of the floating point state. */ + if (regnum == ALPHA_FPCR_REGNUM) + return group == float_reggroup; + + if (regnum >= ALPHA_FP0_REGNUM && regnum < ALPHA_FP0_REGNUM + 31) + return group == float_reggroup; + else + return group == general_reggroup; } static int @@ -330,1228 +155,1078 @@ alpha_register_virtual_size (int regno) { return 8; } - - -static CORE_ADDR -alpha_sigcontext_addr (struct frame_info *fi) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - - if (tdep->sigcontext_addr) - return (tdep->sigcontext_addr (fi)); - - return (0); -} -/* Guaranteed to set frame->saved_regs to some values (it never leaves it - NULL). */ +/* The following represents exactly the conversion performed by + the LDS instruction. This applies to both single-precision + floating point and 32-bit integers. */ static void -alpha_find_saved_regs (struct frame_info *frame) +alpha_lds (void *out, const void *in) { - int ireg; - CORE_ADDR reg_position; - unsigned long mask; - alpha_extra_func_info_t proc_desc; - int returnreg; - - frame_saved_regs_zalloc (frame); - - /* If it is the frame for __sigtramp, the saved registers are located - in a sigcontext structure somewhere on the stack. __sigtramp - passes a pointer to the sigcontext structure on the stack. - If the stack layout for __sigtramp changes, or if sigcontext offsets - change, we might have to update this code. */ -#ifndef SIGFRAME_PC_OFF -#define SIGFRAME_PC_OFF (2 * 8) -#define SIGFRAME_REGSAVE_OFF (4 * 8) -#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_REGSAVE_OFF + 32 * 8 + 8) -#endif - if ((get_frame_type (frame) == SIGTRAMP_FRAME)) + ULONGEST mem = extract_unsigned_integer (in, 4); + ULONGEST frac = (mem >> 0) & 0x7fffff; + ULONGEST sign = (mem >> 31) & 1; + ULONGEST exp_msb = (mem >> 30) & 1; + ULONGEST exp_low = (mem >> 23) & 0x7f; + ULONGEST exp, reg; + + exp = (exp_msb << 10) | exp_low; + if (exp_msb) { - CORE_ADDR sigcontext_addr; - - sigcontext_addr = alpha_sigcontext_addr (frame); - if (sigcontext_addr == 0) - { - /* Don't know where the sigcontext is; just bail. */ - return; - } - for (ireg = 0; ireg < 32; ireg++) - { - reg_position = sigcontext_addr + SIGFRAME_REGSAVE_OFF + ireg * 8; - get_frame_saved_regs (frame)[ireg] = reg_position; - } - for (ireg = 0; ireg < 32; ireg++) - { - reg_position = sigcontext_addr + SIGFRAME_FPREGSAVE_OFF + ireg * 8; - get_frame_saved_regs (frame)[FP0_REGNUM + ireg] = reg_position; - } - get_frame_saved_regs (frame)[PC_REGNUM] = sigcontext_addr + SIGFRAME_PC_OFF; - return; + if (exp_low == 0x7f) + exp = 0x7ff; } - - proc_desc = get_frame_extra_info (frame)->proc_desc; - if (proc_desc == NULL) - /* I'm not sure how/whether this can happen. Normally when we can't - find a proc_desc, we "synthesize" one using heuristic_proc_desc - and set the saved_regs right away. */ - return; - - /* Fill in the offsets for the registers which gen_mask says - were saved. */ - - reg_position = get_frame_base (frame) + PROC_REG_OFFSET (proc_desc); - mask = PROC_REG_MASK (proc_desc); - - returnreg = PROC_PC_REG (proc_desc); - - /* Note that RA is always saved first, regardless of its actual - register number. */ - if (mask & (1 << returnreg)) + else { - get_frame_saved_regs (frame)[returnreg] = reg_position; - reg_position += 8; - mask &= ~(1 << returnreg); /* Clear bit for RA so we - don't save again later. */ + if (exp_low != 0x00) + exp |= 0x380; } - for (ireg = 0; ireg <= 31; ++ireg) - if (mask & (1 << ireg)) - { - get_frame_saved_regs (frame)[ireg] = reg_position; - reg_position += 8; - } + reg = (sign << 63) | (exp << 52) | (frac << 29); + store_unsigned_integer (out, 8, reg); +} + +/* Similarly, this represents exactly the conversion performed by + the STS instruction. */ - /* Fill in the offsets for the registers which float_mask says - were saved. */ +static inline void +alpha_sts (void *out, const void *in) +{ + ULONGEST reg, mem; - reg_position = get_frame_base (frame) + PROC_FREG_OFFSET (proc_desc); - mask = PROC_FREG_MASK (proc_desc); + reg = extract_unsigned_integer (in, 8); + mem = ((reg >> 32) & 0xc0000000) | ((reg >> 29) & 0x3fffffff); + store_unsigned_integer (out, 4, mem); +} - for (ireg = 0; ireg <= 31; ++ireg) - if (mask & (1 << ireg)) - { - get_frame_saved_regs (frame)[FP0_REGNUM + ireg] = reg_position; - reg_position += 8; - } +/* The alpha needs a conversion between register and memory format if the + register is a floating point register and memory format is float, as the + register format must be double or memory format is an integer with 4 + bytes or less, as the representation of integers in floating point + registers is different. */ - get_frame_saved_regs (frame)[PC_REGNUM] = get_frame_saved_regs (frame)[returnreg]; +static int +alpha_convert_register_p (int regno, struct type *type) +{ + return (regno >= ALPHA_FP0_REGNUM && regno < ALPHA_FP0_REGNUM + 31); } static void -alpha_frame_init_saved_regs (struct frame_info *fi) +alpha_register_to_value (struct frame_info *frame, int regnum, + struct type *valtype, void *out) { - if (get_frame_saved_regs (fi) == NULL) - alpha_find_saved_regs (fi); - get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi); + char in[MAX_REGISTER_SIZE]; + frame_register_read (frame, regnum, in); + switch (TYPE_LENGTH (valtype)) + { + case 4: + alpha_sts (out, in); + break; + case 8: + memcpy (out, in, 8); + break; + default: + error ("Cannot retrieve value from floating point register"); + } } -static CORE_ADDR -alpha_init_frame_pc_first (int fromleaf, struct frame_info *prev) +static void +alpha_value_to_register (struct frame_info *frame, int regnum, + struct type *valtype, const void *in) { - return (fromleaf - ? DEPRECATED_SAVED_PC_AFTER_CALL (get_next_frame (prev)) - : get_next_frame (prev) - ? DEPRECATED_FRAME_SAVED_PC (get_next_frame (prev)) - : read_pc ()); + char out[MAX_REGISTER_SIZE]; + switch (TYPE_LENGTH (valtype)) + { + case 4: + alpha_lds (out, in); + break; + case 8: + memcpy (out, in, 8); + break; + default: + error ("Cannot store value in floating point register"); + } + put_frame_register (frame, regnum, out); } + +/* The alpha passes the first six arguments in the registers, the rest on + the stack. The register arguments are stored in ARG_REG_BUFFER, and + then moved into the register file; this simplifies the passing of a + large struct which extends from the registers to the stack, plus avoids + three ptrace invocations per word. + + We don't bother tracking which register values should go in integer + regs or fp regs; we load the same values into both. + + If the called function is returning a structure, the address of the + structure to be returned is passed as a hidden first argument. */ + static CORE_ADDR -read_next_frame_reg (struct frame_info *fi, int regno) +alpha_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, + struct regcache *regcache, CORE_ADDR bp_addr, + int nargs, struct value **args, CORE_ADDR sp, + int struct_return, CORE_ADDR struct_addr) { - for (; fi; fi = get_next_frame (fi)) + int i; + int accumulate_size = struct_return ? 8 : 0; + struct alpha_arg { - /* We have to get the saved sp from the sigcontext - if it is a signal handler frame. */ - if (regno == SP_REGNUM && !(get_frame_type (fi) == SIGTRAMP_FRAME)) - return get_frame_base (fi); - else + char *contents; + int len; + int offset; + }; + struct alpha_arg *alpha_args + = (struct alpha_arg *) alloca (nargs * sizeof (struct alpha_arg)); + register struct alpha_arg *m_arg; + char arg_reg_buffer[ALPHA_REGISTER_SIZE * ALPHA_NUM_ARG_REGS]; + int required_arg_regs; + + /* The ABI places the address of the called function in T12. */ + regcache_cooked_write_signed (regcache, ALPHA_T12_REGNUM, func_addr); + + /* Set the return address register to point to the entry point + of the program, where a breakpoint lies in wait. */ + regcache_cooked_write_signed (regcache, ALPHA_RA_REGNUM, bp_addr); + + /* Lay out the arguments in memory. */ + for (i = 0, m_arg = alpha_args; i < nargs; i++, m_arg++) + { + struct value *arg = args[i]; + struct type *arg_type = check_typedef (VALUE_TYPE (arg)); + + /* Cast argument to long if necessary as the compiler does it too. */ + switch (TYPE_CODE (arg_type)) { - if (get_frame_saved_regs (fi) == NULL) - alpha_find_saved_regs (fi); - if (get_frame_saved_regs (fi)[regno]) - return read_memory_integer (get_frame_saved_regs (fi)[regno], 8); + case TYPE_CODE_INT: + case TYPE_CODE_BOOL: + case TYPE_CODE_CHAR: + case TYPE_CODE_RANGE: + case TYPE_CODE_ENUM: + if (TYPE_LENGTH (arg_type) == 4) + { + /* 32-bit values must be sign-extended to 64 bits + even if the base data type is unsigned. */ + arg_type = builtin_type_int32; + arg = value_cast (arg_type, arg); + } + if (TYPE_LENGTH (arg_type) < ALPHA_REGISTER_SIZE) + { + arg_type = builtin_type_int64; + arg = value_cast (arg_type, arg); + } + break; + + case TYPE_CODE_FLT: + /* "float" arguments loaded in registers must be passed in + register format, aka "double". */ + if (accumulate_size < sizeof (arg_reg_buffer) + && TYPE_LENGTH (arg_type) == 4) + { + arg_type = builtin_type_ieee_double_little; + arg = value_cast (arg_type, arg); + } + /* Tru64 5.1 has a 128-bit long double, and passes this by + invisible reference. No one else uses this data type. */ + else if (TYPE_LENGTH (arg_type) == 16) + { + /* Allocate aligned storage. */ + sp = (sp & -16) - 16; + + /* Write the real data into the stack. */ + write_memory (sp, VALUE_CONTENTS (arg), 16); + + /* Construct the indirection. */ + arg_type = lookup_pointer_type (arg_type); + arg = value_from_pointer (arg_type, sp); + } + break; + + case TYPE_CODE_COMPLEX: + /* ??? The ABI says that complex values are passed as two + separate scalar values. This distinction only matters + for complex float. However, GCC does not implement this. */ + + /* Tru64 5.1 has a 128-bit long double, and passes this by + invisible reference. */ + if (TYPE_LENGTH (arg_type) == 32) + { + /* Allocate aligned storage. */ + sp = (sp & -16) - 16; + + /* Write the real data into the stack. */ + write_memory (sp, VALUE_CONTENTS (arg), 32); + + /* Construct the indirection. */ + arg_type = lookup_pointer_type (arg_type); + arg = value_from_pointer (arg_type, sp); + } + break; + + default: + break; } + m_arg->len = TYPE_LENGTH (arg_type); + m_arg->offset = accumulate_size; + accumulate_size = (accumulate_size + m_arg->len + 7) & ~7; + m_arg->contents = VALUE_CONTENTS (arg); } - return read_register (regno); -} -static CORE_ADDR -alpha_frame_saved_pc (struct frame_info *frame) -{ - alpha_extra_func_info_t proc_desc = get_frame_extra_info (frame)->proc_desc; - /* We have to get the saved pc from the sigcontext - if it is a signal handler frame. */ - int pcreg = ((get_frame_type (frame) == SIGTRAMP_FRAME) - ? PC_REGNUM - : get_frame_extra_info (frame)->pc_reg); + /* Determine required argument register loads, loading an argument register + is expensive as it uses three ptrace calls. */ + required_arg_regs = accumulate_size / 8; + if (required_arg_regs > ALPHA_NUM_ARG_REGS) + required_arg_regs = ALPHA_NUM_ARG_REGS; - if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc)) - return read_memory_integer (get_frame_base (frame) - 8, 8); + /* Make room for the arguments on the stack. */ + if (accumulate_size < sizeof(arg_reg_buffer)) + accumulate_size = 0; + else + accumulate_size -= sizeof(arg_reg_buffer); + sp -= accumulate_size; - return read_next_frame_reg (frame, pcreg); -} + /* Keep sp aligned to a multiple of 16 as the ABI requires. */ + sp &= ~15; -static CORE_ADDR -alpha_saved_pc_after_call (struct frame_info *frame) -{ - CORE_ADDR pc = get_frame_pc (frame); - CORE_ADDR tmp; - alpha_extra_func_info_t proc_desc; - int pcreg; + /* `Push' arguments on the stack. */ + for (i = nargs; m_arg--, --i >= 0;) + { + char *contents = m_arg->contents; + int offset = m_arg->offset; + int len = m_arg->len; - /* Skip over shared library trampoline if necessary. */ - tmp = SKIP_TRAMPOLINE_CODE (pc); - if (tmp != 0) - pc = tmp; + /* Copy the bytes destined for registers into arg_reg_buffer. */ + if (offset < sizeof(arg_reg_buffer)) + { + if (offset + len <= sizeof(arg_reg_buffer)) + { + memcpy (arg_reg_buffer + offset, contents, len); + continue; + } + else + { + int tlen = sizeof(arg_reg_buffer) - offset; + memcpy (arg_reg_buffer + offset, contents, tlen); + offset += tlen; + contents += tlen; + len -= tlen; + } + } - proc_desc = find_proc_desc (pc, get_next_frame (frame)); - pcreg = proc_desc ? PROC_PC_REG (proc_desc) : ALPHA_RA_REGNUM; + /* Everything else goes to the stack. */ + write_memory (sp + offset - sizeof(arg_reg_buffer), contents, len); + } + if (struct_return) + store_unsigned_integer (arg_reg_buffer, ALPHA_REGISTER_SIZE, struct_addr); - if ((get_frame_type (frame) == SIGTRAMP_FRAME)) - return alpha_frame_saved_pc (frame); - else - return read_register (pcreg); -} + /* Load the argument registers. */ + for (i = 0; i < required_arg_regs; i++) + { + regcache_cooked_write (regcache, ALPHA_A0_REGNUM + i, + arg_reg_buffer + i*ALPHA_REGISTER_SIZE); + regcache_cooked_write (regcache, ALPHA_FPA0_REGNUM + i, + arg_reg_buffer + i*ALPHA_REGISTER_SIZE); + } + /* Finally, update the stack pointer. */ + regcache_cooked_write_signed (regcache, ALPHA_SP_REGNUM, sp); -static struct alpha_extra_func_info temp_proc_desc; -static CORE_ADDR temp_saved_regs[ALPHA_NUM_REGS]; + return sp; +} -/* Nonzero if instruction at PC is a return instruction. "ret - $zero,($ra),1" on alpha. */ +/* Extract from REGCACHE the value about to be returned from a function + and copy it into VALBUF. */ -static int -alpha_about_to_return (CORE_ADDR pc) +static void +alpha_extract_return_value (struct type *valtype, struct regcache *regcache, + void *valbuf) { - return read_memory_integer (pc, 4) == 0x6bfa8001; -} + int length = TYPE_LENGTH (valtype); + char raw_buffer[ALPHA_REGISTER_SIZE]; + ULONGEST l; + switch (TYPE_CODE (valtype)) + { + case TYPE_CODE_FLT: + switch (length) + { + case 4: + regcache_cooked_read (regcache, ALPHA_FP0_REGNUM, raw_buffer); + alpha_sts (valbuf, raw_buffer); + break; + case 8: + regcache_cooked_read (regcache, ALPHA_FP0_REGNUM, valbuf); + break; -/* This fencepost looks highly suspicious to me. Removing it also - seems suspicious as it could affect remote debugging across serial - lines. */ + case 16: + regcache_cooked_read_unsigned (regcache, ALPHA_V0_REGNUM, &l); + read_memory (l, valbuf, 16); + break; -static CORE_ADDR -heuristic_proc_start (CORE_ADDR pc) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - CORE_ADDR start_pc = pc; - CORE_ADDR fence = start_pc - heuristic_fence_post; + default: + internal_error (__FILE__, __LINE__, "unknown floating point width"); + } + break; - if (start_pc == 0) - return 0; + case TYPE_CODE_COMPLEX: + switch (length) + { + case 8: + /* ??? This isn't correct wrt the ABI, but it's what GCC does. */ + regcache_cooked_read (regcache, ALPHA_FP0_REGNUM, valbuf); + break; - if (heuristic_fence_post == UINT_MAX - || fence < tdep->vm_min_address) - fence = tdep->vm_min_address; + case 16: + regcache_cooked_read (regcache, ALPHA_FP0_REGNUM, valbuf); + regcache_cooked_read (regcache, ALPHA_FP0_REGNUM+1, + (char *)valbuf + 8); + break; - /* search back for previous return */ - for (start_pc -= 4;; start_pc -= 4) - if (start_pc < fence) - { - /* It's not clear to me why we reach this point when - stop_soon, but with this test, at least we - don't print out warnings for every child forked (eg, on - decstation). 22apr93 rich@cygnus.com. */ - if (stop_soon == NO_STOP_QUIETLY) - { - static int blurb_printed = 0; - - if (fence == tdep->vm_min_address) - warning ("Hit beginning of text section without finding"); - else - warning ("Hit heuristic-fence-post without finding"); - - warning ("enclosing function for address 0x%s", paddr_nz (pc)); - if (!blurb_printed) - { - printf_filtered ("\ -This warning occurs if you are debugging a function without any symbols\n\ -(for example, in a stripped executable). In that case, you may wish to\n\ -increase the size of the search with the `set heuristic-fence-post' command.\n\ -\n\ -Otherwise, you told GDB there was a function where there isn't one, or\n\ -(more likely) you have encountered a bug in GDB.\n"); - blurb_printed = 1; - } - } + case 32: + regcache_cooked_read_signed (regcache, ALPHA_V0_REGNUM, &l); + read_memory (l, valbuf, 32); + break; - return 0; - } - else if (alpha_about_to_return (start_pc)) + default: + internal_error (__FILE__, __LINE__, "unknown floating point width"); + } break; - start_pc += 4; /* skip return */ - return start_pc; + default: + /* Assume everything else degenerates to an integer. */ + regcache_cooked_read_unsigned (regcache, ALPHA_V0_REGNUM, &l); + store_unsigned_integer (valbuf, length, l); + break; + } } -static alpha_extra_func_info_t -heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, - struct frame_info *next_frame) +/* Extract from REGCACHE the address of a structure about to be returned + from a function. */ + +static CORE_ADDR +alpha_extract_struct_value_address (struct regcache *regcache) { - CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM); - CORE_ADDR vfp = sp; - CORE_ADDR cur_pc; - int frame_size; - int has_frame_reg = 0; - unsigned long reg_mask = 0; - int pcreg = -1; - int regno; + ULONGEST addr; + regcache_cooked_read_unsigned (regcache, ALPHA_V0_REGNUM, &addr); + return addr; +} - if (start_pc == 0) - return NULL; - memset (&temp_proc_desc, '\0', sizeof (temp_proc_desc)); - memset (&temp_saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS); - PROC_LOW_ADDR (&temp_proc_desc) = start_pc; +/* Insert the given value into REGCACHE as if it was being + returned by a function. */ - if (start_pc + 200 < limit_pc) - limit_pc = start_pc + 200; - frame_size = 0; - for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += 4) +static void +alpha_store_return_value (struct type *valtype, struct regcache *regcache, + const void *valbuf) +{ + int length = TYPE_LENGTH (valtype); + char raw_buffer[ALPHA_REGISTER_SIZE]; + ULONGEST l; + + switch (TYPE_CODE (valtype)) { - char buf[4]; - unsigned long word; - int status; + case TYPE_CODE_FLT: + switch (length) + { + case 4: + alpha_lds (raw_buffer, valbuf); + regcache_cooked_write (regcache, ALPHA_FP0_REGNUM, raw_buffer); + break; - status = read_memory_nobpt (cur_pc, buf, 4); - if (status) - memory_error (status, cur_pc); - word = extract_unsigned_integer (buf, 4); + case 8: + regcache_cooked_write (regcache, ALPHA_FP0_REGNUM, valbuf); + break; - if ((word & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */ - { - if (word & 0x8000) - { - /* Consider only the first stack allocation instruction - to contain the static size of the frame. */ - if (frame_size == 0) - frame_size += (-word) & 0xffff; - } - else - /* Exit loop if a positive stack adjustment is found, which - usually means that the stack cleanup code in the function - epilogue is reached. */ - break; - } - else if ((word & 0xfc1f0000) == 0xb41e0000 /* stq reg,n($sp) */ - && (word & 0xffff0000) != 0xb7fe0000) /* reg != $zero */ - { - int reg = (word & 0x03e00000) >> 21; - reg_mask |= 1 << reg; - - /* Do not compute the address where the register was saved yet, - because we don't know yet if the offset will need to be - relative to $sp or $fp (we can not compute the address relative - to $sp if $sp is updated during the execution of the current - subroutine, for instance when doing some alloca). So just store - the offset for the moment, and compute the address later - when we know whether this frame has a frame pointer or not. - */ - temp_saved_regs[reg] = (short) word; - - /* Starting with OSF/1-3.2C, the system libraries are shipped - without local symbols, but they still contain procedure - descriptors without a symbol reference. GDB is currently - unable to find these procedure descriptors and uses - heuristic_proc_desc instead. - As some low level compiler support routines (__div*, __add*) - use a non-standard return address register, we have to - add some heuristics to determine the return address register, - or stepping over these routines will fail. - Usually the return address register is the first register - saved on the stack, but assembler optimization might - rearrange the register saves. - So we recognize only a few registers (t7, t9, ra) within - the procedure prologue as valid return address registers. - If we encounter a return instruction, we extract the - the return address register from it. - - FIXME: Rewriting GDB to access the procedure descriptors, - e.g. via the minimal symbol table, might obviate this hack. */ - if (pcreg == -1 - && cur_pc < (start_pc + 80) - && (reg == ALPHA_T7_REGNUM || reg == ALPHA_T9_REGNUM - || reg == ALPHA_RA_REGNUM)) - pcreg = reg; + case 16: + /* FIXME: 128-bit long doubles are returned like structures: + by writing into indirect storage provided by the caller + as the first argument. */ + error ("Cannot set a 128-bit long double return value."); + + default: + internal_error (__FILE__, __LINE__, "unknown floating point width"); } - else if ((word & 0xffe0ffff) == 0x6be08001) /* ret zero,reg,1 */ - pcreg = (word >> 16) & 0x1f; - else if (word == 0x47de040f || word == 0x47fe040f) /* bis sp,sp fp */ - { - /* ??? I am not sure what instruction is 0x47fe040f, and I - am suspecting that there was a typo and should have been - 0x47fe040f. I'm keeping it in the test above until further - investigation */ - has_frame_reg = 1; - vfp = read_next_frame_reg (next_frame, ALPHA_GCC_FP_REGNUM); - } - } - if (pcreg == -1) - { - /* If we haven't found a valid return address register yet, - keep searching in the procedure prologue. */ - while (cur_pc < (limit_pc + 80) && cur_pc < (start_pc + 80)) + break; + + case TYPE_CODE_COMPLEX: + switch (length) { - char buf[4]; - unsigned long word; + case 8: + /* ??? This isn't correct wrt the ABI, but it's what GCC does. */ + regcache_cooked_write (regcache, ALPHA_FP0_REGNUM, valbuf); + break; - if (read_memory_nobpt (cur_pc, buf, 4)) - break; - cur_pc += 4; - word = extract_unsigned_integer (buf, 4); + case 16: + regcache_cooked_write (regcache, ALPHA_FP0_REGNUM, valbuf); + regcache_cooked_write (regcache, ALPHA_FP0_REGNUM+1, + (const char *)valbuf + 8); + break; - if ((word & 0xfc1f0000) == 0xb41e0000 /* stq reg,n($sp) */ - && (word & 0xffff0000) != 0xb7fe0000) /* reg != $zero */ - { - int reg = (word & 0x03e00000) >> 21; - if (reg == ALPHA_T7_REGNUM || reg == ALPHA_T9_REGNUM - || reg == ALPHA_RA_REGNUM) - { - pcreg = reg; - break; - } - } - else if ((word & 0xffe0ffff) == 0x6be08001) /* ret zero,reg,1 */ - { - pcreg = (word >> 16) & 0x1f; - break; - } + case 32: + /* FIXME: 128-bit long doubles are returned like structures: + by writing into indirect storage provided by the caller + as the first argument. */ + error ("Cannot set a 128-bit long double return value."); + + default: + internal_error (__FILE__, __LINE__, "unknown floating point width"); } - } + break; - if (has_frame_reg) - PROC_FRAME_REG (&temp_proc_desc) = ALPHA_GCC_FP_REGNUM; - else - PROC_FRAME_REG (&temp_proc_desc) = SP_REGNUM; - - /* At this point, we know which of the Stack Pointer or the Frame Pointer - to use as the reference address to compute the saved registers address. - But in both cases, the processing above has set vfp to this reference - address, so just need to increment the offset of each saved register - by this address. */ - for (regno = 0; regno < NUM_REGS; regno++) - { - if (reg_mask & 1 << regno) - temp_saved_regs[regno] += vfp; + default: + /* Assume everything else degenerates to an integer. */ + /* 32-bit values must be sign-extended to 64 bits + even if the base data type is unsigned. */ + if (length == 4) + valtype = builtin_type_int32; + l = unpack_long (valtype, valbuf); + regcache_cooked_write_unsigned (regcache, ALPHA_V0_REGNUM, l); + break; } +} + + +static const unsigned char * +alpha_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) +{ + static const unsigned char alpha_breakpoint[] = + { 0x80, 0, 0, 0 }; /* call_pal bpt */ - PROC_FRAME_OFFSET (&temp_proc_desc) = frame_size; - PROC_REG_MASK (&temp_proc_desc) = reg_mask; - PROC_PC_REG (&temp_proc_desc) = (pcreg == -1) ? ALPHA_RA_REGNUM : pcreg; - PROC_LOCALOFF (&temp_proc_desc) = 0; /* XXX - bogus */ - return &temp_proc_desc; + *lenptr = sizeof(alpha_breakpoint); + return (alpha_breakpoint); } -/* This returns the PC of the first inst after the prologue. If we can't - find the prologue, then return 0. */ + +/* This returns the PC of the first insn after the prologue. + If we can't find the prologue, then return 0. */ -static CORE_ADDR -after_prologue (CORE_ADDR pc, alpha_extra_func_info_t proc_desc) +CORE_ADDR +alpha_after_prologue (CORE_ADDR pc) { struct symtab_and_line sal; CORE_ADDR func_addr, func_end; - if (!proc_desc) - proc_desc = find_proc_desc (pc, NULL); - - if (proc_desc) - { - if (alpha_proc_desc_is_dyn_sigtramp (proc_desc)) - return PROC_LOW_ADDR (proc_desc); /* "prologue" is in kernel */ - - /* If function is frameless, then we need to do it the hard way. I - strongly suspect that frameless always means prologueless... */ - if (PROC_FRAME_REG (proc_desc) == SP_REGNUM - && PROC_FRAME_OFFSET (proc_desc) == 0) - return 0; - } - if (!find_pc_partial_function (pc, NULL, &func_addr, &func_end)) - return 0; /* Unknown */ + return 0; sal = find_pc_line (func_addr, 0); - if (sal.end < func_end) return sal.end; /* The line after the prologue is after the end of the function. In this case, tell the caller to find the prologue the hard way. */ - return 0; } -/* Return non-zero if we *might* be in a function prologue. Return zero if we - are definitively *not* in a function prologue. */ +/* Read an instruction from memory at PC, looking through breakpoints. */ -static int -alpha_in_prologue (CORE_ADDR pc, alpha_extra_func_info_t proc_desc) +unsigned int +alpha_read_insn (CORE_ADDR pc) { - CORE_ADDR after_prologue_pc; - - after_prologue_pc = after_prologue (pc, proc_desc); + char buf[4]; + int status; - if (after_prologue_pc == 0 - || pc < after_prologue_pc) - return 1; - else - return 0; + status = read_memory_nobpt (pc, buf, 4); + if (status) + memory_error (status, pc); + return extract_unsigned_integer (buf, 4); } -static alpha_extra_func_info_t -find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame) +/* To skip prologues, I use this predicate. Returns either PC itself + if the code at PC does not look like a function prologue; otherwise + returns an address that (if we're lucky) follows the prologue. If + LENIENT, then we must skip everything which is involved in setting + up the frame (it's OK to skip more, just so long as we don't skip + anything which might clobber the registers which are being saved. */ + +static CORE_ADDR +alpha_skip_prologue (CORE_ADDR pc) { - alpha_extra_func_info_t proc_desc; - struct block *b; - struct symbol *sym; - CORE_ADDR startaddr; - - /* Try to get the proc_desc from the linked call dummy proc_descs - if the pc is in the call dummy. - This is hairy. In the case of nested dummy calls we have to find the - right proc_desc, but we might not yet know the frame for the dummy - as it will be contained in the proc_desc we are searching for. - So we have to find the proc_desc whose frame is closest to the current - stack pointer. */ - - if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) - { - struct linked_proc_info *link; - CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM); - alpha_extra_func_info_t found_proc_desc = NULL; - long min_distance = LONG_MAX; + unsigned long inst; + int offset; + CORE_ADDR post_prologue_pc; + char buf[4]; - for (link = linked_proc_desc_table; link; link = link->next) - { - long distance = (CORE_ADDR) PROC_DUMMY_FRAME (&link->info) - sp; - if (distance > 0 && distance < min_distance) - { - min_distance = distance; - found_proc_desc = &link->info; - } - } - if (found_proc_desc != NULL) - return found_proc_desc; - } + /* Silently return the unaltered pc upon memory errors. + This could happen on OSF/1 if decode_line_1 tries to skip the + prologue for quickstarted shared library functions when the + shared library is not yet mapped in. + Reading target memory is slow over serial lines, so we perform + this check only if the target has shared libraries (which all + Alpha targets do). */ + if (target_read_memory (pc, buf, 4)) + return pc; - b = block_for_pc (pc); + /* See if we can determine the end of the prologue via the symbol table. + If so, then return either PC, or the PC after the prologue, whichever + is greater. */ - find_pc_partial_function (pc, NULL, &startaddr, NULL); - if (b == NULL) - sym = NULL; - else - { - if (startaddr > BLOCK_START (b)) - /* This is the "pathological" case referred to in a comment in - print_frame_info. It might be better to move this check into - symbol reading. */ - sym = NULL; - else - sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_DOMAIN, - 0, NULL); - } + post_prologue_pc = alpha_after_prologue (pc); + if (post_prologue_pc != 0) + return max (pc, post_prologue_pc); - /* If we never found a PDR for this function in symbol reading, then - examine prologues to find the information. */ - if (sym && ((mips_extra_func_info_t) SYMBOL_VALUE (sym))->pdr.framereg == -1) - sym = NULL; + /* Can't determine prologue from the symbol table, need to examine + instructions. */ - if (sym) - { - /* IF this is the topmost frame AND - * (this proc does not have debugging information OR - * the PC is in the procedure prologue) - * THEN create a "heuristic" proc_desc (by analyzing - * the actual code) to replace the "official" proc_desc. - */ - proc_desc = (alpha_extra_func_info_t) SYMBOL_VALUE (sym); - if (next_frame == NULL) - { - if (PROC_DESC_IS_DUMMY (proc_desc) || alpha_in_prologue (pc, proc_desc)) - { - alpha_extra_func_info_t found_heuristic = - heuristic_proc_desc (PROC_LOW_ADDR (proc_desc), - pc, next_frame); - if (found_heuristic) - { - PROC_LOCALOFF (found_heuristic) = - PROC_LOCALOFF (proc_desc); - PROC_PC_REG (found_heuristic) = PROC_PC_REG (proc_desc); - proc_desc = found_heuristic; - } - } - } - } - else + /* Skip the typical prologue instructions. These are the stack adjustment + instruction and the instructions that save registers on the stack + or in the gcc frame. */ + for (offset = 0; offset < 100; offset += 4) { - long offset; - - /* Is linked_proc_desc_table really necessary? It only seems to be used - by procedure call dummys. However, the procedures being called ought - to have their own proc_descs, and even if they don't, - heuristic_proc_desc knows how to create them! */ - - register struct linked_proc_info *link; - for (link = linked_proc_desc_table; link; link = link->next) - if (PROC_LOW_ADDR (&link->info) <= pc - && PROC_HIGH_ADDR (&link->info) > pc) - return &link->info; - - /* If PC is inside a dynamically generated sigtramp handler, - create and push a procedure descriptor for that code: */ - offset = alpha_dynamic_sigtramp_offset (pc); - if (offset >= 0) - return push_sigtramp_desc (pc - offset); - - /* If heuristic_fence_post is non-zero, determine the procedure - start address by examining the instructions. - This allows us to find the start address of static functions which - have no symbolic information, as startaddr would have been set to - the preceding global function start address by the - find_pc_partial_function call above. */ - if (startaddr == 0 || heuristic_fence_post != 0) - startaddr = heuristic_proc_start (pc); - - proc_desc = - heuristic_proc_desc (startaddr, pc, next_frame); + inst = alpha_read_insn (pc + offset); + + if ((inst & 0xffff0000) == 0x27bb0000) /* ldah $gp,n($t12) */ + continue; + if ((inst & 0xffff0000) == 0x23bd0000) /* lda $gp,n($gp) */ + continue; + if ((inst & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */ + continue; + if ((inst & 0xffe01fff) == 0x43c0153e) /* subq $sp,n,$sp */ + continue; + + if (((inst & 0xfc1f0000) == 0xb41e0000 /* stq reg,n($sp) */ + || (inst & 0xfc1f0000) == 0x9c1e0000) /* stt reg,n($sp) */ + && (inst & 0x03e00000) != 0x03e00000) /* reg != $zero */ + continue; + + if (inst == 0x47de040f) /* bis sp,sp,fp */ + continue; + if (inst == 0x47fe040f) /* bis zero,sp,fp */ + continue; + + break; } - return proc_desc; + return pc + offset; } -alpha_extra_func_info_t cached_proc_desc; + +/* Figure out where the longjmp will land. + We expect the first arg to be a pointer to the jmp_buf structure from + which we extract the PC (JB_PC) that we will land at. The PC is copied + into the "pc". This routine returns true on success. */ -static CORE_ADDR -alpha_frame_chain (struct frame_info *frame) +static int +alpha_get_longjmp_target (CORE_ADDR *pc) { - alpha_extra_func_info_t proc_desc; - CORE_ADDR saved_pc = DEPRECATED_FRAME_SAVED_PC (frame); + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + CORE_ADDR jb_addr; + char raw_buffer[ALPHA_REGISTER_SIZE]; - if (saved_pc == 0 || inside_entry_file (saved_pc)) - return 0; + jb_addr = read_register (ALPHA_A0_REGNUM); - proc_desc = find_proc_desc (saved_pc, frame); - if (!proc_desc) + if (target_read_memory (jb_addr + (tdep->jb_pc * tdep->jb_elt_size), + raw_buffer, tdep->jb_elt_size)) return 0; - cached_proc_desc = proc_desc; - - /* Fetch the frame pointer for a dummy frame from the procedure - descriptor. */ - if (PROC_DESC_IS_DUMMY (proc_desc)) - return (CORE_ADDR) PROC_DUMMY_FRAME (proc_desc); - - /* If no frame pointer and frame size is zero, we must be at end - of stack (or otherwise hosed). If we don't check frame size, - we loop forever if we see a zero size frame. */ - if (PROC_FRAME_REG (proc_desc) == SP_REGNUM - && PROC_FRAME_OFFSET (proc_desc) == 0 - /* The previous frame from a sigtramp frame might be frameless - and have frame size zero. */ - && !(get_frame_type (frame) == SIGTRAMP_FRAME)) - return alpha_frame_past_sigtramp_frame (frame, saved_pc); - else - return read_next_frame_reg (frame, PROC_FRAME_REG (proc_desc)) - + PROC_FRAME_OFFSET (proc_desc); + *pc = extract_unsigned_integer (raw_buffer, tdep->jb_elt_size); + return 1; } -void -alpha_print_extra_frame_info (struct frame_info *fi) + +/* Frame unwinder for signal trampolines. We use alpha tdep bits that + describe the location and shape of the sigcontext structure. After + that, all registers are in memory, so it's easy. */ +/* ??? Shouldn't we be able to do this generically, rather than with + OSABI data specific to Alpha? */ + +struct alpha_sigtramp_unwind_cache { - if (fi - && get_frame_extra_info (fi) - && get_frame_extra_info (fi)->proc_desc - && get_frame_extra_info (fi)->proc_desc->pdr.framereg < NUM_REGS) - printf_filtered (" frame pointer is at %s+%s\n", - REGISTER_NAME (get_frame_extra_info (fi)->proc_desc->pdr.framereg), - paddr_d (get_frame_extra_info (fi)->proc_desc->pdr.frameoffset)); -} + CORE_ADDR sigcontext_addr; +}; -static void -alpha_init_extra_frame_info (int fromleaf, struct frame_info *frame) +static struct alpha_sigtramp_unwind_cache * +alpha_sigtramp_frame_unwind_cache (struct frame_info *next_frame, + void **this_prologue_cache) { - /* Use proc_desc calculated in frame_chain */ - alpha_extra_func_info_t proc_desc = - get_next_frame (frame) - ? cached_proc_desc - : find_proc_desc (get_frame_pc (frame), get_next_frame (frame)); - - frame_extra_info_zalloc (frame, sizeof (struct frame_extra_info)); - - /* NOTE: cagney/2003-01-03: No need to set saved_regs to NULL, - always NULL by default. */ - /* frame->saved_regs = NULL; */ - get_frame_extra_info (frame)->localoff = 0; - get_frame_extra_info (frame)->pc_reg = ALPHA_RA_REGNUM; - get_frame_extra_info (frame)->proc_desc = proc_desc == &temp_proc_desc ? 0 : proc_desc; - if (proc_desc) - { - /* Get the locals offset and the saved pc register from the - procedure descriptor, they are valid even if we are in the - middle of the prologue. */ - get_frame_extra_info (frame)->localoff = PROC_LOCALOFF (proc_desc); - get_frame_extra_info (frame)->pc_reg = PROC_PC_REG (proc_desc); - - /* Fixup frame-pointer - only needed for top frame */ - - /* Fetch the frame pointer for a dummy frame from the procedure - descriptor. */ - if (PROC_DESC_IS_DUMMY (proc_desc)) - deprecated_update_frame_base_hack (frame, (CORE_ADDR) PROC_DUMMY_FRAME (proc_desc)); - - /* This may not be quite right, if proc has a real frame register. - Get the value of the frame relative sp, procedure might have been - interrupted by a signal at it's very start. */ - else if (get_frame_pc (frame) == PROC_LOW_ADDR (proc_desc) - && !alpha_proc_desc_is_dyn_sigtramp (proc_desc)) - deprecated_update_frame_base_hack (frame, read_next_frame_reg (get_next_frame (frame), SP_REGNUM)); - else - deprecated_update_frame_base_hack (frame, read_next_frame_reg (get_next_frame (frame), PROC_FRAME_REG (proc_desc)) - + PROC_FRAME_OFFSET (proc_desc)); + struct alpha_sigtramp_unwind_cache *info; + struct gdbarch_tdep *tdep; - if (proc_desc == &temp_proc_desc) - { - char *name; - - /* Do not set the saved registers for a sigtramp frame, - alpha_find_saved_registers will do that for us. We can't - use (get_frame_type (frame) == SIGTRAMP_FRAME), it is not - yet set. */ - /* FIXME: cagney/2002-11-18: This problem will go away once - frame.c:get_prev_frame() is modified to set the frame's - type before calling functions like this. */ - find_pc_partial_function (get_frame_pc (frame), &name, - (CORE_ADDR *) NULL, (CORE_ADDR *) NULL); - if (!PC_IN_SIGTRAMP (get_frame_pc (frame), name)) - { - frame_saved_regs_zalloc (frame); - memcpy (get_frame_saved_regs (frame), temp_saved_regs, - SIZEOF_FRAME_SAVED_REGS); - get_frame_saved_regs (frame)[PC_REGNUM] - = get_frame_saved_regs (frame)[ALPHA_RA_REGNUM]; - } - } - } -} + if (*this_prologue_cache) + return *this_prologue_cache; -static CORE_ADDR -alpha_frame_locals_address (struct frame_info *fi) -{ - return (get_frame_base (fi) - get_frame_extra_info (fi)->localoff); -} + info = FRAME_OBSTACK_ZALLOC (struct alpha_sigtramp_unwind_cache); + *this_prologue_cache = info; -static CORE_ADDR -alpha_frame_args_address (struct frame_info *fi) -{ - return (get_frame_base (fi) - (ALPHA_NUM_ARG_REGS * 8)); + tdep = gdbarch_tdep (current_gdbarch); + info->sigcontext_addr = tdep->sigcontext_addr (next_frame); + + return info; } -/* ALPHA stack frames are almost impenetrable. When execution stops, - we basically have to look at symbol information for the function - that we stopped in, which tells us *which* register (if any) is - the base of the frame pointer, and what offset from that register - the frame itself is at. +/* Return the address of REGNO in a sigtramp frame. Since this is all + arithmetic, it doesn't seem worthwhile to cache it. */ - This presents a problem when trying to examine a stack in memory - (that isn't executing at the moment), using the "frame" command. We - don't have a PC, nor do we have any registers except SP. - - This routine takes two arguments, SP and PC, and tries to make the - cached frames look as if these two arguments defined a frame on the - cache. This allows the rest of info frame to extract the important - arguments without difficulty. */ +#ifndef SIGFRAME_PC_OFF +#define SIGFRAME_PC_OFF (2 * 8) +#define SIGFRAME_REGSAVE_OFF (4 * 8) +#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_REGSAVE_OFF + 32 * 8 + 8) +#endif -struct frame_info * -alpha_setup_arbitrary_frame (int argc, CORE_ADDR *argv) -{ - if (argc != 2) - error ("ALPHA frame specifications require two arguments: sp and pc"); +static CORE_ADDR +alpha_sigtramp_register_address (CORE_ADDR sigcontext_addr, unsigned int regno) +{ + if (regno < 32) + return sigcontext_addr + SIGFRAME_REGSAVE_OFF + regno * 8; + if (regno >= ALPHA_FP0_REGNUM && regno < ALPHA_FP0_REGNUM + 32) + return sigcontext_addr + SIGFRAME_FPREGSAVE_OFF + regno * 8; + if (regno == ALPHA_PC_REGNUM) + return sigcontext_addr + SIGFRAME_PC_OFF; - return create_new_frame (argv[0], argv[1]); + return 0; } -/* The alpha passes the first six arguments in the registers, the rest on - the stack. The register arguments are eventually transferred to the - argument transfer area immediately below the stack by the called function - anyway. So we `push' at least six arguments on the stack, `reload' the - argument registers and then adjust the stack pointer to point past the - sixth argument. This algorithm simplifies the passing of a large struct - which extends from the registers to the stack. - If the called function is returning a structure, the address of the - structure to be returned is passed as a hidden first argument. */ +/* Given a GDB frame, determine the address of the calling function's + frame. This will be used to create a new GDB frame struct. */ -static CORE_ADDR -alpha_push_arguments (int nargs, struct value **args, CORE_ADDR sp, - int struct_return, CORE_ADDR struct_addr) +static void +alpha_sigtramp_frame_this_id (struct frame_info *next_frame, + void **this_prologue_cache, + struct frame_id *this_id) { - int i; - int accumulate_size = struct_return ? 8 : 0; - int arg_regs_size = ALPHA_NUM_ARG_REGS * 8; - struct alpha_arg - { - char *contents; - int len; - int offset; - }; - struct alpha_arg *alpha_args = - (struct alpha_arg *) alloca (nargs * sizeof (struct alpha_arg)); - register struct alpha_arg *m_arg; - char raw_buffer[sizeof (CORE_ADDR)]; - int required_arg_regs; + struct alpha_sigtramp_unwind_cache *info + = alpha_sigtramp_frame_unwind_cache (next_frame, this_prologue_cache); + struct gdbarch_tdep *tdep; + CORE_ADDR stack_addr, code_addr; - for (i = 0, m_arg = alpha_args; i < nargs; i++, m_arg++) + /* If the OSABI couldn't locate the sigcontext, give up. */ + if (info->sigcontext_addr == 0) + return; + + /* If we have dynamic signal trampolines, find their start. + If we do not, then we must assume there is a symbol record + that can provide the start address. */ + tdep = gdbarch_tdep (current_gdbarch); + if (tdep->dynamic_sigtramp_offset) { - struct value *arg = args[i]; - struct type *arg_type = check_typedef (VALUE_TYPE (arg)); - /* Cast argument to long if necessary as the compiler does it too. */ - switch (TYPE_CODE (arg_type)) - { - case TYPE_CODE_INT: - case TYPE_CODE_BOOL: - case TYPE_CODE_CHAR: - case TYPE_CODE_RANGE: - case TYPE_CODE_ENUM: - if (TYPE_LENGTH (arg_type) < TYPE_LENGTH (builtin_type_long)) - { - arg_type = builtin_type_long; - arg = value_cast (arg_type, arg); - } - break; - default: - break; - } - m_arg->len = TYPE_LENGTH (arg_type); - m_arg->offset = accumulate_size; - accumulate_size = (accumulate_size + m_arg->len + 7) & ~7; - m_arg->contents = VALUE_CONTENTS (arg); + int offset; + code_addr = frame_pc_unwind (next_frame); + offset = tdep->dynamic_sigtramp_offset (code_addr); + if (offset >= 0) + code_addr -= offset; + else + code_addr = 0; } + else + code_addr = frame_func_unwind (next_frame); - /* Determine required argument register loads, loading an argument register - is expensive as it uses three ptrace calls. */ - required_arg_regs = accumulate_size / 8; - if (required_arg_regs > ALPHA_NUM_ARG_REGS) - required_arg_regs = ALPHA_NUM_ARG_REGS; + /* The stack address is trivially read from the sigcontext. */ + stack_addr = alpha_sigtramp_register_address (info->sigcontext_addr, + ALPHA_SP_REGNUM); + stack_addr = get_frame_memory_unsigned (next_frame, stack_addr, + ALPHA_REGISTER_SIZE); + + *this_id = frame_id_build (stack_addr, code_addr); +} - /* Make room for the arguments on the stack. */ - if (accumulate_size < arg_regs_size) - accumulate_size = arg_regs_size; - sp -= accumulate_size; +/* Retrieve the value of REGNUM in FRAME. Don't give up! */ - /* Keep sp aligned to a multiple of 16 as the compiler does it too. */ - sp &= ~15; +static void +alpha_sigtramp_frame_prev_register (struct frame_info *next_frame, + void **this_prologue_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *bufferp) +{ + struct alpha_sigtramp_unwind_cache *info + = alpha_sigtramp_frame_unwind_cache (next_frame, this_prologue_cache); + CORE_ADDR addr; - /* `Push' arguments on the stack. */ - for (i = nargs; m_arg--, --i >= 0;) - write_memory (sp + m_arg->offset, m_arg->contents, m_arg->len); - if (struct_return) + if (info->sigcontext_addr != 0) { - /* NOTE: cagney/2003-05-09: Using sizeof CORE_ADDR here is just - wrong. */ - store_unsigned_integer (raw_buffer, sizeof (CORE_ADDR), struct_addr); - write_memory (sp, raw_buffer, sizeof (CORE_ADDR)); + /* All integer and fp registers are stored in memory. */ + addr = alpha_sigtramp_register_address (info->sigcontext_addr, regnum); + if (addr != 0) + { + *optimizedp = 0; + *lvalp = lval_memory; + *addrp = addr; + *realnump = -1; + if (bufferp != NULL) + get_frame_memory (next_frame, addr, bufferp, ALPHA_REGISTER_SIZE); + return; + } } - /* Load the argument registers. */ - for (i = 0; i < required_arg_regs; i++) - { - LONGEST val; + /* This extra register may actually be in the sigcontext, but our + current description of it in alpha_sigtramp_frame_unwind_cache + doesn't include it. Too bad. Fall back on whatever's in the + outer frame. */ + frame_register (next_frame, regnum, optimizedp, lvalp, addrp, + realnump, bufferp); +} - val = read_memory_integer (sp + i * 8, 8); - write_register (ALPHA_A0_REGNUM + i, val); - write_register (ALPHA_FPA0_REGNUM + i, val); - } +static const struct frame_unwind alpha_sigtramp_frame_unwind = { + SIGTRAMP_FRAME, + alpha_sigtramp_frame_this_id, + alpha_sigtramp_frame_prev_register +}; - return sp + arg_regs_size; +static const struct frame_unwind * +alpha_sigtramp_frame_p (CORE_ADDR pc) +{ + char *name; + + /* We shouldn't even bother to try if the OSABI didn't register + a sigcontext_addr handler. */ + if (!gdbarch_tdep (current_gdbarch)->sigcontext_addr) + return NULL; + + /* Otherwise we should be in a signal frame. */ + find_pc_partial_function (pc, &name, NULL, NULL); + if (PC_IN_SIGTRAMP (pc, name)) + return &alpha_sigtramp_frame_unwind; + + return NULL; } + +/* Fallback alpha frame unwinder. Uses instruction scanning and knows + something about the traditional layout of alpha stack frames. */ -static void -alpha_push_dummy_frame (void) +struct alpha_heuristic_unwind_cache { - int ireg; - struct linked_proc_info *link; - alpha_extra_func_info_t proc_desc; - CORE_ADDR sp = read_register (SP_REGNUM); - CORE_ADDR save_address; - char raw_buffer[ALPHA_MAX_REGISTER_RAW_SIZE]; - unsigned long mask; - - link = (struct linked_proc_info *) xmalloc (sizeof (struct linked_proc_info)); - link->next = linked_proc_desc_table; - linked_proc_desc_table = link; - - proc_desc = &link->info; - - /* - * The registers we must save are all those not preserved across - * procedure calls. - * In addition, we must save the PC and RA. - * - * Dummy frame layout: - * (high memory) - * Saved PC - * Saved F30 - * ... - * Saved F0 - * Saved R29 - * ... - * Saved R0 - * Saved R26 (RA) - * Parameter build area - * (low memory) - */ - -/* MASK(i,j) == (1<>= 1) - if (mask & 1) - { - if (ireg == ALPHA_RA_REGNUM) - continue; - store_unsigned_integer (raw_buffer, 8, read_register (ireg)); - write_memory (save_address, raw_buffer, 8); - save_address += 8; - } - - store_unsigned_integer (raw_buffer, 8, read_register (PC_REGNUM)); - write_memory (sp - 8, raw_buffer, 8); - - /* Save floating point registers. */ - save_address = sp + PROC_FREG_OFFSET (proc_desc); - mask = PROC_FREG_MASK (proc_desc) & 0xffffffffL; - for (ireg = 0; mask; ireg++, mask >>= 1) - if (mask & 1) - { - store_unsigned_integer (raw_buffer, 8, read_register (ireg + FP0_REGNUM)); - write_memory (save_address, raw_buffer, 8); - save_address += 8; - } - - /* Set and save the frame address for the dummy. - This is tricky. The only registers that are suitable for a frame save - are those that are preserved across procedure calls (s0-s6). But if - a read system call is interrupted and then a dummy call is made - (see testsuite/gdb.t17/interrupt.exp) the dummy call hangs till the read - is satisfied. Then it returns with the s0-s6 registers set to the values - on entry to the read system call and our dummy frame pointer would be - destroyed. So we save the dummy frame in the proc_desc and handle the - retrieval of the frame pointer of a dummy specifically. The frame register - is set to the virtual frame (pseudo) register, it's value will always - be read as zero and will help us to catch any errors in the dummy frame - retrieval code. */ - PROC_DUMMY_FRAME (proc_desc) = sp; - PROC_FRAME_REG (proc_desc) = DEPRECATED_FP_REGNUM; - PROC_FRAME_OFFSET (proc_desc) = 0; - sp += PROC_REG_OFFSET (proc_desc); - write_register (SP_REGNUM, sp); - - PROC_LOW_ADDR (proc_desc) = CALL_DUMMY_ADDRESS (); - PROC_HIGH_ADDR (proc_desc) = PROC_LOW_ADDR (proc_desc) + 4; - - SET_PROC_DESC_IS_DUMMY (proc_desc); - PROC_PC_REG (proc_desc) = ALPHA_RA_REGNUM; -} + CORE_ADDR *saved_regs; + CORE_ADDR vfp; + CORE_ADDR start_pc; + int return_reg; +}; -static void -alpha_pop_frame (void) +/* Heuristic_proc_start may hunt through the text section for a long + time across a 2400 baud serial line. Allows the user to limit this + search. */ +static unsigned int heuristic_fence_post = 0; + +/* Attempt to locate the start of the function containing PC. We assume that + the previous function ends with an about_to_return insn. Not foolproof by + any means, since gcc is happy to put the epilogue in the middle of a + function. But we're guessing anyway... */ + +static CORE_ADDR +alpha_heuristic_proc_start (CORE_ADDR pc) { - register int regnum; - struct frame_info *frame = get_current_frame (); - CORE_ADDR new_sp = get_frame_base (frame); + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + CORE_ADDR last_non_nop = pc; + CORE_ADDR fence = pc - heuristic_fence_post; + CORE_ADDR orig_pc = pc; + CORE_ADDR func; - alpha_extra_func_info_t proc_desc = get_frame_extra_info (frame)->proc_desc; + if (pc == 0) + return 0; - /* we need proc_desc to know how to restore the registers; - if it is NULL, construct (a temporary) one */ - if (proc_desc == NULL) - proc_desc = find_proc_desc (get_frame_pc (frame), get_next_frame (frame)); + /* First see if we can find the start of the function from minimal + symbol information. This can succeed with a binary that doesn't + have debug info, but hasn't been stripped. */ + func = get_pc_function_start (pc); + if (func) + return func; - /* Question: should we copy this proc_desc and save it in - frame->proc_desc? If we do, who will free it? - For now, we don't save a copy... */ + if (heuristic_fence_post == UINT_MAX + || fence < tdep->vm_min_address) + fence = tdep->vm_min_address; - write_register (PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (frame)); - if (get_frame_saved_regs (frame) == NULL) - alpha_find_saved_regs (frame); - if (proc_desc) + /* Search back for previous return; also stop at a 0, which might be + seen for instance before the start of a code section. Don't include + nops, since this usually indicates padding between functions. */ + for (pc -= 4; pc >= fence; pc -= 4) { - for (regnum = 32; --regnum >= 0;) - if (PROC_REG_MASK (proc_desc) & (1 << regnum)) - write_register (regnum, - read_memory_integer (get_frame_saved_regs (frame)[regnum], - 8)); - for (regnum = 32; --regnum >= 0;) - if (PROC_FREG_MASK (proc_desc) & (1 << regnum)) - write_register (regnum + FP0_REGNUM, - read_memory_integer (get_frame_saved_regs (frame)[regnum + FP0_REGNUM], 8)); - } - write_register (SP_REGNUM, new_sp); - flush_cached_frames (); + unsigned int insn = alpha_read_insn (pc); + switch (insn) + { + case 0: /* invalid insn */ + case 0x6bfa8001: /* ret $31,($26),1 */ + return last_non_nop; - if (proc_desc && (PROC_DESC_IS_DUMMY (proc_desc) - || alpha_proc_desc_is_dyn_sigtramp (proc_desc))) - { - struct linked_proc_info *pi_ptr, *prev_ptr; + case 0x2ffe0000: /* unop: ldq_u $31,0($30) */ + case 0x47ff041f: /* nop: bis $31,$31,$31 */ + break; - for (pi_ptr = linked_proc_desc_table, prev_ptr = NULL; - pi_ptr != NULL; - prev_ptr = pi_ptr, pi_ptr = pi_ptr->next) - { - if (&pi_ptr->info == proc_desc) - break; + default: + last_non_nop = pc; + break; } + } - if (pi_ptr == NULL) - error ("Can't locate dummy extra frame info\n"); + /* It's not clear to me why we reach this point when stopping quietly, + but with this test, at least we don't print out warnings for every + child forked (eg, on decstation). 22apr93 rich@cygnus.com. */ + if (stop_soon == NO_STOP_QUIETLY) + { + static int blurb_printed = 0; - if (prev_ptr != NULL) - prev_ptr->next = pi_ptr->next; + if (fence == tdep->vm_min_address) + warning ("Hit beginning of text section without finding"); else - linked_proc_desc_table = pi_ptr->next; + warning ("Hit heuristic-fence-post without finding"); + warning ("enclosing function for address 0x%s", paddr_nz (orig_pc)); - xfree (pi_ptr); + if (!blurb_printed) + { + printf_filtered ("\ +This warning occurs if you are debugging a function without any symbols\n\ +(for example, in a stripped executable). In that case, you may wish to\n\ +increase the size of the search with the `set heuristic-fence-post' command.\n\ +\n\ +Otherwise, you told GDB there was a function where there isn't one, or\n\ +(more likely) you have encountered a bug in GDB.\n"); + blurb_printed = 1; + } } + + return 0; } - -/* To skip prologues, I use this predicate. Returns either PC itself - if the code at PC does not look like a function prologue; otherwise - returns an address that (if we're lucky) follows the prologue. If - LENIENT, then we must skip everything which is involved in setting - up the frame (it's OK to skip more, just so long as we don't skip - anything which might clobber the registers which are being saved. - Currently we must not skip more on the alpha, but we might need the - lenient stuff some day. */ -static CORE_ADDR -alpha_skip_prologue_internal (CORE_ADDR pc, int lenient) +static struct alpha_heuristic_unwind_cache * +alpha_heuristic_frame_unwind_cache (struct frame_info *next_frame, + void **this_prologue_cache, + CORE_ADDR start_pc) { - unsigned long inst; - int offset; - CORE_ADDR post_prologue_pc; - char buf[4]; - - /* Silently return the unaltered pc upon memory errors. - This could happen on OSF/1 if decode_line_1 tries to skip the - prologue for quickstarted shared library functions when the - shared library is not yet mapped in. - Reading target memory is slow over serial lines, so we perform - this check only if the target has shared libraries (which all - Alpha targets do). */ - if (target_read_memory (pc, buf, 4)) - return pc; + struct alpha_heuristic_unwind_cache *info; + ULONGEST val; + CORE_ADDR limit_pc, cur_pc; + int frame_reg, frame_size, return_reg, reg; - /* See if we can determine the end of the prologue via the symbol table. - If so, then return either PC, or the PC after the prologue, whichever - is greater. */ + if (*this_prologue_cache) + return *this_prologue_cache; - post_prologue_pc = after_prologue (pc, NULL); + info = FRAME_OBSTACK_ZALLOC (struct alpha_heuristic_unwind_cache); + *this_prologue_cache = info; + info->saved_regs = frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS); - if (post_prologue_pc != 0) - return max (pc, post_prologue_pc); + limit_pc = frame_pc_unwind (next_frame); + if (start_pc == 0) + start_pc = alpha_heuristic_proc_start (limit_pc); + info->start_pc = start_pc; - /* Can't determine prologue from the symbol table, need to examine - instructions. */ + frame_reg = ALPHA_SP_REGNUM; + frame_size = 0; + return_reg = -1; - /* Skip the typical prologue instructions. These are the stack adjustment - instruction and the instructions that save registers on the stack - or in the gcc frame. */ - for (offset = 0; offset < 100; offset += 4) + /* If we've identified a likely place to start, do code scanning. */ + if (start_pc != 0) { - int status; + /* Limit the forward search to 50 instructions. */ + if (start_pc + 200 < limit_pc) + limit_pc = start_pc + 200; - status = read_memory_nobpt (pc + offset, buf, 4); - if (status) - memory_error (status, pc + offset); - inst = extract_unsigned_integer (buf, 4); + for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += 4) + { + unsigned int word = alpha_read_insn (cur_pc); - /* The alpha has no delay slots. But let's keep the lenient stuff, - we might need it for something else in the future. */ - if (lenient && 0) - continue; + if ((word & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */ + { + if (word & 0x8000) + { + /* Consider only the first stack allocation instruction + to contain the static size of the frame. */ + if (frame_size == 0) + frame_size = (-word) & 0xffff; + } + else + { + /* Exit loop if a positive stack adjustment is found, which + usually means that the stack cleanup code in the function + epilogue is reached. */ + break; + } + } + else if ((word & 0xfc1f0000) == 0xb41e0000) /* stq reg,n($sp) */ + { + reg = (word & 0x03e00000) >> 21; + + if (reg == 31) + continue; + + /* Do not compute the address where the register was saved yet, + because we don't know yet if the offset will need to be + relative to $sp or $fp (we can not compute the address + relative to $sp if $sp is updated during the execution of + the current subroutine, for instance when doing some alloca). + So just store the offset for the moment, and compute the + address later when we know whether this frame has a frame + pointer or not. */ + /* Hack: temporarily add one, so that the offset is non-zero + and we can tell which registers have save offsets below. */ + info->saved_regs[reg] = (word & 0xffff) + 1; + + /* Starting with OSF/1-3.2C, the system libraries are shipped + without local symbols, but they still contain procedure + descriptors without a symbol reference. GDB is currently + unable to find these procedure descriptors and uses + heuristic_proc_desc instead. + As some low level compiler support routines (__div*, __add*) + use a non-standard return address register, we have to + add some heuristics to determine the return address register, + or stepping over these routines will fail. + Usually the return address register is the first register + saved on the stack, but assembler optimization might + rearrange the register saves. + So we recognize only a few registers (t7, t9, ra) within + the procedure prologue as valid return address registers. + If we encounter a return instruction, we extract the + the return address register from it. + + FIXME: Rewriting GDB to access the procedure descriptors, + e.g. via the minimal symbol table, might obviate this hack. */ + if (return_reg == -1 + && cur_pc < (start_pc + 80) + && (reg == ALPHA_T7_REGNUM + || reg == ALPHA_T9_REGNUM + || reg == ALPHA_RA_REGNUM)) + return_reg = reg; + } + else if ((word & 0xffe0ffff) == 0x6be08001) /* ret zero,reg,1 */ + return_reg = (word >> 16) & 0x1f; + else if (word == 0x47de040f) /* bis sp,sp,fp */ + frame_reg = ALPHA_GCC_FP_REGNUM; + else if (word == 0x47fe040f) /* bis zero,sp,fp */ + frame_reg = ALPHA_GCC_FP_REGNUM; + } - if ((inst & 0xffff0000) == 0x27bb0000) /* ldah $gp,n($t12) */ - continue; - if ((inst & 0xffff0000) == 0x23bd0000) /* lda $gp,n($gp) */ - continue; - if ((inst & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */ - continue; - if ((inst & 0xffe01fff) == 0x43c0153e) /* subq $sp,n,$sp */ - continue; + /* If we haven't found a valid return address register yet, keep + searching in the procedure prologue. */ + if (return_reg == -1) + { + while (cur_pc < (limit_pc + 80) && cur_pc < (start_pc + 80)) + { + unsigned int word = alpha_read_insn (cur_pc); - if ((inst & 0xfc1f0000) == 0xb41e0000 - && (inst & 0xffff0000) != 0xb7fe0000) - continue; /* stq reg,n($sp) */ - /* reg != $zero */ - if ((inst & 0xfc1f0000) == 0x9c1e0000 - && (inst & 0xffff0000) != 0x9ffe0000) - continue; /* stt reg,n($sp) */ - /* reg != $zero */ - if (inst == 0x47de040f) /* bis sp,sp,fp */ - continue; + if ((word & 0xfc1f0000) == 0xb41e0000) /* stq reg,n($sp) */ + { + reg = (word & 0x03e00000) >> 21; + if (reg == ALPHA_T7_REGNUM + || reg == ALPHA_T9_REGNUM + || reg == ALPHA_RA_REGNUM) + { + return_reg = reg; + break; + } + } + else if ((word & 0xffe0ffff) == 0x6be08001) /* ret zero,reg,1 */ + { + return_reg = (word >> 16) & 0x1f; + break; + } - break; + cur_pc += 4; + } + } } - return pc + offset; -} -static CORE_ADDR -alpha_skip_prologue (CORE_ADDR addr) -{ - return (alpha_skip_prologue_internal (addr, 0)); -} + /* Failing that, do default to the customary RA. */ + if (return_reg == -1) + return_reg = ALPHA_RA_REGNUM; + info->return_reg = return_reg; -#if 0 -/* Is address PC in the prologue (loosely defined) for function at - STARTADDR? */ + frame_unwind_unsigned_register (next_frame, frame_reg, &val); + info->vfp = val + frame_size; -static int -alpha_in_lenient_prologue (CORE_ADDR startaddr, CORE_ADDR pc) -{ - CORE_ADDR end_prologue = alpha_skip_prologue_internal (startaddr, 1); - return pc >= startaddr && pc < end_prologue; + /* Convert offsets to absolute addresses. See above about adding + one to the offsets to make all detected offsets non-zero. */ + for (reg = 0; reg < ALPHA_NUM_REGS; ++reg) + if (info->saved_regs[reg]) + info->saved_regs[reg] += val - 1; + + return info; } -#endif -/* The alpha needs a conversion between register and memory format if - the register is a floating point register and - memory format is float, as the register format must be double - or - memory format is an integer with 4 bytes or less, as the representation - of integers in floating point registers is different. */ +/* Given a GDB frame, determine the address of the calling function's + frame. This will be used to create a new GDB frame struct. */ + static void -alpha_register_convert_to_virtual (int regnum, struct type *valtype, - char *raw_buffer, char *virtual_buffer) +alpha_heuristic_frame_this_id (struct frame_info *next_frame, + void **this_prologue_cache, + struct frame_id *this_id) { - if (TYPE_LENGTH (valtype) >= REGISTER_RAW_SIZE (regnum)) - { - memcpy (virtual_buffer, raw_buffer, REGISTER_VIRTUAL_SIZE (regnum)); - return; - } + struct alpha_heuristic_unwind_cache *info + = alpha_heuristic_frame_unwind_cache (next_frame, this_prologue_cache, 0); - if (TYPE_CODE (valtype) == TYPE_CODE_FLT) - { - double d = deprecated_extract_floating (raw_buffer, REGISTER_RAW_SIZE (regnum)); - deprecated_store_floating (virtual_buffer, TYPE_LENGTH (valtype), d); - } - else if (TYPE_CODE (valtype) == TYPE_CODE_INT && TYPE_LENGTH (valtype) <= 4) - { - ULONGEST l; - l = extract_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum)); - l = ((l >> 32) & 0xc0000000) | ((l >> 29) & 0x3fffffff); - store_unsigned_integer (virtual_buffer, TYPE_LENGTH (valtype), l); - } - else - error ("Cannot retrieve value from floating point register"); + /* This is meant to halt the backtrace at "_start". Make sure we + don't halt it at a generic dummy frame. */ + if (inside_entry_file (info->start_pc)) + return; + + *this_id = frame_id_build (info->vfp, info->start_pc); } +/* Retrieve the value of REGNUM in FRAME. Don't give up! */ + static void -alpha_register_convert_to_raw (struct type *valtype, int regnum, - char *virtual_buffer, char *raw_buffer) +alpha_heuristic_frame_prev_register (struct frame_info *next_frame, + void **this_prologue_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *bufferp) { - if (TYPE_LENGTH (valtype) >= REGISTER_RAW_SIZE (regnum)) + struct alpha_heuristic_unwind_cache *info + = alpha_heuristic_frame_unwind_cache (next_frame, this_prologue_cache, 0); + + /* The PC of the previous frame is stored in the link register of + the current frame. Frob regnum so that we pull the value from + the correct place. */ + if (regnum == ALPHA_PC_REGNUM) + regnum = info->return_reg; + + /* For all registers known to be saved in the current frame, + do the obvious and pull the value out. */ + if (info->saved_regs[regnum]) { - memcpy (raw_buffer, virtual_buffer, REGISTER_RAW_SIZE (regnum)); + *optimizedp = 0; + *lvalp = lval_memory; + *addrp = info->saved_regs[regnum]; + *realnump = -1; + if (bufferp != NULL) + get_frame_memory (next_frame, *addrp, bufferp, ALPHA_REGISTER_SIZE); return; } - if (TYPE_CODE (valtype) == TYPE_CODE_FLT) - { - double d = deprecated_extract_floating (virtual_buffer, TYPE_LENGTH (valtype)); - deprecated_store_floating (raw_buffer, REGISTER_RAW_SIZE (regnum), d); - } - else if (TYPE_CODE (valtype) == TYPE_CODE_INT && TYPE_LENGTH (valtype) <= 4) + /* The stack pointer of the previous frame is computed by popping + the current stack frame. */ + if (regnum == ALPHA_SP_REGNUM) { - ULONGEST l; - if (TYPE_UNSIGNED (valtype)) - l = extract_unsigned_integer (virtual_buffer, TYPE_LENGTH (valtype)); - else - l = extract_signed_integer (virtual_buffer, TYPE_LENGTH (valtype)); - l = ((l & 0xc0000000) << 32) | ((l & 0x3fffffff) << 29); - store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), l); + *optimizedp = 0; + *lvalp = not_lval; + *addrp = 0; + *realnump = -1; + if (bufferp != NULL) + store_unsigned_integer (bufferp, ALPHA_REGISTER_SIZE, info->vfp); + return; } - else - error ("Cannot store value in floating point register"); -} - -static const unsigned char * -alpha_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) -{ - static const unsigned char alpha_breakpoint[] = - { 0x80, 0, 0, 0 }; /* call_pal bpt */ - *lenptr = sizeof(alpha_breakpoint); - return (alpha_breakpoint); + /* Otherwise assume the next frame has the same register value. */ + frame_register (next_frame, regnum, optimizedp, lvalp, addrp, + realnump, bufferp); } -/* Given a return value in `regbuf' with a type `valtype', - extract and copy its value into `valbuf'. */ +static const struct frame_unwind alpha_heuristic_frame_unwind = { + NORMAL_FRAME, + alpha_heuristic_frame_this_id, + alpha_heuristic_frame_prev_register +}; -static void -alpha_extract_return_value (struct type *valtype, - char regbuf[ALPHA_REGISTER_BYTES], char *valbuf) +static const struct frame_unwind * +alpha_heuristic_frame_p (CORE_ADDR pc) { - if (TYPE_CODE (valtype) == TYPE_CODE_FLT) - alpha_register_convert_to_virtual (FP0_REGNUM, valtype, - regbuf + REGISTER_BYTE (FP0_REGNUM), - valbuf); - else - memcpy (valbuf, regbuf + REGISTER_BYTE (ALPHA_V0_REGNUM), - TYPE_LENGTH (valtype)); + return &alpha_heuristic_frame_unwind; } -/* Given a return value in `regbuf' with a type `valtype', - write its value into the appropriate register. */ - -static void -alpha_store_return_value (struct type *valtype, char *valbuf) +static CORE_ADDR +alpha_heuristic_frame_base_address (struct frame_info *next_frame, + void **this_prologue_cache) { - char raw_buffer[ALPHA_MAX_REGISTER_RAW_SIZE]; - int regnum = ALPHA_V0_REGNUM; - int length = TYPE_LENGTH (valtype); - - if (TYPE_CODE (valtype) == TYPE_CODE_FLT) - { - regnum = FP0_REGNUM; - length = REGISTER_RAW_SIZE (regnum); - alpha_register_convert_to_raw (valtype, regnum, valbuf, raw_buffer); - } - else - memcpy (raw_buffer, valbuf, length); + struct alpha_heuristic_unwind_cache *info + = alpha_heuristic_frame_unwind_cache (next_frame, this_prologue_cache, 0); - deprecated_write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, length); + return info->vfp; } +static const struct frame_base alpha_heuristic_frame_base = { + &alpha_heuristic_frame_unwind, + alpha_heuristic_frame_base_address, + alpha_heuristic_frame_base_address, + alpha_heuristic_frame_base_address +}; + /* Just like reinit_frame_cache, but with the right arguments to be - callable as an sfunc. */ + callable as an sfunc. Used by the "set heuristic-fence-post" command. */ static void reinit_frame_cache_sfunc (char *args, int from_tty, struct cmd_list_element *c) @@ -1559,90 +1234,120 @@ reinit_frame_cache_sfunc (char *args, int from_tty, struct cmd_list_element *c) reinit_frame_cache (); } -/* This is the definition of CALL_DUMMY_ADDRESS. It's a heuristic that is used - to find a convenient place in the text segment to stick a breakpoint to - detect the completion of a target function call (ala call_function_by_hand). - */ - -CORE_ADDR -alpha_call_dummy_address (void) -{ - CORE_ADDR entry; - struct minimal_symbol *sym; + +/* ALPHA stack frames are almost impenetrable. When execution stops, + we basically have to look at symbol information for the function + that we stopped in, which tells us *which* register (if any) is + the base of the frame pointer, and what offset from that register + the frame itself is at. - entry = entry_point_address (); + This presents a problem when trying to examine a stack in memory + (that isn't executing at the moment), using the "frame" command. We + don't have a PC, nor do we have any registers except SP. - if (entry != 0) - return entry; + This routine takes two arguments, SP and PC, and tries to make the + cached frames look as if these two arguments defined a frame on the + cache. This allows the rest of info frame to extract the important + arguments without difficulty. */ - sym = lookup_minimal_symbol ("_Prelude", NULL, symfile_objfile); +struct frame_info * +alpha_setup_arbitrary_frame (int argc, CORE_ADDR *argv) +{ + if (argc != 2) + error ("ALPHA frame specifications require two arguments: sp and pc"); - if (!sym || MSYMBOL_TYPE (sym) != mst_text) - return 0; - else - return SYMBOL_VALUE_ADDRESS (sym) + 4; + return create_new_frame (argv[0], argv[1]); } -static void -alpha_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, - struct value **args, struct type *type, int gcc_p) +/* Assuming NEXT_FRAME->prev is a dummy, return the frame ID of that + dummy frame. The frame ID's base needs to match the TOS value + saved by save_dummy_frame_tos(), and the PC match the dummy frame's + breakpoint. */ + +static struct frame_id +alpha_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) { - CORE_ADDR bp_address = CALL_DUMMY_ADDRESS (); + ULONGEST base; + frame_unwind_unsigned_register (next_frame, ALPHA_SP_REGNUM, &base); + return frame_id_build (base, frame_pc_unwind (next_frame)); +} - if (bp_address == 0) - error ("no place to put call"); - write_register (ALPHA_RA_REGNUM, bp_address); - write_register (ALPHA_T12_REGNUM, fun); +static CORE_ADDR +alpha_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) +{ + ULONGEST pc; + frame_unwind_unsigned_register (next_frame, ALPHA_PC_REGNUM, &pc); + return pc; } -/* On the Alpha, the call dummy code is nevery copied to user space - (see alpha_fix_call_dummy() above). The contents of this do not - matter. */ -LONGEST alpha_call_dummy_words[] = { 0 }; + +/* Helper routines for alpha*-nat.c files to move register sets to and + from core files. The UNIQUE pointer is allowed to be NULL, as most + targets don't supply this value in their core files. */ -static int -alpha_use_struct_convention (int gcc_p, struct type *type) +void +alpha_supply_int_regs (int regno, const void *r0_r30, + const void *pc, const void *unique) { - /* Structures are returned by ref in extra arg0. */ - return 1; + int i; + + for (i = 0; i < 31; ++i) + if (regno == i || regno == -1) + supply_register (i, (const char *)r0_r30 + i*8); + + if (regno == ALPHA_ZERO_REGNUM || regno == -1) + supply_register (ALPHA_ZERO_REGNUM, NULL); + + if (regno == ALPHA_PC_REGNUM || regno == -1) + supply_register (ALPHA_PC_REGNUM, pc); + + if (regno == ALPHA_UNIQUE_REGNUM || regno == -1) + supply_register (ALPHA_UNIQUE_REGNUM, unique); } -static void -alpha_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) +void +alpha_fill_int_regs (int regno, void *r0_r30, void *pc, void *unique) { - /* Store the address of the place in which to copy the structure the - subroutine will return. Handled by alpha_push_arguments. */ + int i; + + for (i = 0; i < 31; ++i) + if (regno == i || regno == -1) + regcache_collect (i, (char *)r0_r30 + i*8); + + if (regno == ALPHA_PC_REGNUM || regno == -1) + regcache_collect (ALPHA_PC_REGNUM, pc); + + if (unique && (regno == ALPHA_UNIQUE_REGNUM || regno == -1)) + regcache_collect (ALPHA_UNIQUE_REGNUM, unique); } -static CORE_ADDR -alpha_extract_struct_value_address (char *regbuf) +void +alpha_supply_fp_regs (int regno, const void *f0_f30, const void *fpcr) { - return (extract_address (regbuf + REGISTER_BYTE (ALPHA_V0_REGNUM), - REGISTER_RAW_SIZE (ALPHA_V0_REGNUM))); -} + int i; -/* Figure out where the longjmp will land. - We expect the first arg to be a pointer to the jmp_buf structure from - which we extract the PC (JB_PC) that we will land at. The PC is copied - into the "pc". This routine returns true on success. */ + for (i = ALPHA_FP0_REGNUM; i < ALPHA_FP0_REGNUM + 31; ++i) + if (regno == i || regno == -1) + supply_register (i, (const char *)f0_f30 + (i - ALPHA_FP0_REGNUM) * 8); -static int -alpha_get_longjmp_target (CORE_ADDR *pc) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - CORE_ADDR jb_addr; - char raw_buffer[ALPHA_MAX_REGISTER_RAW_SIZE]; + if (regno == ALPHA_FPCR_REGNUM || regno == -1) + supply_register (ALPHA_FPCR_REGNUM, fpcr); +} - jb_addr = read_register (ALPHA_A0_REGNUM); +void +alpha_fill_fp_regs (int regno, void *f0_f30, void *fpcr) +{ + int i; - if (target_read_memory (jb_addr + (tdep->jb_pc * tdep->jb_elt_size), - raw_buffer, tdep->jb_elt_size)) - return 0; + for (i = ALPHA_FP0_REGNUM; i < ALPHA_FP0_REGNUM + 31; ++i) + if (regno == i || regno == -1) + regcache_collect (i, (char *)f0_f30 + (i - ALPHA_FP0_REGNUM) * 8); - *pc = extract_address (raw_buffer, tdep->jb_elt_size); - return 1; + if (regno == ALPHA_FPCR_REGNUM || regno == -1) + regcache_collect (ALPHA_FPCR_REGNUM, fpcr); } + /* alpha_software_single_step() is called just before we want to resume the inferior, if we want to single-step it but there is no hardware or kernel single-step support (NetBSD on Alpha, for example). We find @@ -1659,7 +1364,7 @@ alpha_next_pc (CORE_ADDR pc) int offset; LONGEST rav; - insn = read_memory_unsigned_integer (pc, sizeof (insn)); + insn = alpha_read_insn (pc); /* Opcode is top 6 bits. */ op = (insn >> 26) & 0x3f; @@ -1722,6 +1427,8 @@ alpha_next_pc (CORE_ADDR pc) if (rav >= 0) goto branch_taken; break; + + /* ??? Missing floating-point branches. */ } } @@ -1753,7 +1460,6 @@ alpha_software_single_step (enum target_signal sig, int insert_breakpoints_p) } - /* Initialize the current architecture based on INFO. If possible, re-use an architecture from ARCHES, which is a list of architectures already created during this debugging session. @@ -1783,12 +1489,11 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = xmalloc (sizeof (struct gdbarch_tdep)); gdbarch = gdbarch_alloc (&info, tdep); - /* Lowest text address. This is used by heuristic_proc_start() to - decide when to stop looking. */ + /* Lowest text address. This is used by heuristic_proc_start() + to decide when to stop looking. */ tdep->vm_min_address = (CORE_ADDR) 0x120000000; tdep->dynamic_sigtramp_offset = NULL; - tdep->skip_sigtramp_frame = NULL; tdep->sigcontext_addr = NULL; tdep->jb_pc = -1; /* longjmp support not enabled by default */ @@ -1806,76 +1511,48 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Register info */ set_gdbarch_num_regs (gdbarch, ALPHA_NUM_REGS); set_gdbarch_sp_regnum (gdbarch, ALPHA_SP_REGNUM); - set_gdbarch_deprecated_fp_regnum (gdbarch, ALPHA_FP_REGNUM); set_gdbarch_pc_regnum (gdbarch, ALPHA_PC_REGNUM); set_gdbarch_fp0_regnum (gdbarch, ALPHA_FP0_REGNUM); set_gdbarch_register_name (gdbarch, alpha_register_name); - set_gdbarch_deprecated_register_size (gdbarch, ALPHA_REGISTER_SIZE); - set_gdbarch_deprecated_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_deprecated_max_register_raw_size (gdbarch, ALPHA_MAX_REGISTER_RAW_SIZE); - set_gdbarch_register_virtual_size (gdbarch, alpha_register_virtual_size); - set_gdbarch_deprecated_max_register_virtual_size (gdbarch, - ALPHA_MAX_REGISTER_VIRTUAL_SIZE); - set_gdbarch_register_virtual_type (gdbarch, alpha_register_virtual_type); + set_gdbarch_deprecated_register_byte (gdbarch, alpha_register_byte); + set_gdbarch_deprecated_register_raw_size (gdbarch, alpha_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, alpha_register_virtual_size); + set_gdbarch_register_type (gdbarch, alpha_register_type); set_gdbarch_cannot_fetch_register (gdbarch, alpha_cannot_fetch_register); set_gdbarch_cannot_store_register (gdbarch, alpha_cannot_store_register); - set_gdbarch_register_convertible (gdbarch, alpha_register_convertible); - set_gdbarch_register_convert_to_virtual (gdbarch, - alpha_register_convert_to_virtual); - set_gdbarch_register_convert_to_raw (gdbarch, alpha_register_convert_to_raw); + set_gdbarch_convert_register_p (gdbarch, alpha_convert_register_p); + set_gdbarch_register_to_value (gdbarch, alpha_register_to_value); + set_gdbarch_value_to_register (gdbarch, alpha_value_to_register); + + set_gdbarch_register_reggroup_p (gdbarch, alpha_register_reggroup_p); + /* Prologue heuristics. */ set_gdbarch_skip_prologue (gdbarch, alpha_skip_prologue); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); + /* Disassembler. */ + set_gdbarch_print_insn (gdbarch, print_insn_alpha); + + /* Call info. */ set_gdbarch_frameless_function_invocation (gdbarch, generic_frameless_function_invocation_not); - set_gdbarch_deprecated_saved_pc_after_call (gdbarch, alpha_saved_pc_after_call); - - set_gdbarch_deprecated_frame_chain (gdbarch, alpha_frame_chain); - set_gdbarch_deprecated_frame_saved_pc (gdbarch, alpha_frame_saved_pc); - - 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); - - set_gdbarch_deprecated_store_struct_return (gdbarch, alpha_store_struct_return); - set_gdbarch_deprecated_store_return_value (gdbarch, alpha_store_return_value); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, + set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention); + set_gdbarch_extract_return_value (gdbarch, alpha_extract_return_value); + set_gdbarch_store_return_value (gdbarch, alpha_store_return_value); + set_gdbarch_extract_struct_value_address (gdbarch, alpha_extract_struct_value_address); /* Settings for calling functions in the inferior. */ - set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); - set_gdbarch_deprecated_push_arguments (gdbarch, alpha_push_arguments); - set_gdbarch_deprecated_pop_frame (gdbarch, alpha_pop_frame); - - /* On the Alpha, the call dummy code is never copied to user space, - stopping the user call is achieved via a bp_call_dummy breakpoint. - But we need a fake CALL_DUMMY definition to enable the proper - call_function_by_hand and to avoid zero length array warnings. */ - set_gdbarch_deprecated_call_dummy_words (gdbarch, alpha_call_dummy_words); - set_gdbarch_deprecated_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_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 - argument handling and bp_call_dummy takes care of stopping the dummy. */ - set_gdbarch_call_dummy_address (gdbarch, alpha_call_dummy_address); - set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); - set_gdbarch_deprecated_push_dummy_frame (gdbarch, alpha_push_dummy_frame); - /* Should be using push_dummy_call. */ - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); - set_gdbarch_deprecated_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); + set_gdbarch_push_dummy_call (gdbarch, alpha_push_dummy_call); + + /* Methods for saving / extracting a dummy frame's ID. */ + set_gdbarch_unwind_dummy_id (gdbarch, alpha_unwind_dummy_id); + + /* Return the unwound PC value. */ + set_gdbarch_unwind_pc (gdbarch, alpha_unwind_pc); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); @@ -1895,37 +1572,30 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (tdep->jb_pc >= 0) set_gdbarch_get_longjmp_target (gdbarch, alpha_get_longjmp_target); + frame_unwind_append_predicate (gdbarch, alpha_sigtramp_frame_p); + frame_unwind_append_predicate (gdbarch, alpha_heuristic_frame_p); + + frame_base_set_default (gdbarch, &alpha_heuristic_frame_base); + return gdbarch; } -static void -alpha_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) +void +alpha_dwarf2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - - if (tdep == NULL) - return; - - fprintf_unfiltered (file, - "alpha_dump_tdep: vm_min_address = 0x%lx\n", - (long) tdep->vm_min_address); - - fprintf_unfiltered (file, - "alpha_dump_tdep: jb_pc = %d\n", - tdep->jb_pc); - fprintf_unfiltered (file, - "alpha_dump_tdep: jb_elt_size = %ld\n", - (long) tdep->jb_elt_size); + frame_unwind_append_predicate (gdbarch, dwarf2_frame_p); + frame_base_append_predicate (gdbarch, dwarf2_frame_base_p); + set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info); } +extern initialize_file_ftype _initialize_alpha_tdep; /* -Wmissing-prototypes */ + void _initialize_alpha_tdep (void) { struct cmd_list_element *c; - gdbarch_register (bfd_arch_alpha, alpha_gdbarch_init, alpha_dump_tdep); - - deprecated_tm_print_insn = print_insn_alpha; + gdbarch_register (bfd_arch_alpha, alpha_gdbarch_init, NULL); /* Let the user set the fence post for heuristic_proc_start. */ diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h index 0e8aefbfe16..c0e28e65772 100644 --- a/gdb/alpha-tdep.h +++ b/gdb/alpha-tdep.h @@ -34,33 +34,24 @@ register state. */ #define ALPHA_REGISTER_BYTES (ALPHA_NUM_REGS * 8) -/* Largest value REGISTER_RAW_SIZE can have. */ -#define ALPHA_MAX_REGISTER_RAW_SIZE 8 - -/* Largest value REGISTER_VIRTUAL_SIZE can have. */ -#define ALPHA_MAX_REGISTER_VIRTUAL_SIZE 8 - /* Register numbers of various important registers. Note that most of these values are "real" register numbers, and correspond to the - general registers of the machine, and DEPRECATED_FP_REGNUM is a - "phony" register number which is too large to be an actual register - number as far as the user is concerned but serves to get the - desired value when passed to read_register. */ + general registers of the machine. */ #define ALPHA_V0_REGNUM 0 /* Function integer return value */ #define ALPHA_T7_REGNUM 8 /* Return address register for OSF/1 __add* */ #define ALPHA_GCC_FP_REGNUM 15 /* Used by gcc as frame register */ #define ALPHA_A0_REGNUM 16 /* Loc of first arg during a subr call */ #define ALPHA_T9_REGNUM 23 /* Return address register for OSF/1 __div* */ +#define ALPHA_RA_REGNUM 26 /* Contains return address value */ #define ALPHA_T12_REGNUM 27 /* Contains start addr of current proc */ +#define ALPHA_GP_REGNUM 29 /* Contains the global pointer */ #define ALPHA_SP_REGNUM 30 /* Contains address of top of stack */ -#define ALPHA_RA_REGNUM 26 /* Contains return address value */ #define ALPHA_ZERO_REGNUM 31 /* Read-only register, always 0 */ #define ALPHA_FP0_REGNUM 32 /* Floating point register 0 */ #define ALPHA_FPA0_REGNUM 48 /* First float arg during a subr call */ #define ALPHA_FPCR_REGNUM 63 /* Floating point control register */ #define ALPHA_PC_REGNUM 64 /* Contains program counter */ -#define ALPHA_FP_REGNUM 65 /* Virtual frame pointer */ #define ALPHA_UNIQUE_REGNUM 66 /* PAL_rduniq value */ /* The alpha has two different virtual pointers for arguments and locals. @@ -80,19 +71,15 @@ /* Target-dependent structure in gdbarch. */ struct gdbarch_tdep { - CORE_ADDR vm_min_address; /* used by heuristic_proc_start */ + CORE_ADDR vm_min_address; /* Used by alpha_heuristic_proc_start. */ /* If PC is inside a dynamically-generated signal trampoline function (i.e. one copied onto the user stack at run-time), return how many bytes PC is beyond the start of that function. Otherwise, return -1. */ LONGEST (*dynamic_sigtramp_offset) (CORE_ADDR); - /* If FRAME refers to a sigtramp frame, return the address of the next - frame. */ - CORE_ADDR (*skip_sigtramp_frame) (struct frame_info *, CORE_ADDR); - - /* Translate a signal handler frame into the address of the sigcontext - structure for that signal handler. */ + /* Translate a signal handler stack base address into the address of + the sigcontext structure for that signal handler. */ CORE_ADDR (*sigcontext_addr) (struct frame_info *); int jb_pc; /* Offset to PC value in jump buffer. @@ -101,6 +88,17 @@ struct gdbarch_tdep size_t jb_elt_size; /* And the size of each entry in the buf. */ }; -void alpha_software_single_step (enum target_signal, int); +extern unsigned int alpha_read_insn (CORE_ADDR pc); +extern void alpha_software_single_step (enum target_signal, int); +extern CORE_ADDR alpha_after_prologue (CORE_ADDR pc); + +extern void alpha_mdebug_init_abi (struct gdbarch_info, struct gdbarch *); +extern void alpha_dwarf2_init_abi (struct gdbarch_info, struct gdbarch *); + +extern void alpha_supply_int_regs (int, const void *, const void *, + const void *); +extern void alpha_fill_int_regs (int, void *, void *, void *); +extern void alpha_supply_fp_regs (int, const void *, const void *); +extern void alpha_fill_fp_regs (int, void *, void *); #endif /* ALPHA_TDEP_H */ diff --git a/gdb/alphabsd-nat.c b/gdb/alphabsd-nat.c index a20b36f575e..0781698710f 100644 --- a/gdb/alphabsd-nat.c +++ b/gdb/alphabsd-nat.c @@ -75,7 +75,6 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) static int getregs_supplies (int regno) { - return ((regno >= ALPHA_V0_REGNUM && regno <= ALPHA_ZERO_REGNUM) || regno >= PC_REGNUM); } @@ -87,7 +86,6 @@ getregs_supplies (int regno) void fetch_inferior_registers (int regno) { - if (regno == -1 || getregs_supplies (regno)) { struct reg gregs; @@ -111,9 +109,6 @@ fetch_inferior_registers (int regno) alphabsd_supply_fpreg ((char *) &fpregs, regno); } - - /* Reset virtual frame pointer. */ - supply_register (DEPRECATED_FP_REGNUM, NULL); } /* Store register REGNO back into the inferior. If REGNO is -1, do @@ -122,7 +117,6 @@ fetch_inferior_registers (int regno) void store_inferior_registers (int regno) { - if (regno == -1 || getregs_supplies (regno)) { struct reg gregs; diff --git a/gdb/alphabsd-tdep.c b/gdb/alphabsd-tdep.c index 39a9b1ae77e..3e0f2272787 100644 --- a/gdb/alphabsd-tdep.c +++ b/gdb/alphabsd-tdep.c @@ -19,84 +19,37 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" -#include "regcache.h" #include "alpha-tdep.h" #include "alphabsd-tdep.h" -/* Number of general-purpose registers. */ -#define NUM_GREGS 32 - -/* Number of floating-point registers. */ -#define NUM_FPREGS 31 - /* Conviently, GDB uses the same register numbering as the ptrace register structure used by BSD on Alpha. */ void alphabsd_supply_reg (char *regs, int regno) { - int i; - - for (i = 0; i < NUM_GREGS; i++) - { - if (i == regno || regno == -1) - { - if (CANNOT_FETCH_REGISTER (i)) - supply_register (i, NULL); - else - supply_register (i, regs + (i * 8)); - } - } - - /* The PC travels in the ZERO slot. */ - if (regno == PC_REGNUM || regno == -1) - supply_register (PC_REGNUM, regs + (31 * 8)); + /* PC is at slot 32; UNIQUE not present. */ + alpha_supply_int_regs (regno, regs, regs + 31*8, NULL); } void alphabsd_fill_reg (char *regs, int regno) { - int i; - - for (i = 0; i < NUM_GREGS; i++) - if ((regno == i || regno == -1) && ! CANNOT_STORE_REGISTER (i)) - regcache_collect (i, regs + (i * 8)); - - /* The PC travels in the ZERO slot. */ - if (regno == PC_REGNUM || regno == -1) - regcache_collect (PC_REGNUM, regs + (31 * 8)); + /* PC is at slot 32; UNIQUE not present. */ + alpha_fill_int_regs (regno, regs, regs + 31*8, NULL); } void alphabsd_supply_fpreg (char *fpregs, int regno) { - int i; - - for (i = FP0_REGNUM; i < FP0_REGNUM + NUM_FPREGS; i++) - { - if (i == regno || regno == -1) - { - if (CANNOT_FETCH_REGISTER (i)) - supply_register (i, NULL); - else - supply_register (i, fpregs + ((i - FP0_REGNUM) * 8)); - } - } - - if (regno == ALPHA_FPCR_REGNUM || regno == -1) - supply_register (ALPHA_FPCR_REGNUM, fpregs + (32 * 8)); + /* FPCR is at slot 33; slot 32 unused. */ + alpha_supply_fp_regs (regno, fpregs, fpregs + 32*8); } void alphabsd_fill_fpreg (char *fpregs, int regno) { - int i; - - for (i = FP0_REGNUM; i < FP0_REGNUM + NUM_FPREGS; i++) - if ((regno == i || regno == -1) && ! CANNOT_STORE_REGISTER (i)) - regcache_collect (i, fpregs + ((i - FP0_REGNUM) * 8)); - - if (regno == ALPHA_FPCR_REGNUM || regno == -1) - regcache_collect (ALPHA_FPCR_REGNUM, fpregs + (32 * 8)); + /* FPCR is at slot 33; slot 32 unused. */ + alpha_fill_fp_regs (regno, fpregs, fpregs + 32*8); } diff --git a/gdb/alphafbsd-tdep.c b/gdb/alphafbsd-tdep.c index 3d8eafb2927..680e303f587 100644 --- a/gdb/alphafbsd-tdep.c +++ b/gdb/alphafbsd-tdep.c @@ -68,6 +68,12 @@ alphafbsd_init_abi (struct gdbarch_info info, { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + /* Hook into the DWARF CFI frame unwinder. */ + alpha_dwarf2_init_abi (info, gdbarch); + + /* Hook into the MDEBUG frame unwinder. */ + alpha_mdebug_init_abi (info, gdbarch); + set_gdbarch_pc_in_sigtramp (gdbarch, alphafbsd_pc_in_sigtramp); set_gdbarch_use_struct_convention (gdbarch, alphafbsd_use_struct_convention); diff --git a/gdb/alphanbsd-tdep.c b/gdb/alphanbsd-tdep.c index a4a77c1c00c..efb7ab9b47d 100644 --- a/gdb/alphanbsd-tdep.c +++ b/gdb/alphanbsd-tdep.c @@ -70,7 +70,6 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, for (regno = 0; regno < ALPHA_ZERO_REGNUM; regno++) supply_register (regno, regs + (regmap[regno] * 8)); supply_register (ALPHA_ZERO_REGNUM, NULL); - supply_register (DEPRECATED_FP_REGNUM, NULL); supply_register (PC_REGNUM, regs + (28 * 8)); /* Floating point registers. */ @@ -190,21 +189,7 @@ alphanbsd_sigcontext_addr (struct frame_info *frame) /* FIXME: This is not correct for all versions of NetBSD/alpha. We will probably need to disassemble the trampoline to figure out which trampoline frame type we have. */ - return frame->frame; -} - -static CORE_ADDR -alphanbsd_skip_sigtramp_frame (struct frame_info *frame, CORE_ADDR pc) -{ - char *name; - - /* FIXME: This is not correct for all versions of NetBSD/alpha. - We will probably need to disassemble the trampoline to figure - out which trampoline frame type we have. */ - find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL); - if (PC_IN_SIGTRAMP (pc, name)) - return frame->frame; - return 0; + return get_frame_base (frame); } static void @@ -213,6 +198,12 @@ alphanbsd_init_abi (struct gdbarch_info info, { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + /* Hook into the DWARF CFI frame unwinder. */ + alpha_dwarf2_init_abi (info, gdbarch); + + /* Hook into the MDEBUG frame unwinder. */ + alpha_mdebug_init_abi (info, gdbarch); + set_gdbarch_pc_in_sigtramp (gdbarch, alphanbsd_pc_in_sigtramp); /* NetBSD/alpha does not provide single step support via ptrace(2); we @@ -222,7 +213,6 @@ alphanbsd_init_abi (struct gdbarch_info info, set_solib_svr4_fetch_link_map_offsets (gdbarch, nbsd_lp64_solib_svr4_fetch_link_map_offsets); - tdep->skip_sigtramp_frame = alphanbsd_skip_sigtramp_frame; tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset; tdep->sigcontext_addr = alphanbsd_sigcontext_addr; diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 48f7f7ebe05..043600e9848 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -72,6 +72,13 @@ legacy_store_return_value (struct type *type, struct regcache *regcache, } +int +always_use_struct_convention (int gcc_p, struct type *value_type) +{ + return 1; +} + + int legacy_register_sim_regno (int regnum) { @@ -232,14 +239,7 @@ default_double_format (struct gdbarch *gdbarch) /* Misc helper functions for targets. */ int -frame_num_args_unknown (struct frame_info *fi) -{ - return -1; -} - - -int -generic_register_convertible_not (int num) +deprecated_register_convertible_not (int num) { return 0; } @@ -272,66 +272,6 @@ no_op_reg_to_regnum (int reg) return reg; } -/* Default prepare_to_procced(). */ -int -default_prepare_to_proceed (int select_it) -{ - return 0; -} - -/* Generic prepare_to_proceed(). This one should be suitable for most - targets that support threads. */ -int -generic_prepare_to_proceed (int select_it) -{ - ptid_t wait_ptid; - struct target_waitstatus wait_status; - - /* Get the last target status returned by target_wait(). */ - get_last_target_status (&wait_ptid, &wait_status); - - /* Make sure we were stopped either at a breakpoint, or because - of a Ctrl-C. */ - if (wait_status.kind != TARGET_WAITKIND_STOPPED - || (wait_status.value.sig != TARGET_SIGNAL_TRAP && - wait_status.value.sig != TARGET_SIGNAL_INT)) - { - return 0; - } - - if (!ptid_equal (wait_ptid, minus_one_ptid) - && !ptid_equal (inferior_ptid, wait_ptid)) - { - /* Switched over from WAIT_PID. */ - CORE_ADDR wait_pc = read_pc_pid (wait_ptid); - - if (wait_pc != read_pc ()) - { - if (select_it) - { - /* Switch back to WAIT_PID thread. */ - inferior_ptid = wait_ptid; - - /* FIXME: This stuff came from switch_to_thread() in - thread.c (which should probably be a public function). */ - flush_cached_frames (); - registers_changed (); - stop_pc = wait_pc; - select_frame (get_current_frame ()); - } - /* We return 1 to indicate that there is a breakpoint here, - so we need to step over it before continuing to avoid - hitting it straight away. */ - if (breakpoint_here_p (wait_pc)) - { - return 1; - } - } - } - return 0; - -} - CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev) { @@ -440,23 +380,29 @@ legacy_pc_in_sigtramp (CORE_ADDR pc, char *name) } int -legacy_convert_register_p (int regnum) +legacy_convert_register_p (int regnum, struct type *type) { - return REGISTER_CONVERTIBLE (regnum); + return DEPRECATED_REGISTER_CONVERTIBLE (regnum); } void -legacy_register_to_value (int regnum, struct type *type, - char *from, char *to) +legacy_register_to_value (struct frame_info *frame, int regnum, + struct type *type, void *to) { - REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to); + char from[MAX_REGISTER_SIZE]; + frame_read_register (frame, regnum, from); + DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to); } void -legacy_value_to_register (struct type *type, int regnum, - char *from, char *to) +legacy_value_to_register (struct frame_info *frame, int regnum, + struct type *type, const void *tmp) { - REGISTER_CONVERT_TO_RAW (type, regnum, from, to); + char to[MAX_REGISTER_SIZE]; + char *from = alloca (TYPE_LENGTH (type)); + memcpy (from, from, TYPE_LENGTH (type)); + DEPRECATED_REGISTER_CONVERT_TO_RAW (type, regnum, from, to); + put_frame_register (frame, regnum, to); } @@ -882,7 +828,7 @@ gdbarch_info_init (struct gdbarch_info *info) /* */ -extern initialize_file_ftype _initialize_gdbarch_utils; +extern initialize_file_ftype _initialize_gdbarch_utils; /* -Wmissing-prototypes */ void _initialize_gdbarch_utils (void) diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 27f219b0be9..234257d97b2 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -32,14 +32,10 @@ struct gdbarch_info; extern int gdbarch_debug; /* Fallback for register convertible. */ -extern gdbarch_register_convertible_ftype generic_register_convertible_not; +extern gdbarch_deprecated_register_convertible_ftype deprecated_register_convertible_not; extern CORE_ADDR generic_cannot_extract_struct_value_address (char *dummy); -/* Helper function for targets that don't know how my arguments are - being passed */ -extern gdbarch_frame_num_args_ftype frame_num_args_unknown; - /* Implementation of extract return value that grubs around in the register cache. */ extern gdbarch_extract_return_value_ftype legacy_extract_return_value; @@ -47,6 +43,10 @@ extern gdbarch_extract_return_value_ftype legacy_extract_return_value; /* Implementation of store return value that grubs the register cache. */ extern gdbarch_store_return_value_ftype legacy_store_return_value; +/* To return any structure or union type by value, store it at the + address passed as an invisible first argument to the function. */ +extern gdbarch_use_struct_convention_ftype always_use_struct_convention; + /* Frameless functions not identifable. */ extern gdbarch_frameless_function_invocation_ftype generic_frameless_function_invocation_not; @@ -81,11 +81,6 @@ extern int core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs); extern const struct floatformat *default_float_format (struct gdbarch *gdbarch); extern const struct floatformat *default_double_format (struct gdbarch *gdbarch); -/* Helper function for targets that don't know how my arguments are - being passed */ -extern int frame_num_args_unknown (struct frame_info *fi); - - /* The following DEPRECATED interfaces are for pre- multi-arch legacy targets. */ @@ -110,12 +105,6 @@ extern CORE_ADDR core_addr_identity (CORE_ADDR addr); extern int no_op_reg_to_regnum (int reg); -/* Default prepare_to_procced. */ - -extern int default_prepare_to_proceed (int select_it); - -extern int generic_prepare_to_proceed (int select_it); - /* Versions of init_frame_pc(). Do nothing; do the default. */ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev); @@ -165,9 +154,11 @@ extern int legacy_pc_in_sigtramp (CORE_ADDR pc, char *name); (something that is discouraged); and to convert a register to the type of a corresponding variable. These legacy functions preserve that overloaded behavour in existing targets. */ -extern int legacy_convert_register_p (int regnum); -extern void legacy_register_to_value (int regnum, struct type *type, char *from, char *to); -extern void legacy_value_to_register (struct type *type, int regnum, char *from, char *to); +extern int legacy_convert_register_p (int regnum, struct type *type); +extern void legacy_register_to_value (struct frame_info *frame, int regnum, + struct type *type, void *to); +extern void legacy_value_to_register (struct frame_info *frame, int regnum, + struct type *type, const void *from); /* For compatibility with older architectures, returns (LEGACY_SIM_REGNO_IGNORE) when the register doesn't have a valid diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index a2ea4935303..5ea3ef2f982 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -27,6 +27,7 @@ #include "frame.h" #include "regcache.h" #include "doublest.h" +#include "solib-svr4.h" #include "osabi.h" #include "arm-tdep.h" @@ -193,7 +194,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp, && NULL != target_type && TYPE_CODE_FUNC == TYPE_CODE (target_type)) { - CORE_ADDR regval = extract_address (val, len); + CORE_ADDR regval = extract_unsigned_integer (val, len); if (arm_pc_is_thumb (regval)) store_unsigned_integer (val, len, MAKE_THUMB_ADDR (regval)); } @@ -208,7 +209,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp, if (argreg <= ARM_LAST_ARG_REGNUM) { /* It's an argument being passed in a general register. */ - regval = extract_address (val, partial_len); + regval = extract_unsigned_integer (val, partial_len); write_register (argreg++, regval); } else @@ -376,6 +377,49 @@ find_minsym_and_objfile (char *name, struct objfile **objfile_p) } +/* Fetch, and possibly build, an appropriate link_map_offsets structure + for ARM linux targets using the struct offsets defined in . + Note, however, that link.h is not actually referred to in this file. + Instead, the relevant structs offsets were obtained from examining + link.h. (We can't refer to link.h from this file because the host + system won't necessarily have it, or if it does, the structs which + it defines will refer to the host system, not the target). */ + +static struct link_map_offsets * +arm_linux_svr4_fetch_link_map_offsets (void) +{ + static struct link_map_offsets lmo; + static struct link_map_offsets *lmp = 0; + + if (lmp == 0) + { + lmp = &lmo; + + lmo.r_debug_size = 8; /* Actual size is 20, but this is all we + need. */ + + lmo.r_map_offset = 4; + lmo.r_map_size = 4; + + lmo.link_map_size = 20; /* Actual size is 552, but this is all we + need. */ + + lmo.l_addr_offset = 0; + lmo.l_addr_size = 4; + + lmo.l_name_offset = 4; + lmo.l_name_size = 4; + + lmo.l_next_offset = 12; + lmo.l_next_size = 4; + + lmo.l_prev_offset = 16; + lmo.l_prev_size = 4; + } + + return lmp; +} + static CORE_ADDR skip_hurd_resolver (CORE_ADDR pc) { @@ -530,6 +574,9 @@ arm_linux_init_abi (struct gdbarch_info info, tdep->jb_pc = ARM_LINUX_JB_PC; tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE; + set_solib_svr4_fetch_link_map_offsets + (gdbarch, arm_linux_svr4_fetch_link_map_offsets); + set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_linux_call_dummy_words); set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (arm_linux_call_dummy_words)); diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index c0e2408c886..3f2f13c3bb6 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -33,7 +33,6 @@ #include "doublest.h" #include "value.h" #include "arch-utils.h" -#include "solib-svr4.h" #include "osabi.h" #include "arm-tdep.h" @@ -306,28 +305,6 @@ arm_frameless_function_invocation (struct frame_info *fi) return frameless; } -/* The address of the arguments in the frame. */ -static CORE_ADDR -arm_frame_args_address (struct frame_info *fi) -{ - return get_frame_base (fi); -} - -/* The address of the local variables in the frame. */ -static CORE_ADDR -arm_frame_locals_address (struct frame_info *fi) -{ - return get_frame_base (fi); -} - -/* The number of arguments being passed in the frame. */ -static int -arm_frame_num_args (struct frame_info *fi) -{ - /* We have no way of knowing. */ - return -1; -} - /* A typical Thumb prologue looks like this: push {r7, lr} add sp, sp, #-28 @@ -1405,19 +1382,20 @@ pop_stack_item (struct stack_item *si) we should probably support some of them based on the selected ABI. */ static CORE_ADDR -arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, - CORE_ADDR dummy_addr, int nargs, struct value **args, - CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) +arm_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, + struct regcache *regcache, CORE_ADDR bp_addr, int nargs, + struct value **args, CORE_ADDR sp, int struct_return, + CORE_ADDR struct_addr) { int argnum; int argreg; int nstack; struct stack_item *si = NULL; - /* Set the return address. For the ARM, the return breakpoint is always - at DUMMY_ADDR. */ + /* Set the return address. For the ARM, the return breakpoint is + always at BP_ADDR. */ /* XXX Fix for Thumb. */ - regcache_cooked_write_unsigned (regcache, ARM_LR_REGNUM, dummy_addr); + regcache_cooked_write_unsigned (regcache, ARM_LR_REGNUM, bp_addr); /* Walk through the list of args and determine how large a temporary stack is required. Need to take care here as structs may be @@ -1464,7 +1442,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, && target_type != NULL && TYPE_CODE_FUNC == TYPE_CODE (target_type)) { - CORE_ADDR regval = extract_address (val, len); + CORE_ADDR regval = extract_unsigned_integer (val, len); if (arm_pc_is_thumb (regval)) { val = alloca (len); @@ -1483,7 +1461,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, { /* The argument is being passed in a general purpose register. */ - CORE_ADDR regval = extract_address (val, partial_len); + CORE_ADDR regval = extract_unsigned_integer (val, partial_len); if (arm_debug) fprintf_unfiltered (gdb_stdlog, "arg %d in %s = 0x%s\n", argnum, REGISTER_NAME (argreg), @@ -2493,7 +2471,7 @@ arm_get_longjmp_target (CORE_ADDR *pc) INT_REGISTER_RAW_SIZE)) return 0; - *pc = extract_address (buf, INT_REGISTER_RAW_SIZE); + *pc = extract_unsigned_integer (buf, INT_REGISTER_RAW_SIZE); return 1; } @@ -2689,49 +2667,6 @@ arm_othernames (char *names, int n) set_disassembly_style (); } -/* Fetch, and possibly build, an appropriate link_map_offsets structure - for ARM linux targets using the struct offsets defined in . - Note, however, that link.h is not actually referred to in this file. - Instead, the relevant structs offsets were obtained from examining - link.h. (We can't refer to link.h from this file because the host - system won't necessarily have it, or if it does, the structs which - it defines will refer to the host system, not the target). */ - -struct link_map_offsets * -arm_linux_svr4_fetch_link_map_offsets (void) -{ - static struct link_map_offsets lmo; - static struct link_map_offsets *lmp = 0; - - if (lmp == 0) - { - lmp = &lmo; - - lmo.r_debug_size = 8; /* Actual size is 20, but this is all we - need. */ - - lmo.r_map_offset = 4; - lmo.r_map_size = 4; - - lmo.link_map_size = 20; /* Actual size is 552, but this is all we - need. */ - - lmo.l_addr_offset = 0; - lmo.l_addr_size = 4; - - lmo.l_name_offset = 4; - lmo.l_name_size = 4; - - lmo.l_next_offset = 12; - lmo.l_next_size = 4; - - lmo.l_prev_offset = 16; - lmo.l_prev_size = 4; - } - - return lmp; -} - /* Test whether the coff symbol specific value corresponds to a Thumb function. */ @@ -2943,9 +2878,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frameless_function_invocation (gdbarch, arm_frameless_function_invocation); set_gdbarch_deprecated_frame_saved_pc (gdbarch, arm_frame_saved_pc); - set_gdbarch_frame_args_address (gdbarch, arm_frame_args_address); - 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_deprecated_frame_init_saved_regs (gdbarch, arm_frame_init_saved_regs); set_gdbarch_deprecated_pop_frame (gdbarch, arm_pop_frame); @@ -2975,17 +2907,17 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_fp_regnum (gdbarch, ARM_FP_REGNUM); /* ??? */ set_gdbarch_sp_regnum (gdbarch, ARM_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, ARM_PC_REGNUM); - set_gdbarch_register_byte (gdbarch, arm_register_byte); + set_gdbarch_deprecated_register_byte (gdbarch, arm_register_byte); set_gdbarch_deprecated_register_bytes (gdbarch, (NUM_GREGS * INT_REGISTER_RAW_SIZE + NUM_FREGS * FP_REGISTER_RAW_SIZE + NUM_SREGS * STATUS_REGISTER_SIZE)); 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_deprecated_register_raw_size (gdbarch, arm_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, arm_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); + set_gdbarch_deprecated_register_virtual_type (gdbarch, arm_register_type); /* Internal <-> external register number maps. */ set_gdbarch_register_sim_regno (gdbarch, arm_register_sim_regno); @@ -3078,6 +3010,8 @@ arm_init_abi_apcs (struct gdbarch_info info, /* Place-holder. */ } +extern initialize_file_ftype _initialize_arm_tdep; /* -Wmissing-prototypes */ + void _initialize_arm_tdep (void) { diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 4ade2ab41ec..c5d6ffe769d 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -25,6 +25,10 @@ by Denis Chertykov, denisc@overta.ru */ #include "defs.h" +#include "frame.h" +#include "frame-unwind.h" +#include "frame-base.h" +#include "trad-frame.h" #include "gdbcmd.h" #include "gdbcore.h" #include "inferior.h" @@ -89,7 +93,7 @@ enum AVR_PC_REG_INDEX = 35, /* index into array of registers */ - AVR_MAX_PROLOGUE_SIZE = 56, /* bytes */ + AVR_MAX_PROLOGUE_SIZE = 64, /* bytes */ /* Count of pushed registers. From r2 to r17 (inclusively), r28, r29 */ AVR_MAX_PUSHES = 18, @@ -97,6 +101,12 @@ enum /* Number of the last pushed register. r17 for current avr-gcc */ AVR_LAST_PUSHED_REGNUM = 17, + AVR_ARG1_REGNUM = 24, /* Single byte argument */ + AVR_ARGN_REGNUM = 25, /* Multi byte argments */ + + AVR_RET1_REGNUM = 24, /* Single byte return value */ + AVR_RETN_REGNUM = 25, /* Multi byte return value */ + /* FIXME: TRoth/2002-01-??: Can we shift all these memory masks left 8 bits? Do these have to match the bfd vma values?. It sure would make things easier in the future if they didn't need to match. @@ -130,6 +140,20 @@ enum #endif }; +/* Prologue types: + + NORMAL and CALL are the typical types (the -mcall-prologues gcc option + causes the generation of the CALL type prologues). */ + +enum { + AVR_PROLOGUE_NONE, /* No prologue */ + AVR_PROLOGUE_NORMAL, + AVR_PROLOGUE_CALL, /* -mcall-prologues */ + AVR_PROLOGUE_MAIN, + AVR_PROLOGUE_INTR, /* interrupt handler */ + AVR_PROLOGUE_SIG, /* signal handler */ +}; + /* Any function with a frame looks like this ....... <-SP POINTS HERE LOCALS1 <-FP POINTS HERE @@ -141,14 +165,17 @@ enum FIRST ARG SECOND ARG */ -struct frame_extra_info +struct avr_unwind_cache { - CORE_ADDR return_pc; - CORE_ADDR args_pointer; - int locals_size; - int framereg; - int framesize; - int is_main; + /* The previous frame's inner most stack address. Used as this + frame ID's stack_addr. */ + CORE_ADDR prev_sp; + /* The frame's base, optionally used by the high-level debug info. */ + CORE_ADDR base; + int size; + int prologue_type; + /* Table indicating the location of each and every register. */ + struct trad_frame_saved_reg *saved_regs; }; struct gdbarch_tdep @@ -176,60 +203,18 @@ avr_register_name (int regnum) return register_names[regnum]; } -/* Index within `registers' of the first byte of the space for - register REGNUM. */ - -static int -avr_register_byte (int regnum) -{ - if (regnum < AVR_PC_REGNUM) - return regnum; - else - return AVR_PC_REG_INDEX; -} - -/* Number of bytes of storage in the actual machine representation for - register REGNUM. */ - -static int -avr_register_raw_size (int regnum) -{ - switch (regnum) - { - case AVR_PC_REGNUM: - return 4; - case AVR_SP_REGNUM: - case AVR_FP_REGNUM: - return 2; - default: - return 1; - } -} - -/* Number of bytes of storage in the program's representation - for register N. */ - -static int -avr_register_virtual_size (int regnum) -{ - return TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (regnum)); -} - /* Return the GDB type object for the "standard" data type of data in register N. */ static struct type * -avr_register_virtual_type (int regnum) +avr_register_type (struct gdbarch *gdbarch, int reg_nr) { - switch (regnum) - { - case AVR_PC_REGNUM: - return builtin_type_unsigned_long; - case AVR_SP_REGNUM: - return builtin_type_unsigned_short; - default: - return builtin_type_unsigned_char; - } + if (reg_nr == AVR_PC_REGNUM) + return builtin_type_uint32; + if (reg_nr == AVR_SP_REGNUM) + return builtin_type_void_data_ptr; + else + return builtin_type_uint8; } /* Instruction address checks and convertions. */ @@ -311,7 +296,7 @@ avr_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr) || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD) { store_unsigned_integer (buf, TYPE_LENGTH (type), - avr_convert_iaddr_to_raw (addr)); + avr_convert_iaddr_to_raw (addr >> 1)); } else { @@ -324,21 +309,13 @@ avr_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr) static CORE_ADDR avr_pointer_to_address (struct type *type, const void *buf) { - CORE_ADDR addr = extract_address (buf, TYPE_LENGTH (type)); - - if (TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type))) - { - fprintf_unfiltered (gdb_stderr, "CODE_SPACE ---->> ptr->addr: 0x%lx\n", - addr); - fprintf_unfiltered (gdb_stderr, - "+++ If you see this, please send me an email \n"); - } + CORE_ADDR addr = extract_unsigned_integer (buf, TYPE_LENGTH (type)); /* Is it a code address? */ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD || TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type))) - return avr_make_iaddr (addr); + return avr_make_iaddr (addr << 1); else return avr_make_saddr (addr); } @@ -347,12 +324,12 @@ static CORE_ADDR avr_read_pc (ptid_t ptid) { ptid_t save_ptid; - CORE_ADDR pc; + ULONGEST pc; CORE_ADDR retval; save_ptid = inferior_ptid; inferior_ptid = ptid; - pc = (int) read_register (AVR_PC_REGNUM); + regcache_cooked_read_unsigned (current_regcache, AVR_PC_REGNUM, &pc); inferior_ptid = save_ptid; retval = avr_make_iaddr (pc); return retval; @@ -372,131 +349,141 @@ avr_write_pc (CORE_ADDR val, ptid_t ptid) static CORE_ADDR avr_read_sp (void) { - return (avr_make_saddr (read_register (AVR_SP_REGNUM))); -} - -static void -avr_write_sp (CORE_ADDR val) -{ - write_register (AVR_SP_REGNUM, avr_convert_saddr_to_raw (val)); -} + ULONGEST sp; -static CORE_ADDR -avr_read_fp (void) -{ - return (avr_make_saddr (read_register (AVR_FP_REGNUM))); + regcache_cooked_read_unsigned (current_regcache, AVR_SP_REGNUM, &sp); + return (avr_make_saddr (sp)); } -/* Translate a GDB virtual ADDR/LEN into a format the remote target - understands. Returns number of bytes that can be transfered - starting at TARG_ADDR. Return ZERO if no bytes can be transfered - (segmentation fault). - - TRoth/2002-04-08: Could this be used to check for dereferencing an invalid - pointer? */ - -static void -avr_remote_translate_xfer_address (struct gdbarch *gdbarch, - struct regcache *regcache, - CORE_ADDR memaddr, int nr_bytes, - CORE_ADDR *targ_addr, int *targ_len) +static int +avr_scan_arg_moves (int vpc, unsigned char *prologue) { - long out_addr; - long out_len; - - /* FIXME: TRoth: Do nothing for now. Will need to examine memaddr at this - point and see if the high bit are set with the masks that we want. */ - - *targ_addr = memaddr; - *targ_len = nr_bytes; -} - -/* Function pointers obtained from the target are half of what gdb expects so - multiply by 2. */ + unsigned short insn; -static CORE_ADDR -avr_convert_from_func_ptr_addr (CORE_ADDR addr) -{ - return addr * 2; + for (; vpc < AVR_MAX_PROLOGUE_SIZE; vpc += 2) + { + insn = EXTRACT_INSN (&prologue[vpc]); + if ((insn & 0xff00) == 0x0100) /* movw rXX, rYY */ + continue; + else if ((insn & 0xfc00) == 0x2c00) /* mov rXX, rYY */ + continue; + else + break; + } + + return vpc; } -/* avr_scan_prologue is also used as the - deprecated_frame_init_saved_regs(). +/* Function: avr_scan_prologue - Put here the code to store, into fi->saved_regs, the addresses of - the saved registers of frame described by FRAME_INFO. This - includes special registers such as pc and fp saved in special ways - in the stack frame. sp is even more special: the address we return - for it IS the sp for the next frame. */ - -/* Function: avr_scan_prologue (helper function for avr_init_extra_frame_info) - This function decodes a AVR function prologue to determine: + This function decodes an AVR function prologue to determine: 1) the size of the stack frame 2) which registers are saved on it 3) the offsets of saved regs - This information is stored in the "extra_info" field of the frame_info. - - A typical AVR function prologue might look like this: - push rXX - push r28 - push r29 - in r28,__SP_L__ - in r29,__SP_H__ - sbiw r28, - in __tmp_reg__,__SREG__ + This information is stored in the avr_unwind_cache structure. + + Some devices lack the sbiw instruction, so on those replace this: + sbiw r28, XX + with this: + subi r28,lo8(XX) + sbci r29,hi8(XX) + + A typical AVR function prologue with a frame pointer might look like this: + push rXX ; saved regs + ... + push r28 + push r29 + in r28,__SP_L__ + in r29,__SP_H__ + sbiw r28, + in __tmp_reg__,__SREG__ cli - out __SP_L__,r28 - out __SREG__,__tmp_reg__ - out __SP_H__,r29 - - A `-mcall-prologues' prologue look like this: - ldi r26, - ldi r27,/265 - ldi r30,pm_lo8(.L_foo_body) - ldi r31,pm_hi8(.L_foo_body) - rjmp __prologue_saves__+RRR - .L_foo_body: */ + out __SP_H__,r29 + out __SREG__,__tmp_reg__ + out __SP_L__,r28 + + A typical AVR function prologue without a frame pointer might look like + this: + push rXX ; saved regs + ... + + A main function prologue looks like this: + ldi r28,lo8( - ) + ldi r29,hi8( - ) + out __SP_H__,r29 + out __SP_L__,r28 + + A signal handler prologue looks like this: + push __zero_reg__ + push __tmp_reg__ + in __tmp_reg__, __SREG__ + push __tmp_reg__ + clr __zero_reg__ + push rXX ; save registers r18:r27, r30:r31 + ... + push r28 ; save frame pointer + push r29 + in r28, __SP_L__ + in r29, __SP_H__ + sbiw r28, + out __SP_H__, r29 + out __SP_L__, r28 + + A interrupt handler prologue looks like this: + sei + push __zero_reg__ + push __tmp_reg__ + in __tmp_reg__, __SREG__ + push __tmp_reg__ + clr __zero_reg__ + push rXX ; save registers r18:r27, r30:r31 + ... + push r28 ; save frame pointer + push r29 + in r28, __SP_L__ + in r29, __SP_H__ + sbiw r28, + cli + out __SP_H__, r29 + sei + out __SP_L__, r28 + + A `-mcall-prologues' prologue looks like this (Note that the megas use a + jmp instead of a rjmp, thus the prologue is one word larger since jmp is a + 32 bit insn and rjmp is a 16 bit insn): + ldi r26,lo8() + ldi r27,hi8() + ldi r30,pm_lo8(.L_foo_body) + ldi r31,pm_hi8(.L_foo_body) + rjmp __prologue_saves__+RRR + .L_foo_body: */ + +/* Not really part of a prologue, but still need to scan for it, is when a + function prologue moves values passed via registers as arguments to new + registers. In this case, all local variables live in registers, so there + may be some register saves. This is what it looks like: + movw rMM, rNN + ... + + There could be multiple movw's. If the target doesn't have a movw insn, it + will use two mov insns. This could be done after any of the above prologue + types. */ -static void -avr_scan_prologue (struct frame_info *fi) +static CORE_ADDR +avr_scan_prologue (CORE_ADDR pc, struct avr_unwind_cache *info) { - CORE_ADDR prologue_start; - CORE_ADDR prologue_end; int i; unsigned short insn; - int regno; int scan_stage = 0; - char *name; struct minimal_symbol *msymbol; - int prologue_len; unsigned char prologue[AVR_MAX_PROLOGUE_SIZE]; int vpc = 0; - get_frame_extra_info (fi)->framereg = AVR_SP_REGNUM; - - if (find_pc_partial_function - (get_frame_pc (fi), &name, &prologue_start, &prologue_end)) - { - struct symtab_and_line sal = find_pc_line (prologue_start, 0); - - if (sal.line == 0) /* no line info, use current PC */ - prologue_end = get_frame_pc (fi); - else if (sal.end < prologue_end) /* next line begins after fn end */ - prologue_end = sal.end; /* (probably means no prologue) */ - } - else - /* We're in the boondocks: allow for */ - /* 19 pushes, an add, and "mv fp,sp" */ - prologue_end = prologue_start + AVR_MAX_PROLOGUE_SIZE; - - prologue_end = min (prologue_end, get_frame_pc (fi)); - - /* Search the prologue looking for instructions that set up the - frame pointer, adjust the stack pointer, and save registers. */ - - get_frame_extra_info (fi)->framesize = 0; - prologue_len = prologue_end - prologue_start; - read_memory (prologue_start, prologue, prologue_len); + /* FIXME: TRoth/2003-06-11: This could be made more efficient by only + reading in the bytes of the prologue. The problem is that the figuring + out where the end of the prologue is is a bit difficult. The old code + tried to do that, but failed quite often. */ + read_memory (pc, prologue, AVR_MAX_PROLOGUE_SIZE); /* Scanning main()'s prologue ldi r28,lo8( - ) @@ -504,7 +491,7 @@ avr_scan_prologue (struct frame_info *fi) out __SP_H__,r29 out __SP_L__,r28 */ - if (name && strcmp ("main", name) == 0 && prologue_len == 8) + if (1) { CORE_ADDR locals; unsigned char img[] = { @@ -512,7 +499,6 @@ avr_scan_prologue (struct frame_info *fi) 0xcd, 0xbf /* out __SP_L__,r28 */ }; - get_frame_extra_info (fi)->framereg = AVR_FP_REGNUM; insn = EXTRACT_INSN (&prologue[vpc]); /* ldi r28,lo8( - ) */ if ((insn & 0xf0f0) == 0xe0c0) @@ -525,94 +511,124 @@ avr_scan_prologue (struct frame_info *fi) locals |= ((insn & 0xf) | ((insn & 0x0f00) >> 4)) << 8; if (memcmp (prologue + vpc + 4, img, sizeof (img)) == 0) { - deprecated_update_frame_base_hack (fi, locals); - - get_frame_extra_info (fi)->is_main = 1; - return; + info->prologue_type = AVR_PROLOGUE_MAIN; + info->base = locals; + return pc + 4; } } } } /* Scanning `-mcall-prologues' prologue - FIXME: mega prologue have a 12 bytes long */ + Classic prologue is 10 bytes, mega prologue is a 12 bytes long */ - while (prologue_len <= 12) /* I'm use while to avoit many goto's */ + while (1) /* Using a while to avoid many goto's */ { int loc_size; int body_addr; unsigned num_pushes; + int pc_offset = 0; insn = EXTRACT_INSN (&prologue[vpc]); /* ldi r26, */ if ((insn & 0xf0f0) != 0xe0a0) break; loc_size = (insn & 0xf) | ((insn & 0x0f00) >> 4); + pc_offset += 2; insn = EXTRACT_INSN (&prologue[vpc + 2]); /* ldi r27, / 256 */ if ((insn & 0xf0f0) != 0xe0b0) break; loc_size |= ((insn & 0xf) | ((insn & 0x0f00) >> 4)) << 8; + pc_offset += 2; insn = EXTRACT_INSN (&prologue[vpc + 4]); /* ldi r30,pm_lo8(.L_foo_body) */ if ((insn & 0xf0f0) != 0xe0e0) break; body_addr = (insn & 0xf) | ((insn & 0x0f00) >> 4); + pc_offset += 2; insn = EXTRACT_INSN (&prologue[vpc + 6]); /* ldi r31,pm_hi8(.L_foo_body) */ if ((insn & 0xf0f0) != 0xe0f0) break; body_addr |= ((insn & 0xf) | ((insn & 0x0f00) >> 4)) << 8; - - if (body_addr != (prologue_start + 10) / 2) - break; + pc_offset += 2; msymbol = lookup_minimal_symbol ("__prologue_saves__", NULL, NULL); if (!msymbol) break; - /* FIXME: prologue for mega have a JMP instead of RJMP */ insn = EXTRACT_INSN (&prologue[vpc + 8]); /* rjmp __prologue_saves__+RRR */ - if ((insn & 0xf000) != 0xc000) - break; + if ((insn & 0xf000) == 0xc000) + { + /* Extract PC relative offset from RJMP */ + i = (insn & 0xfff) | (insn & 0x800 ? (-1 ^ 0xfff) : 0); + /* Convert offset to byte addressable mode */ + i *= 2; + /* Destination address */ + i += pc + 10; + + if (body_addr != (pc + 10)/2) + break; + + pc_offset += 2; + } + else if ((insn & 0xfe0e) == 0x940c) + { + /* Extract absolute PC address from JMP */ + i = (((insn & 0x1) | ((insn & 0x1f0) >> 3) << 16) + | (EXTRACT_INSN (&prologue[vpc + 10]) & 0xffff)); + /* Convert address to byte addressable mode */ + i *= 2; + + if (body_addr != (pc + 12)/2) + break; + + pc_offset += 4; + } + else + break; - /* Extract PC relative offset from RJMP */ - i = (insn & 0xfff) | (insn & 0x800 ? (-1 ^ 0xfff) : 0); - /* Convert offset to byte addressable mode */ - i *= 2; - /* Destination address */ - i += vpc + prologue_start + 10; - /* Resovle offset (in words) from __prologue_saves__ symbol. + /* Resolve offset (in words) from __prologue_saves__ symbol. Which is a pushes count in `-mcall-prologues' mode */ num_pushes = AVR_MAX_PUSHES - (i - SYMBOL_VALUE_ADDRESS (msymbol)) / 2; if (num_pushes > AVR_MAX_PUSHES) - num_pushes = 0; + { + fprintf_unfiltered (gdb_stderr, "Num pushes too large: %d\n", + num_pushes); + num_pushes = 0; + } if (num_pushes) { int from; - get_frame_saved_regs (fi)[AVR_FP_REGNUM + 1] = num_pushes; + + info->saved_regs[AVR_FP_REGNUM + 1].addr = num_pushes; if (num_pushes >= 2) - get_frame_saved_regs (fi)[AVR_FP_REGNUM] = num_pushes - 1; + info->saved_regs[AVR_FP_REGNUM].addr = num_pushes - 1; + i = 0; for (from = AVR_LAST_PUSHED_REGNUM + 1 - (num_pushes - 2); from <= AVR_LAST_PUSHED_REGNUM; ++from) - get_frame_saved_regs (fi)[from] = ++i; + info->saved_regs [from].addr = ++i; } - get_frame_extra_info (fi)->locals_size = loc_size; - get_frame_extra_info (fi)->framesize = loc_size + num_pushes; - get_frame_extra_info (fi)->framereg = AVR_FP_REGNUM; - return; + info->size = loc_size + num_pushes; + info->prologue_type = AVR_PROLOGUE_CALL; + + return pc + pc_offset; } - /* Scan interrupt or signal function */ + /* Scan for the beginning of the prologue for an interrupt or signal + function. Note that we have to set the prologue type here since the + third stage of the prologue may not be present (e.g. no saved registered + or changing of the SP register). */ - if (prologue_len >= 12) + if (1) { unsigned char img[] = { 0x78, 0x94, /* sei */ @@ -624,44 +640,52 @@ avr_scan_prologue (struct frame_info *fi) }; if (memcmp (prologue, img, sizeof (img)) == 0) { + info->prologue_type = AVR_PROLOGUE_INTR; vpc += sizeof (img); - get_frame_saved_regs (fi)[0] = 2; - get_frame_saved_regs (fi)[1] = 1; - get_frame_extra_info (fi)->framesize += 3; + info->saved_regs[AVR_SREG_REGNUM].addr = 3; + info->saved_regs[0].addr = 2; + info->saved_regs[1].addr = 1; + info->size += 3; } - else if (memcmp (img + 1, prologue, sizeof (img) - 1) == 0) + else if (memcmp (img + 2, prologue, sizeof (img) - 2) == 0) { - vpc += sizeof (img) - 1; - get_frame_saved_regs (fi)[0] = 2; - get_frame_saved_regs (fi)[1] = 1; - get_frame_extra_info (fi)->framesize += 3; + info->prologue_type = AVR_PROLOGUE_SIG; + vpc += sizeof (img) - 2; + info->saved_regs[AVR_SREG_REGNUM].addr = 3; + info->saved_regs[0].addr = 2; + info->saved_regs[1].addr = 1; + info->size += 3; } } /* First stage of the prologue scanning. - Scan pushes */ + Scan pushes (saved registers) */ - for (; vpc <= prologue_len; vpc += 2) + for (; vpc < AVR_MAX_PROLOGUE_SIZE; vpc += 2) { insn = EXTRACT_INSN (&prologue[vpc]); if ((insn & 0xfe0f) == 0x920f) /* push rXX */ { /* Bits 4-9 contain a mask for registers R0-R32. */ - regno = (insn & 0x1f0) >> 4; - ++get_frame_extra_info (fi)->framesize; - get_frame_saved_regs (fi)[regno] = get_frame_extra_info (fi)->framesize; + int regno = (insn & 0x1f0) >> 4; + info->size++; + info->saved_regs[regno].addr = info->size; scan_stage = 1; } else break; } + if (vpc >= AVR_MAX_PROLOGUE_SIZE) + fprintf_unfiltered (gdb_stderr, + "Hit end of prologue while scanning pushes\n"); + /* Second stage of the prologue scanning. Scan: in r28,__SP_L__ in r29,__SP_H__ */ - if (scan_stage == 1 && vpc + 4 <= prologue_len) + if (scan_stage == 1 && vpc < AVR_MAX_PROLOGUE_SIZE) { unsigned char img[] = { 0xcd, 0xb7, /* in r28,__SP_L__ */ @@ -672,7 +696,6 @@ avr_scan_prologue (struct frame_info *fi) if (memcmp (prologue + vpc, img, sizeof (img)) == 0) { vpc += 4; - get_frame_extra_info (fi)->framereg = AVR_FP_REGNUM; scan_stage = 2; } } @@ -680,32 +703,32 @@ avr_scan_prologue (struct frame_info *fi) /* Third stage of the prologue scanning. (Really two stages) Scan for: sbiw r28,XX or subi r28,lo8(XX) - sbci r29,hi8(XX) + sbci r29,hi8(XX) in __tmp_reg__,__SREG__ cli - out __SP_L__,r28 + out __SP_H__,r29 out __SREG__,__tmp_reg__ - out __SP_H__,r29 */ + out __SP_L__,r28 */ - if (scan_stage == 2 && vpc + 12 <= prologue_len) + if (scan_stage == 2 && vpc < AVR_MAX_PROLOGUE_SIZE) { int locals_size = 0; unsigned char img[] = { 0x0f, 0xb6, /* in r0,0x3f */ 0xf8, 0x94, /* cli */ - 0xcd, 0xbf, /* out 0x3d,r28 ; SPL */ + 0xde, 0xbf, /* out 0x3e,r29 ; SPH */ 0x0f, 0xbe, /* out 0x3f,r0 ; SREG */ - 0xde, 0xbf /* out 0x3e,r29 ; SPH */ + 0xcd, 0xbf /* out 0x3d,r28 ; SPL */ }; unsigned char img_sig[] = { - 0xcd, 0xbf, /* out 0x3d,r28 ; SPL */ - 0xde, 0xbf /* out 0x3e,r29 ; SPH */ + 0xde, 0xbf, /* out 0x3e,r29 ; SPH */ + 0xcd, 0xbf /* out 0x3d,r28 ; SPL */ }; unsigned char img_int[] = { 0xf8, 0x94, /* cli */ - 0xcd, 0xbf, /* out 0x3d,r28 ; SPL */ + 0xde, 0xbf, /* out 0x3e,r29 ; SPH */ 0x78, 0x94, /* sei */ - 0xde, 0xbf /* out 0x3e,r29 ; SPH */ + 0xcd, 0xbf /* out 0x3d,r28 ; SPL */ }; insn = EXTRACT_INSN (&prologue[vpc]); @@ -720,297 +743,419 @@ avr_scan_prologue (struct frame_info *fi) locals_size += ((insn & 0xf) | ((insn & 0xf00) >> 4) << 8); } else - return; - get_frame_extra_info (fi)->locals_size = locals_size; - get_frame_extra_info (fi)->framesize += locals_size; + return pc + vpc; + + /* Scan the last part of the prologue. May not be present for interrupt + or signal handler functions, which is why we set the prologue type + when we saw the beginning of the prologue previously. */ + + if (memcmp (prologue + vpc, img_sig, sizeof (img_sig)) == 0) + { + vpc += sizeof (img_sig); + } + else if (memcmp (prologue + vpc, img_int, sizeof (img_int)) == 0) + { + vpc += sizeof (img_int); + } + if (memcmp (prologue + vpc, img, sizeof (img)) == 0) + { + info->prologue_type = AVR_PROLOGUE_NORMAL; + vpc += sizeof (img); + } + + info->size += locals_size; + + return pc + avr_scan_arg_moves (vpc, prologue); } -} -/* This function actually figures out the frame address for a given pc and - sp. This is tricky because we sometimes don't use an explicit - frame pointer, and the previous stack pointer isn't necessarily recorded - on the stack. The only reliable way to get this info is to - examine the prologue. */ + /* If we got this far, we could not scan the prologue, so just return the pc + of the frame plus an adjustment for argument move insns. */ -static void -avr_init_extra_frame_info (int fromleaf, struct frame_info *fi) -{ - int reg; + return pc + avr_scan_arg_moves (vpc, prologue);; +} - if (get_next_frame (fi)) - deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi))); +/* Returns the return address for a dummy. */ - frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); - frame_saved_regs_zalloc (fi); +static CORE_ADDR +avr_call_dummy_address (void) +{ + return entry_point_address (); +} - get_frame_extra_info (fi)->return_pc = 0; - get_frame_extra_info (fi)->args_pointer = 0; - get_frame_extra_info (fi)->locals_size = 0; - get_frame_extra_info (fi)->framereg = 0; - get_frame_extra_info (fi)->framesize = 0; - get_frame_extra_info (fi)->is_main = 0; +static CORE_ADDR +avr_skip_prologue (CORE_ADDR pc) +{ + CORE_ADDR func_addr, func_end; + CORE_ADDR prologue_end = pc; - avr_scan_prologue (fi); + /* See what the symbol table says */ - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi), - get_frame_base (fi))) - { - /* We need to setup fi->frame here because call_function_by_hand - gets it wrong by assuming it's always FP. */ - deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), - AVR_PC_REGNUM)); - } - else if (!get_next_frame (fi)) - /* this is the innermost frame? */ - deprecated_update_frame_base_hack (fi, read_register (get_frame_extra_info (fi)->framereg)); - else if (get_frame_extra_info (fi)->is_main != 1) - /* not the innermost frame, not `main' */ - /* If we have an next frame, the callee saved it. */ + if (find_pc_partial_function (pc, NULL, &func_addr, &func_end)) { - struct frame_info *next_fi = get_next_frame (fi); - if (get_frame_extra_info (fi)->framereg == AVR_SP_REGNUM) - deprecated_update_frame_base_hack (fi, (get_frame_base (next_fi) - + 2 /* ret addr */ - + get_frame_extra_info (next_fi)->framesize)); - /* FIXME: I don't analyse va_args functions */ - else - { - CORE_ADDR fp = 0; - CORE_ADDR fp1 = 0; - unsigned int fp_low, fp_high; + struct symtab_and_line sal; + struct avr_unwind_cache info = {0}; + struct trad_frame_saved_reg saved_regs[AVR_NUM_REGS]; - /* Scan all frames */ - for (; next_fi; next_fi = get_next_frame (next_fi)) - { - /* look for saved AVR_FP_REGNUM */ - if (get_frame_saved_regs (next_fi)[AVR_FP_REGNUM] && !fp) - fp = get_frame_saved_regs (next_fi)[AVR_FP_REGNUM]; - /* look for saved AVR_FP_REGNUM + 1 */ - if (get_frame_saved_regs (next_fi)[AVR_FP_REGNUM + 1] && !fp1) - fp1 = get_frame_saved_regs (next_fi)[AVR_FP_REGNUM + 1]; - } - fp_low = (fp ? read_memory_unsigned_integer (avr_make_saddr (fp), 1) - : read_register (AVR_FP_REGNUM)) & 0xff; - fp_high = - (fp1 ? read_memory_unsigned_integer (avr_make_saddr (fp1), 1) : - read_register (AVR_FP_REGNUM + 1)) & 0xff; - deprecated_update_frame_base_hack (fi, fp_low | (fp_high << 8)); - } - } + info.saved_regs = saved_regs; - /* TRoth: Do we want to do this if we are in main? I don't think we should - since return_pc makes no sense when we are in main. */ + /* Need to run the prologue scanner to figure out if the function has a + prologue and possibly skip over moving arguments passed via registers + to other registers. */ - if ((get_frame_pc (fi)) && (get_frame_extra_info (fi)->is_main == 0)) - /* We are not in CALL_DUMMY */ - { - CORE_ADDR addr; - int i; + prologue_end = avr_scan_prologue (pc, &info); - addr = get_frame_base (fi) + get_frame_extra_info (fi)->framesize + 1; + if (info.prologue_type != AVR_PROLOGUE_NONE) + { + sal = find_pc_line (func_addr, 0); - /* Return address in stack in different endianness */ + if (sal.line != 0 && sal.end < func_end) + return sal.end; + } + } - get_frame_extra_info (fi)->return_pc = - read_memory_unsigned_integer (avr_make_saddr (addr), 1) << 8; - get_frame_extra_info (fi)->return_pc |= - read_memory_unsigned_integer (avr_make_saddr (addr + 1), 1); +/* Either we didn't find the start of this function (nothing we can do), + or there's no line info, or the line after the prologue is after + the end of the function (there probably isn't a prologue). */ - /* This return address in words, - must be converted to the bytes address */ - get_frame_extra_info (fi)->return_pc *= 2; + return prologue_end; +} - /* Resolve a pushed registers addresses */ - for (i = 0; i < NUM_REGS; i++) - { - if (get_frame_saved_regs (fi)[i]) - get_frame_saved_regs (fi)[i] = addr - get_frame_saved_regs (fi)[i]; - } - } +/* Not all avr devices support the BREAK insn. Those that don't should treat + it as a NOP. Thus, it should be ok. Since the avr is currently a remote + only target, this shouldn't be a problem (I hope). TRoth/2003-05-14 */ + +static const unsigned char * +avr_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) +{ + static unsigned char avr_break_insn [] = { 0x98, 0x95 }; + *lenptr = sizeof (avr_break_insn); + return avr_break_insn; } -/* Restore the machine to the state it had before the current frame was - created. Usually used either by the "RETURN" command, or by - call_function_by_hand after the dummy_frame is finished. */ +/* Given a return value in `regbuf' with a type `valtype', + extract and copy its value into `valbuf'. + + Return values are always passed via registers r25:r24:... */ static void -avr_pop_frame (void) +avr_extract_return_value (struct type *type, struct regcache *regcache, + void *valbuf) { - unsigned regnum; - CORE_ADDR saddr; - struct frame_info *frame = get_current_frame (); - - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), - get_frame_base (frame), - get_frame_base (frame))) + ULONGEST r24, r25; + ULONGEST c; + int len; + if (TYPE_LENGTH (type) == 1) { - generic_pop_dummy_frame (); + regcache_cooked_read_unsigned (regcache, 24, &c); + store_unsigned_integer (valbuf, 1, c); } else { - /* TRoth: Why only loop over 8 registers? */ - - for (regnum = 0; regnum < 8; regnum++) - { - /* Don't forget AVR_SP_REGNUM in a frame_saved_regs struct is the - actual value we want, not the address of the value we want. */ - if (get_frame_saved_regs (frame)[regnum] && regnum != AVR_SP_REGNUM) - { - saddr = avr_make_saddr (get_frame_saved_regs (frame)[regnum]); - write_register (regnum, - read_memory_unsigned_integer (saddr, 1)); - } - else if (get_frame_saved_regs (frame)[regnum] && regnum == AVR_SP_REGNUM) - write_register (regnum, get_frame_base (frame) + 2); - } - - /* Don't forget the update the PC too! */ - write_pc (get_frame_extra_info (frame)->return_pc); + int i; + /* The MSB of the return value is always in r25, calculate which + register holds the LSB. */ + int lsb_reg = 25 - TYPE_LENGTH (type) + 1; + + for (i=0; i< TYPE_LENGTH (type); i++) + { + regcache_cooked_read (regcache, lsb_reg + i, + (bfd_byte *) valbuf + i); + } } - flush_cached_frames (); } -/* Return the saved PC from this frame. */ - -static CORE_ADDR -avr_frame_saved_pc (struct frame_info *frame) +static void +avr_saved_regs_unwinder (struct frame_info *next_frame, + struct trad_frame_saved_reg *this_saved_regs, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *bufferp) { - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), - get_frame_base (frame), - get_frame_base (frame))) - return deprecated_read_register_dummy (get_frame_pc (frame), - get_frame_base (frame), - AVR_PC_REGNUM); - else - return get_frame_extra_info (frame)->return_pc; -} + if (this_saved_regs[regnum].addr != 0) + { + *optimizedp = 0; + *lvalp = lval_memory; + *addrp = this_saved_regs[regnum].addr; + *realnump = -1; + if (bufferp != NULL) + { + /* Read the value in from memory. */ + + if (regnum == AVR_PC_REGNUM) + { + /* Reading the return PC from the PC register is slightly + abnormal. register_size(AVR_PC_REGNUM) says it is 4 bytes, + but in reality, only two bytes (3 in upcoming mega256) are + stored on the stack. + + Also, note that the value on the stack is an addr to a word + not a byte, so we will need to multiply it by two at some + point. + + And to confuse matters even more, the return address stored + on the stack is in big endian byte order, even though most + everything else about the avr is little endian. Ick! */ + + /* FIXME: number of bytes read here will need updated for the + mega256 when it is available. */ + + ULONGEST pc; + unsigned char tmp; + unsigned char buf[2]; + + read_memory (this_saved_regs[regnum].addr, buf, 2); + + /* Convert the PC read from memory as a big-endian to + little-endian order. */ + tmp = buf[0]; + buf[0] = buf[1]; + buf[1] = tmp; + + pc = (extract_unsigned_integer (buf, 2) * 2); + store_unsigned_integer (bufferp, + register_size (current_gdbarch, regnum), + pc); + } + else + { + read_memory (this_saved_regs[regnum].addr, bufferp, + register_size (current_gdbarch, regnum)); + } + } -static CORE_ADDR -avr_saved_pc_after_call (struct frame_info *frame) -{ - unsigned char m1, m2; - unsigned int sp = read_register (AVR_SP_REGNUM); - m1 = read_memory_unsigned_integer (avr_make_saddr (sp + 1), 1); - m2 = read_memory_unsigned_integer (avr_make_saddr (sp + 2), 1); - return (m2 | (m1 << 8)) * 2; + return; + } + + /* No luck, assume this and the next frame have the same register + value. If a value is needed, pass the request on down the chain; + otherwise just return an indication that the value is in the same + register as the next frame. */ + frame_register_unwind (next_frame, regnum, optimizedp, lvalp, addrp, + realnump, bufferp); } -/* Returns the return address for a dummy. */ +/* Put here the code to store, into fi->saved_regs, the addresses of + the saved registers of frame described by FRAME_INFO. This + includes special registers such as pc and fp saved in special ways + in the stack frame. sp is even more special: the address we return + for it IS the sp for the next frame. */ -static CORE_ADDR -avr_call_dummy_address (void) +struct avr_unwind_cache * +avr_frame_unwind_cache (struct frame_info *next_frame, + void **this_prologue_cache) { - return entry_point_address (); -} + CORE_ADDR pc; + ULONGEST prev_sp; + ULONGEST this_base; + struct avr_unwind_cache *info; + int i; -/* 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. */ + if ((*this_prologue_cache)) + return (*this_prologue_cache); -static CORE_ADDR -avr_push_return_address (CORE_ADDR pc, CORE_ADDR sp) -{ - unsigned char buf[2]; - int wordsize = 2; -#if 0 - struct minimal_symbol *msymbol; - CORE_ADDR mon_brk; -#endif + info = FRAME_OBSTACK_ZALLOC (struct avr_unwind_cache); + (*this_prologue_cache) = info; + info->saved_regs = trad_frame_alloc_saved_regs (next_frame); - buf[0] = 0; - buf[1] = 0; - sp -= wordsize; - write_memory (sp + 1, buf, 2); + info->size = 0; + info->prologue_type = AVR_PROLOGUE_NONE; -#if 0 - /* FIXME: TRoth/2002-02-18: This should probably be removed since it's a - left-over from Denis' original patch which used avr-mon for the target - instead of the generic remote target. */ - if ((strcmp (target_shortname, "avr-mon") == 0) - && (msymbol = lookup_minimal_symbol ("gdb_break", NULL, NULL))) + pc = frame_func_unwind (next_frame); + + if ((pc > 0) && (pc < frame_pc_unwind (next_frame))) + avr_scan_prologue (pc, info); + + if (info->prologue_type != AVR_PROLOGUE_NONE) + { + ULONGEST high_base; /* High byte of FP */ + + /* The SP was moved to the FP. This indicates that a new frame + was created. Get THIS frame's FP value by unwinding it from + the next frame. */ + frame_unwind_unsigned_register (next_frame, AVR_FP_REGNUM, &this_base); + frame_unwind_unsigned_register (next_frame, AVR_FP_REGNUM+1, &high_base); + this_base += (high_base << 8); + + /* The FP points at the last saved register. Adjust the FP back + to before the first saved register giving the SP. */ + prev_sp = this_base + info->size; + } + else { - mon_brk = SYMBOL_VALUE_ADDRESS (msymbol); - store_unsigned_integer (buf, wordsize, mon_brk / 2); - sp -= wordsize; - write_memory (sp + 1, buf + 1, 1); - write_memory (sp + 2, buf, 1); + /* Assume that the FP is this frame's SP but with that pushed + stack space added back. */ + frame_unwind_unsigned_register (next_frame, AVR_SP_REGNUM, &this_base); + prev_sp = this_base + info->size; } -#endif - return sp; + + /* Add 1 here to adjust for the post-decrement nature of the push + instruction.*/ + info->prev_sp = avr_make_saddr (prev_sp+1); + + info->base = avr_make_saddr (this_base); + + /* Adjust all the saved registers so that they contain addresses and not + offsets. We need to add one to the addresses since push ops are post + decrement on the avr. */ + for (i = 0; i < NUM_REGS - 1; i++) + if (info->saved_regs[i].addr) + { + info->saved_regs[i].addr = (info->prev_sp - info->saved_regs[i].addr); + } + + /* Except for the main and startup code, the return PC is always saved on + the stack and is at the base of the frame. */ + + if (info->prologue_type != AVR_PROLOGUE_MAIN) + { + info->saved_regs[AVR_PC_REGNUM].addr = info->prev_sp; + } + + return info; } static CORE_ADDR -avr_skip_prologue (CORE_ADDR pc) +avr_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) { - CORE_ADDR func_addr, func_end; - struct symtab_and_line sal; + ULONGEST pc; - /* See what the symbol table says */ + frame_unwind_unsigned_register (next_frame, AVR_PC_REGNUM, &pc); - if (find_pc_partial_function (pc, NULL, &func_addr, &func_end)) - { - sal = find_pc_line (func_addr, 0); + return avr_make_iaddr (pc); +} - /* troth/2002-08-05: For some very simple functions, gcc doesn't - generate a prologue and the sal.end ends up being the 2-byte ``ret'' - instruction at the end of the function, but func_end ends up being - the address of the first instruction of the _next_ function. By - adjusting func_end by 2 bytes, we can catch these functions and not - return sal.end if it is the ``ret'' instruction. */ +/* Given a GDB frame, determine the address of the calling function's + frame. This will be used to create a new GDB frame struct. */ - if (sal.line != 0 && sal.end < (func_end-2)) - return sal.end; - } +static void +avr_frame_this_id (struct frame_info *next_frame, + void **this_prologue_cache, + struct frame_id *this_id) +{ + struct avr_unwind_cache *info + = avr_frame_unwind_cache (next_frame, this_prologue_cache); + CORE_ADDR base; + CORE_ADDR func; + struct frame_id id; + + /* The FUNC is easy. */ + func = frame_func_unwind (next_frame); + + /* This is meant to halt the backtrace at "_start". Make sure we + don't halt it at a generic dummy frame. */ + if (inside_entry_file (func)) + return; + + /* Hopefully the prologue analysis either correctly determined the + frame's base (which is the SP from the previous frame), or set + that base to "NULL". */ + base = info->prev_sp; + if (base == 0) + return; + + id = frame_id_build (base, func); + + /* Check that we're not going round in circles with the same frame + ID (but avoid applying the test to sentinel frames which do go + round in circles). Can't use frame_id_eq() as that doesn't yet + compare the frame's PC value. */ + if (frame_relative_level (next_frame) >= 0 + && get_frame_type (next_frame) != DUMMY_FRAME + && frame_id_eq (get_frame_id (next_frame), id)) + return; + + (*this_id) = id; +} -/* Either we didn't find the start of this function (nothing we can do), - or there's no line info, or the line after the prologue is after - the end of the function (there probably isn't a prologue). */ +static void +avr_frame_prev_register (struct frame_info *next_frame, + void **this_prologue_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *bufferp) +{ + struct avr_unwind_cache *info + = avr_frame_unwind_cache (next_frame, this_prologue_cache); + + avr_saved_regs_unwinder (next_frame, info->saved_regs, regnum, optimizedp, + lvalp, addrp, realnump, bufferp); +} - return pc; +static const struct frame_unwind avr_frame_unwind = { + NORMAL_FRAME, + avr_frame_this_id, + avr_frame_prev_register +}; + +const struct frame_unwind * +avr_frame_p (CORE_ADDR pc) +{ + return &avr_frame_unwind; } static CORE_ADDR -avr_frame_address (struct frame_info *fi) +avr_frame_base_address (struct frame_info *next_frame, void **this_cache) { - return avr_make_saddr (get_frame_base (fi)); + struct avr_unwind_cache *info + = avr_frame_unwind_cache (next_frame, this_cache); + + return info->base; } -/* 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 DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC - will be called for the new frame. +static const struct frame_base avr_frame_base = { + &avr_frame_unwind, + avr_frame_base_address, + avr_frame_base_address, + avr_frame_base_address +}; - 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. */ +/* Assuming NEXT_FRAME->prev is a dummy, return the frame ID of that + dummy frame. The frame ID's base needs to match the TOS value + saved by save_dummy_frame_tos(), and the PC match the dummy frame's + breakpoint. */ -static CORE_ADDR -avr_frame_chain (struct frame_info *frame) +static struct frame_id +avr_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) { - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), - get_frame_base (frame), - get_frame_base (frame))) - { - /* initialize the return_pc now */ - get_frame_extra_info (frame)->return_pc - = deprecated_read_register_dummy (get_frame_pc (frame), - get_frame_base (frame), - AVR_PC_REGNUM); - return get_frame_base (frame); - } - return (get_frame_extra_info (frame)->is_main ? 0 - : get_frame_base (frame) + get_frame_extra_info (frame)->framesize + 2 /* ret addr */ ); + ULONGEST base; + + frame_unwind_unsigned_register (next_frame, AVR_SP_REGNUM, &base); + return frame_id_build (avr_make_saddr (base), frame_pc_unwind (next_frame)); } -/* Store the address of the place in which to copy the structure the - subroutine will return. This is called from call_function. +/* When arguments must be pushed onto the stack, they go on in reverse + order. The below implements a FILO (stack) to do this. */ - We store structs through a pointer passed in the first Argument - register. */ +struct stack_item +{ + int len; + struct stack_item *prev; + void *data; +}; -static void -avr_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) +static struct stack_item *push_stack_item (struct stack_item *prev, + void *contents, int len); +static struct stack_item * +push_stack_item (struct stack_item *prev, void *contents, int len) { - write_register (0, addr); + struct stack_item *si; + si = xmalloc (sizeof (struct stack_item)); + si->data = xmalloc (len); + si->len = len; + si->prev = prev; + memcpy (si->data, contents, len); + return si; +} + +static struct stack_item *pop_stack_item (struct stack_item *si); +static struct stack_item * +pop_stack_item (struct stack_item *si) +{ + struct stack_item *dead = si; + si = si->prev; + xfree (dead->data); + xfree (dead); + return si; } /* Setup the function arguments for calling a function in the inferior. @@ -1019,9 +1164,20 @@ avr_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) dedicated for passing function arguments. Up to the first 18 arguments (depending on size) may go into these registers. The rest go on the stack. - Arguments that are larger than WORDSIZE bytes will be split between two or - more registers as available, but will NOT be split between a register and - the stack. + All arguments are aligned to start in even-numbered registers (odd-sized + arguments, including char, have one free register above them). For example, + an int in arg1 and a char in arg2 would be passed as such: + + arg1 -> r25:r24 + arg2 -> r22 + + Arguments that are larger than 2 bytes will be split between two or more + registers as available, but will NOT be split between a register and the + stack. Arguments that go onto the stack are pushed last arg first (this is + similar to the d10v). */ + +/* NOTE: TRoth/2003-06-17: The rest of this comment is old looks to be + inaccurate. An exceptional case exists for struct arguments (and possibly other aggregates such as arrays) -- if the size is larger than WORDSIZE bytes but @@ -1042,65 +1198,87 @@ avr_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) registers R0 to R2. */ static CORE_ADDR -avr_push_arguments (int nargs, struct value **args, CORE_ADDR sp, - int struct_return, CORE_ADDR struct_addr) +avr_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, + struct regcache *regcache, CORE_ADDR bp_addr, + int nargs, struct value **args, CORE_ADDR sp, + int struct_return, CORE_ADDR struct_addr) { - int stack_alloc, stack_offset; - int wordsize; - int argreg; - int argnum; - struct type *type; - CORE_ADDR regval; - char *val; - char valbuf[4]; - int len; + int i; + unsigned char buf[2]; + CORE_ADDR return_pc = avr_convert_iaddr_to_raw (bp_addr); + int regnum = AVR_ARGN_REGNUM; + struct stack_item *si = NULL; - wordsize = 1; #if 0 - /* Now make sure there's space on the stack */ - for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++) - stack_alloc += TYPE_LENGTH (VALUE_TYPE (args[argnum])); - sp -= stack_alloc; /* make room on stack for args */ - /* we may over-allocate a little here, but that won't hurt anything */ -#endif - argreg = 25; - if (struct_return) /* "struct return" pointer takes up one argreg */ + /* FIXME: TRoth/2003-06-18: Not sure what to do when returning a struct. */ + if (struct_return) { - write_register (--argreg, struct_addr); + fprintf_unfiltered (gdb_stderr, "struct_return: 0x%lx\n", struct_addr); + write_register (argreg--, struct_addr & 0xff); + write_register (argreg--, (struct_addr >>8) & 0xff); } +#endif - /* Now load as many as possible of the first arguments into registers, and - push the rest onto the stack. There are 3N bytes in three registers - available. Loop thru args from first to last. */ + for (i = 0; i < nargs; i++) + { + int last_regnum; + int j; + struct value *arg = args[i]; + struct type *type = check_typedef (VALUE_TYPE (arg)); + char *contents = VALUE_CONTENTS (arg); + int len = TYPE_LENGTH (type); + + /* Calculate the potential last register needed. */ + last_regnum = regnum - (len + (len & 1)); + + /* If there are registers available, use them. Once we start putting + stuff on the stack, all subsequent args go on stack. */ + if ((si == NULL) && (last_regnum >= 8)) + { + ULONGEST val; + + /* Skip a register for odd length args. */ + if (len & 1) + regnum--; + + val = extract_unsigned_integer (contents, len); + for (j=0; j> (8*(len-j-1))); + } + } + /* No registers available, push the args onto the stack. */ + else + { + /* From here on, we don't care about regnum. */ + si = push_stack_item (si, contents, len); + } + } - for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++) + /* Push args onto the stack. */ + while (si) { - type = VALUE_TYPE (args[argnum]); - len = TYPE_LENGTH (type); - val = (char *) VALUE_CONTENTS (args[argnum]); - - /* NOTE WELL!!!!! This is not an "else if" clause!!! That's because - some *&^%$ things get passed on the stack AND in the registers! */ - while (len > 0) - { /* there's room in registers */ - len -= wordsize; - regval = extract_address (val + len, wordsize); - write_register (argreg--, regval); - } + sp -= si->len; + /* Add 1 to sp here to account for post decr nature of pushes. */ + write_memory (sp+1, si->data, si->len); + si = pop_stack_item (si); } - return sp; -} -/* Not all avr devices support the BREAK insn. Those that don't should treat - it as a NOP. Thus, it should be ok. Since the avr is currently a remote - only target, this shouldn't be a problem (I hope). TRoth/2003-05-14 */ + /* Set the return address. For the avr, the return address is the BP_ADDR. + Need to push the return address onto the stack noting that it needs to be + in big-endian order on the stack. */ + buf[0] = (return_pc >> 8) & 0xff; + buf[1] = return_pc & 0xff; -const unsigned char * -avr_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) -{ - static unsigned char avr_break_insn [] = { 0x98, 0x95 }; - *lenptr = sizeof (avr_break_insn); - return avr_break_insn; + sp -= 2; + write_memory (sp+1, buf, 2); /* Add one since pushes are post decr ops. */ + + /* Finally, update the SP register. */ + regcache_cooked_write_unsigned (regcache, AVR_SP_REGNUM, + avr_convert_saddr_to_raw (sp)); + + return sp; } /* Initialize the gdbarch structure for the AVR's. */ @@ -1108,12 +1286,6 @@ avr_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) static struct gdbarch * avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { - /* FIXME: TRoth/2002-02-18: I have no idea if avr_call_dummy_words[] should - be bigger or not. Initial testing seems to show that `call my_func()` - works and backtrace from a breakpoint within the call looks correct. - Admittedly, I haven't tested with more than a very simple program. */ - static LONGEST avr_call_dummy_words[] = { 0 }; - struct gdbarch *gdbarch; struct gdbarch_tdep *tdep; @@ -1126,10 +1298,6 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = XMALLOC (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); - /* NOTE: cagney/2002-12-06: This can be deleted when this arch is - ready to unwind the PC first (see frame.c:get_prev_frame()). */ - set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); - /* If we ever need to differentiate the device types, do it here. */ switch (info.bfd_arch_info->mach) { @@ -1147,7 +1315,6 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT); set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT); set_gdbarch_addr_bit (gdbarch, 32); - set_gdbarch_bfd_vma_bit (gdbarch, 32); /* FIXME: TRoth/2002-02-18: Is this needed? */ set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_double_bit (gdbarch, 4 * TARGET_CHAR_BIT); @@ -1159,44 +1326,27 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_read_pc (gdbarch, avr_read_pc); set_gdbarch_write_pc (gdbarch, avr_write_pc); - set_gdbarch_deprecated_target_read_fp (gdbarch, avr_read_fp); set_gdbarch_read_sp (gdbarch, avr_read_sp); - set_gdbarch_deprecated_dummy_write_sp (gdbarch, avr_write_sp); set_gdbarch_num_regs (gdbarch, AVR_NUM_REGS); set_gdbarch_sp_regnum (gdbarch, AVR_SP_REGNUM); - set_gdbarch_deprecated_fp_regnum (gdbarch, AVR_FP_REGNUM); set_gdbarch_pc_regnum (gdbarch, AVR_PC_REGNUM); set_gdbarch_register_name (gdbarch, avr_register_name); - set_gdbarch_deprecated_register_size (gdbarch, 1); - set_gdbarch_deprecated_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_deprecated_max_register_raw_size (gdbarch, 4); - set_gdbarch_register_virtual_size (gdbarch, avr_register_virtual_size); - set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4); - set_gdbarch_register_virtual_type (gdbarch, avr_register_virtual_type); + set_gdbarch_register_type (gdbarch, avr_register_type); + set_gdbarch_extract_return_value (gdbarch, avr_extract_return_value); set_gdbarch_print_insn (gdbarch, print_insn_avr); set_gdbarch_call_dummy_address (gdbarch, avr_call_dummy_address); - set_gdbarch_deprecated_call_dummy_words (gdbarch, avr_call_dummy_words); - -/* set_gdbarch_believe_pcc_promotion (gdbarch, 1); // TRoth: should this be set? */ + set_gdbarch_push_dummy_call (gdbarch, avr_push_dummy_call); set_gdbarch_address_to_pointer (gdbarch, avr_address_to_pointer); set_gdbarch_pointer_to_address (gdbarch, avr_pointer_to_address); - set_gdbarch_deprecated_push_arguments (gdbarch, avr_push_arguments); - set_gdbarch_deprecated_push_return_address (gdbarch, avr_push_return_address); - set_gdbarch_deprecated_pop_frame (gdbarch, avr_pop_frame); set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention); - set_gdbarch_deprecated_store_struct_return (gdbarch, avr_store_struct_return); - 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_inner_than (gdbarch, core_addr_lessthan); @@ -1204,19 +1354,17 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_from_pc (gdbarch, avr_breakpoint_from_pc); set_gdbarch_function_start_offset (gdbarch, 0); - set_gdbarch_remote_translate_xfer_address (gdbarch, - avr_remote_translate_xfer_address); + set_gdbarch_frame_args_skip (gdbarch, 0); - set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue); /* ??? */ - set_gdbarch_deprecated_frame_chain (gdbarch, avr_frame_chain); - set_gdbarch_deprecated_frame_saved_pc (gdbarch, avr_frame_saved_pc); - set_gdbarch_frame_args_address (gdbarch, avr_frame_address); - set_gdbarch_frame_locals_address (gdbarch, avr_frame_address); - set_gdbarch_deprecated_saved_pc_after_call (gdbarch, avr_saved_pc_after_call); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); + set_gdbarch_frameless_function_invocation (gdbarch, + frameless_look_for_prologue); + + frame_unwind_append_predicate (gdbarch, avr_frame_p); + frame_base_set_default (gdbarch, &avr_frame_base); - set_gdbarch_convert_from_func_ptr_addr (gdbarch, - avr_convert_from_func_ptr_addr); + set_gdbarch_unwind_dummy_id (gdbarch, avr_unwind_dummy_id); + + set_gdbarch_unwind_pc (gdbarch, avr_unwind_pc); return gdbarch; } @@ -1245,13 +1393,11 @@ avr_io_reg_read_command (char *args, int from_tty) unsigned int val; int i, j, k, step; -/* fprintf_unfiltered (gdb_stderr, "DEBUG: avr_io_reg_read_command (\"%s\", %d)\n", */ -/* args, from_tty); */ - if (!current_target.to_query) { fprintf_unfiltered (gdb_stderr, - "ERR: info io_registers NOT supported by current target\n"); + "ERR: info io_registers NOT supported by current " + "target\n"); return; } @@ -1311,6 +1457,8 @@ avr_io_reg_read_command (char *args, int from_tty) } } +extern initialize_file_ftype _initialize_avr_tdep; /* -Wmissing-prototypes */ + void _initialize_avr_tdep (void) { diff --git a/gdb/block.c b/gdb/block.c index c2bae05dbeb..8729a24b576 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -71,17 +71,18 @@ block_function (const struct block *bl) 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, +blockvector_for_pc_sect (CORE_ADDR pc, struct sec *section, int *pindex, struct symtab *symtab) { - register struct block *b; - register int bot, top, half; + struct block *b; + 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) + symtab = find_pc_sect_symtab (pc, section); + if (symtab == 0) return 0; } @@ -125,7 +126,7 @@ blockvector_for_pc_sect (register CORE_ADDR pc, struct sec *section, Backward compatibility, no section. */ struct blockvector * -blockvector_for_pc (register CORE_ADDR pc, int *pindex) +blockvector_for_pc (CORE_ADDR pc, int *pindex) { return blockvector_for_pc_sect (pc, find_pc_mapped_section (pc), pindex, NULL); @@ -135,9 +136,9 @@ blockvector_for_pc (register CORE_ADDR pc, int *pindex) in the specified section, or 0 if there is none. */ struct block * -block_for_pc_sect (register CORE_ADDR pc, struct sec *section) +block_for_pc_sect (CORE_ADDR pc, struct sec *section) { - register struct blockvector *bl; + struct blockvector *bl; int index; bl = blockvector_for_pc_sect (pc, section, &index, NULL); @@ -150,7 +151,7 @@ block_for_pc_sect (register CORE_ADDR pc, struct sec *section) or 0 if there is none. Backward compatibility, no section. */ struct block * -block_for_pc (register CORE_ADDR pc) +block_for_pc (CORE_ADDR pc) { return block_for_pc_sect (pc, find_pc_mapped_section (pc)); } diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 9788409563b..37debe0a952 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -144,7 +144,7 @@ inside_entry_func (CORE_ADDR pc) int frameless_look_for_prologue (struct frame_info *frame) { - CORE_ADDR func_start, after_prologue; + CORE_ADDR func_start; func_start = get_frame_func (frame); if (func_start) @@ -223,28 +223,31 @@ get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block) CORE_ADDR get_pc_function_start (CORE_ADDR pc) { - register struct block *bl; - register struct symbol *symbol; - register struct minimal_symbol *msymbol; - CORE_ADDR fstart; + struct block *bl; + struct minimal_symbol *msymbol; - if ((bl = block_for_pc (pc)) != NULL && - (symbol = block_function (bl)) != NULL) - { - bl = SYMBOL_BLOCK_VALUE (symbol); - fstart = BLOCK_START (bl); - } - else if ((msymbol = lookup_minimal_symbol_by_pc (pc)) != NULL) + bl = block_for_pc (pc); + if (bl) { - fstart = SYMBOL_VALUE_ADDRESS (msymbol); - if (!find_pc_section (fstart)) - return 0; + struct symbol *symbol = block_function (bl); + + if (symbol) + { + bl = SYMBOL_BLOCK_VALUE (symbol); + return BLOCK_START (bl); + } } - else + + msymbol = lookup_minimal_symbol_by_pc (pc); + if (msymbol) { - fstart = 0; + CORE_ADDR fstart = SYMBOL_VALUE_ADDRESS (msymbol); + + if (find_pc_section (fstart)) + return fstart; } - return (fstart); + + return 0; } /* Return the symbol for the function executing in frame FRAME. */ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 3d7935fbcba..79f0071700a 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -704,6 +704,35 @@ read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len) } +/* A wrapper function for inserting catchpoints. */ +int +insert_catchpoint (struct ui_out *uo, void *args) +{ + struct breakpoint *b = (struct breakpoint *) args; + int val = -1; + + switch (b->type) + { + case bp_catch_fork: + val = target_insert_fork_catchpoint (PIDGET (inferior_ptid)); + break; + case bp_catch_vfork: + val = target_insert_vfork_catchpoint (PIDGET (inferior_ptid)); + break; + case bp_catch_exec: + val = target_insert_exec_catchpoint (PIDGET (inferior_ptid)); + break; + default: + internal_error (__FILE__, __LINE__, "unknown breakpoint type"); + break; + } + + if (val < 0) + throw_exception (RETURN_ERROR); + + return 0; +} + /* insert_breakpoints is used when starting or continuing the program. remove_breakpoints is used when the program stops. Both return zero if successful, @@ -1055,32 +1084,15 @@ insert_breakpoints (void) && !b->inserted && !b->duplicate) { - val = -1; - switch (b->type) - { - case bp_catch_fork: - val = target_insert_fork_catchpoint (PIDGET (inferior_ptid)); - break; - case bp_catch_vfork: - val = target_insert_vfork_catchpoint (PIDGET (inferior_ptid)); - break; - case bp_catch_exec: - val = target_insert_exec_catchpoint (PIDGET (inferior_ptid)); - break; - default: - warning ("Internal error, %s line %d.", __FILE__, __LINE__); - break; - } + char prefix[64]; + + sprintf (prefix, "warning: inserting catchpoint %d: ", b->number); + val = catch_exceptions (uiout, insert_catchpoint, b, prefix, + RETURN_MASK_ERROR); if (val < 0) - { - fprintf_unfiltered (tmp_error_stream, - "Cannot insert catchpoint %d.", b->number); - } + b->enable_state = bp_disabled; else b->inserted = 1; - - if (val) - return_val = val; /* remember failure */ } } @@ -4608,7 +4620,7 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string, addresses found. ADDR_STRING contains a vector of (canonical) address strings. ARG points to the end of the SAL. */ -void +static void parse_breakpoint_sals (char **address, struct symtabs_and_lines *sals, char ***addr_string) @@ -4675,7 +4687,7 @@ parse_breakpoint_sals (char **address, /* Convert each SAL into a real PC. Verify that the PC can be inserted as a breakpoint. If it can't throw an error. */ -void +static void breakpoint_sals_to_pc (struct symtabs_and_lines *sals, char *address) { @@ -6083,7 +6095,7 @@ handle_gnu_v3_exceptions (int tempflag, char *cond_string, sals = decode_line_1 (&nameptr, 1, NULL, 0, NULL); if (sals.nelts == 0) { - free (trigger_func_name); + xfree (trigger_func_name); return 0; } @@ -6099,7 +6111,7 @@ handle_gnu_v3_exceptions (int tempflag, char *cond_string, b->disposition = tempflag ? disp_del : disp_donttouch; b->ops = &gnu_v3_exception_catchpoint_ops; - free (sals.sals); + xfree (sals.sals); mention (b); return 1; } diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 71980ab5d09..63f60546056 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -309,12 +309,12 @@ finish_block (struct symbol *symbol, struct pending **listhead, TYPE_FIELDS (ftype) = (struct field *) TYPE_ALLOC (ftype, nparams * sizeof (struct field)); - for (sym = dict_iterator_first (BLOCK_DICT (block), &iter), - iparams = 0; - iparams < nparams; - sym = dict_iterator_next (&iter)) + iparams = 0; + ALL_BLOCK_SYMBOLS (block, iter, sym) { - gdb_assert (sym != NULL); + if (iparams == nparams) + break; + switch (SYMBOL_CLASS (sym)) { case LOC_ARG: @@ -439,6 +439,7 @@ finish_block (struct symbol *symbol, struct pending **listhead, record_pending_block (objfile, block, opblock); } + /* Record BLOCK on the list of all blocks in the file. Put it after OPBLOCK, or at the beginning if opblock is NULL. This puts the block in the list after all its subblocks. diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 3b4ac2ab3e0..d8b9a264293 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -213,6 +213,8 @@ c_val_print (struct type *type, char *valaddr, int embedded_offset, struct value *vt_val; struct symbol *wsym = (struct symbol *) NULL; struct type *wtype; + struct block *block = (struct block *) NULL; + int is_this_fld; if (msymbol != NULL) wsym = lookup_symbol_minsym (msymbol); @@ -589,7 +591,8 @@ c_value_print (struct value *val, struct ui_file *stream, int format, /* Otherwise, we end up at the return outside this "if" */ } - return val_print (type, VALUE_CONTENTS_ALL (val), VALUE_EMBEDDED_OFFSET (val), - VALUE_ADDRESS (val), + return val_print (type, VALUE_CONTENTS_ALL (val), + VALUE_EMBEDDED_OFFSET (val), + VALUE_ADDRESS (val) + VALUE_OFFSET (val), stream, format, 1, 0, pretty); } diff --git a/gdb/charset.c b/gdb/charset.c index 0062e281e99..c311447ea44 100644 --- a/gdb/charset.c +++ b/gdb/charset.c @@ -1163,6 +1163,7 @@ target_char_to_host (int target_char, int *host_char) /* The charset.c module initialization function. */ +extern initialize_file_ftype _initialize_charset; /* -Wmissing-prototype */ void _initialize_charset (void) diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 108329a50c7..45794f7599f 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -26,6 +26,7 @@ #include "gdb_wait.h" /* For shell escape implementation */ #include "gdb_regex.h" /* Used by apropos_command */ #include "gdb_string.h" +#include "gdb_vfork.h" #include "linespec.h" #include "expression.h" #include "frame.h" @@ -48,18 +49,6 @@ #define GDBINIT_FILENAME ".gdbinit" #endif -/* From gdb/top.c */ - -extern void dont_repeat (void); - -extern void set_verbose (char *, int, struct cmd_list_element *); - -extern void show_history (char *, int); - -extern void set_history (char *, int); - -extern void show_commands (char *, int); - /* Prototypes for local command functions */ static void complete_command (char *, int); @@ -510,19 +499,20 @@ shell_escape (char *arg, int from_tty) #endif #else /* Can fork. */ int rc, status, pid; - char *p, *user_shell; - if ((user_shell = (char *) getenv ("SHELL")) == NULL) - user_shell = "/bin/sh"; + if ((pid = vfork ()) == 0) + { + char *p, *user_shell; - /* Get the name of the shell for arg0 */ - if ((p = strrchr (user_shell, '/')) == NULL) - p = user_shell; - else - p++; /* Get past '/' */ + if ((user_shell = (char *) getenv ("SHELL")) == NULL) + user_shell = "/bin/sh"; + + /* Get the name of the shell for arg0 */ + if ((p = strrchr (user_shell, '/')) == NULL) + p = user_shell; + else + p++; /* Get past '/' */ - if ((pid = fork ()) == 0) - { if (!arg) execl (user_shell, p, 0); else diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 2a6d196930e..be516c9a6f3 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -183,20 +183,6 @@ add_cmd (char *name, enum command_class class, void (*fun) (char *, int), return c; } -/* Same as above, except that the abbrev_flag is set. */ -/* Note: Doesn't seem to be used anywhere currently. */ - -struct cmd_list_element * -add_abbrev_cmd (char *name, enum command_class class, void (*fun) (char *, int), - char *doc, struct cmd_list_element **list) -{ - register struct cmd_list_element *c - = add_cmd (name, class, fun, doc, list); - - c->abbrev_flag = 1; - return c; -} - /* Deprecates a command CMD. REPLACEMENT is the name of the command which should be used in place of this command, or NULL if no such command exists. diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c index 6bd40e033b1..7b88975c6d4 100644 --- a/gdb/cli/cli-dump.c +++ b/gdb/cli/cli-dump.c @@ -698,6 +698,8 @@ binary_append_command (char *cmd, int from_tty) help_list (binary_append_cmdlist, "append binary ", -1, gdb_stdout); } +extern initialize_file_ftype _initialize_cli_dump; /* -Wmissing-prototypes */ + void _initialize_cli_dump (void) { diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index e2116e70c58..45679f07b98 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -118,6 +118,8 @@ safe_execute_command (struct ui_out *uiout, char *command, int from_tty) /* standard gdb initialization hook */ +extern initialize_file_ftype _initialize_cli_interp; /* -Wmissing-prototypes */ + void _initialize_cli_interp (void) { diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index d68c365959d..0f789bb1627 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -34,12 +34,6 @@ #include "cli/cli-decode.h" #include "cli/cli-script.h" -/* From gdb/top.c */ - -extern void dont_repeat (void); - -extern void do_restore_instream_cleanup (void *stream); - /* Prototypes for local functions */ static struct cleanup * @@ -216,7 +210,7 @@ print_command_lines (struct ui_out *uiout, struct command_line *cmd, /* Handle pre-post hooks. */ -void +static void clear_hook_in_cleanup (void *data) { struct cmd_list_element *c = data; @@ -248,7 +242,7 @@ execute_cmd_post_hook (struct cmd_list_element *c) } /* Execute the command in CMD. */ -void +static void do_restore_user_call_depth (void * call_depth) { int * depth = call_depth; diff --git a/gdb/coffread.c b/gdb/coffread.c index 2b827c70841..00b6b7f14f5 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -45,6 +45,7 @@ #include "target.h" #include "gdb_assert.h" #include "block.h" +#include "dictionary.h" #include "coff-pe-read.h" #include "dictionary.h" @@ -869,7 +870,6 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, print_address_symbolic work right without the (now gone) "set fast-symbolic-addr off" kludge. */ - /* FIXME: should use mst_abs, and not relocate, if absolute. */ enum minimal_symbol_type ms_type; int sec; @@ -891,12 +891,23 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, || cs->c_sclass == C_THUMBEXT ? mst_bss : mst_file_bss; } + else if (cs->c_secnum == N_ABS) + { + /* Use the correct minimal symbol type (and don't + relocate) for absolute values. */ + ms_type = mst_abs; + sec = cs_to_section (cs, objfile); + tmpaddr = cs->c_value; + } else { sec = cs_to_section (cs, objfile); tmpaddr = cs->c_value; - if (cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC - || cs->c_sclass == C_THUMBEXT) + /* Statics in a PE file also get relocated */ + if (cs->c_sclass == C_EXT + || cs->c_sclass == C_THUMBEXTFUNC + || cs->c_sclass == C_THUMBEXT + || (pe_file && (cs->c_sclass == C_STAT))) tmpaddr += ANOFFSET (objfile->section_offsets, sec); if (sec == SECT_OFF_TEXT (objfile)) diff --git a/gdb/config.in b/gdb/config.in index 450051976a4..787afb26ce4 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -257,6 +257,9 @@ /* Define if you have the strchr function. */ #undef HAVE_STRCHR +/* Define if you have the syscall function. */ +#undef HAVE_SYSCALL + /* Define if you have the header file. */ #undef HAVE_ARGZ_H @@ -438,6 +441,9 @@ Solaris 2.[78] when using GCC. */ #undef _MSE_INT_H +/* Define to 1 if we found this declaration otherwise define to 0. */ +#undef HAVE_DECL_GETOPT + /* Define if sigsetjmp is available. */ #undef HAVE_SIGSETJMP @@ -513,6 +519,9 @@ /* Define if has the TD_NOTALLOC error code. */ #undef THREAD_DB_HAS_TD_NOTALLOC +/* Define if we can use the tkill syscall. */ +#undef HAVE_TKILL_SYSCALL + /* Define to the default OS ABI for this configuration. */ #undef GDB_OSABI_DEFAULT diff --git a/gdb/config/alpha/alpha-linux.mh b/gdb/config/alpha/alpha-linux.mh index 7691d0729eb..d3731795020 100644 --- a/gdb/config/alpha/alpha-linux.mh +++ b/gdb/config/alpha/alpha-linux.mh @@ -2,7 +2,8 @@ XM_FILE= xm-alphalinux.h NAT_FILE= nm-linux.h NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o linux-proc.o \ - fork-child.o proc-service.o thread-db.o lin-lwp.o gcore.o + fork-child.o proc-service.o thread-db.o lin-lwp.o gcore.o \ + linux-nat.o LOADLIBES = -ldl -rdynamic diff --git a/gdb/config/alpha/alpha-linux.mt b/gdb/config/alpha/alpha-linux.mt index 25538b34589..8fe98f264b7 100644 --- a/gdb/config/alpha/alpha-linux.mt +++ b/gdb/config/alpha/alpha-linux.mt @@ -1,3 +1,4 @@ # Target: Little-endian Alpha -TDEPFILES= alpha-tdep.o alpha-linux-tdep.o solib.o solib-svr4.o solib-legacy.o +TDEPFILES= alpha-tdep.o alpha-mdebug-tdep.o alpha-linux-tdep.o \ + solib.o solib-svr4.o solib-legacy.o TM_FILE= tm-alphalinux.h diff --git a/gdb/config/alpha/alpha-osf1.mt b/gdb/config/alpha/alpha-osf1.mt index 29212c9a957..2a47bd41429 100644 --- a/gdb/config/alpha/alpha-osf1.mt +++ b/gdb/config/alpha/alpha-osf1.mt @@ -1,3 +1,3 @@ # Target: Little-endian Alpha -TDEPFILES= alpha-tdep.o alpha-osf1-tdep.o +TDEPFILES= alpha-tdep.o alpha-osf1-tdep.o alpha-mdebug-tdep.o TM_FILE= tm-alpha.h diff --git a/gdb/config/alpha/fbsd.mt b/gdb/config/alpha/fbsd.mt index 4b4ecbf6235..24d2fd80b84 100644 --- a/gdb/config/alpha/fbsd.mt +++ b/gdb/config/alpha/fbsd.mt @@ -1,3 +1,3 @@ # Target: FreeBSD/Alpha -TDEPFILES= alpha-tdep.o alphabsd-tdep.o alphafbsd-tdep.o +TDEPFILES= alpha-tdep.o alpha-mdebug-tdep.o alphabsd-tdep.o alphafbsd-tdep.o TM_FILE= tm-fbsd.h diff --git a/gdb/config/alpha/nbsd.mt b/gdb/config/alpha/nbsd.mt index 7fd9c503255..065a28c9a01 100644 --- a/gdb/config/alpha/nbsd.mt +++ b/gdb/config/alpha/nbsd.mt @@ -1,4 +1,4 @@ # Target: Alpha running NetBSD -TDEPFILES= alpha-tdep.o alphabsd-tdep.o alphanbsd-tdep.o corelow.o \ - nbsd-tdep.o solib.o solib-svr4.o +TDEPFILES= alpha-tdep.o alpha-mdebug-tdep.o alphabsd-tdep.o alphanbsd-tdep.o \ + corelow.o nbsd-tdep.o solib.o solib-svr4.o TM_FILE= tm-nbsd.h diff --git a/gdb/config/alpha/nm-linux.h b/gdb/config/alpha/nm-linux.h index 9e99b33cd1f..a6f9a49f9d6 100644 --- a/gdb/config/alpha/nm-linux.h +++ b/gdb/config/alpha/nm-linux.h @@ -45,6 +45,9 @@ pointer to the first register. */ #define ALPHA_REGSET_BASE(regsetp) ((long *) (regsetp)) +/* Given a pointer to a gregset_t, locate the UNIQUE value. */ +#define ALPHA_REGSET_UNIQUE(regsetp) ((long *)(regsetp) + 32) + /* The address of UNIQUE for ptrace. */ #define ALPHA_UNIQUE_PTRACE_ADDR 65 diff --git a/gdb/config/alpha/tm-alpha.h b/gdb/config/alpha/tm-alpha.h index feb752a1495..9ced4f238ed 100644 --- a/gdb/config/alpha/tm-alpha.h +++ b/gdb/config/alpha/tm-alpha.h @@ -64,11 +64,6 @@ typedef struct alpha_extra_func_info #define mips_extra_func_info alpha_extra_func_info #define mips_extra_func_info_t alpha_extra_func_info_t - -#define PRINT_EXTRA_FRAME_INFO(fi) alpha_print_extra_frame_info ((fi)) -extern void alpha_print_extra_frame_info (struct frame_info *); - - /* It takes two values to specify a frame on the ALPHA. Sigh. In fact, at the moment, the *PC* is the primary value that sets up diff --git a/gdb/config/alpha/tm-alphalinux.h b/gdb/config/alpha/tm-alphalinux.h index 4858b90eba2..30ae4f756f3 100644 --- a/gdb/config/alpha/tm-alphalinux.h +++ b/gdb/config/alpha/tm-alphalinux.h @@ -2,8 +2,8 @@ definitions here are used when the _target_ system is running GNU/Linux. - Copyright 1996, 1998, 1999, 2000, 2002 Free Software Foundation, - Inc. + Copyright 1996, 1998, 1999, 2000, 2002, 2003 + Free Software Foundation, Inc. This file is part of GDB. @@ -27,13 +27,6 @@ #include "alpha/tm-alpha.h" -/* Get start and end address of sigtramp handler. */ - -extern LONGEST alpha_linux_sigtramp_offset (CORE_ADDR); -#define SIGTRAMP_START(pc) (pc - alpha_linux_sigtramp_offset (pc)) -#define SIGTRAMP_END(pc) (SIGTRAMP_START(pc) + 3*4) - - /* Number of traps that happen between exec'ing the shell to run an inferior, and when we finally get to the inferior code. This is 2 on GNU/Linux and most implementations. */ diff --git a/gdb/config/arm/linux.mh b/gdb/config/arm/linux.mh index fa1eb63d67f..1b0a3ba46d4 100644 --- a/gdb/config/arm/linux.mh +++ b/gdb/config/arm/linux.mh @@ -5,7 +5,7 @@ XM_FILE= xm-linux.h NAT_FILE= nm-linux.h NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \ core-regset.o arm-linux-nat.o linux-proc.o gcore.o \ - proc-service.o thread-db.o lin-lwp.o + proc-service.o thread-db.o lin-lwp.o linux-nat.o LOADLIBES= -ldl -rdynamic diff --git a/gdb/config/arm/linux.mt b/gdb/config/arm/linux.mt index e1996ab0639..c17b2e5ec53 100644 --- a/gdb/config/arm/linux.mt +++ b/gdb/config/arm/linux.mt @@ -1,5 +1,3 @@ # Target: ARM based machine running GNU/Linux TM_FILE= tm-linux.h TDEPFILES= arm-tdep.o arm-linux-tdep.o solib.o solib-svr4.o solib-legacy.o - -GDBSERVER_DEPFILES = linux-low.o linux-arm-low.o reg-arm.o diff --git a/gdb/config/arm/nm-linux.h b/gdb/config/arm/nm-linux.h index 7e0156db43c..3de00c915ca 100644 --- a/gdb/config/arm/nm-linux.h +++ b/gdb/config/arm/nm-linux.h @@ -27,11 +27,6 @@ #define U_REGS_OFFSET 0 -#ifdef GDBSERVER -#define REGISTER_U_ADDR(addr,blockend,regno) \ - (addr) = arm_register_u_addr ((blockend),(regno)) -#endif /* GDBSERVER */ - /* Return sizeof user struct to callers in less machine dependent routines */ extern int kernel_u_size (void); #define KERNEL_U_SIZE arm_linux_kernel_u_size() diff --git a/gdb/config/arm/tm-linux.h b/gdb/config/arm/tm-linux.h index bbf566d2d83..995ba7312fb 100644 --- a/gdb/config/arm/tm-linux.h +++ b/gdb/config/arm/tm-linux.h @@ -21,19 +21,11 @@ #ifndef TM_ARMLINUX_H #define TM_ARMLINUX_H -#ifdef GDBSERVER -#define ARM_GNULINUX_TARGET -#endif - /* Include the common ARM target definitions. */ #include "arm/tm-arm.h" #include "config/tm-linux.h" -/* Use target-specific function to define link map offsets. */ -extern struct link_map_offsets *arm_linux_svr4_fetch_link_map_offsets (void); -#define SVR4_FETCH_LINK_MAP_OFFSETS() arm_linux_svr4_fetch_link_map_offsets () - /* Offset to saved PC in sigcontext structure, from */ #define SIGCONTEXT_PC_OFFSET (sizeof(unsigned long) * 18) diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst index 386fcf09fe4..96b0c431e45 100644 --- a/gdb/config/djgpp/fnchange.lst +++ b/gdb/config/djgpp/fnchange.lst @@ -168,7 +168,6 @@ @V@/gdb/regformats/reg-i386-linux.dat @V@/gdb/regformats/r-i386-lnx.dat @V@/gdb/regformats/reg-s390x.dat @V@/gdb/regformats/r-s390x.dat @V@/gdb/remote-adapt.c @V@/gdb/rmt-adapt.c -@V@/gdb/remote-array.c @V@/gdb/rmt-array.c @V@/gdb/remote-e7000.c @V@/gdb/rmt-e7000.c @V@/gdb/remote-eb.c @V@/gdb/rmt-eb.c @V@/gdb/remote-est.c @V@/gdb/rmt-est.c @@ -252,6 +251,8 @@ @V@/gdb/testsuite/gdb.c++/ovldbreak.exp @V@/gdb/testsuite/gdb.cxx/ovldbreak.exp @V@/gdb/testsuite/gdb.c++/pr-1023.cc @V@/gdb/testsuite/gdb.cxx/pr-1023.cc @V@/gdb/testsuite/gdb.c++/pr-1023.exp @V@/gdb/testsuite/gdb.cxx/pr-1023.exp +@V@/gdb/testsuite/gdb.c++/pr-1210.cc @V@/gdb/testsuite/gdb.cxx/pr-1210.cc +@V@/gdb/testsuite/gdb.c++/pr-1210.exp @V@/gdb/testsuite/gdb.cxx/pr-1210.exp @V@/gdb/testsuite/gdb.c++/pr-574.cc @V@/gdb/testsuite/gdb.cxx/pr-574.cc @V@/gdb/testsuite/gdb.c++/pr-574.exp @V@/gdb/testsuite/gdb.cxx/pr-574.exp @V@/gdb/testsuite/gdb.c++/printmethod.cc @V@/gdb/testsuite/gdb.cxx/printmethod.cc @@ -426,6 +427,8 @@ @V@/sim/mn10300/dv-mn103tim.c @V@/sim/mn10300/dv-mn1tim.c @V@/sim/ppc/.gdbinit @V@/sim/ppc/gdb.ini @V@/sim/ppc/corefile-n.h @V@/sim/ppc/corefle-n.h +@V@/sim/ppc/altivec_expression.h @V@/sim/ppc/av_expression.h +@V@/sim/ppc/altivec_registers.h @V@/sim/ppc/av_registers.h @V@/sim/ppc/idecode_branch.h @V@/sim/ppc/idec_branch.h @V@/sim/ppc/idecode_expression.h @V@/sim/ppc/idec_expression.h @V@/sim/ppc/idecode_fields.h @V@/sim/ppc/idec_fields.h diff --git a/gdb/config/h8300/tm-h8300.h b/gdb/config/h8300/tm-h8300.h index 4e600575045..e560c644c8d 100644 --- a/gdb/config/h8300/tm-h8300.h +++ b/gdb/config/h8300/tm-h8300.h @@ -28,10 +28,11 @@ GDB_TARGET_IS_H8300 in remote-e7000.c */ extern int h8300hmode; extern int h8300smode; +extern int h8300sxmode; #define GDB_TARGET_IS_H8300 /* Needed for remote.c */ -#define REMOTE_BREAKPOINT { 0x57, 0x30} /* trapa #3 */ +#define DEPRECATED_REMOTE_BREAKPOINT { 0x57, 0x30} /* trapa #3 */ /* Needed for remote-hms.c */ #define CCR_REGNUM 8 /* Needed for remote-e7000.c */ diff --git a/gdb/config/i386/i386sol2.mt b/gdb/config/i386/i386sol2.mt index f8fabd494b7..93c2d783538 100644 --- a/gdb/config/i386/i386sol2.mt +++ b/gdb/config/i386/i386sol2.mt @@ -1,3 +1,3 @@ # Target: Intel 386 running Solaris 2 (SVR4) -TDEPFILES= i386-tdep.o i387-tdep.o i386-sol2-tdep.o i386bsd-tdep.o +TDEPFILES= i386-tdep.o i387-tdep.o i386-sol2-tdep.o TM_FILE= tm-i386sol2.h diff --git a/gdb/config/i386/linux.mh b/gdb/config/i386/linux.mh index 494ccf1a4a4..2a20cdd9749 100644 --- a/gdb/config/i386/linux.mh +++ b/gdb/config/i386/linux.mh @@ -5,7 +5,8 @@ XM_FILE= xm-i386.h NAT_FILE= nm-linux.h NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o linux-proc.o \ core-aout.o i386-nat.o i386-linux-nat.o \ - proc-service.o thread-db.o lin-lwp.o linux-proc.o gcore.o + proc-service.o thread-db.o lin-lwp.o linux-proc.o gcore.o \ + linux-nat.o # The dynamically loaded libthread_db needs access to symbols in the # gdb executable. diff --git a/gdb/config/i386/linux.mt b/gdb/config/i386/linux.mt index 43bc2d26b73..2d27a02638e 100644 --- a/gdb/config/i386/linux.mt +++ b/gdb/config/i386/linux.mt @@ -2,5 +2,3 @@ TDEPFILES= i386-tdep.o i386-linux-tdep.o i387-tdep.o \ solib.o solib-svr4.o solib-legacy.o TM_FILE= tm-linux.h - -GDBSERVER_DEPFILES = linux-low.o linux-i386-low.o reg-i386.o diff --git a/gdb/config/i386/nm-x86-64linux.h b/gdb/config/i386/nm-x86-64linux.h index 4430fcba5db..8ff80957d57 100644 --- a/gdb/config/i386/nm-x86-64linux.h +++ b/gdb/config/i386/nm-x86-64linux.h @@ -1,7 +1,8 @@ /* Native support for GNU/Linux x86-64. - Copyright 2001, 2002 Free Software Foundation, Inc. Contributed by - Jiri Smid, SuSE Labs. + Copyright 2001, 2002, 2003 Free Software Foundation, Inc. + + Contributed by Jiri Smid, SuSE Labs. This file is part of GDB. @@ -20,15 +21,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef NM_X86_64_H -#define NM_X86_64_H - -#include "config/nm-linux.h" +#ifndef NM_X86_64_LINUX_H +#define NM_X86_64_LINUX_H +/* GNU/Linux supports the i386 hardware debugging registers. */ #define I386_USE_GENERIC_WATCHPOINTS + #include "i386/nm-i386.h" +#include "config/nm-linux.h" -/* Support for 8-byte wide hw watchpoints. */ +/* Support for 8-byte wide hardware watchpoints. */ #define TARGET_HAS_DR_LEN_8 1 /* Provide access to the i386 hardware debugging registers. */ @@ -50,41 +52,13 @@ extern unsigned long x86_64_linux_dr_get_status (void); x86_64_linux_dr_get_status () -#define REGISTER_U_ADDR(addr, blockend, regno) \ - (addr) = x86_64_register_u_addr ((blockend),(regno)); -CORE_ADDR x86_64_register_u_addr (CORE_ADDR, int); - -/* Return the size of the user struct. */ -#define KERNEL_U_SIZE kernel_u_size() -extern int kernel_u_size (void); - -/* Offset of the registers within the user area. */ -#define U_REGS_OFFSET 0 - -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ -#define KERNEL_U_ADDR 0x0 - -#define PTRACE_ARG3_TYPE void* -#define PTRACE_XFER_TYPE unsigned long - - -/* We define this if link.h is available, because with ELF we use SVR4 style - shared libraries. */ +/* Type of the third argument to the `ptrace' system call. */ +#define PTRACE_ARG3_TYPE long -#ifdef HAVE_LINK_H -#define SVR4_SHARED_LIBS -#include "solib.h" /* Support for shared libraries. */ -#endif +/* Type of the fourth argument to the `ptrace' system call. */ +#define PTRACE_XFER_TYPE long /* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */ #define FETCH_INFERIOR_REGISTERS -#undef PREPARE_TO_PROCEED - -#include - -extern void lin_thread_get_thread_signals (sigset_t * mask); -#define GET_THREAD_SIGNALS(mask) lin_thread_get_thread_signals (mask) - -#endif /* NM_X86_64.h */ +#endif /* NM_X86_64_LINUX_H */ diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/i386/tm-i386.h index e80b258e7d8..395c9b259b1 100644 --- a/gdb/config/i386/tm-i386.h +++ b/gdb/config/i386/tm-i386.h @@ -24,8 +24,4 @@ #define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL -/* FIXME: kettenis/2000-06-12: These do not belong here. */ -extern void print_387_control_word (unsigned int); -extern void print_387_status_word (unsigned int); - #endif /* ifndef TM_I386_H */ diff --git a/gdb/config/i386/tm-x86-64linux.h b/gdb/config/i386/tm-x86-64linux.h index 11eea93793a..4c16766f3a8 100644 --- a/gdb/config/i386/tm-x86-64linux.h +++ b/gdb/config/i386/tm-x86-64linux.h @@ -1,6 +1,6 @@ /* Definitions to target GDB to GNU/Linux on x86-64. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. Contributed by Michal Ludvig, SuSE Labs. @@ -25,10 +25,10 @@ #define TM_X86_64LINUX_H /* We define SVR4_SHARED_LIBS unconditionally, on the assumption that - * link.h is available on all linux platforms. For I386 and SH3/4, - * we hard-code the information rather than use link.h anyway (for - * the benefit of cross-debugging). We may move to doing that for - * other architectures as well. */ + link.h is available on all linux platforms. For I386 and SH3/4, we + hard-code the information rather than use link.h anyway (for the + benefit of cross-debugging). We may move to doing that for other + architectures as well. */ #define SVR4_SHARED_LIBS #include "solib.h" /* Support for shared libraries. */ diff --git a/gdb/config/i386/x86-64linux.mh b/gdb/config/i386/x86-64linux.mh index 7c221ebd807..0c3c855e018 100644 --- a/gdb/config/i386/x86-64linux.mh +++ b/gdb/config/i386/x86-64linux.mh @@ -4,8 +4,10 @@ XM_FILE= xm-i386.h NAT_FILE= nm-x86-64linux.h NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \ - core-aout.o i386-nat.o x86-64-linux-nat.o \ - proc-service.o thread-db.o lin-lwp.o \ - linux-proc.o gcore.o + core-regset.o i386-nat.o x86-64-linux-nat.o \ + linux-nat.o \ + proc-service.o thread-db.o lin-lwp.o linux-proc.o gcore.o +# The dynamically loaded libthread_db needs access to symbols in the +# gdb executable. LOADLIBES = -ldl -rdynamic diff --git a/gdb/config/i386/x86-64linux.mt b/gdb/config/i386/x86-64linux.mt index d0ffb34f97a..d4484523227 100644 --- a/gdb/config/i386/x86-64linux.mt +++ b/gdb/config/i386/x86-64linux.mt @@ -1,6 +1,6 @@ # Target: AMD x86-64 running GNU/Linux -TDEPFILES= x86-64-tdep.o x86-64-linux-tdep.o dwarf2cfi.o \ - i386-tdep.o i387-tdep.o \ +TDEPFILES= x86-64-tdep.o x86-64-linux-tdep.o \ + i386-tdep.o i387-tdep.o i386-linux-tdep.o \ solib.o solib-svr4.o solib-legacy.o GDB_MULTI_ARCH=GDB_MULTI_ARCH_TM diff --git a/gdb/config/ia64/linux.mh b/gdb/config/ia64/linux.mh index 65f30284e1c..2013af35505 100644 --- a/gdb/config/ia64/linux.mh +++ b/gdb/config/ia64/linux.mh @@ -5,6 +5,6 @@ XM_FILE= xm-linux.h NAT_FILE= nm-linux.h NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o gcore.o \ core-aout.o core-regset.o ia64-linux-nat.o linux-proc.o \ - proc-service.o thread-db.o lin-lwp.o + proc-service.o thread-db.o lin-lwp.o linux-nat.o LOADLIBES = -ldl -rdynamic diff --git a/gdb/config/ia64/linux.mt b/gdb/config/ia64/linux.mt index d841f75f37f..3a661b3d947 100644 --- a/gdb/config/ia64/linux.mt +++ b/gdb/config/ia64/linux.mt @@ -2,5 +2,3 @@ TDEPFILES= ia64-tdep.o ia64-aix-tdep.o ia64-linux-tdep.o \ solib.o solib-svr4.o solib-legacy.o TM_FILE= tm-linux.h - -GDBSERVER_DEPFILES = linux-low.o linux-ia64-low.o reg-ia64.o diff --git a/gdb/config/ia64/nm-linux.h b/gdb/config/ia64/nm-linux.h index e00d561b6a3..0418495c111 100644 --- a/gdb/config/ia64/nm-linux.h +++ b/gdb/config/ia64/nm-linux.h @@ -34,13 +34,6 @@ extern int ia64_cannot_fetch_register (int regno); #define CANNOT_STORE_REGISTER(regno) ia64_cannot_store_register(regno) extern int ia64_cannot_store_register (int regno); -#ifdef GDBSERVER -#define REGISTER_U_ADDR(addr, blockend, regno) \ - (addr) = ia64_register_u_addr ((blockend),(regno)); - -extern int ia64_register_u_addr(int, int); -#endif /* GDBSERVER */ - #define U_REGS_OFFSET 0 #define PTRACE_ARG3_TYPE long diff --git a/gdb/config/ia64/tm-ia64.h b/gdb/config/ia64/tm-ia64.h index 2445395974d..1b2baacd5a0 100644 --- a/gdb/config/ia64/tm-ia64.h +++ b/gdb/config/ia64/tm-ia64.h @@ -21,59 +21,8 @@ #ifndef TM_IA64_H #define TM_IA64_H -#if !defined(GDBSERVER) - #define GDB_MULTI_ARCH 1 -#else /* defines needed for GDBSERVER */ - -/* Say how long (ordinary) registers are. This is a piece of bogosity - used in push_word and a few other places; REGISTER_RAW_SIZE is the - real way to know how big a register is. */ - -#define DEPRECATED_REGISTER_SIZE 8 - -#undef NUM_REGS -#define NUM_REGS 590 - -/* Some pseudo register numbers */ - -#define PC_REGNUM IA64_IP_REGNUM -#define SP_REGNUM IA64_GR12_REGNUM -#define DEPRECATED_FP_REGNUM IA64_VFP_REGNUM - -/* Total amount of space needed to store our copies of the machine's - register state, the array `registers'. On the ia64, all registers - fit in 64 bits except for the floating point registers which require - 84 bits. But 84 isn't a nice number, so we'll just allocate 128 - bits for each of these. The expression below says that we - need 8 bytes for each register, plus an additional 8 bytes for each - of the 128 floating point registers. */ - -#define DEPRECATED_REGISTER_BYTES (NUM_REGS*8+128*8) - -/* Index within `registers' of the first byte of the space for - register N. */ - -#define REGISTER_BYTE(N) (((N) * 8) \ - + ((N) <= IA64_FR0_REGNUM ? 0 : 8 * (((N) > IA64_FR127_REGNUM) ? 128 : (N) - IA64_FR0_REGNUM))) - -/* Number of bytes of storage in the actual machine representation - for register N. */ - -#define REGISTER_RAW_SIZE(N) \ - ((IA64_FR0_REGNUM <= (N) && (N) <= IA64_FR127_REGNUM) ? 16 : 8) - -/* Largest value REGISTER_RAW_SIZE can have. */ - -#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 } - -#endif /* GDBSERVER */ - - /* Register numbers of various important registers */ /* General registers; there are 128 of these 64 bit wide registers. The diff --git a/gdb/config/m68k/linux.mh b/gdb/config/m68k/linux.mh index f94df64c104..7de2c3f6e13 100644 --- a/gdb/config/m68k/linux.mh +++ b/gdb/config/m68k/linux.mh @@ -5,10 +5,8 @@ XM_FILE= xm-linux.h NAT_FILE= nm-linux.h NATDEPFILES= infptrace.o inftarg.o fork-child.o \ corelow.o core-aout.o m68klinux-nat.o linux-proc.o gcore.o \ - proc-service.o thread-db.o lin-lwp.o + proc-service.o thread-db.o lin-lwp.o linux-nat.o # The dynamically loaded libthread_db needs access to symbols in the # gdb executable. LOADLIBES = -ldl -rdynamic - -GDBSERVER_DEPFILES = linux-low.o linux-m68k-low.o reg-m68k.o diff --git a/gdb/config/m68k/tm-delta68.h b/gdb/config/m68k/tm-delta68.h index 03172b0dd75..25b747ec8eb 100644 --- a/gdb/config/m68k/tm-delta68.h +++ b/gdb/config/m68k/tm-delta68.h @@ -49,7 +49,7 @@ struct frame_info; #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ - REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \ + DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \ ®BUF[REGISTER_BYTE (FP0_REGNUM)], \ VALBUF); \ else \ @@ -69,7 +69,7 @@ struct frame_info; if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ { \ char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \ - REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buf); \ + DEPRECATED_REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buf); \ deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \ raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \ } \ @@ -105,5 +105,5 @@ extern CORE_ADDR delta68_frame_saved_pc (struct frame_info *fi); #define DEPRECATED_FRAME_SAVED_PC(fi) delta68_frame_saved_pc (fi) extern CORE_ADDR delta68_frame_args_address (struct frame_info *fi); -#undef FRAME_ARGS_ADDRESS -#define FRAME_ARGS_ADDRESS(fi) delta68_frame_args_address (fi) +#undef DEPRECATED_FRAME_ARGS_ADDRESS +#define DEPRECATED_FRAME_ARGS_ADDRESS(fi) delta68_frame_args_address (fi) diff --git a/gdb/config/m68k/tm-linux.h b/gdb/config/m68k/tm-linux.h index 636df0bb733..fc191b16404 100644 --- a/gdb/config/m68k/tm-linux.h +++ b/gdb/config/m68k/tm-linux.h @@ -20,28 +20,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "config/tm-linux.h" -#include "m68k/tm-m68k.h" - -#include "regcache.h" - -/* Number of traps that happen between exec'ing the shell to run an - inferior, and when we finally get to the inferior code. This is 2 - on most implementations. */ - -#define START_INFERIOR_TRAPS_EXPECTED 2 - -/* Offsets (in target ints) into jmp_buf. */ - -#define JB_ELEMENT_SIZE 4 -#define JB_PC 7 - -/* Figure out where the longjmp will land. Slurp the args out of the stack. - We expect the first arg to be a pointer to the jmp_buf structure from which - we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. - This routine returns true on success */ - -#define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR) - -#define IN_SIGTRAMP(pc,name) m68k_linux_in_sigtramp (pc) -extern int m68k_linux_in_sigtramp (CORE_ADDR pc); +/* We define SVR4_SHARED_LIBS unconditionally, on the assumption that + link.h is available on all linux platforms. For I386 and SH3/4, + we hard-code the information rather than use link.h anyway (for + the benefit of cross-debugging). We may move to doing that for + other architectures as well. */ + +#define SVR4_SHARED_LIBS +#include "solib.h" /* Support for shared libraries. */ diff --git a/gdb/config/m68k/tm-m68k.h b/gdb/config/m68k/tm-m68k.h index cb72c982f80..f773428a2f0 100644 --- a/gdb/config/m68k/tm-m68k.h +++ b/gdb/config/m68k/tm-m68k.h @@ -1,6 +1,6 @@ /* Parameters for execution on a 68000 series machine. Copyright 1986, 1987, 1989, 1990, 1992, 1993, 1994, 1995, 1996, 1998, - 1999, 2000 Free Software Foundation, Inc. + 1999, 2000, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -19,8 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "regcache.h" - #define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL extern int m68k_get_longjmp_target (CORE_ADDR *); diff --git a/gdb/config/m68k/tm-m68klynx.h b/gdb/config/m68k/tm-m68klynx.h index ed1f6f0f05e..71ed690545c 100644 --- a/gdb/config/m68k/tm-m68klynx.h +++ b/gdb/config/m68k/tm-m68klynx.h @@ -34,6 +34,6 @@ #include "m68k/tm-m68k.h" /* Disable dumbshit alternate breakpoint mechanism needed by 68k stub. */ -#undef REMOTE_BREAKPOINT +#undef DEPRECATED_REMOTE_BREAKPOINT #endif /* TM_M68KLYNX_H */ diff --git a/gdb/config/m68k/tm-sun3.h b/gdb/config/m68k/tm-sun3.h index 6e978cf5bdf..f721dcf6fdb 100644 --- a/gdb/config/m68k/tm-sun3.h +++ b/gdb/config/m68k/tm-sun3.h @@ -46,7 +46,7 @@ #include "m68k/tm-m68k.h" /* Disable alternate breakpoint mechanism needed by 68k stub. */ -#undef REMOTE_BREAKPOINT +#undef DEPRECATED_REMOTE_BREAKPOINT /* Offsets (in target ints) into jmp_buf. Not defined by Sun, but at least documented in a comment in ! */ diff --git a/gdb/config/mips/bigmips.mt b/gdb/config/mips/bigmips.mt deleted file mode 100644 index 38f03f2f8e4..00000000000 --- a/gdb/config/mips/bigmips.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: Big-endian MIPS machine such as Sony News -TDEPFILES= mips-tdep.o -TM_FILE= tm-bigmips.h diff --git a/gdb/config/mips/bigmips64.mt b/gdb/config/mips/bigmips64.mt deleted file mode 100644 index fcb7b21dae5..00000000000 --- a/gdb/config/mips/bigmips64.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: Big-endian MIPS machine such as Sony News -TDEPFILES= mips-tdep.o -TM_FILE= tm-bigmips64.h diff --git a/gdb/config/mips/decstation.mt b/gdb/config/mips/decstation.mt deleted file mode 100644 index 19847224d2f..00000000000 --- a/gdb/config/mips/decstation.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: Little-endian MIPS machine such as DECstation. -TDEPFILES= mips-tdep.o -TM_FILE= tm-mips.h diff --git a/gdb/config/mips/embed.mt b/gdb/config/mips/embed.mt index 42ab4aa47b9..e17c5c2d4ff 100644 --- a/gdb/config/mips/embed.mt +++ b/gdb/config/mips/embed.mt @@ -1,5 +1,5 @@ # Target: Big-endian mips board, typically an IDT. -TDEPFILES= mips-tdep.o remote-mips.o remote-array.o +TDEPFILES= mips-tdep.o remote-mips.o TM_FILE= tm-embed.h SIM_OBS = remote-sim.o SIM = ../sim/mips/libsim.a diff --git a/gdb/config/mips/embed64.mt b/gdb/config/mips/embed64.mt index ed60fd25031..aee68aeb335 100644 --- a/gdb/config/mips/embed64.mt +++ b/gdb/config/mips/embed64.mt @@ -1,5 +1,5 @@ # Target: Big-endian mips board, typically an IDT. -TDEPFILES= mips-tdep.o remote-mips.o remote-array.o -TM_FILE= tm-embed64.h +TDEPFILES= mips-tdep.o remote-mips.o +TM_FILE= tm-mips64.h SIM_OBS = remote-sim.o SIM = ../sim/mips/libsim.a diff --git a/gdb/config/mips/embedl.mt b/gdb/config/mips/embedl.mt index 0ed8b8d5021..bbc9b7d1b95 100644 --- a/gdb/config/mips/embedl.mt +++ b/gdb/config/mips/embedl.mt @@ -1,5 +1,5 @@ # Target: Big-endian mips board, typically an IDT. -TDEPFILES= mips-tdep.o remote-mips.o remote-array.o -TM_FILE= tm-embedl.h +TDEPFILES= mips-tdep.o remote-mips.o +TM_FILE= tm-mips.h SIM_OBS = remote-sim.o SIM = ../sim/mips/libsim.a diff --git a/gdb/config/mips/embedl64.mt b/gdb/config/mips/embedl64.mt index 28c41be48fb..aee68aeb335 100644 --- a/gdb/config/mips/embedl64.mt +++ b/gdb/config/mips/embedl64.mt @@ -1,5 +1,5 @@ # Target: Big-endian mips board, typically an IDT. -TDEPFILES= mips-tdep.o remote-mips.o remote-array.o -TM_FILE= tm-embedl64.h +TDEPFILES= mips-tdep.o remote-mips.o +TM_FILE= tm-mips64.h SIM_OBS = remote-sim.o SIM = ../sim/mips/libsim.a diff --git a/gdb/config/mips/linux.mh b/gdb/config/mips/linux.mh index 991fd6c0dee..38f87256689 100644 --- a/gdb/config/mips/linux.mh +++ b/gdb/config/mips/linux.mh @@ -2,6 +2,7 @@ XM_FILE= xm-linux.h NAT_FILE= nm-linux.h NATDEPFILES= infptrace.o inftarg.o fork-child.o mips-linux-nat.o \ - thread-db.o lin-lwp.o proc-service.o linux-proc.o gcore.o + thread-db.o lin-lwp.o proc-service.o linux-proc.o gcore.o \ + linux-nat.o LOADLIBES = -ldl -rdynamic diff --git a/gdb/config/mips/linux.mt b/gdb/config/mips/linux.mt index 60bbfb25212..25d99b370ca 100644 --- a/gdb/config/mips/linux.mt +++ b/gdb/config/mips/linux.mt @@ -3,7 +3,5 @@ TDEPFILES= mips-tdep.o mips-linux-tdep.o corelow.o \ solib.o solib-svr4.o TM_FILE= tm-linux.h -GDBSERVER_DEPFILES = linux-low.o linux-mips-low.o reg-mips.o - SIM_OBS = remote-sim.o SIM = ../sim/mips/libsim.a diff --git a/gdb/config/mips/littlemips.mt b/gdb/config/mips/littlemips.mt deleted file mode 100644 index 19847224d2f..00000000000 --- a/gdb/config/mips/littlemips.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: Little-endian MIPS machine such as DECstation. -TDEPFILES= mips-tdep.o -TM_FILE= tm-mips.h diff --git a/gdb/config/mips/tm-bigmips.h b/gdb/config/mips/tm-bigmips.h deleted file mode 100644 index 7a5a6b816c1..00000000000 --- a/gdb/config/mips/tm-bigmips.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 1990, 1994, 2000 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "mips/tm-mips.h" diff --git a/gdb/config/mips/tm-bigmips64.h b/gdb/config/mips/tm-bigmips64.h deleted file mode 100644 index 9f171eef11c..00000000000 --- a/gdb/config/mips/tm-bigmips64.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Target machine parameters for MIPS r4000 - Copyright 1994, 2000 Free Software Foundation, Inc. - Contributed by Ian Lance Taylor (ian@cygnus.com) - - This file is part of GDB. - - 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. */ - -#include "mips/tm-mips64.h" diff --git a/gdb/config/mips/tm-embed.h b/gdb/config/mips/tm-embed.h index 44072f4cb38..a7a794807f0 100644 --- a/gdb/config/mips/tm-embed.h +++ b/gdb/config/mips/tm-embed.h @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "mips/tm-bigmips.h" +#include "mips/tm-mips.h" /* Watchpoint support */ diff --git a/gdb/config/mips/tm-embed64.h b/gdb/config/mips/tm-embed64.h deleted file mode 100644 index 630b8e02516..00000000000 --- a/gdb/config/mips/tm-embed64.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 1993, 2000 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "mips/tm-bigmips64.h" diff --git a/gdb/config/mips/tm-embedl.h b/gdb/config/mips/tm-embedl.h deleted file mode 100644 index d53f5c86228..00000000000 --- a/gdb/config/mips/tm-embedl.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 1993, 2000 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "mips/tm-mips.h" diff --git a/gdb/config/mips/tm-embedl64.h b/gdb/config/mips/tm-embedl64.h deleted file mode 100644 index c76c612ac9d..00000000000 --- a/gdb/config/mips/tm-embedl64.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 1993, 2000 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "mips/tm-mips64.h" diff --git a/gdb/config/mips/tm-irix3.h b/gdb/config/mips/tm-irix3.h index 03c66bd9fd0..05ab07d89a2 100644 --- a/gdb/config/mips/tm-irix3.h +++ b/gdb/config/mips/tm-irix3.h @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "mips/tm-bigmips.h" +#include "mips/tm-mips.h" /* Redefine register numbers for SGI. */ diff --git a/gdb/config/mips/tm-irix5.h b/gdb/config/mips/tm-irix5.h index d3dfdc46903..932852ea487 100644 --- a/gdb/config/mips/tm-irix5.h +++ b/gdb/config/mips/tm-irix5.h @@ -30,19 +30,16 @@ * Irix 6 (n32 ABI) has 32-bit GP regs and 64-bit FP regs */ -#undef DEPRECATED_REGISTER_BYTES -#define DEPRECATED_REGISTER_BYTES (MIPS_NUMREGS * 8 + (NUM_REGS - MIPS_NUMREGS) * MIPS_REGSIZE) - -#undef REGISTER_BYTE -#define REGISTER_BYTE(N) \ +#undef MIPS_REGISTER_BYTE +#define MIPS_REGISTER_BYTE(N) \ (((N) < FP0_REGNUM) ? (N) * MIPS_REGSIZE : \ ((N) < FP0_REGNUM + 32) ? \ FP0_REGNUM * MIPS_REGSIZE + \ ((N) - FP0_REGNUM) * sizeof(double) : \ 32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE) -#undef REGISTER_VIRTUAL_TYPE -#define REGISTER_VIRTUAL_TYPE(N) \ +#undef MIPS_REGISTER_TYPE +#define MIPS_REGISTER_TYPE(N) \ (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \ : ((N) == 32 /*SR*/) ? builtin_type_uint32 \ : ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \ diff --git a/gdb/config/mips/tm-irix6.h b/gdb/config/mips/tm-irix6.h index 812aed5a25d..e6395ae6ef9 100644 --- a/gdb/config/mips/tm-irix6.h +++ b/gdb/config/mips/tm-irix6.h @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "mips/tm-bigmips64.h" +#include "mips/tm-mips64.h" #include "solib.h" /* Redefine register numbers for SGI. */ @@ -62,11 +62,8 @@ #define FCRIR_REGNUM 70 /* FP implementation/revision */ -#undef DEPRECATED_REGISTER_BYTES -#define DEPRECATED_REGISTER_BYTES (MIPS_NUMREGS * 8 + (NUM_REGS - MIPS_NUMREGS) * MIPS_REGSIZE) - -#undef REGISTER_BYTE -#define REGISTER_BYTE(N) \ +#undef MIPS_REGISTER_BYTE +#define MIPS_REGISTER_BYTE(N) \ (((N) < FP0_REGNUM) ? (N) * MIPS_REGSIZE : \ ((N) < FP0_REGNUM + 32) ? \ FP0_REGNUM * MIPS_REGSIZE + \ @@ -96,9 +93,5 @@ #define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 2 * 4 + 8 + 32 * 8 + 4) #define SIGFRAME_REG_SIZE 8 -/* Select the disassembler */ -#undef TM_PRINT_INSN_MACH -#define TM_PRINT_INSN_MACH bfd_mach_mips8000 - /* Undefine those methods which have been multiarched. */ -#undef REGISTER_VIRTUAL_TYPE +#undef MIPS_REGISTER_TYPE diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h index 540db163080..51a6a7dbaeb 100644 --- a/gdb/config/mips/tm-mips.h +++ b/gdb/config/mips/tm-mips.h @@ -1,7 +1,7 @@ /* Definitions to make GDB run on a mips box under 4.3bsd. Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, - 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. + 1997, 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. Contributed by Per Bothner (bothner@cs.wisc.edu) at U.Wisconsin and by Alessandro Forin (af@cs.cmu.edu) at CMU.. @@ -45,15 +45,7 @@ extern int mips_step_skips_delay (CORE_ADDR); #define STEP_SKIPS_DELAY_P (1) #define STEP_SKIPS_DELAY(pc) (mips_step_skips_delay (pc)) -/* Say how long (ordinary) registers are. This is a piece of bogosity - used in push_word and a few other places; REGISTER_RAW_SIZE is the - real way to know how big a register is. */ - -#define DEPRECATED_REGISTER_SIZE 4 - -/* The size of a register. This is predefined in tm-mips64.h. We - can't use DEPRECATED_REGISTER_SIZE because that is used for various other - things. */ +/* The size of a register. This is predefined in tm-mips64.h. */ #ifndef MIPS_REGSIZE #define MIPS_REGSIZE 4 @@ -103,46 +95,22 @@ extern int mips_step_skips_delay (CORE_ADDR); #define PRID_REGNUM 89 /* Processor ID */ #define LAST_EMBED_REGNUM 89 /* Last one */ -/* Total amount of space needed to store our copies of the machine's - register state, the array `registers'. */ - -#define DEPRECATED_REGISTER_BYTES (NUM_REGS*MIPS_REGSIZE) - /* Index within `registers' of the first byte of the space for register N. */ -#define REGISTER_BYTE(N) ((N) * MIPS_REGSIZE) +#define MIPS_REGISTER_BYTE(N) ((N) * MIPS_REGSIZE) /* Return the GDB type object for the "standard" data type of data in register N. */ -#ifndef REGISTER_VIRTUAL_TYPE -#define REGISTER_VIRTUAL_TYPE(N) \ +#ifndef MIPS_REGISTER_TYPE +#define MIPS_REGISTER_TYPE(N) \ (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_float \ : ((N) == 32 /*SR*/) ? builtin_type_uint32 \ : ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \ : builtin_type_int) #endif -/* All mips targets store doubles in a register pair with the least - significant register in the lower numbered register. - If the target is big endian, double register values need conversion - between memory and register formats. */ - -extern void mips_register_convert_to_type (int regnum, - struct type *type, - char *buffer); -extern void mips_register_convert_from_type (int regnum, - struct type *type, - char *buffer); - -#define REGISTER_CONVERT_TO_TYPE(n, type, buffer) \ - mips_register_convert_to_type ((n), (type), (buffer)) - -#define REGISTER_CONVERT_FROM_TYPE(n, type, buffer) \ - mips_register_convert_from_type ((n), (type), (buffer)) - - /* Special symbol found in blocks associated with routines. We can hang mips_extra_func_info_t's off of this. */ @@ -182,10 +150,6 @@ extern void mips_print_extra_frame_info (struct frame_info *frame); #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv) extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *); -/* Select the default mips disassembler */ - -#define TM_PRINT_INSN_MACH 0 - /* These are defined in mdebugread.c and are used in mips-tdep.c */ extern CORE_ADDR sigtramp_address, sigtramp_end; extern void fixup_sigtramp (void); @@ -197,22 +161,12 @@ extern char *mips_read_processor_type (void); #define IGNORE_HELPER_CALL(pc) mips_ignore_helper (pc) extern int mips_ignore_helper (CORE_ADDR pc); -#ifndef TARGET_MIPS -#define TARGET_MIPS -#endif - /* Definitions and declarations used by mips-tdep.c and remote-mips.c */ #define MIPS_INSTLEN 4 /* Length of an instruction */ #define MIPS16_INSTLEN 2 /* Length of an instruction on MIPS16 */ #define MIPS_NUMREGS 32 /* Number of integer or float registers */ typedef unsigned long t_inst; /* Integer big enough to hold an instruction */ -/* MIPS16 function addresses are odd (bit 0 is set). Here are some - macros to test, set, or clear bit 0 of addresses. */ -#define IS_MIPS16_ADDR(addr) ((addr) & 1) -#define MAKE_MIPS16_ADDR(addr) ((addr) | 1) -#define UNMAKE_MIPS16_ADDR(addr) ((addr) & ~1) - #endif /* TM_MIPS_H */ /* Command to set the processor type. */ diff --git a/gdb/config/mips/tm-mips64.h b/gdb/config/mips/tm-mips64.h index 13e62d2acf3..2547e86f482 100644 --- a/gdb/config/mips/tm-mips64.h +++ b/gdb/config/mips/tm-mips64.h @@ -23,7 +23,7 @@ #define MIPS_REGSIZE 8 /* define 8 byte register type */ -#define REGISTER_VIRTUAL_TYPE(N) \ +#define MIPS_REGISTER_TYPE(N) \ (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \ : ((N) == 32 /*SR*/) ? builtin_type_uint32 \ : ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \ diff --git a/gdb/config/mips/tm-mipsv4.h b/gdb/config/mips/tm-mipsv4.h index ebf671bd54a..37f9e464790 100644 --- a/gdb/config/mips/tm-mipsv4.h +++ b/gdb/config/mips/tm-mipsv4.h @@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "mips/tm-bigmips.h" +#include "mips/tm-mips.h" #include "config/tm-sysv4.h" /* The signal handler trampoline is called _sigtramp. */ diff --git a/gdb/config/mips/tm-tx39.h b/gdb/config/mips/tm-tx39.h index d095db0668f..81f3b6ddc41 100644 --- a/gdb/config/mips/tm-tx39.h +++ b/gdb/config/mips/tm-tx39.h @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "mips/tm-bigmips.h" +#include "mips/tm-mips.h" #undef MIPS_REGISTER_NAMES #define MIPS_REGISTER_NAMES \ diff --git a/gdb/config/mips/tm-tx39l.h b/gdb/config/mips/tm-tx39l.h deleted file mode 100644 index 81f3b6ddc41..00000000000 --- a/gdb/config/mips/tm-tx39l.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright 1993, 1997, 1999, 2000 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "mips/tm-mips.h" - -#undef MIPS_REGISTER_NAMES -#define MIPS_REGISTER_NAMES \ - { "sr", "lo", "hi", "bad", "cause","pc", \ - "", "", "", "", "", "", "", "", \ - "", "", "", "", "", "", "", "", \ - "", "", "", "", "", "", "", "", \ - "", "", "", "", "", "", "", "", \ - "", "", "", "", \ - "", "", "", "", "", "", "", "", \ - "", "", "config", "cache", "debug", "depc", "epc", "" \ - } diff --git a/gdb/config/mips/tm-vr4100.h b/gdb/config/mips/tm-vr4100.h deleted file mode 100644 index 9c4472b0510..00000000000 --- a/gdb/config/mips/tm-vr4100.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 1998, 2000 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "mips/tm-bigmips64.h" diff --git a/gdb/config/mips/tm-vr4300.h b/gdb/config/mips/tm-vr4300.h deleted file mode 100644 index 728c73135e5..00000000000 --- a/gdb/config/mips/tm-vr4300.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 1993, 1995, 1996, 2000 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "mips/tm-bigmips64.h" diff --git a/gdb/config/mips/tm-vr4300el.h b/gdb/config/mips/tm-vr4300el.h deleted file mode 100644 index e7e56805dfb..00000000000 --- a/gdb/config/mips/tm-vr4300el.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 1993, 1995, 1996, 2000 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "mips/tm-mips64.h" diff --git a/gdb/config/mips/tm-vr4xxx.h b/gdb/config/mips/tm-vr4xxx.h deleted file mode 100644 index 9c4472b0510..00000000000 --- a/gdb/config/mips/tm-vr4xxx.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 1998, 2000 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "mips/tm-bigmips64.h" diff --git a/gdb/config/mips/tm-vr4xxxel.h b/gdb/config/mips/tm-vr4xxxel.h deleted file mode 100644 index 7f2e4cd2d04..00000000000 --- a/gdb/config/mips/tm-vr4xxxel.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 1998, 2000 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "mips/tm-mips64.h" diff --git a/gdb/config/mips/tm-vr5000.h b/gdb/config/mips/tm-vr5000.h deleted file mode 100644 index 0d68345d093..00000000000 --- a/gdb/config/mips/tm-vr5000.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 1996, 2000 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "mips/tm-bigmips64.h" diff --git a/gdb/config/mips/tm-vr5000el.h b/gdb/config/mips/tm-vr5000el.h deleted file mode 100644 index 7fae087d24b..00000000000 --- a/gdb/config/mips/tm-vr5000el.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 1996, 2000 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "mips/tm-mips64.h" diff --git a/gdb/config/mips/tx39l.mt b/gdb/config/mips/tx39l.mt index 35083293d45..8b4c1a92c24 100644 --- a/gdb/config/mips/tx39l.mt +++ b/gdb/config/mips/tx39l.mt @@ -1,5 +1,5 @@ # Target: Big-endian mips board, typically an IDT. TDEPFILES= mips-tdep.o remote-mips.o dve3900-rom.o monitor.o dsrec.o -TM_FILE= tm-tx39l.h +TM_FILE= tm-tx39.h SIM_OBS = remote-sim.o SIM = ../sim/mips/libsim.a diff --git a/gdb/config/mips/vr4100.mt b/gdb/config/mips/vr4100.mt deleted file mode 100644 index c5ae4f94a6d..00000000000 --- a/gdb/config/mips/vr4100.mt +++ /dev/null @@ -1,5 +0,0 @@ -# Target: Big-endian SIM monitor board. -TDEPFILES= mips-tdep.o remote-mips.o -TM_FILE= tm-vr4100.h -SIM_OBS = remote-sim.o -SIM = ../sim/mips/libsim.a diff --git a/gdb/config/mips/vr4300.mt b/gdb/config/mips/vr4300.mt deleted file mode 100644 index 22cb25eb425..00000000000 --- a/gdb/config/mips/vr4300.mt +++ /dev/null @@ -1,5 +0,0 @@ -# Target: Big-endian SIM monitor board. -TDEPFILES= mips-tdep.o remote-mips.o -TM_FILE= tm-vr4300.h -SIM_OBS = remote-sim.o -SIM = ../sim/mips/libsim.a diff --git a/gdb/config/mips/vr4300el.mt b/gdb/config/mips/vr4300el.mt deleted file mode 100644 index cff7241597b..00000000000 --- a/gdb/config/mips/vr4300el.mt +++ /dev/null @@ -1,5 +0,0 @@ -# Target: Little-endian SIM monitor board. -TDEPFILES= mips-tdep.o remote-mips.o -TM_FILE= tm-vr4300el.h -SIM_OBS = remote-sim.o -SIM = ../sim/mips/libsim.a diff --git a/gdb/config/mips/vr4xxx.mt b/gdb/config/mips/vr4xxx.mt deleted file mode 100644 index 4c79ec7552d..00000000000 --- a/gdb/config/mips/vr4xxx.mt +++ /dev/null @@ -1,5 +0,0 @@ -# Target: Big-endian SIM monitor board. -TDEPFILES= mips-tdep.o remote-mips.o -TM_FILE= tm-vr4xxx.h -SIM_OBS = remote-sim.o -SIM = ../sim/mips/libsim.a diff --git a/gdb/config/mips/vr4xxxel.mt b/gdb/config/mips/vr4xxxel.mt deleted file mode 100644 index 5124dd75461..00000000000 --- a/gdb/config/mips/vr4xxxel.mt +++ /dev/null @@ -1,5 +0,0 @@ -# Target: Big-endian SIM monitor board. -TDEPFILES= mips-tdep.o remote-mips.o -TM_FILE= tm-vr4xxxel.h -SIM_OBS = remote-sim.o -SIM = ../sim/mips/libsim.a diff --git a/gdb/config/mips/vr5000.mt b/gdb/config/mips/vr5000.mt deleted file mode 100644 index 7a4a915a12c..00000000000 --- a/gdb/config/mips/vr5000.mt +++ /dev/null @@ -1,5 +0,0 @@ -# Target: Big-endian SIM monitor board. -TDEPFILES= mips-tdep.o remote-mips.o -TM_FILE= tm-vr5000.h -SIM_OBS = remote-sim.o -SIM = ../sim/mips/libsim.a diff --git a/gdb/config/mips/vr5000el.mt b/gdb/config/mips/vr5000el.mt deleted file mode 100644 index 99687edcefc..00000000000 --- a/gdb/config/mips/vr5000el.mt +++ /dev/null @@ -1,5 +0,0 @@ -# Target: Little-endian SIM monitor board. -TDEPFILES= mips-tdep.o remote-mips.o -TM_FILE= tm-vr5000el.h -SIM_OBS = remote-sim.o -SIM = ../sim/mips/libsim.a diff --git a/gdb/config/nm-linux.h b/gdb/config/nm-linux.h index 0fb56271473..9a04cf71cf1 100644 --- a/gdb/config/nm-linux.h +++ b/gdb/config/nm-linux.h @@ -51,9 +51,6 @@ struct target_waitstatus; extern ptid_t child_wait (ptid_t ptid, struct target_waitstatus *ourstatus); #define CHILD_WAIT -extern int lin_lwp_prepare_to_proceed (void); -#define PREPARE_TO_PROCEED(select_it) lin_lwp_prepare_to_proceed () - extern void lin_lwp_attach_lwp (ptid_t ptid, int verbose); #define ATTACH_LWP(ptid, verbose) lin_lwp_attach_lwp ((ptid), (verbose)) @@ -73,7 +70,6 @@ extern void lin_thread_get_thread_signals (sigset_t *mask); /* Override child_pid_to_exec_file in 'inftarg.c'. */ #define CHILD_PID_TO_EXEC_FILE -struct mem_attrib; -extern int linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, - int write, struct mem_attrib *attrib, - struct target_ops *target); +#define CHILD_INSERT_FORK_CATCHPOINT +#define CHILD_INSERT_VFORK_CATCHPOINT +#define CHILD_INSERT_EXEC_CATCHPOINT diff --git a/gdb/config/pa/nm-hppah.h b/gdb/config/pa/nm-hppah.h index f8a2a117fa2..05e7db2b91f 100644 --- a/gdb/config/pa/nm-hppah.h +++ b/gdb/config/pa/nm-hppah.h @@ -53,11 +53,6 @@ #define CHILD_XFER_MEMORY #define CHILD_FOLLOW_FORK -/* While this is for use by threaded programs, it doesn't appear - * to hurt non-threaded ones. This is used in infrun.c: */ -#define PREPARE_TO_PROCEED(select_it) hppa_prepare_to_proceed() -extern int hppa_prepare_to_proceed (void); - /* In infptrace.c or infttrace.c: */ #define CHILD_PID_TO_EXEC_FILE #define CHILD_POST_STARTUP_INFERIOR diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 988b790561f..1ec91d453f6 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -25,7 +25,7 @@ #include "regcache.h" /* Wonder if this is correct? Should be using push_dummy_call(). */ -#define DEPRECATED_DUMMY_WRITE_SP(SP) generic_target_write_sp (SP) +#define DEPRECATED_DUMMY_WRITE_SP(SP) deprecated_write_sp (SP) #ifndef GDB_MULTI_ARCH #define GDB_MULTI_ARCH 1 @@ -45,19 +45,6 @@ struct value; struct type; struct inferior_status; -/* Get at various relevent fields of an instruction word. */ - -#define MASK_5 0x1f -#define MASK_11 0x7ff -#define MASK_14 0x3fff -#define MASK_21 0x1fffff - -/* This macro gets bit fields using HP's numbering (MSB = 0) */ -#ifndef GET_FIELD -#define GET_FIELD(X, FROM, TO) \ - ((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1)) -#endif - /* Sequence of bytes for breakpoint instruction. */ const unsigned char *hppa_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr); @@ -121,27 +108,6 @@ extern int hppa_pc_requires_run_before_use (CORE_ADDR pc); #define ARG2_REGNUM 24 /* The third argument of a callee. */ #define ARG3_REGNUM 23 /* The fourth argument of a callee. */ -/* - * Processor Status Word Masks - */ - -#define PSW_T 0x01000000 /* Taken Branch Trap Enable */ -#define PSW_H 0x00800000 /* Higher-Privilege Transfer Trap Enable */ -#define PSW_L 0x00400000 /* Lower-Privilege Transfer Trap Enable */ -#define PSW_N 0x00200000 /* PC Queue Front Instruction Nullified */ -#define PSW_X 0x00100000 /* Data Memory Break Disable */ -#define PSW_B 0x00080000 /* Taken Branch in Previous Cycle */ -#define PSW_C 0x00040000 /* Code Address Translation Enable */ -#define PSW_V 0x00020000 /* Divide Step Correction */ -#define PSW_M 0x00010000 /* High-Priority Machine Check Disable */ -#define PSW_CB 0x0000ff00 /* Carry/Borrow Bits */ -#define PSW_R 0x00000010 /* Recovery Counter Enable */ -#define PSW_Q 0x00000008 /* Interruption State Collection Enable */ -#define PSW_P 0x00000004 /* Protection ID Validation Enable */ -#define PSW_D 0x00000002 /* Data Address Translation Enable */ -#define PSW_I 0x00000001 /* External, Power Failure, Low-Priority */ - /* Machine Check Interruption Enable */ - /* When fetching register values from an inferior or a core file, clean them up using this macro. BUF is a char pointer to the raw value of the register in the registers[] array. */ @@ -185,9 +151,6 @@ extern void hppa_frame_init_saved_regs (struct frame_info *); #define INSTRUCTION_SIZE 4 -/* Non-level zero PA's have space registers (but they don't always have - floating-point, do they???? */ - /* This sequence of words is the instructions ; Call stack frame has already been built by gdb. Since we could be calling @@ -250,14 +213,6 @@ extern void hppa_frame_init_saved_regs (struct frame_info *); avoid the kernel bug. The second NOP is needed to keep the call dummy 8 byte aligned. */ -/* Define offsets into the call dummy for the target function address */ -#define FUNC_LDIL_OFFSET (INSTRUCTION_SIZE * 9) -#define FUNC_LDO_OFFSET (INSTRUCTION_SIZE * 10) - -/* Define offsets into the call dummy for the _sr4export address */ -#define SR4EXPORT_LDIL_OFFSET (INSTRUCTION_SIZE * 12) -#define SR4EXPORT_LDO_OFFSET (INSTRUCTION_SIZE * 13) - #define CALL_DUMMY {0x4BDA3FB9, 0x4BD93FB1, 0x4BD83FA9, 0x4BD73FA1,\ 0x37C13FB9, 0x24201004, 0x2C391005, 0x24311006,\ 0x2C291007, 0x22C00000, 0x36D60000, 0x02C010A4,\ @@ -352,25 +307,6 @@ struct unwind_table_entry "converts" them into normal unwind entries using some of the reserved fields to store the stub type. */ -struct stub_unwind_entry - { - /* The offset within the executable for the associated stub. */ - unsigned stub_offset; - - /* The type of stub this unwind entry describes. */ - char type; - - /* Unknown. Not needed by GDB at this time. */ - char prs_info; - - /* Length (in instructions) of the associated stub. */ - short stub_length; - }; - -/* Sizes (in bytes) of the native unwind entries. */ -#define UNWIND_ENTRY_SIZE 16 -#define STUB_UNWIND_ENTRY_SIZE 8 - /* The gaps represent linker stubs used in MPE and space for future expansion. */ enum unwind_stub_types diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h index 6d39ed0c6a4..2e5e039d7f3 100644 --- a/gdb/config/pa/tm-hppa64.h +++ b/gdb/config/pa/tm-hppa64.h @@ -35,9 +35,14 @@ struct frame_info; the conversion for hppa64 hasn't been completed yet. */ #define GDB_MULTI_ARCH 0 -/* FIXME: brobecker 2003-04-21: All the definition from this point until - the include of pa/tm-hppah.h are extracted from tm-hppa.h. They have - been temporarily moved here, until hppa64 is multiarched too. */ +/* FIXME: brobecker 2003-05-22: All the definition from this point until + the include of pa/tm-hppah.h are extracted from tm-hppa.h and tm-hppah.h. + They have been temporarily moved here, until hppa64 is multiarched too. */ + +#if !GDB_MULTI_ARCH +extern int hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name); +#define PC_IN_SIGTRAMP(pc, name) hppa_hpux_pc_in_sigtramp (pc, name) +#endif #if !GDB_MULTI_ARCH extern int hppa_reg_struct_has_addr (int gcc_p, struct type *type); @@ -278,17 +283,12 @@ extern CORE_ADDR hppa_frame_saved_pc (struct frame_info *frame); #if !GDB_MULTI_ARCH extern CORE_ADDR hppa_frame_args_address (struct frame_info *fi); -#define FRAME_ARGS_ADDRESS(fi) hppa_frame_args_address (fi) +#define DEPRECATED_FRAME_ARGS_ADDRESS(fi) hppa_frame_args_address (fi) #endif #if !GDB_MULTI_ARCH extern CORE_ADDR hppa_frame_locals_address (struct frame_info *fi); -#define FRAME_LOCALS_ADDRESS(fi) hppa_frame_locals_address (fi) -#endif - -#if !GDB_MULTI_ARCH -extern int hppa_frame_num_args (struct frame_info *frame); -#define FRAME_NUM_ARGS(fi) hppa_frame_num_args (fi) +#define DEPRECATED_FRAME_LOCALS_ADDRESS(fi) hppa_frame_locals_address (fi) #endif #if !GDB_MULTI_ARCH @@ -445,8 +445,8 @@ extern CORE_ADDR hppa_target_read_fp (void); /* We access locals from SP. This may not work for frames which call alloca; for those, we may need to consult unwind tables. jimb: FIXME. */ -#undef FRAME_LOCALS_ADDRESS -#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) +#undef DEPRECATED_FRAME_LOCALS_ADDRESS +#define DEPRECATED_FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) /* For a number of horrible reasons we may have to adjust the location of variables on the stack. Ugh. jimb: why? */ diff --git a/gdb/config/pa/tm-hppah.h b/gdb/config/pa/tm-hppah.h index 290f752d0a3..345baafb4dc 100644 --- a/gdb/config/pa/tm-hppah.h +++ b/gdb/config/pa/tm-hppah.h @@ -35,11 +35,6 @@ struct frame_info; #include "somsolib.h" #endif -#if !GDB_MULTI_ARCH -extern int hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name); -#define PC_IN_SIGTRAMP(pc, name) hppa_hpux_pc_in_sigtramp (pc, name) -#endif - extern void hppa_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi, CORE_ADDR *tmp); #define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \ diff --git a/gdb/config/powerpc/linux.mh b/gdb/config/powerpc/linux.mh index d0a2104bd89..925650dd272 100644 --- a/gdb/config/powerpc/linux.mh +++ b/gdb/config/powerpc/linux.mh @@ -6,8 +6,6 @@ XM_CLIBS= NAT_FILE= nm-linux.h NATDEPFILES= infptrace.o inftarg.o fork-child.o linux-proc.o \ ppc-linux-nat.o proc-service.o thread-db.o lin-lwp.o \ - gcore.o + gcore.o linux-nat.o LOADLIBES = -ldl -rdynamic - -GDBSERVER_DEPFILES = linux-low.o linux-ppc-low.o reg-ppc.o diff --git a/gdb/config/powerpc/ppc64-linux.mh b/gdb/config/powerpc/ppc64-linux.mh index dd815863f64..c7a69ea073c 100644 --- a/gdb/config/powerpc/ppc64-linux.mh +++ b/gdb/config/powerpc/ppc64-linux.mh @@ -6,7 +6,7 @@ XM_CLIBS= NAT_FILE= nm-ppc64-linux.h NATDEPFILES= infptrace.o inftarg.o fork-child.o linux-proc.o \ ppc-linux-nat.o proc-service.o thread-db.o lin-lwp.o \ - gcore.o linux-nat.o + gcore.o # The PowerPC has severe limitations on TOC size, and uses them even # for non-PIC code. GDB overflows those tables when compiling with diff --git a/gdb/config/powerpc/tm-linux.h b/gdb/config/powerpc/tm-linux.h index d69dfc1f5bf..34d95cadca4 100644 --- a/gdb/config/powerpc/tm-linux.h +++ b/gdb/config/powerpc/tm-linux.h @@ -26,6 +26,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #undef SKIP_TRAMPOLINE_CODE #include "config/tm-linux.h" +/* We've multi-arched these. (Note that this completely undoes the + effect of config/tm-linux.h #including config/tm-sysv4.h.) */ +#undef IN_SOLIB_CALL_TRAMPOLINE +#undef SKIP_TRAMPOLINE_CODE + /* We can single step on linux */ #undef SOFTWARE_SINGLE_STEP #define SOFTWARE_SINGLE_STEP(p,q) internal_error (__FILE__, __LINE__, "Will never execute!") @@ -43,10 +48,6 @@ extern int at_subroutine_call_instruction_target(); in symfile.c) */ #undef IBM6000_TARGET -extern CORE_ADDR ppc_linux_skip_trampoline_code (CORE_ADDR pc); -#undef SKIP_TRAMPOLINE_CODE -#define SKIP_TRAMPOLINE_CODE(pc) ppc_linux_skip_trampoline_code (pc) - extern int ppc_linux_in_sigtramp (CORE_ADDR pc, char *func_name); #undef IN_SIGTRAMP #define IN_SIGTRAMP(pc,func_name) ppc_linux_in_sigtramp (pc,func_name) diff --git a/gdb/config/s390/s390.mh b/gdb/config/s390/s390.mh index 300a5e3c1ce..ab3350fdb47 100644 --- a/gdb/config/s390/s390.mh +++ b/gdb/config/s390/s390.mh @@ -6,7 +6,7 @@ XM_CLIBS= NAT_FILE= nm-linux.h NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o s390-nat.o \ core-aout.o core-regset.o linux-proc.o gcore.o thread-db.o lin-lwp.o \ - proc-service.o + proc-service.o linux-nat.o LOADLIBES = -ldl -rdynamic diff --git a/gdb/config/s390/tm-linux.h b/gdb/config/s390/tm-linux.h index c1b4a294ad8..7b406e0dc0a 100644 --- a/gdb/config/s390/tm-linux.h +++ b/gdb/config/s390/tm-linux.h @@ -24,9 +24,7 @@ #ifndef TM_LINUX_H #define TM_LINUX_H -#ifdef GDBSERVER -#define S390_GNULINUX_TARGET -#endif /* GDBSERVER */ + #undef TARGET_ELF64 #define TARGET_ELF64 (gdbarch_tdep (current_gdbarch)->intreg_size==8) diff --git a/gdb/config/s390/tm-s390.h b/gdb/config/s390/tm-s390.h index c8a6e8d0323..d36c2798f4f 100644 --- a/gdb/config/s390/tm-s390.h +++ b/gdb/config/s390/tm-s390.h @@ -73,43 +73,6 @@ #define S390X_REGISTER_BYTES ((8+8)+(8*S390_NUM_GPRS)+(4*S390_NUM_ACRS)+ \ (8*S390_NUM_CRS)+(S390_FPC_SIZE+S390_FPC_PAD_SIZE)+(S390_FPR_SIZE*S390_NUM_FPRS)) -#ifdef GDBSERVER - -int s390_register_byte (int reg_nr); -#define REGISTER_BYTE(reg_nr) s390_register_byte(reg_nr) -#define PC_REGNUM S390_PC_REGNUM -#define NUM_REGS S390_NUM_REGS -#define NUM_FREGS S390_NUM_FPRS -#define DEPRECATED_FP_REGNUM S390_FP_REGNUM -#define SP_REGNUM S390_SP_REGNUM -/* Obviously ptrace for user program tracing cannot be allowed - mess with control registers (except per registers for hardware watchpoints), - when we add kernel debugging we may need to alter these macros. */ -int s390_cannot_fetch_register (int regno); -#define CANNOT_FETCH_REGISTER(regno) s390_cannot_fetch_register(regno) -#define CANNOT_STORE_REGISTER(regno) s390_cannot_fetch_register(regno) - -#if CONFIG_ARCH_S390X - -int s390x_register_raw_size (int reg_nr); -#define REGISTER_RAW_SIZE(reg_nr) s390x_register_raw_size(reg_nr) -#define GDB_TARGET_IS_ESAME (1) -#define DEPRECATED_REGISTER_SIZE (8) -#define DEPRECATED_REGISTER_BYTES S390X_REGISTER_BYTES - -#else /* CONFIG_ARCH_S390X */ - -int s390_register_raw_size (int reg_nr); -#define REGISTER_RAW_SIZE(reg_nr) s390_register_raw_size(reg_nr) -#define GDB_TARGET_IS_ESAME (0) -#define DEPRECATED_REGISTER_SIZE (4) -#define DEPRECATED_REGISTER_BYTES S390_REGISTER_BYTES - -#endif /* CONFIG_ARCH_S390X */ - -#else /* GDBSERVER */ - #define GDB_TARGET_IS_ESAME (TARGET_ARCHITECTURE->mach == bfd_mach_s390_64) -#endif /* GDBSERVER */ #endif /* ifndef TM_S390_H */ diff --git a/gdb/config/sh/linux.mt b/gdb/config/sh/linux.mt index ea8460cdee9..8f217cccb21 100644 --- a/gdb/config/sh/linux.mt +++ b/gdb/config/sh/linux.mt @@ -4,5 +4,3 @@ TM_FILE= tm-linux.h SIM_OBS = remote-sim.o SIM = ../sim/sh/libsim.a - -GDBSERVER_DEPFILES = linux-low.o linux-sh-low.o reg-sh.o diff --git a/gdb/config/sh/tm-sh.h b/gdb/config/sh/tm-sh.h index 6ae6085d9b7..dfd96c139dd 100644 --- a/gdb/config/sh/tm-sh.h +++ b/gdb/config/sh/tm-sh.h @@ -27,7 +27,7 @@ #define REGISTER_TYPE long /* used in standalone.c */ -#define BIG_REMOTE_BREAKPOINT { 0xc3, 0x20 } /* Used in remote.c */ -#define LITTLE_REMOTE_BREAKPOINT { 0x20, 0xc3 } /* Used in remote.c */ +#define DEPRECATED_BIG_REMOTE_BREAKPOINT { 0xc3, 0x20 } /* Used in remote.c */ +#define DEPRECATED_LITTLE_REMOTE_BREAKPOINT { 0x20, 0xc3 } /* Used in remote.c */ /*#define NOP {0x20, 0x0b}*/ /* Who uses this???*/ diff --git a/gdb/config/sparc/linux.mh b/gdb/config/sparc/linux.mh index 4a2c41f38c4..f36dbb1ae34 100644 --- a/gdb/config/sparc/linux.mh +++ b/gdb/config/sparc/linux.mh @@ -5,7 +5,7 @@ XM_FILE= xm-linux.h NAT_FILE= nm-linux.h NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o sparc-nat.o \ proc-service.o thread-db.o lin-lwp.o sparc-linux-nat.o \ - linux-proc.o gcore.o + linux-proc.o gcore.o linux-nat.o # The dynamically loaded libthread_db needs access to symbols in the # gdb executable. diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index ab18477fab9..64ce5c72cbd 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -267,18 +267,17 @@ extern CORE_ADDR sparc_skip_prologue (CORE_ADDR); /* Write into appropriate registers a function return value of type TYPE, given in virtual format. */ -#define DEPRECATED_STORE_RETURN_VALUE(TYPE, VALBUF) \ - sparc_store_return_value (TYPE, VALBUF) -extern void sparc_store_return_value (struct type *, char *); +#define STORE_RETURN_VALUE(TYPE, REGCACHE, VALBUF) \ + sparc32_store_return_value (TYPE, REGCACHE, VALBUF) +extern void sparc32_store_return_value (struct type *, struct regcache *, + const void *); -/* 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). */ +/* Extract from REGCACHE the address in which a function should return + its structure value. */ -#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ - sparc_extract_struct_value_address (REGBUF) - -extern CORE_ADDR sparc_extract_struct_value_address (char *); +#define EXTRACT_STRUCT_VALUE_ADDRESS(REGCACHE) \ + sparc_extract_struct_value_address (REGCACHE) +extern CORE_ADDR sparc_extract_struct_value_address (struct regcache *); /* Stack must be aligned on 64-bit boundaries when synthesizing function calls (128-bit for sparc64). */ @@ -442,17 +441,13 @@ extern CORE_ADDR sparc_frame_chain (struct frame_info *); extern CORE_ADDR sparc_frame_saved_pc (struct frame_info *); /* If the argument is on the stack, it will be here. */ -#define FRAME_ARGS_ADDRESS(FI) (get_frame_base (FI)) +#define DEPRECATED_FRAME_ARGS_ADDRESS(FI) (get_frame_base (FI)) -#define FRAME_LOCALS_ADDRESS(FI) (get_frame_base (FI)) +#define DEPRECATED_FRAME_LOCALS_ADDRESS(FI) (get_frame_base (FI)) /* Set VAL to the number of args passed to frame described by FI. Can set VAL to -1, meaning no way to tell. */ -/* We can't tell how many args there are - now that the C compiler delays popping them. */ -#define FRAME_NUM_ARGS(FI) (-1) - /* Return number of bytes at start of arglist that are not really args. */ #define FRAME_ARGS_SKIP 68 @@ -668,9 +663,10 @@ extern CORE_ADDR sparc32_push_arguments (int, struct value **, CORE_ADDR, int, function return value of type TYPE, and copy that, in virtual format, into VALBUF. */ -#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \ - sparc32_extract_return_value (TYPE, REGBUF, VALBUF) -extern void sparc32_extract_return_value (struct type *, char[], char *); +#define EXTRACT_RETURN_VALUE(TYPE, REGCACHE, VALBUF) \ + sparc32_extract_return_value (TYPE, REGCACHE, VALBUF) +extern void sparc32_extract_return_value (struct type *, struct regcache *, + void *valbuf); #endif /* GDB_MULTI_ARCH */ diff --git a/gdb/config/vax/tm-vax.h b/gdb/config/vax/tm-vax.h index 22e60a09fda..f1ed146fe8e 100644 --- a/gdb/config/vax/tm-vax.h +++ b/gdb/config/vax/tm-vax.h @@ -24,8 +24,4 @@ #define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL -/* XXXJRT not yet under gdbarch control */ -#define FRAME_ARGS_ADDRESS_CORRECT(fi) vax_frame_args_address_correct ((fi)) -extern CORE_ADDR vax_frame_args_address_correct (struct frame_info *); - #endif /* TM_VAX_H */ diff --git a/gdb/configure b/gdb/configure index 207381adefb..e27294cf577 100755 --- a/gdb/configure +++ b/gdb/configure @@ -5304,17 +5304,74 @@ fi done +# ------------------------- # +# Checks for declarations. # +# ------------------------- # + +for ac_func in getopt +do + ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6 +echo "configure:5316: checking whether $ac_func is declared" >&5 +if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "gcc_cv_have_decl_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "gcc_cv_have_decl_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <&6 ; cat >> confdefs.h <> confdefs.h <<\EOF +#define HAVE_DECL_GETOPT 1 +EOF +fi + + # ------------------ # # Checks for types. # # ------------------ # echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:5313: checking return type of signal handlers" >&5 +echo "configure:5370: 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 < #include @@ -5331,7 +5388,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:5335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -5355,12 +5412,12 @@ EOF # ------------------------------------- # echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:5359: checking for working const" >&5 +echo "configure:5416: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -5430,21 +5487,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:5434: checking for inline" >&5 +echo "configure:5491: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -5477,19 +5534,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:5481: checking for working alloca.h" >&5 +echo "configure:5538: 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 < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:5493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5550: \"$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 @@ -5510,12 +5567,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:5514: checking for alloca" >&5 +echo "configure:5571: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5604: \"$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 @@ -5575,12 +5632,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:5579: checking whether alloca needs Cray hooks" >&5 +echo "configure:5636: 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 <&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:5609: checking for $ac_func" >&5 +echo "configure:5666: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5694: \"$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 @@ -5660,7 +5717,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:5664: checking stack direction for C alloca" >&5 +echo "configure:5721: 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 @@ -5668,7 +5725,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5748: \"$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 @@ -5712,17 +5769,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:5716: checking for $ac_hdr" >&5 +echo "configure:5773: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5783: \"$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* @@ -5751,12 +5808,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5755: checking for $ac_func" >&5 +echo "configure:5812: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5840: \"$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 @@ -5804,7 +5861,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:5808: checking for working mmap" >&5 +echo "configure:5865: 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 @@ -5812,7 +5869,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6013: \"$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 @@ -5975,12 +6032,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:5979: checking for pid_t" >&5 +echo "configure:6036: 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 < #if STDC_HEADERS @@ -6009,17 +6066,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:6013: checking for vfork.h" >&5 +echo "configure:6070: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6080: \"$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* @@ -6044,18 +6101,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:6048: checking for working vfork" >&5 +echo "configure:6105: 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:6054: checking for vfork" >&5 +echo "configure:6111: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6139: \"$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 @@ -6100,7 +6157,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -6195,7 +6252,7 @@ main() { } } EOF -if { (eval echo configure:6199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6256: \"$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 @@ -6220,12 +6277,12 @@ fi for ac_func in canonicalize_file_name realpath do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6224: checking for $ac_func" >&5 +echo "configure:6281: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6309: \"$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 @@ -6275,12 +6332,12 @@ done for ac_func in poll do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6279: checking for $ac_func" >&5 +echo "configure:6336: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6364: \"$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 @@ -6330,12 +6387,12 @@ done for ac_func in pread64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6334: checking for $ac_func" >&5 +echo "configure:6391: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6419: \"$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 @@ -6385,12 +6442,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6389: checking for $ac_func" >&5 +echo "configure:6446: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6474: \"$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 @@ -6440,12 +6497,12 @@ done for ac_func in setpgid setpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6444: checking for $ac_func" >&5 +echo "configure:6501: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6529: \"$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 @@ -6495,12 +6552,12 @@ done for ac_func in sigaction sigprocmask sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6499: checking for $ac_func" >&5 +echo "configure:6556: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6584: \"$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 @@ -6550,12 +6607,12 @@ done for ac_func in socketpair do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6554: checking for $ac_func" >&5 +echo "configure:6611: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6639: \"$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 <&6 +fi +done + +for ac_func in syscall +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:6666: 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 < +/* 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:6694: \"$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 @@ -6605,7 +6717,7 @@ done if test "$cross_compiling" = no; then echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:6609: checking whether setpgrp takes no argument" >&5 +echo "configure:6721: 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 @@ -6613,7 +6725,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6749: \"$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 @@ -6658,12 +6770,12 @@ fi else echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:6662: checking whether setpgrp takes no argument" >&5 +echo "configure:6774: 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 < @@ -6677,7 +6789,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_func_setpgrp_void=no else @@ -6701,12 +6813,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:6705: checking for sigsetjmp" >&5 +echo "configure:6817: 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 < @@ -6715,7 +6827,7 @@ int main() { sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1); ; return 0; } EOF -if { (eval echo configure:6719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_func_sigsetjmp=yes else @@ -6741,12 +6853,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:6745: checking for GNU regex" >&5 +echo "configure:6857: 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 < int main() { @@ -6756,7 +6868,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:6760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_gnu_regex=yes else @@ -6791,19 +6903,19 @@ fi # See if 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:6795: checking for r_fs in struct reg" >&5 +echo "configure:6907: 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 < int main() { struct reg r; r.r_fs; ; return 0; } EOF -if { (eval echo configure:6807: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_fs=yes else @@ -6823,19 +6935,19 @@ EOF fi echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6 -echo "configure:6827: checking for r_gs in struct reg" >&5 +echo "configure:6939: 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 < int main() { struct reg r; r.r_gs; ; return 0; } EOF -if { (eval echo configure:6839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_gs=yes else @@ -6857,19 +6969,19 @@ fi # See if provides the PTRACE_GETREGS request. echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6 -echo "configure:6861: checking for PTRACE_GETREGS" >&5 +echo "configure:6973: 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 < int main() { PTRACE_GETREGS; ; return 0; } EOF -if { (eval echo configure:6873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getregs=yes else @@ -6891,19 +7003,19 @@ fi # See if provides the PTRACE_GETFPXREGS request. echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6 -echo "configure:6895: checking for PTRACE_GETFPXREGS" >&5 +echo "configure:7007: 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 < int main() { PTRACE_GETFPXREGS; ; return 0; } EOF -if { (eval echo configure:6907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getfpxregs=yes else @@ -6925,12 +7037,12 @@ fi # See if provides the PT_GETDBREGS request. echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6 -echo "configure:6929: checking for PT_GETDBREGS" >&5 +echo "configure:7041: 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 < #include @@ -6938,7 +7050,7 @@ int main() { PT_GETDBREGS; ; return 0; } EOF -if { (eval echo configure:6942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getdbregs=yes else @@ -6960,12 +7072,12 @@ fi # See if provides the PT_GETXMMREGS request. echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6 -echo "configure:6964: checking for PT_GETXMMREGS" >&5 +echo "configure:7076: 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 < #include @@ -6973,7 +7085,7 @@ int main() { PT_GETXMMREGS; ; return 0; } EOF -if { (eval echo configure:6977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getxmmregs=yes else @@ -6996,19 +7108,19 @@ 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 +echo "configure:7112: 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 < int main() { uintptr_t foo = 0; ; return 0; } EOF -if { (eval echo configure:7012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7124: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_uintptr_t=yes else @@ -7030,12 +7142,12 @@ EOF fi echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:7034: checking whether malloc must be declared" >&5 +echo "configure:7146: 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 < @@ -7056,7 +7168,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:7060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -7077,12 +7189,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:7081: checking whether realloc must be declared" >&5 +echo "configure:7193: 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 < @@ -7103,7 +7215,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:7107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -7124,12 +7236,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:7128: checking whether free must be declared" >&5 +echo "configure:7240: 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 < @@ -7150,7 +7262,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:7154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -7171,12 +7283,12 @@ EOF fi echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6 -echo "configure:7175: checking whether strerror must be declared" >&5 +echo "configure:7287: 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 < @@ -7197,7 +7309,7 @@ int main() { char *(*pfn) = (char *(*)) strerror ; return 0; } EOF -if { (eval echo configure:7201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strerror=no else @@ -7218,12 +7330,12 @@ EOF fi echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6 -echo "configure:7222: checking whether strdup must be declared" >&5 +echo "configure:7334: 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 < @@ -7244,7 +7356,7 @@ int main() { char *(*pfn) = (char *(*)) strdup ; return 0; } EOF -if { (eval echo configure:7248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strdup=no else @@ -7265,12 +7377,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:7269: checking whether strstr must be declared" >&5 +echo "configure:7381: 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 < @@ -7291,7 +7403,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:7295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -7312,12 +7424,12 @@ EOF fi echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6 -echo "configure:7316: checking whether canonicalize_file_name must be declared" >&5 +echo "configure:7428: 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 < @@ -7338,7 +7450,7 @@ int main() { char *(*pfn) = (char *(*)) canonicalize_file_name ; return 0; } EOF -if { (eval echo configure:7342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_canonicalize_file_name=no else @@ -7364,9 +7476,9 @@ fi # could be expunged. --jsm 1999-03-22 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6 -echo "configure:7368: checking for HPUX save_state structure" >&5 +echo "configure:7480: checking for HPUX save_state structure" >&5 cat > conftest.$ac_ext < EOF @@ -7381,7 +7493,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -7451,12 +7563,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:7455: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:7567: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -7487,12 +7599,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:7491: checking for prrun_t in sys/procfs.h" >&5 +echo "configure:7603: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prrun_t=yes else @@ -7523,12 +7635,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:7527: checking for gregset_t in sys/procfs.h" >&5 +echo "configure:7639: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_gregset_t=yes else @@ -7559,12 +7671,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:7563: checking for fpregset_t in sys/procfs.h" >&5 +echo "configure:7675: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_fpregset_t=yes else @@ -7595,12 +7707,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:7599: checking for prgregset_t in sys/procfs.h" >&5 +echo "configure:7711: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset_t=yes else @@ -7631,12 +7743,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:7635: checking for prfpregset_t in sys/procfs.h" >&5 +echo "configure:7747: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset_t=yes else @@ -7667,12 +7779,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:7671: checking for prgregset32_t in sys/procfs.h" >&5 +echo "configure:7783: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset32_t=yes else @@ -7703,12 +7815,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:7707: checking for prfpregset32_t in sys/procfs.h" >&5 +echo "configure:7819: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset32_t=yes else @@ -7739,12 +7851,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:7743: checking for lwpid_t in sys/procfs.h" >&5 +echo "configure:7855: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpid_t=yes else @@ -7775,12 +7887,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:7779: checking for psaddr_t in sys/procfs.h" >&5 +echo "configure:7891: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psaddr_t=yes else @@ -7811,12 +7923,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:7815: checking for prsysent_t in sys/procfs.h" >&5 +echo "configure:7927: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prsysent_t=yes else @@ -7847,12 +7959,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:7851: checking for pr_sigset_t in sys/procfs.h" >&5 +echo "configure:7963: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigset_t=yes else @@ -7883,12 +7995,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:7887: checking for pr_sigaction64_t in sys/procfs.h" >&5 +echo "configure:7999: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes else @@ -7919,12 +8031,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:7923: checking for pr_siginfo64_t in sys/procfs.h" >&5 +echo "configure:8035: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes else @@ -7960,7 +8072,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:7964: checking whether prfpregset_t type is broken" >&5 +echo "configure:8076: 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 @@ -7968,7 +8080,7 @@ else gdb_cv_prfpregset_t_broken=yes else cat > conftest.$ac_ext < int main () @@ -7978,7 +8090,7 @@ else return 0; } EOF -if { (eval echo configure:7982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8094: \"$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 @@ -8003,12 +8115,12 @@ EOF echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8007: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 +echo "configure:8119: 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 < #include @@ -8021,7 +8133,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:8025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_procfs_piocset=yes else @@ -8045,19 +8157,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:8049: checking for member l_addr in struct link_map" >&5 +echo "configure:8161: 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 < int main() { struct link_map lm; (void) lm.l_addr; ; return 0; } EOF -if { (eval echo configure:8061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_l_members=yes else @@ -8079,12 +8191,12 @@ EOF echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:8083: checking for member lm_addr in struct link_map" >&5 +echo "configure:8195: 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 < #include @@ -8092,7 +8204,7 @@ int main() { struct link_map lm; (void) lm.lm_addr; ; return 0; } EOF -if { (eval echo configure:8096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_lm_members=yes else @@ -8114,12 +8226,12 @@ EOF echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6 -echo "configure:8118: checking for member som_addr in struct so_map" >&5 +echo "configure:8230: 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 < #ifdef HAVE_NLIST_H @@ -8130,7 +8242,7 @@ int main() { struct so_map lm; (void) lm.som_addr; ; return 0; } EOF -if { (eval echo configure:8134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_so_map_with_som_members=yes else @@ -8152,12 +8264,12 @@ EOF echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6 -echo "configure:8156: checking for struct link_map32 in sys/link.h" >&5 +echo "configure:8268: 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 < @@ -8165,7 +8277,7 @@ int main() { struct link_map32 l; ; return 0; } EOF -if { (eval echo configure:8169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map32=yes else @@ -8192,12 +8304,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:8196: checking for long long support in compiler" >&5 +echo "configure:8308: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -8229,7 +8341,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:8233: checking for long long support in printf" >&5 +echo "configure:8345: 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 @@ -8237,7 +8349,7 @@ else gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8367: \"$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 @@ -8275,19 +8387,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:8279: checking for long double support in compiler" >&5 +echo "configure:8391: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -8309,7 +8421,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:8313: checking for long double support in printf" >&5 +echo "configure:8425: 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 @@ -8317,7 +8429,7 @@ else gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8443: \"$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 @@ -8351,7 +8463,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:8355: checking for long double support in scanf" >&5 +echo "configure:8467: 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 @@ -8359,7 +8471,7 @@ else gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext < 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:8373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8485: \"$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 @@ -8394,7 +8506,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:8398: checking for -bbigtoc option" >&5 +echo "configure:8510: checking for -bbigtoc option" >&5 if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8408,14 +8520,14 @@ else LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -8438,7 +8550,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:8442: checking for HPUX/OSF thread support" >&5 +echo "configure:8554: 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 @@ -8461,7 +8573,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:8465: checking for Solaris thread debugging library" >&5 +echo "configure:8577: 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 @@ -8471,7 +8583,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:8475: checking for dlopen in -ldl" >&5 +echo "configure:8587: 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 @@ -8479,7 +8591,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8606: \"$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 @@ -8522,17 +8634,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:8526: checking for the ld -export-dynamic flag" >&5 +echo "configure:8638: checking for the ld -export-dynamic flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -8551,13 +8663,13 @@ rm -f conftest* # Sun randomly tweaked the prototypes in # at one point. echo $ac_n "checking if is old""... $ac_c" 1>&6 -echo "configure:8555: checking if is old" >&5 +echo "configure:8667: checking if 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 < @@ -8568,7 +8680,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:8572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_proc_service_is_old=no else @@ -8594,12 +8706,12 @@ EOF ;; aix*) echo $ac_n "checking for AiX thread debugging library""... $ac_c" 1>&6 -echo "configure:8598: checking for AiX thread debugging library" >&5 +echo "configure:8710: 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 < int main() { @@ -8608,7 +8720,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:8612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_aix_thread_debug=yes else @@ -8633,19 +8745,19 @@ fi if test "x$ac_cv_header_thread_db_h" = "xyes"; then echo $ac_n "checking whether has TD_NOTALLOC""... $ac_c" 1>&6 -echo "configure:8637: checking whether has TD_NOTALLOC" >&5 +echo "configure:8749: checking whether 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 < int main() { int i = TD_NOTALLOC; ; return 0; } EOF -if { (eval echo configure:8649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_thread_db_h_has_td_notalloc=yes else @@ -8668,6 +8780,43 @@ EOF fi +if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then + echo $ac_n "checking whether has __NR_tkill""... $ac_c" 1>&6 +echo "configure:8786: checking whether has __NR_tkill" >&5 +if eval "test \"`echo '$''{'gdb_cv_sys_syscall_h_has_tkill'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +int i = __NR_tkill; +; return 0; } +EOF +if { (eval echo configure:8798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gdb_cv_sys_syscall_h_has_tkill=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gdb_cv_sys_syscall_h_has_tkill=no + +fi +rm -f conftest* + +fi + +echo "$ac_t""$gdb_cv_sys_syscall_h_has_tkill" 1>&6 +fi +if test "x$gdb_cv_sys_syscall_h_has_tkill" = "xyes" && test "x$ac_cv_func_syscall" = "xyes"; then + cat >> confdefs.h <<\EOF +#define HAVE_TKILL_SYSCALL 1 +EOF + +fi + # Check whether --with-sysroot or --without-sysroot was given. if test "${with_sysroot+set}" = set; then @@ -8756,7 +8905,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:8760: checking compiler warning flags" >&5 +echo "configure:8909: 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 @@ -8766,14 +8915,14 @@ echo "configure:8760: checking compiler warning flags" >&5 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $w" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* WARN_CFLAGS="${WARN_CFLAGS} $w" else @@ -8821,12 +8970,12 @@ fi # In the Cygwin environment, we need some additional flags. echo $ac_n "checking for cygwin""... $ac_c" 1>&6 -echo "configure:8825: checking for cygwin" >&5 +echo "configure:8974: 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 <&6 -echo "configure:8908: checking for Tcl configuration" >&5 +echo "configure:9057: 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 @@ -9013,7 +9162,7 @@ if test "${with_tkconfig+set}" = set; then fi echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6 -echo "configure:9017: checking for Tk configuration" >&5 +echo "configure:9166: 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 @@ -9122,7 +9271,7 @@ fi no_tcl=true echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6 -echo "configure:9126: checking for Tcl private headers. dir=${configdir}" >&5 +echo "configure:9275: 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" @@ -9188,17 +9337,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:9192: checking for tclInt.h" >&5 +echo "configure:9341: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9351: \"$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* @@ -9258,7 +9407,7 @@ fi # no_tk=true echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6 -echo "configure:9262: checking for Tk private headers" >&5 +echo "configure:9411: 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" @@ -9324,17 +9473,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:9328: checking for tk.h" >&5 +echo "configure:9477: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9338: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9487: \"$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* @@ -9380,7 +9529,7 @@ fi echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:9384: checking for Itcl private headers. srcdir=${srcdir}" >&5 +echo "configure:9533: 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 @@ -9403,7 +9552,7 @@ fi echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:9407: checking for Itk private headers. srcdir=${srcdir}" >&5 +echo "configure:9556: 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 @@ -9458,7 +9607,7 @@ if test "${with_itclconfig+set}" = set; then fi echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6 -echo "configure:9462: checking for Itcl configuration" >&5 +echo "configure:9611: 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 @@ -9561,7 +9710,7 @@ if test "${with_itkconfig+set}" = set; then fi echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6 -echo "configure:9565: checking for Itk configuration" >&5 +echo "configure:9714: 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 @@ -9704,7 +9853,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:9708: checking for X" >&5 +echo "configure:9857: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -9766,12 +9915,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9924: \"$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* @@ -9840,14 +9989,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10000: \"$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. @@ -10095,7 +10244,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:10099: checking whether gdbserver is supported on this host" >&5 +echo "configure:10248: 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 @@ -10159,12 +10308,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:10163: checking for Cygwin environment" >&5 +echo "configure:10312: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -10192,19 +10341,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:10196: checking for mingw32 environment" >&5 +echo "configure:10345: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -10223,7 +10372,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:10227: checking for executable suffix" >&5 +echo "configure:10376: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10233,7 +10382,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:10237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:10386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -10275,7 +10424,7 @@ fi echo $ac_n "checking for iconv""... $ac_c" 1>&6 -echo "configure:10279: checking for iconv" >&5 +echo "configure:10428: checking for iconv" >&5 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10283,7 +10432,7 @@ else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat > conftest.$ac_ext < #include @@ -10293,7 +10442,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:10297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_func_iconv=yes else @@ -10305,7 +10454,7 @@ rm -f conftest* am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" cat > conftest.$ac_ext < #include @@ -10315,7 +10464,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:10319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10468: \"$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 @@ -10336,13 +10485,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6 EOF echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6 -echo "configure:10340: checking for iconv declaration" >&5 +echo "configure:10489: 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 < @@ -10361,7 +10510,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:10365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_proto_iconv_arg1="" else diff --git a/gdb/configure.host b/gdb/configure.host index 8f96b0a842c..0c88533f785 100644 --- a/gdb/configure.host +++ b/gdb/configure.host @@ -13,7 +13,7 @@ case "${host_cpu}" in alpha*) gdb_host_cpu=alpha ;; arm*) gdb_host_cpu=arm ;; hppa*) gdb_host_cpu=pa ;; -i[3456]86*) gdb_host_cpu=i386 ;; +i[34567]86*) gdb_host_cpu=i386 ;; m68*) gdb_host_cpu=m68k ;; mips*) gdb_host_cpu=mips ;; powerpc*) gdb_host_cpu=powerpc ;; @@ -48,34 +48,34 @@ hppa*-*-hpux11*) gdb_host=hpux11 ;; hppa*-*-hpux*) gdb_host=hppahpux ;; # OBSOLETE hppa*-*-osf*) gdb_host=hppaosf ;; -i[3456]86-ncr-*) gdb_host=ncr3000 ;; +i[34567]86-ncr-*) gdb_host=ncr3000 ;; # OBSOLETE i[3456]86-sequent-bsd*) gdb_host=symmetry ;; # dynix # OBSOLETE i[3456]86-sequent-sysv4*) gdb_host=ptx4 ;; # OBSOLETE i[3456]86-sequent-sysv*) gdb_host=ptx ;; -i[3456]86-*-bsd*) gdb_host=i386bsd ;; -i[3456]86-*-dgux*) gdb_host=i386v4 ;; -i[3456]86-*-freebsd*) gdb_host=fbsd ;; -i[3456]86-*-netbsdelf*) gdb_host=nbsdelf ;; -i[3456]86-*-netbsdaout*) gdb_host=nbsdaout ;; -i[3456]86-*-netbsd*) gdb_host=nbsdaout ;; -i[3456]86-*-go32*) gdb_host=go32 ;; -i[3456]86-*-msdosdjgpp*) gdb_host=go32 ;; -i[3456]86-*-linux*) gdb_host=linux ;; -i[3456]86-*-lynxos*) gdb_host=i386lynx ;; -i[3456]86-*-gnu*) gdb_host=i386gnu ;; -i[3456]86-*-openbsd*) gdb_host=obsd ;; -i[3456]86-*-sco3.2v5*) gdb_host=i386sco5 ;; -i[3456]86-*-sco3.2v4*) gdb_host=i386sco4 ;; -i[3456]86-*-sco*) gdb_host=i386sco ;; -i[3456]86-*-solaris*) gdb_host=i386sol2 ;; -i[3456]86-*-sysv4.2*) gdb_host=i386v42mp ;; -i[3456]86-*-sysv4*) gdb_host=i386v4 ;; -i[3456]86-*-sysv5*) gdb_host=i386v42mp ;; -i[3456]86-*-unixware2*) gdb_host=i386v42mp ;; -i[3456]86-*-unixware*) gdb_host=i386v4 ;; -i[3456]86-*-sysv*) gdb_host=i386v ;; -i[3456]86-*-isc*) gdb_host=i386v ;; -i[3456]86-*-cygwin*) gdb_host=cygwin ;; +i[34567]86-*-bsd*) gdb_host=i386bsd ;; +i[34567]86-*-dgux*) gdb_host=i386v4 ;; +i[34567]86-*-freebsd*) gdb_host=fbsd ;; +i[34567]86-*-netbsdelf*) gdb_host=nbsdelf ;; +i[34567]86-*-netbsdaout*) gdb_host=nbsdaout ;; +i[34567]86-*-netbsd*) gdb_host=nbsdaout ;; +i[34567]86-*-go32*) gdb_host=go32 ;; +i[34567]86-*-msdosdjgpp*) gdb_host=go32 ;; +i[34567]86-*-linux*) gdb_host=linux ;; +i[34567]86-*-lynxos*) gdb_host=i386lynx ;; +i[34567]86-*-gnu*) gdb_host=i386gnu ;; +i[34567]86-*-openbsd*) gdb_host=obsd ;; +i[34567]86-*-sco3.2v5*) gdb_host=i386sco5 ;; +i[34567]86-*-sco3.2v4*) gdb_host=i386sco4 ;; +i[34567]86-*-sco*) gdb_host=i386sco ;; +i[34567]86-*-solaris*) gdb_host=i386sol2 ;; +i[34567]86-*-sysv4.2*) gdb_host=i386v42mp ;; +i[34567]86-*-sysv4*) gdb_host=i386v4 ;; +i[34567]86-*-sysv5*) gdb_host=i386v42mp ;; +i[34567]86-*-unixware2*) gdb_host=i386v42mp ;; +i[34567]86-*-unixware*) gdb_host=i386v4 ;; +i[34567]86-*-sysv*) gdb_host=i386v ;; +i[34567]86-*-isc*) gdb_host=i386v ;; +i[34567]86-*-cygwin*) gdb_host=cygwin ;; ia64-*-aix*) gdb_host=aix ;; ia64-*-linux*) gdb_host=linux ;; @@ -120,6 +120,8 @@ powerpc-*-aix*) gdb_host=aix432 ;; powerpc-*-linux*) gdb_host=linux ;; powerpc-*-netbsd*) gdb_host=nbsd ;; +powerpc64-*-linux*) gdb_host=ppc64-linux ;; + rs6000-*-lynxos*) gdb_host=rs6000lynx ;; rs6000-*-aix4*) gdb_host=aix4 ;; rs6000-*-*) gdb_host=rs6000 ;; diff --git a/gdb/configure.in b/gdb/configure.in index 07aab351423..38792e03396 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -357,6 +357,12 @@ AC_CHECK_HEADERS(curses.h ncurses.h term.h) # unconditionally, so what's the point in checking these? AC_CHECK_HEADERS(ctype.h time.h) +# ------------------------- # +# Checks for declarations. # +# ------------------------- # + +gcc_AC_CHECK_DECLS(getopt) + # ------------------ # # Checks for types. # # ------------------ # @@ -384,6 +390,7 @@ AC_CHECK_FUNCS(sbrk) AC_CHECK_FUNCS(setpgid setpgrp) AC_CHECK_FUNCS(sigaction sigprocmask sigsetmask) AC_CHECK_FUNCS(socketpair) +AC_CHECK_FUNCS(syscall) dnl AC_FUNC_SETPGRP does not work when cross compiling dnl Instead, assume we will have a prototype for setpgrp if cross compiling. @@ -911,6 +918,24 @@ if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then [Define if has the TD_NOTALLOC error code.]) fi +dnl See if we have a sys/syscall header file that has __NR_tkill. +if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then + AC_CACHE_CHECK([whether has __NR_tkill], + gdb_cv_sys_syscall_h_has_tkill, + AC_TRY_COMPILE( + [#include ], + [int i = __NR_tkill;], + gdb_cv_sys_syscall_h_has_tkill=yes, + gdb_cv_sys_syscall_h_has_tkill=no + ) + ) +fi +dnl See if we can issue tkill syscall. +if test "x$gdb_cv_sys_syscall_h_has_tkill" = "xyes" && test "x$ac_cv_func_syscall" = "xyes"; then + AC_DEFINE(HAVE_TKILL_SYSCALL, 1, + [Define if we can use the tkill syscall.]) +fi + dnl Handle optional features that can be enabled. AC_ARG_WITH(sysroot, diff --git a/gdb/configure.tgt b/gdb/configure.tgt index fe4cc5d4856..21945c5f314 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -16,7 +16,7 @@ alpha*) gdb_target_cpu=alpha ;; arm*) gdb_target_cpu=arm ;; avr*) gdb_target_cpu=avr ;; hppa*) gdb_target_cpu=pa ;; -i[3456]86*) gdb_target_cpu=i386 ;; +i[34567]86*) gdb_target_cpu=i386 ;; m68hc11*|m6811*) gdb_target_cpu=m68hc11 ;; m68*) gdb_target_cpu=m68k ;; mips*) gdb_target_cpu=mips ;; @@ -85,27 +85,27 @@ hppa*-*-*) gdb_target=hppa ;; # OBSOLETE i[3456]86-sequent-bsd*) gdb_target=symmetry ;; # OBSOLETE i[3456]86-sequent-sysv4*) gdb_target=ptx4 ;; # OBSOLETE i[3456]86-sequent-sysv*) gdb_target=ptx ;; -i[3456]86-ncr-*) gdb_target=ncr3000 ;; -i[3456]86-*-bsd*) gdb_target=i386bsd ;; -i[3456]86-*-netbsd*) gdb_target=nbsd ;; -i[3456]86-*-openbsd*) gdb_target=obsd ;; -i[3456]86-*-go32*) gdb_target=i386aout ;; -i[3456]86-*-msdosdjgpp*) gdb_target=go32 ;; -i[3456]86-*-nto*) gdb_target=nto ;; -i[3456]86-*-lynxos*) gdb_target=i386lynx ;; -i[3456]86-*-solaris*) gdb_target=i386sol2 ;; -i[3456]86-*-sco*) gdb_target=i386v ;; -i[3456]86-*-sysv*) gdb_target=i386v ;; -i[3456]86-*-linux*) gdb_target=linux +i[34567]86-ncr-*) gdb_target=ncr3000 ;; +i[34567]86-*-bsd*) gdb_target=i386bsd ;; +i[34567]86-*-netbsd*) gdb_target=nbsd ;; +i[34567]86-*-openbsd*) gdb_target=obsd ;; +i[34567]86-*-go32*) gdb_target=i386aout ;; +i[34567]86-*-msdosdjgpp*) gdb_target=go32 ;; +i[34567]86-*-nto*) gdb_target=nto ;; +i[34567]86-*-lynxos*) gdb_target=i386lynx ;; +i[34567]86-*-solaris*) gdb_target=i386sol2 ;; +i[34567]86-*-sco*) gdb_target=i386v ;; +i[34567]86-*-sysv*) gdb_target=i386v ;; +i[34567]86-*-linux*) gdb_target=linux build_gdbserver=yes ;; -i[3456]86-*-isc*) gdb_target=i386v ;; -i[3456]86-*-gnu*) gdb_target=i386gnu ;; -i[3456]86-*-netware*) gdb_target=i386nw +i[34567]86-*-isc*) gdb_target=i386v ;; +i[34567]86-*-gnu*) gdb_target=i386gnu ;; +i[34567]86-*-netware*) gdb_target=i386nw configdirs="${configdirs} nlm" ;; -i[3456]86-*-cygwin*) gdb_target=cygwin ;; -i[3456]86-*-vxworks*) gdb_target=vxworks ;; -i[3456]86-*-*) gdb_target=embed ;; +i[34567]86-*-cygwin*) gdb_target=cygwin ;; +i[34567]86-*-vxworks*) gdb_target=vxworks ;; +i[34567]86-*-*) gdb_target=embed ;; ia64-*-aix*) gdb_target=aix ;; ia64-*-linux*) gdb_target=linux @@ -130,6 +130,7 @@ m68*-*-aout*) gdb_target=monitor ;; m68*-*-coff*) gdb_target=monitor ;; m68*-*-elf*) gdb_target=monitor ;; m68*-*-linux*) gdb_target=linux + gdb_multi_arch=1 build_gdbserver=yes ;; m68*-*-lynxos*) gdb_target=m68klynx ;; @@ -141,21 +142,13 @@ m68*-*-sysv4*) gdb_target=m68kv4 ;; m68*-*-vxworks*) gdb_target=vxworks68 ;; mcore*-*-*) gdb_target=mcore ;; -mips64*-big-*) gdb_target=bigmips64 ;; -mips*-big-*) gdb_target=bigmips ;; -mips*-dec-*) gdb_target=decstation ;; +mips64*-big-*) gdb_target=mips64 ;; +mips*-big-*) gdb_target=mips ;; +mips*-dec-*) gdb_target=mips ;; mips*-*-pe) gdb_target=wince ;; mips64*el-*-ecoff*) gdb_target=embedl64 ;; mips64*-*-ecoff*) gdb_target=embed64 ;; -mips64*vr4xxx*el-*-elf*)gdb_target=vr4xxxel ;; -mips64*vr4xxx*-*-elf*) gdb_target=vr4xxx ;; -mips64*vr4300*el-*-elf*) gdb_target=vr4300el ;; -mips64*vr4300*-*-elf*) gdb_target=vr4300 ;; -mips64*vr4100*el-*-elf*) gdb_target=vr4300el ;; -mips64*vr4100*-*-elf*) gdb_target=vr4100 ;; -mips64*vr5000*el-*-elf*) gdb_target=vr5000el ;; -mips64*vr5000*-*-elf*) gdb_target=vr5000 ;; -mips*tx39*el*-elf*) gdb_target=tx39l ;; +mips64*vr*-*-elf*) gdb_target=mips64 ;; mips*tx39*-elf*) gdb_target=tx39 ;; mips64*el-*-elf*) gdb_target=embedl64 ;; mips64*-*-elf*) gdb_target=embed64 ;; @@ -164,20 +157,20 @@ mips*el-*-ecoff*) gdb_target=embedl ;; mips*-*-ecoff*) gdb_target=embed ;; mips*el-*-elf*) gdb_target=embedl ;; mips*-*-elf*) gdb_target=embed ;; -mips*-little-*) gdb_target=littlemips ;; +mips*-little-*) gdb_target=mips ;; mips*-*-lnews*) gdb_target=embedl ;; mips*-sgi-irix5*) gdb_target=irix5 ;; mips*-sgi-irix6*) gdb_target=irix6 ;; mips*-sgi-*) gdb_target=irix3 ;; -mips*-sony-*) gdb_target=bigmips ;; +mips*-sony-*) gdb_target=mips64 ;; mips*-*-linux*) gdb_target=linux build_gdbserver=yes ;; mips*-*-netbsd*) gdb_target=nbsd ;; # OBSOLETE mips*-*-mach3*) gdb_target=mipsm3 ;; mips*-*-sysv4*) gdb_target=mipsv4 ;; -mips*-*-sysv*) gdb_target=bigmips ;; -mips*-*-riscos*) gdb_target=bigmips ;; +mips*-*-sysv*) gdb_target=mips ;; +mips*-*-riscos*) gdb_target=mips ;; mips*-*-vxworks*) gdb_target=vxmips ;; mips*-*-*) gdb_target=embed ;; @@ -193,6 +186,7 @@ powerpc-*-aix*) gdb_target=aix ;; powerpc-*-linux*) gdb_target=linux build_gdbserver=yes ;; +powerpc64-*-linux*) gdb_target=linux ;; powerpc-*-vxworks*) gdb_target=vxworks ;; powerpc*-*-*) if test -f ../sim/ppc/Makefile; then gdb_target=ppc-sim diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c index 3aa9966433f..43361fca2ea 100644 --- a/gdb/cp-abi.c +++ b/gdb/cp-abi.c @@ -234,6 +234,8 @@ show_cp_abi_cmd (char *args, int from_tty) ui_out_text (uiout, ").\n"); } +extern initialize_file_ftype _initialize_cp_abi; /* -Wmissing-prototypes */ + void _initialize_cp_abi (void) { diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index 9142e13159c..131e6aa6976 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -43,6 +43,9 @@ unsigned char processing_has_namespace_info; contain the name of the current namespace. The string is temporary; copy it if you need it. */ +/* FIXME: carlton/2003-06-12: This isn't entirely reliable: currently, + we get mislead by DW_AT_specification. */ + const char *processing_current_prefix; /* List of using directives that are active in the current file. */ @@ -232,6 +235,12 @@ cp_set_block_scope (const struct symbol *symbol, if (SYMBOL_CPLUS_DEMANGLED_NAME (symbol) != NULL) { +#if 0 + /* FIXME: carlton/2003-06-12: As mentioned above, + 'processing_has_namespace_info' currently isn't entirely + reliable, so let's always use demangled names to get this + information for now. */ + if (processing_has_namespace_info) { block_set_scope @@ -241,6 +250,7 @@ cp_set_block_scope (const struct symbol *symbol, obstack); } else +#endif { /* Try to figure out the appropriate namespace from the demangled name. */ diff --git a/gdb/cp-support.c b/gdb/cp-support.c index c4c45f5780e..14374f34ebb 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -28,6 +28,28 @@ #include "gdb_assert.h" #include "symtab.h" #include "gdbcmd.h" +#include "dictionary.h" +#include "objfiles.h" +#include "frame.h" +#include "symtab.h" +#include "block.h" + +/* Functions/variables related to overload resolution. */ + +static int sym_return_val_size; +static int sym_return_val_index; +static struct symbol **sym_return_val; + +static void overload_list_add_symbol (struct symbol *sym, + const char *oload_name); + +static void make_symbol_overload_list_using (const char *func_name, + const char *namespace, + const struct block *block); + +static void make_symbol_overload_list_qualified (const char *func_name); + +static void read_in_psymtabs (const char *oload_name); /* The list of "maint cplus" commands. */ @@ -355,6 +377,278 @@ cp_func_name (const char *full_name) return remove_params (previous_component); } +/* Overload resolution functions. */ + +char * +remove_params (const char *demangled_name) +{ + const char *argp; + char *new_name; + int depth; + + if (demangled_name == NULL) + return NULL; + + /* First find the end of the arg list. */ + argp = strrchr (demangled_name, ')'); + if (argp == NULL) + return NULL; + + /* Back up to the beginning. */ + depth = 1; + + while (argp-- > demangled_name) + { + if (*argp == ')') + depth ++; + else if (*argp == '(') + { + depth --; + + if (depth == 0) + break; + } + } + if (depth != 0) + internal_error (__FILE__, __LINE__, + "bad demangled name %s\n", demangled_name); + while (argp[-1] == ' ' && argp > demangled_name) + argp --; + + new_name = xmalloc (argp - demangled_name + 1); + memcpy (new_name, demangled_name, argp - demangled_name); + new_name[argp - demangled_name] = '\0'; + return new_name; +} + +/* Helper routine for make_symbol_completion_list. */ + +static int sym_return_val_size; +static int sym_return_val_index; +static struct symbol **sym_return_val; + +/* Test to see if the symbol specified by SYMNAME (which is already + demangled for C++ symbols) matches SYM_TEXT in the first SYM_TEXT_LEN + characters. If so, add it to the current completion list. */ + +static void +overload_list_add_symbol (struct symbol *sym, const char *oload_name) +{ + int newsize; + int i; + char *sym_name; + + /* If there is no type information, we can't do anything, so skip */ + if (SYMBOL_TYPE (sym) == NULL) + return; + + /* skip any symbols that we've already considered. */ + for (i = 0; i < sym_return_val_index; ++i) + if (!strcmp (DEPRECATED_SYMBOL_NAME (sym), DEPRECATED_SYMBOL_NAME (sym_return_val[i]))) + return; + + /* Get the demangled name without parameters */ + sym_name = remove_params (SYMBOL_DEMANGLED_NAME (sym)); + if (!sym_name) + return; + + /* skip symbols that cannot match */ + if (strcmp (sym_name, oload_name) != 0) + { + xfree (sym_name); + return; + } + + xfree (sym_name); + + /* We have a match for an overload instance, so add SYM to the current list + * of overload instances */ + if (sym_return_val_index + 3 > sym_return_val_size) + { + newsize = (sym_return_val_size *= 2) * sizeof (struct symbol *); + sym_return_val = (struct symbol **) xrealloc ((char *) sym_return_val, newsize); + } + sym_return_val[sym_return_val_index++] = sym; + sym_return_val[sym_return_val_index] = NULL; +} + +/* Return a null-terminated list of pointers to function symbols that + match name of the supplied symbol FSYM and that occur within the + namespace given by the initial substring of NAMESPACE_NAME of + length NAMESPACE_LEN. Apply using directives from BLOCK. This is + used in finding all overloaded instances of a function name. This + has been modified from make_symbol_completion_list. */ + +/* FIXME: carlton/2003-01-30: Should BLOCK be here? Maybe it's better + to use get_selected_block (0). */ + +struct symbol ** +make_symbol_overload_list (const char *func_name, + const char *namespace, + const struct block *block) +{ + struct cleanup *old_cleanups; + + sym_return_val_size = 100; + sym_return_val_index = 0; + sym_return_val = xmalloc ((sym_return_val_size + 1) * + sizeof (struct symbol *)); + sym_return_val[0] = NULL; + + old_cleanups = make_cleanup (xfree, sym_return_val); + + make_symbol_overload_list_using (func_name, namespace, + block); + + discard_cleanups (old_cleanups); + + return sym_return_val; +} + +/* This applies the using directives to add namespaces to search in, + and then searches for overloads in all of those namespaces. It + adds the symbols found to sym_return_val. Arguments are as in + make_symbol_overload_list. */ + +static void +make_symbol_overload_list_using (const char *func_name, + const char *namespace, + const struct block *block) +{ + const struct using_direct *current; + + /* First, go through the using directives. If any of them apply, + look in the appropriate namespaces for new functions to match + on. */ + + for (current = block_using (block); + current != NULL; + current = current->next) + { + if (strcmp (namespace, current->outer) == 0) + { + make_symbol_overload_list_using (func_name, + current->inner, + block); + } + } + + /* Now, add names for this namespace. */ + + if (namespace[0] == '\0') + { + make_symbol_overload_list_qualified (func_name); + } + else + { + char *concatenated_name + = alloca (strlen (namespace) + 2 + strlen (func_name) + 1); + strcpy (concatenated_name, namespace); + strcat (concatenated_name, "::"); + strcat (concatenated_name, func_name); + make_symbol_overload_list_qualified (concatenated_name); + } +} + +/* This does the bulk of the work of finding overloaded symbols. + FUNC_NAME is the name of the overloaded function we're looking for + (possibly including namespace info); NEW_LIST is 1 if we should + allocate a new list of overloads and 0 if we should continue using + the same old list. */ + +static void +make_symbol_overload_list_qualified (const char *func_name) +{ + struct symbol *sym; + struct symtab *s; + struct objfile *objfile; + const struct block *b, *surrounding_static_block = 0; + struct dict_iterator iter; + const struct dictionary *dict; + + /* Look through the partial symtabs for all symbols which begin + by matching FUNC_NAME. Make sure we read that symbol table in. */ + + read_in_psymtabs (func_name); + + /* Search upwards from currently selected frame (so that we can + complete on local vars. */ + + for (b = get_selected_block (0); b != NULL; b = BLOCK_SUPERBLOCK (b)) + { + dict = BLOCK_DICT (b); + + for (sym = dict_iter_name_first (dict, func_name, &iter); + sym; + sym = dict_iter_name_next (func_name, &iter)) + { + overload_list_add_symbol (sym, func_name); + } + } + + surrounding_static_block = block_static_block (get_selected_block (0)); + + /* Go through the symtabs and check the externs and statics for + symbols which match. */ + + /* FIXME: carlton/2003-01-30: Why are we checking all the statics? + Also, this shouldn't check all the globals if there's an + anonymous namespace involved somewhere. */ + + ALL_SYMTABS (objfile, s) + { + QUIT; + b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK); + dict = BLOCK_DICT (b); + + for (sym = dict_iter_name_first (dict, func_name, &iter); + sym; + sym = dict_iter_name_next (func_name, &iter)) + { + overload_list_add_symbol (sym, func_name); + } + } + + ALL_SYMTABS (objfile, s) + { + QUIT; + b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK); + /* Don't do this block twice. */ + if (b == surrounding_static_block) + continue; + dict = BLOCK_DICT (b); + + for (sym = dict_iter_name_first (dict, func_name, &iter); + sym; + sym = dict_iter_name_next (func_name, &iter)) + { + overload_list_add_symbol (sym, func_name); + } + } +} + +/* Look through the partial symtabs for all symbols which begin + by matching FUNC_NAME. Make sure we read that symbol table in. */ + +static void +read_in_psymtabs (const char *func_name) +{ + struct partial_symtab *ps; + struct objfile *objfile; + + ALL_PSYMTABS (objfile, ps) + { + if (ps->readin) + continue; + + if ((lookup_partial_symbol (ps, func_name, NULL, 1, VAR_DOMAIN) + != NULL) + || (lookup_partial_symbol (ps, func_name, NULL, 0, VAR_DOMAIN) + != NULL)) + psymtab_to_symtab (ps); + } +} + /* Don't allow just "maintenance cplus". */ static void @@ -380,6 +674,8 @@ first_component_command (char *arg, int from_tty) printf_unfiltered ("%s\n", prefix); } +extern initialize_file_ftype _initialize_cp_support; /* -Wmissing-prototypes */ + void _initialize_cp_support (void) { diff --git a/gdb/cp-support.h b/gdb/cp-support.h index 9cfee7cce6b..0686c4a0714 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -30,6 +30,7 @@ /* Opaque declarations. */ +struct symbol; struct obstack; struct block; @@ -59,6 +60,12 @@ extern unsigned int cp_entire_prefix_len (const char *name); extern char *cp_func_name (const char *full_name); +extern char *remove_params (const char *demangled_name); + +extern struct symbol **make_symbol_overload_list (const char *, + const char *, + const struct block *); + /* Functions/variables from cp-namespace.c. */ extern unsigned char processing_has_namespace_info; @@ -71,7 +78,7 @@ extern void cp_add_using_directive (const char *name, unsigned int outer_length, unsigned int inner_length); -extern void cp_initialize_namespace (); +extern void cp_initialize_namespace (void); extern void cp_finalize_namespace (struct block *static_block, struct obstack *obstack); diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index 6749f8e59e5..e5984b4e86b 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -554,7 +554,7 @@ cp_print_value (struct type *type, struct type *real_type, char *valaddr, { boffset = baseclass_offset (type, i, valaddr + offset, - address + offset); + address); skip = ((boffset == -1) || (boffset + offset) < 0) ? 1 : -1; if (BASETYPE_VIA_VIRTUAL (type, i)) @@ -569,9 +569,10 @@ cp_print_value (struct type *type, struct type *real_type, char *valaddr, { /* FIXME (alloca): unsafe if baseclass is really really large. */ base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass)); - if (target_read_memory (address + offset + boffset, base_valaddr, + if (target_read_memory (address + boffset, base_valaddr, TYPE_LENGTH (baseclass)) != 0) skip = 1; + address = address + boffset; thisoffset = 0; boffset = 0; thistype = baseclass; @@ -600,7 +601,8 @@ cp_print_value (struct type *type, struct type *real_type, char *valaddr, fprintf_filtered (stream, ""); else cp_print_value_fields (baseclass, thistype, base_valaddr, - thisoffset + boffset, address, stream, format, + thisoffset + boffset, address + boffset, + stream, format, recurse, pretty, ((struct type **) obstack_base (&dont_print_vb_obstack)), diff --git a/gdb/cpu32bug-rom.c b/gdb/cpu32bug-rom.c index 4341789e165..03b31321577 100644 --- a/gdb/cpu32bug-rom.c +++ b/gdb/cpu32bug-rom.c @@ -162,6 +162,8 @@ cpu32bug_open (char *args, int from_tty) monitor_open (args, &cpu32bug_cmds, from_tty); } +extern initialize_file_ftype _initialize_cpu32bug_rom; /* -Wmissing-prototypes */ + void _initialize_cpu32bug_rom (void) { diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 2fbfde53b0e..3c7bf60a96a 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -464,7 +464,7 @@ static CORE_ADDR bfd_lookup_symbol (bfd *, const char *); the entire prologue is examined (0) or just enough instructions to determine that it is a prologue (1). */ -CORE_ADDR +static CORE_ADDR cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi, int frameless_p) { @@ -712,7 +712,7 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi, /* Advance pc beyond any function entry prologue instructions at pc to reach some "real" code. */ -CORE_ADDR +static CORE_ADDR cris_skip_prologue (CORE_ADDR pc) { return cris_skip_prologue_main (pc, 0); @@ -722,7 +722,7 @@ cris_skip_prologue (CORE_ADDR pc) has a frame. Its result is equal to its input pc if the function is frameless, unequal otherwise. */ -CORE_ADDR +static CORE_ADDR cris_skip_prologue_frameless_p (CORE_ADDR pc) { return cris_skip_prologue_main (pc, 1); @@ -731,7 +731,7 @@ cris_skip_prologue_frameless_p (CORE_ADDR pc) /* Given a PC value corresponding to the start of a function, return the PC of the first instruction after the function prologue. */ -CORE_ADDR +static CORE_ADDR cris_skip_prologue_main (CORE_ADDR pc, int frameless_p) { struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); @@ -763,7 +763,7 @@ cris_skip_prologue_main (CORE_ADDR pc, int frameless_p) adjusts pcptr (if necessary) to point to the actual memory location where the breakpoint should be inserted. */ -const unsigned char * +static const unsigned char * cris_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) { static unsigned char break_insn[] = {0x38, 0xe9}; @@ -784,7 +784,7 @@ cris_saved_pc_after_call (struct frame_info *frame) /* Returns 1 if spec_reg is applicable to the current gdbarch's CRIS version, 0 otherwise. */ -int +static int cris_spec_reg_applicable (struct cris_spec_reg spec_reg) { int version = cris_version (); @@ -818,7 +818,7 @@ cris_spec_reg_applicable (struct cris_spec_reg spec_reg) /* Returns the register size in unit byte. Returns 0 for an unimplemented register, -1 for an invalid register. */ -int +static int cris_register_size (int regno) { int i; @@ -857,7 +857,7 @@ cris_register_size (int regno) /* Nonzero if regno should not be fetched from the target. This is the case for unimplemented (size 0) and non-existant registers. */ -int +static int cris_cannot_fetch_register (int regno) { return ((regno < 0 || regno >= NUM_REGS) @@ -867,7 +867,7 @@ cris_cannot_fetch_register (int regno) /* Nonzero if regno should not be written to the target, for various reasons. */ -int +static int cris_cannot_store_register (int regno) { /* There are three kinds of registers we refuse to write to. @@ -903,7 +903,7 @@ cris_cannot_store_register (int regno) in the saved register state. Returns -1 for an invalid or unimplemented register. */ -int +static int cris_register_offset (int regno) { int i; @@ -929,7 +929,7 @@ cris_register_offset (int regno) /* Return the GDB type (defined in gdbtypes.c) for the "standard" data type of data in register regno. */ -struct type * +static struct type * cris_register_virtual_type (int regno) { if (regno == SP_REGNUM || regno == PC_REGNUM @@ -966,7 +966,7 @@ cris_register_virtual_type (int regno) /* In the original CRIS ABI, R10 is used to store return values. */ -void +static void cris_abi_original_store_return_value (struct type *type, char *valbuf) { int len = TYPE_LENGTH (type); @@ -979,7 +979,7 @@ cris_abi_original_store_return_value (struct type *type, char *valbuf) /* In the CRIS ABI V2, R10 and R11 are used to store return values. */ -void +static void cris_abi_v2_store_return_value (struct type *type, char *valbuf) { int len = TYPE_LENGTH (type); @@ -997,7 +997,7 @@ cris_abi_v2_store_return_value (struct type *type, char *valbuf) /* Return the name of register regno as a string. Return NULL for an invalid or unimplemented register. */ -const char * +static const char * cris_register_name (int regno) { static char *cris_genreg_names[] = @@ -1039,7 +1039,7 @@ cris_register_name (int regno) } } -int +static int cris_register_bytes_ok (long bytes) { return (bytes == DEPRECATED_REGISTER_BYTES); @@ -1051,7 +1051,7 @@ cris_register_bytes_ok (long bytes) /* In the original CRIS ABI, R10 is used to return values. */ -void +static void cris_abi_original_extract_return_value (struct type *type, char *regbuf, char *valbuf) { @@ -1065,7 +1065,7 @@ cris_abi_original_extract_return_value (struct type *type, char *regbuf, /* In the CRIS ABI V2, R10 and R11 are used to store return values. */ -void +static void cris_abi_v2_extract_return_value (struct type *type, char *regbuf, char *valbuf) { @@ -1083,7 +1083,7 @@ cris_abi_v2_extract_return_value (struct type *type, char *regbuf, be stored. R9 is call-clobbered, which means we must save it here for later use. */ -void +static void cris_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) { write_register (STR_REGNUM, addr); @@ -1094,32 +1094,19 @@ cris_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) structure value. It's not there in the CRIS ABI, so we must do it another way. */ -CORE_ADDR +static CORE_ADDR cris_extract_struct_value_address (char *regbuf) { return struct_return_address; } -/* Returns 1 if a value of the given type being returned from a function - must have space allocated for it on the stack. gcc_p is true if the - function being considered is known to have been compiled by GCC. - In the CRIS ABI, structure return values are passed to the called - function by reference in register R9 to a caller-allocated area, so - this is always true. */ - -int -cris_use_struct_convention (int gcc_p, struct type *type) -{ - return 1; -} - /* Returns 1 if the given type will be passed by pointer rather than directly. */ /* In the original CRIS ABI, arguments shorter than or equal to 32 bits are passed by value. */ -int +static int cris_abi_original_reg_struct_has_addr (int gcc_p, struct type *type) { return (TYPE_LENGTH (type) > 4); @@ -1128,7 +1115,7 @@ cris_abi_original_reg_struct_has_addr (int gcc_p, struct type *type) /* In the CRIS ABI V2, arguments shorter than or equal to 64 bits are passed by value. */ -int +static int cris_abi_v2_reg_struct_has_addr (int gcc_p, struct type *type) { return (TYPE_LENGTH (type) > 8); @@ -1137,7 +1124,7 @@ cris_abi_v2_reg_struct_has_addr (int gcc_p, struct type *type) /* Returns 1 if the function invocation represented by fi does not have a stack frame associated with it. Otherwise return 0. */ -int +static int cris_frameless_function_invocation (struct frame_info *fi) { if ((get_frame_type (fi) == SIGTRAMP_FRAME)) @@ -1151,7 +1138,7 @@ cris_frameless_function_invocation (struct frame_info *fi) frame->saved_regs shall be allocated by DEPRECATED_FRAME_INIT_SAVED_REGS using frame_saved_regs_zalloc. */ -void +static void cris_frame_init_saved_regs (struct frame_info *fi) { CORE_ADDR ip; @@ -1198,7 +1185,7 @@ cris_frame_init_saved_regs (struct frame_info *fi) When the call is from get_prev_frame_info, fromleaf is determined by cris_frameless_function_invocation. */ -void +static void cris_init_extra_frame_info (int fromleaf, struct frame_info *fi) { if (get_next_frame (fi)) @@ -1252,7 +1239,7 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi) /* Return the content of the frame pointer in the present frame. In other words, determine the address of the calling function's frame. */ -CORE_ADDR +static CORE_ADDR cris_frame_chain (struct frame_info *fi) { if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), @@ -1273,7 +1260,7 @@ cris_frame_chain (struct frame_info *fi) /* Return the saved PC (which equals the return address) of this frame. */ -CORE_ADDR +static CORE_ADDR cris_frame_saved_pc (struct frame_info *fi) { return get_frame_extra_info (fi)->return_pc; @@ -1281,7 +1268,7 @@ cris_frame_saved_pc (struct frame_info *fi) /* Setup the function arguments for calling a function in the inferior. */ -CORE_ADDR +static CORE_ADDR cris_abi_original_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) @@ -1367,7 +1354,7 @@ cris_abi_original_push_arguments (int nargs, struct value **args, return sp; } -CORE_ADDR +static CORE_ADDR cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { @@ -1499,7 +1486,7 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp, by the called function unless it is a leaf-function. Due to the BRP register the PC will change when continue is sent. */ -CORE_ADDR +static CORE_ADDR cris_push_return_address (CORE_ADDR pc, CORE_ADDR sp) { write_register (SRP_REGNUM, CALL_DUMMY_ADDRESS ()); @@ -1510,7 +1497,7 @@ cris_push_return_address (CORE_ADDR pc, CORE_ADDR sp) was created. Discard the innermost frame from the stack and restore all saved registers. */ -void +static void cris_pop_frame (void) { register struct frame_info *fi = get_current_frame (); @@ -1772,7 +1759,7 @@ find_step_target (inst_env_type *inst_env) digs through the opcodes in order to find all possible targets. Either one ordinary target or two targets for branches may be found. */ -void +static void cris_software_single_step (enum target_signal ignore, int insert_breakpoints) { inst_env_type inst_env; @@ -1816,7 +1803,7 @@ cris_software_single_step (enum target_signal ignore, int insert_breakpoints) /* Calculates the prefix value for quick offset addressing mode. */ -void +static void quick_mode_bdap_prefix (unsigned short inst, inst_env_type *inst_env) { /* It's invalid to be in a delay slot. You can't have a prefix to this @@ -1840,7 +1827,7 @@ quick_mode_bdap_prefix (unsigned short inst, inst_env_type *inst_env) from the size of the operation. The PC is always kept aligned on even word addresses. */ -void +static void process_autoincrement (int size, unsigned short inst, inst_env_type *inst_env) { if (size == INST_BYTE_SIZE) @@ -1871,12 +1858,13 @@ process_autoincrement (int size, unsigned short inst, inst_env_type *inst_env) /* Just a forward declaration. */ -unsigned long get_data_from_address (unsigned short *inst, CORE_ADDR address); +static unsigned long get_data_from_address (unsigned short *inst, + CORE_ADDR address); /* Calculates the prefix value for the general case of offset addressing mode. */ -void +static void bdap_prefix (unsigned short inst, inst_env_type *inst_env) { @@ -1912,7 +1900,7 @@ bdap_prefix (unsigned short inst, inst_env_type *inst_env) /* Calculates the prefix value for the index addressing mode. */ -void +static void biap_prefix (unsigned short inst, inst_env_type *inst_env) { /* It's invalid to be in a delay slot. I can't see that it's possible to @@ -1947,7 +1935,7 @@ biap_prefix (unsigned short inst, inst_env_type *inst_env) /* Calculates the prefix value for the double indirect addressing mode. */ -void +static void dip_prefix (unsigned short inst, inst_env_type *inst_env) { @@ -1980,7 +1968,7 @@ dip_prefix (unsigned short inst, inst_env_type *inst_env) /* Finds the destination for a branch with 8-bits offset. */ -void +static void eight_bit_offset_branch_op (unsigned short inst, inst_env_type *inst_env) { @@ -2017,7 +2005,7 @@ eight_bit_offset_branch_op (unsigned short inst, inst_env_type *inst_env) /* Finds the destination for a branch with 16-bits offset. */ -void +static void sixteen_bit_offset_branch_op (unsigned short inst, inst_env_type *inst_env) { short offset; @@ -2048,7 +2036,7 @@ sixteen_bit_offset_branch_op (unsigned short inst, inst_env_type *inst_env) /* Handles the ABS instruction. */ -void +static void abs_op (unsigned short inst, inst_env_type *inst_env) { @@ -2090,7 +2078,7 @@ abs_op (unsigned short inst, inst_env_type *inst_env) /* Handles the ADDI instruction. */ -void +static void addi_op (unsigned short inst, inst_env_type *inst_env) { /* It's invalid to have the PC as base register. And ADDI can't have @@ -2109,7 +2097,7 @@ addi_op (unsigned short inst, inst_env_type *inst_env) /* Handles the ASR instruction. */ -void +static void asr_op (unsigned short inst, inst_env_type *inst_env) { int shift_steps; @@ -2186,7 +2174,7 @@ asr_op (unsigned short inst, inst_env_type *inst_env) /* Handles the ASRQ instruction. */ -void +static void asrq_op (unsigned short inst, inst_env_type *inst_env) { @@ -2233,7 +2221,7 @@ asrq_op (unsigned short inst, inst_env_type *inst_env) /* Handles the AX, EI and SETF instruction. */ -void +static void ax_ei_setf_op (unsigned short inst, inst_env_type *inst_env) { if (inst_env->prefix_found) @@ -2259,7 +2247,7 @@ ax_ei_setf_op (unsigned short inst, inst_env_type *inst_env) register. Note that check_assign assumes that the caller has checked that there is a prefix to this instruction. The mode check depends on this. */ -void +static void check_assign (unsigned short inst, inst_env_type *inst_env) { /* Check if it's an assign addressing mode. */ @@ -2272,7 +2260,7 @@ check_assign (unsigned short inst, inst_env_type *inst_env) /* Handles the 2-operand BOUND instruction. */ -void +static void two_operand_bound_op (unsigned short inst, inst_env_type *inst_env) { /* It's invalid to have the PC as the index operand. */ @@ -2305,7 +2293,7 @@ two_operand_bound_op (unsigned short inst, inst_env_type *inst_env) /* Handles the 3-operand BOUND instruction. */ -void +static void three_operand_bound_op (unsigned short inst, inst_env_type *inst_env) { /* It's an error if we haven't got a prefix. And it's also an error @@ -2323,7 +2311,7 @@ three_operand_bound_op (unsigned short inst, inst_env_type *inst_env) /* Clears the status flags in inst_env. */ -void +static void btst_nop_op (unsigned short inst, inst_env_type *inst_env) { /* It's an error if we have got a prefix. */ @@ -2341,7 +2329,7 @@ btst_nop_op (unsigned short inst, inst_env_type *inst_env) /* Clears the status flags in inst_env. */ -void +static void clearf_di_op (unsigned short inst, inst_env_type *inst_env) { /* It's an error if we have got a prefix. */ @@ -2359,7 +2347,7 @@ clearf_di_op (unsigned short inst, inst_env_type *inst_env) /* Handles the CLEAR instruction if it's in register mode. */ -void +static void reg_mode_clear_op (unsigned short inst, inst_env_type *inst_env) { /* Check if the target is the PC. */ @@ -2396,7 +2384,7 @@ reg_mode_clear_op (unsigned short inst, inst_env_type *inst_env) /* Handles the TEST instruction if it's in register mode. */ -void +static void reg_mode_test_op (unsigned short inst, inst_env_type *inst_env) { /* It's an error if we have got a prefix. */ @@ -2415,7 +2403,7 @@ reg_mode_test_op (unsigned short inst, inst_env_type *inst_env) /* Handles the CLEAR and TEST instruction if the instruction isn't in register mode. */ -void +static void none_reg_mode_clear_test_op (unsigned short inst, inst_env_type *inst_env) { /* Check if we are in a prefix mode. */ @@ -2440,7 +2428,7 @@ none_reg_mode_clear_test_op (unsigned short inst, inst_env_type *inst_env) /* Checks that the PC isn't the destination register or the instructions has a prefix. */ -void +static void dstep_logshift_mstep_neg_not_op (unsigned short inst, inst_env_type *inst_env) { /* It's invalid to have the PC as the destination. The instruction can't @@ -2459,7 +2447,7 @@ dstep_logshift_mstep_neg_not_op (unsigned short inst, inst_env_type *inst_env) /* Checks that the instruction doesn't have a prefix. */ -void +static void break_op (unsigned short inst, inst_env_type *inst_env) { /* The instruction can't have a prefix. */ @@ -2478,7 +2466,7 @@ break_op (unsigned short inst, inst_env_type *inst_env) /* Checks that the PC isn't the destination register and that the instruction doesn't have a prefix. */ -void +static void scc_op (unsigned short inst, inst_env_type *inst_env) { /* It's invalid to have the PC as the destination. The instruction can't @@ -2497,7 +2485,7 @@ scc_op (unsigned short inst, inst_env_type *inst_env) /* Handles the register mode JUMP instruction. */ -void +static void reg_mode_jump_op (unsigned short inst, inst_env_type *inst_env) { /* It's invalid to do a JUMP in a delay slot. The mode is register, so @@ -2518,7 +2506,8 @@ reg_mode_jump_op (unsigned short inst, inst_env_type *inst_env) /* Handles the JUMP instruction for all modes except register. */ -void none_reg_mode_jump_op (unsigned short inst, inst_env_type *inst_env) +static void +none_reg_mode_jump_op (unsigned short inst, inst_env_type *inst_env) { unsigned long newpc; CORE_ADDR address; @@ -2562,7 +2551,7 @@ void none_reg_mode_jump_op (unsigned short inst, inst_env_type *inst_env) /* Handles moves to special registers (aka P-register) for all modes. */ -void +static void move_to_preg_op (unsigned short inst, inst_env_type *inst_env) { if (inst_env->prefix_found) @@ -2617,7 +2606,7 @@ move_to_preg_op (unsigned short inst, inst_env_type *inst_env) /* Handles moves from special registers (aka P-register) for all modes except register. */ -void +static void none_reg_mode_move_from_preg_op (unsigned short inst, inst_env_type *inst_env) { if (inst_env->prefix_found) @@ -2672,7 +2661,7 @@ none_reg_mode_move_from_preg_op (unsigned short inst, inst_env_type *inst_env) /* Handles moves from special registers (aka P-register) when the mode is register. */ -void +static void reg_mode_move_from_preg_op (unsigned short inst, inst_env_type *inst_env) { /* Register mode move from special register can't have a prefix. */ @@ -2707,7 +2696,7 @@ reg_mode_move_from_preg_op (unsigned short inst, inst_env_type *inst_env) /* Handles the MOVEM from memory to general register instruction. */ -void +static void move_mem_to_reg_movem_op (unsigned short inst, inst_env_type *inst_env) { if (inst_env->prefix_found) @@ -2764,7 +2753,7 @@ move_mem_to_reg_movem_op (unsigned short inst, inst_env_type *inst_env) /* Handles the MOVEM to memory from general register instruction. */ -void +static void move_reg_to_mem_movem_op (unsigned short inst, inst_env_type *inst_env) { if (inst_env->prefix_found) @@ -2803,7 +2792,7 @@ move_reg_to_mem_movem_op (unsigned short inst, inst_env_type *inst_env) /* Handles the pop instruction to a general register. POP is a assembler macro for MOVE.D [SP+], Rd. */ -void +static void reg_pop_op (unsigned short inst, inst_env_type *inst_env) { /* POP can't have a prefix. */ @@ -2831,7 +2820,7 @@ reg_pop_op (unsigned short inst, inst_env_type *inst_env) /* Handles moves from register to memory. */ -void +static void move_reg_to_mem_index_inc_op (unsigned short inst, inst_env_type *inst_env) { /* Check if we have a prefix. */ @@ -2860,7 +2849,7 @@ move_reg_to_mem_index_inc_op (unsigned short inst, inst_env_type *inst_env) /* Handles the intructions that's not yet implemented, by setting inst_env->invalid to true. */ -void +static void not_implemented_op (unsigned short inst, inst_env_type *inst_env) { inst_env->invalid = 1; @@ -2868,7 +2857,7 @@ not_implemented_op (unsigned short inst, inst_env_type *inst_env) /* Handles the XOR instruction. */ -void +static void xor_op (unsigned short inst, inst_env_type *inst_env) { /* XOR can't have a prefix. */ @@ -2897,7 +2886,7 @@ xor_op (unsigned short inst, inst_env_type *inst_env) /* Handles the MULS instruction. */ -void +static void muls_op (unsigned short inst, inst_env_type *inst_env) { /* MULS/U can't have a prefix. */ @@ -2921,7 +2910,7 @@ muls_op (unsigned short inst, inst_env_type *inst_env) /* Handles the MULU instruction. */ -void +static void mulu_op (unsigned short inst, inst_env_type *inst_env) { /* MULS/U can't have a prefix. */ @@ -2946,7 +2935,7 @@ mulu_op (unsigned short inst, inst_env_type *inst_env) /* Calculate the result of the instruction for ADD, SUB, CMP AND, OR and MOVE. The MOVE instruction is the move from source to register. */ -void +static void add_sub_cmp_and_or_move_action (unsigned short inst, inst_env_type *inst_env, unsigned long source1, unsigned long source2) { @@ -3028,7 +3017,7 @@ add_sub_cmp_and_or_move_action (unsigned short inst, inst_env_type *inst_env, is zero extend then the value is extended with zero. If instead the mode is signed extend the sign bit of the value is taken into consideration. */ -unsigned long +static unsigned long do_sign_or_zero_extend (unsigned long value, unsigned short *inst) { /* The size can be either byte or word, check which one it is. @@ -3066,7 +3055,7 @@ do_sign_or_zero_extend (unsigned long value, unsigned short *inst) /* Handles the register mode for the ADD, SUB, CMP, AND, OR and MOVE instruction. The MOVE instruction is the move from source to register. */ -void +static void reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst, inst_env_type *inst_env) { @@ -3111,7 +3100,7 @@ reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst, the size of the operation. If the instruction is a zero or signed extend instruction, the size field is changed in instruction. */ -unsigned long +static unsigned long get_data_from_address (unsigned short *inst, CORE_ADDR address) { int size = cris_get_size (*inst); @@ -3139,7 +3128,7 @@ get_data_from_address (unsigned short *inst, CORE_ADDR address) /* Handles the assign addresing mode for the ADD, SUB, CMP, AND, OR and MOVE instructions. The MOVE instruction is the move from source to register. */ -void +static void handle_prefix_assign_mode_for_aritm_op (unsigned short inst, inst_env_type *inst_env) { @@ -3168,7 +3157,7 @@ handle_prefix_assign_mode_for_aritm_op (unsigned short inst, OR instructions. Note that for this to work as expected, the calling function must have made sure that there is a prefix to this instruction. */ -void +static void three_operand_add_sub_cmp_and_or_op (unsigned short inst, inst_env_type *inst_env) { @@ -3196,7 +3185,7 @@ three_operand_add_sub_cmp_and_or_op (unsigned short inst, /* Handles the index addresing mode for the ADD, SUB, CMP, AND, OR and MOVE instructions. The MOVE instruction is the move from source to register. */ -void +static void handle_prefix_index_mode_for_aritm_op (unsigned short inst, inst_env_type *inst_env) { @@ -3224,7 +3213,7 @@ handle_prefix_index_mode_for_aritm_op (unsigned short inst, CMP, AND OR and MOVE instruction. The MOVE instruction is the move from source to register. */ -void +static void handle_inc_and_index_mode_for_aritm_op (unsigned short inst, inst_env_type *inst_env) { @@ -3274,7 +3263,7 @@ handle_inc_and_index_mode_for_aritm_op (unsigned short inst, /* Handles the two-operand addressing mode, all modes except register, for the ADD, SUB CMP, AND and OR instruction. */ -void +static void none_reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst, inst_env_type *inst_env) { @@ -3303,7 +3292,7 @@ none_reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst, /* Handles the quick addressing mode for the ADD and SUB instruction. */ -void +static void quick_mode_add_sub_op (unsigned short inst, inst_env_type *inst_env) { unsigned long operand1; @@ -3343,7 +3332,7 @@ quick_mode_add_sub_op (unsigned short inst, inst_env_type *inst_env) /* Handles the quick addressing mode for the CMP, AND and OR instruction. */ -void +static void quick_mode_and_cmp_move_or_op (unsigned short inst, inst_env_type *inst_env) { unsigned long operand1; @@ -3389,8 +3378,9 @@ quick_mode_and_cmp_move_or_op (unsigned short inst, inst_env_type *inst_env) /* Translate op_type to a function and call it. */ -static void cris_gdb_func (enum cris_op_type op_type, unsigned short inst, - inst_env_type *inst_env) +static void +cris_gdb_func (enum cris_op_type op_type, unsigned short inst, + inst_env_type *inst_env) { switch (op_type) { @@ -3562,7 +3552,7 @@ typedef elf_greg_t elf_gregset_t[35]; /* Unpack an elf_gregset_t into GDB's register cache. */ -void +static void supply_gregset (elf_gregset_t *gregsetp) { int i; @@ -3627,7 +3617,7 @@ static struct core_fns cris_elf_core_fns = See gdb/solib-svr4.h for an explanation of these fields. */ -struct link_map_offsets * +static struct link_map_offsets * cris_linux_svr4_fetch_link_map_offsets (void) { static struct link_map_offsets lmo; @@ -3855,6 +3845,8 @@ cris_fpless_backtrace (char *noargs, int from_tty) } } +extern initialize_file_ftype _initialize_cris_tdep; /* -Wmissing-prototypes */ + void _initialize_cris_tdep (void) { @@ -4239,21 +4231,21 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Returns the register offset for the first byte of register regno's space in the saved register state. */ - set_gdbarch_register_byte (gdbarch, cris_register_offset); + set_gdbarch_deprecated_register_byte (gdbarch, cris_register_offset); /* The length of the registers in the actual machine representation. */ - set_gdbarch_register_raw_size (gdbarch, cris_register_size); + set_gdbarch_deprecated_register_raw_size (gdbarch, cris_register_size); /* The largest value REGISTER_RAW_SIZE can have. */ 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); + set_gdbarch_deprecated_register_virtual_size (gdbarch, cris_register_size); /* The largest value REGISTER_VIRTUAL_SIZE can have. */ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 32); - set_gdbarch_register_virtual_type (gdbarch, cris_register_virtual_type); + set_gdbarch_deprecated_register_virtual_type (gdbarch, cris_register_virtual_type); /* Use generic dummy frames. */ @@ -4267,16 +4259,13 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register); - /* No register requires conversion from raw format to virtual format. */ - set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not); - set_gdbarch_deprecated_push_return_address (gdbarch, cris_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, cris_pop_frame); set_gdbarch_deprecated_store_struct_return (gdbarch, cris_store_struct_return); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, cris_extract_struct_value_address); - set_gdbarch_use_struct_convention (gdbarch, cris_use_struct_convention); + set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention); 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); @@ -4305,13 +4294,11 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_frame_saved_pc (gdbarch, cris_frame_saved_pc); set_gdbarch_deprecated_saved_pc_after_call (gdbarch, cris_saved_pc_after_call); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); - /* Helpful for backtracing and returning in a call dummy. */ - set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); + set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); /* Should be using push_dummy_call. */ - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); /* Use target_specific function to define link map offsets. */ set_solib_svr4_fetch_link_map_offsets diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index c184b4457e7..d522580c76c 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -44,6 +44,7 @@ #include "gdb/sim-d10v.h" #include "sim-regno.h" #include "disasm.h" +#include "trad-frame.h" #include "gdb_assert.h" @@ -85,13 +86,13 @@ enum RET1_REGNUM = R0_REGNUM, }; -int +static int nr_dmap_regs (struct gdbarch *gdbarch) { return gdbarch_tdep (gdbarch)->nr_dmap_regs; } -int +static int a0_regnum (struct gdbarch *gdbarch) { return gdbarch_tdep (gdbarch)->a0_regnum; @@ -101,8 +102,6 @@ a0_regnum (struct gdbarch *gdbarch) extern void _initialize_d10v_tdep (void); -static CORE_ADDR d10v_read_sp (void); - static void d10v_eva_prepare_to_trace (void); static void d10v_eva_get_trace_data (void); @@ -563,21 +562,20 @@ d10v_skip_prologue (CORE_ADDR pc) struct d10v_unwind_cache { - CORE_ADDR return_pc; /* The previous frame's inner most stack address. Used as this frame ID's stack_addr. */ CORE_ADDR prev_sp; /* The frame's base, optionally used by the high-level debug info. */ CORE_ADDR base; int size; - CORE_ADDR *saved_regs; /* 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; + /* Table indicating the location of each and every register. */ + struct trad_frame_saved_reg *saved_regs; }; static int @@ -591,7 +589,7 @@ prologue_find_regs (struct d10v_unwind_cache *info, unsigned short op, { n = (op & 0x1E0) >> 5; info->sp_offset -= 2; - info->saved_regs[n] = info->sp_offset; + info->saved_regs[n].addr = info->sp_offset; return 1; } @@ -600,8 +598,8 @@ prologue_find_regs (struct d10v_unwind_cache *info, unsigned short op, { n = (op & 0x1E0) >> 5; info->sp_offset -= 4; - info->saved_regs[n] = info->sp_offset; - info->saved_regs[n + 1] = info->sp_offset + 2; + info->saved_regs[n + 0].addr = info->sp_offset + 0; + info->saved_regs[n + 1].addr = info->sp_offset + 2; return 1; } @@ -627,7 +625,7 @@ prologue_find_regs (struct d10v_unwind_cache *info, unsigned short op, if ((op & 0x7E1F) == 0x6816) { n = (op & 0x1E0) >> 5; - info->saved_regs[n] = info->r11_offset; + info->saved_regs[n].addr = info->r11_offset; return 1; } @@ -639,7 +637,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->sp_offset; + info->saved_regs[n].addr = info->sp_offset; return 1; } @@ -647,8 +645,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->sp_offset; - info->saved_regs[n + 1] = info->sp_offset + 2; + info->saved_regs[n + 0].addr = info->sp_offset + 0; + info->saved_regs[n + 1].addr = info->sp_offset + 2; return 1; } @@ -661,10 +659,11 @@ prologue_find_regs (struct d10v_unwind_cache *info, unsigned short op, in the stack frame. sp is even more special: the address we return for it IS the sp for the next frame. */ -struct d10v_unwind_cache * +static struct d10v_unwind_cache * d10v_frame_unwind_cache (struct frame_info *next_frame, void **this_prologue_cache) { + struct gdbarch *gdbarch = get_frame_arch (next_frame); CORE_ADDR pc; ULONGEST prev_sp; ULONGEST this_base; @@ -678,10 +677,9 @@ d10v_frame_unwind_cache (struct frame_info *next_frame, info = FRAME_OBSTACK_ZALLOC (struct d10v_unwind_cache); (*this_prologue_cache) = info; - info->saved_regs = FRAME_OBSTACK_CALLOC (NUM_REGS, CORE_ADDR); + info->saved_regs = trad_frame_alloc_saved_regs (next_frame); info->size = 0; - info->return_pc = 0; info->sp_offset = 0; info->uses_frame = 0; @@ -689,7 +687,7 @@ d10v_frame_unwind_cache (struct frame_info *next_frame, pc > 0 && pc < frame_pc_unwind (next_frame); pc += 4) { - op = (unsigned long) read_memory_integer (pc, 4); + op = get_frame_memory_unsigned (next_frame, pc, 4); if ((op & 0xC0000000) == 0xC0000000) { /* long instruction */ @@ -704,15 +702,15 @@ d10v_frame_unwind_cache (struct frame_info *next_frame, /* st rn, @(offset,sp) */ short offset = op & 0xFFFF; short n = (op >> 20) & 0xF; - info->saved_regs[n] = info->sp_offset + offset; + info->saved_regs[n].addr = 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->sp_offset + offset; - info->saved_regs[n + 1] = info->sp_offset + offset + 2; + info->saved_regs[n + 0].addr = info->sp_offset + offset + 0; + info->saved_regs[n + 1].addr = info->sp_offset + offset + 2; } else break; @@ -738,7 +736,8 @@ d10v_frame_unwind_cache (struct frame_info *next_frame, info->size = -info->sp_offset; - /* Compute the frame's base, and the previous frame's SP. */ + /* Compute the previous frame's stack pointer (which is also the + frame's ID's stack address), and this frame's base pointer. */ if (info->uses_frame) { /* The SP was moved to the FP. This indicates that a new frame @@ -749,15 +748,6 @@ d10v_frame_unwind_cache (struct frame_info *next_frame, to before the first saved register giving the SP. */ prev_sp = this_base + info->size; } - else if (info->saved_regs[D10V_SP_REGNUM]) - { - /* The SP was saved (which is very unusual), the frame base is - just the PREV's frame's TOP-OF-STACK. */ - this_base = read_memory_unsigned_integer (info->saved_regs[D10V_SP_REGNUM], - register_size (current_gdbarch, - D10V_SP_REGNUM)); - prev_sp = this_base; - } else { /* Assume that the FP is this frame's SP but with that pushed @@ -766,34 +756,28 @@ d10v_frame_unwind_cache (struct frame_info *next_frame, prev_sp = this_base + info->size; } + /* Convert that SP/BASE into real addresses. */ + info->prev_sp = d10v_make_daddr (prev_sp); info->base = d10v_make_daddr (this_base); - info->prev_sp = d10v_make_daddr (prev_sp); /* Adjust all the saved registers so that they contain addresses and not offsets. */ for (i = 0; i < NUM_REGS - 1; i++) - if (info->saved_regs[i]) + if (info->saved_regs[i].addr) { - info->saved_regs[i] = (info->prev_sp + info->saved_regs[i]); + info->saved_regs[i].addr = (info->prev_sp + info->saved_regs[i].addr); } - if (info->saved_regs[LR_REGNUM]) - { - CORE_ADDR return_pc - = read_memory_unsigned_integer (info->saved_regs[LR_REGNUM], - register_size (current_gdbarch, LR_REGNUM)); - info->return_pc = d10v_make_iaddr (return_pc); - } - else - { - ULONGEST return_pc; - frame_unwind_unsigned_register (next_frame, LR_REGNUM, &return_pc); - info->return_pc = d10v_make_iaddr (return_pc); - } + /* The call instruction moves the caller's PC in the callee's LR. + Since this is an unwind, do the reverse. Copy the location of LR + into PC (the address / regnum) so that a request for PC will be + converted into a request for the LR. */ + info->saved_regs[D10V_PC_REGNUM] = info->saved_regs[LR_REGNUM]; - /* The D10V_SP_REGNUM is special. Instead of the address of the SP, the - previous frame's SP value is saved. */ - info->saved_regs[D10V_SP_REGNUM] = info->prev_sp; + /* The previous frame's SP needed to be computed. Save the computed + value. */ + trad_frame_register_value (info->saved_regs, D10V_SP_REGNUM, + d10v_make_daddr (prev_sp)); return info; } @@ -873,7 +857,7 @@ d10v_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, int i; fprintf_filtered (file, " "); frame_read_register (frame, a, num); - for (i = 0; i < register_size (current_gdbarch, a); i++) + for (i = 0; i < register_size (gdbarch, a); i++) { fprintf_filtered (file, "%02x", (num[i] & 0xff)); } @@ -916,9 +900,11 @@ d10v_write_pc (CORE_ADDR val, ptid_t ptid) } static CORE_ADDR -d10v_read_sp (void) +d10v_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) { - return (d10v_make_daddr (read_register (D10V_SP_REGNUM))); + ULONGEST sp; + frame_unwind_unsigned_register (next_frame, D10V_SP_REGNUM, &sp); + return d10v_make_daddr (sp); } /* When arguments must be pushed onto the stack, they go on in reverse @@ -977,9 +963,10 @@ d10v_push_dummy_code (struct gdbarch *gdbarch, } static CORE_ADDR -d10v_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, - CORE_ADDR dummy_addr, int nargs, struct value **args, - CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) +d10v_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, + struct regcache *regcache, CORE_ADDR bp_addr, + int nargs, struct value **args, CORE_ADDR sp, int struct_return, + CORE_ADDR struct_addr) { int i; int regnum = ARG1_REGNUM; @@ -987,9 +974,9 @@ d10v_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, long val; /* Set the return address. For the d10v, the return breakpoint is - always at DUMMY_ADDR. */ + always at BP_ADDR. */ regcache_cooked_write_unsigned (regcache, LR_REGNUM, - d10v_convert_iaddr_to_raw (dummy_addr)); + d10v_convert_iaddr_to_raw (bp_addr)); /* If STRUCT_RETURN is true, then the struct return address (in STRUCT_ADDR) will consume the first argument-passing register. @@ -1442,54 +1429,6 @@ d10v_frame_this_id (struct frame_info *next_frame, (*this_id) = id; } -static void -saved_regs_unwinder (struct frame_info *next_frame, - CORE_ADDR *this_saved_regs, - int regnum, int *optimizedp, - enum lval_type *lvalp, CORE_ADDR *addrp, - int *realnump, void *bufferp) -{ - if (this_saved_regs[regnum] != 0) - { - if (regnum == D10V_SP_REGNUM) - { - /* SP register treated specially. */ - *optimizedp = 0; - *lvalp = not_lval; - *addrp = 0; - *realnump = -1; - if (bufferp != NULL) - store_unsigned_integer (bufferp, - register_size (current_gdbarch, regnum), - this_saved_regs[regnum]); - } - else - { - /* Any other register is saved in memory, fetch it but cache - a local copy of its value. */ - *optimizedp = 0; - *lvalp = lval_memory; - *addrp = this_saved_regs[regnum]; - *realnump = -1; - if (bufferp != NULL) - { - /* Read the value in from memory. */ - read_memory (this_saved_regs[regnum], bufferp, - register_size (current_gdbarch, regnum)); - } - } - return; - } - - /* No luck, assume this and the next frame have the same register - value. If a value is needed, pass the request on down the chain; - otherwise just return an indication that the value is in the same - register as the next frame. */ - frame_register_unwind (next_frame, regnum, optimizedp, lvalp, addrp, - realnump, bufferp); -} - - static void d10v_frame_prev_register (struct frame_info *next_frame, void **this_prologue_cache, @@ -1499,19 +1438,8 @@ d10v_frame_prev_register (struct frame_info *next_frame, { struct d10v_unwind_cache *info = d10v_frame_unwind_cache (next_frame, this_prologue_cache); - if (regnum == D10V_PC_REGNUM) - { - /* The call instruction saves the caller's PC in LR. The - function prologue of the callee may then save the LR on the - stack. Find that possibly saved LR value and return it. */ - saved_regs_unwinder (next_frame, info->saved_regs, LR_REGNUM, optimizedp, - lvalp, addrp, realnump, bufferp); - } - else - { - saved_regs_unwinder (next_frame, info->saved_regs, regnum, optimizedp, - lvalp, addrp, realnump, bufferp); - } + trad_frame_prev_register (next_frame, info->saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, bufferp); } static const struct frame_unwind d10v_frame_unwind = { @@ -1520,7 +1448,7 @@ static const struct frame_unwind d10v_frame_unwind = { d10v_frame_prev_register }; -const struct frame_unwind * +static const struct frame_unwind * d10v_frame_p (CORE_ADDR pc) { return &d10v_frame_unwind; @@ -1549,9 +1477,8 @@ static const struct frame_base d10v_frame_base = { static struct frame_id d10v_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) { - ULONGEST base; - frame_unwind_unsigned_register (next_frame, D10V_SP_REGNUM, &base); - return frame_id_build (d10v_make_daddr (base), frame_pc_unwind (next_frame)); + return frame_id_build (d10v_unwind_sp (gdbarch, next_frame), + frame_pc_unwind (next_frame)); } static gdbarch_init_ftype d10v_gdbarch_init; @@ -1600,7 +1527,7 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_read_pc (gdbarch, d10v_read_pc); set_gdbarch_write_pc (gdbarch, d10v_write_pc); - set_gdbarch_read_sp (gdbarch, d10v_read_sp); + set_gdbarch_unwind_sp (gdbarch, d10v_unwind_sp); set_gdbarch_num_regs (gdbarch, d10v_num_regs); set_gdbarch_sp_regnum (gdbarch, D10V_SP_REGNUM); @@ -1656,7 +1583,6 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_skip (gdbarch, 0); set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_frame_align (gdbarch, d10v_frame_align); set_gdbarch_register_sim_regno (gdbarch, d10v_register_sim_regno); @@ -1666,9 +1592,10 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) frame_unwind_append_predicate (gdbarch, d10v_frame_p); frame_base_set_default (gdbarch, &d10v_frame_base); - /* Methods for saving / extracting a dummy frame's ID. */ + /* Methods for saving / extracting a dummy frame's ID. The ID's + stack address must match the SP value returned by + PUSH_DUMMY_CALL, and saved by generic_save_dummy_frame_tos. */ set_gdbarch_unwind_dummy_id (gdbarch, d10v_unwind_dummy_id); - set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); /* Return the unwound PC value. */ set_gdbarch_unwind_pc (gdbarch, d10v_unwind_pc); diff --git a/gdb/dbug-rom.c b/gdb/dbug-rom.c index aadab6f5b06..a592334ea05 100644 --- a/gdb/dbug-rom.c +++ b/gdb/dbug-rom.c @@ -160,6 +160,8 @@ dbug_open (char *args, int from_tty) monitor_open (args, &dbug_cmds, from_tty); } +extern initialize_file_ftype _initialize_dbug_rom; /* -Wmissing-prototypes */ + void _initialize_dbug_rom (void) { diff --git a/gdb/dbxread.c b/gdb/dbxread.c index de4ea741b54..7acc01d079d 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -1232,7 +1232,7 @@ read_dbx_dynamic_symtab (struct objfile *objfile) } #ifdef SOFUN_ADDRESS_MAYBE_MISSING -CORE_ADDR +static CORE_ADDR find_stab_function_addr (char *namestring, const char *filename, struct objfile *objfile) { diff --git a/gdb/defs.h b/gdb/defs.h index f9229b32327..a3895407847 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -405,6 +405,8 @@ extern void reinitialize_more_filter (void); /* Normal results */ extern struct ui_file *gdb_stdout; +/* Input stream */ +extern struct ui_file *gdb_stdin; /* Serious error notifications */ extern struct ui_file *gdb_stderr; /* Log/debug/trace messages that should bypass normal stdout/stderr @@ -417,6 +419,8 @@ extern struct ui_file *gdb_stdlog; very near future that restriction shall be removed - either call shall be unfiltered. (cagney 1999-07-02). */ extern struct ui_file *gdb_stdtarg; +extern struct ui_file *gdb_stdtargerr; +extern struct ui_file *gdb_stdtargin; #if defined(TUI) #include "tui.h" @@ -881,6 +885,9 @@ extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (pri extern NORETURN void error_stream (struct ui_file *) ATTR_NORETURN; +/* Initialize the error buffer. */ +extern void error_init (void); + /* Returns a freshly allocate buffer containing the last error message. */ extern char *error_last_message (void); @@ -1126,8 +1133,6 @@ extern ULONGEST extract_unsigned_integer (const void *, int); extern int extract_long_unsigned_integer (const void *, int, LONGEST *); -extern CORE_ADDR extract_address (const void *, int); - extern CORE_ADDR extract_typed_address (const void *buf, struct type *type); extern void store_signed_integer (void *, int, LONGEST); diff --git a/gdb/dictionary.c b/gdb/dictionary.c index 68366498f6d..38020007637 100644 --- a/gdb/dictionary.c +++ b/gdb/dictionary.c @@ -51,8 +51,8 @@ their structs have the same initial data members. Define accessor macros for your new data members. - * Implement all the functions in dict_vtbl as static functions, - whose name is the same as the corresponding member of dict_vtbl + * Implement all the functions in dict_vector as static functions, + whose name is the same as the corresponding member of dict_vector plus _. You don't have to do this for those members where you can reuse existing generic functions (e.g. add_symbol_nonexpandable, free_obstack) or in the case where @@ -60,7 +60,7 @@ and where the variant doesn't affect the member function in question. - * Define a static const struct dict_vtbl dict__vtbl. + * Define a static const struct dict_vector dict__vector. * Define a function dict_create_ to create these gizmos. Add its declaration to dictionary.h. @@ -68,7 +68,7 @@ To add a new operation on all existing implementations, what you should do is: - * Add a new member to struct dict_vtbl. + * Add a new member to struct dict_vector. * If there is useful generic behavior , define a static function _something_informative that implements that behavior. @@ -78,10 +78,10 @@ behavior for , define a static function _ implementing it. - * Modify all existing dict_vtbl_'s to include the appropriate + * Modify all existing dict_vector_'s to include the appropriate member. - * Define a function dict_ that looks up in the dict_vtbl + * Define a function dict_ that looks up in the dict_vector and calls the appropriate function. Add a declaration for dict_ to dictionary.h. @@ -104,7 +104,7 @@ enum dict_type /* The virtual function table. */ -struct dict_vtbl +struct dict_vector { /* The type of the dictionary. This is only here to make debugging a bit easier; it's not actually used. */ @@ -123,6 +123,8 @@ struct dict_vtbl struct dict_iterator *iterator); struct symbol *(*iter_name_next) (const char *name, struct dict_iterator *iterator); + /* A size function, for maint print symtabs. */ + int (*size) (const struct dictionary *dict); }; /* Now comes the structs used to store the data for different @@ -165,7 +167,7 @@ struct dictionary_linear_expandable struct dictionary { - const struct dict_vtbl *vtbl; + const struct dict_vector *vector; union { struct dictionary_hashed hashed; @@ -178,7 +180,7 @@ struct dictionary /* Accessor macros. */ -#define DICT_VTBL(d) (d)->vtbl +#define DICT_VECTOR(d) (d)->vector /* These can be used for DICT_HASHED_EXPANDABLE, too. */ @@ -219,7 +221,7 @@ struct dictionary otherwise, this is unused. */ #define DICT_ITERATOR_CURRENT(iter) (iter)->current -/* Declarations of functions for vtbls. */ +/* Declarations of functions for vectors. */ /* Functions that might work across a range of dictionary types. */ @@ -243,6 +245,10 @@ static struct symbol *iter_name_first_hashed (const struct dictionary *dict, static struct symbol *iter_name_next_hashed (const char *name, struct dict_iterator *iterator); +/* Functions only for DICT_HASHED. */ + +static int size_hashed (const struct dictionary *dict); + /* Functions only for DICT_HASHED_EXPANDABLE. */ static void free_hashed_expandable (struct dictionary *dict); @@ -250,6 +256,8 @@ static void free_hashed_expandable (struct dictionary *dict); static void add_symbol_hashed_expandable (struct dictionary *dict, struct symbol *sym); +static int size_hashed_expandable (const struct dictionary *dict); + /* Functions for DICT_LINEAR and DICT_LINEAR_EXPANDABLE dictionaries. */ @@ -265,6 +273,7 @@ static struct symbol *iter_name_first_linear (const struct dictionary *dict, static struct symbol *iter_name_next_linear (const char *name, struct dict_iterator *iterator); +static int size_linear (const struct dictionary *dict); /* Functions only for DICT_LINEAR_EXPANDABLE. */ @@ -273,40 +282,58 @@ static void free_linear_expandable (struct dictionary *dict); static void add_symbol_linear_expandable (struct dictionary *dict, struct symbol *sym); -/* Various vtbls that we'll actually use. */ +/* Various vectors that we'll actually use. */ -static const struct dict_vtbl dict_hashed_vtbl = +static const struct dict_vector dict_hashed_vector = { - DICT_HASHED, free_obstack, add_symbol_nonexpandable, - iterator_first_hashed, iterator_next_hashed, - iter_name_first_hashed, iter_name_next_hashed, + DICT_HASHED, /* type */ + free_obstack, /* free */ + add_symbol_nonexpandable, /* add_symbol */ + iterator_first_hashed, /* iteractor_first */ + iterator_next_hashed, /* iterator_next */ + iter_name_first_hashed, /* iter_name_first */ + iter_name_next_hashed, /* iter_name_next */ + size_hashed, /* size */ }; -static const struct dict_vtbl dict_hashed_expandable_vtbl = +static const struct dict_vector dict_hashed_expandable_vector = { - DICT_HASHED_EXPANDABLE, free_hashed_expandable, - add_symbol_hashed_expandable, - iterator_first_hashed, iterator_next_hashed, - iter_name_first_hashed, iter_name_next_hashed, + DICT_HASHED_EXPANDABLE, /* type */ + free_hashed_expandable, /* free */ + add_symbol_hashed_expandable, /* add_symbol */ + iterator_first_hashed, /* iteractor_first */ + iterator_next_hashed, /* iterator_next */ + iter_name_first_hashed, /* iter_name_first */ + iter_name_next_hashed, /* iter_name_next */ + size_hashed_expandable, /* size */ }; -static const struct dict_vtbl dict_linear_vtbl = +static const struct dict_vector dict_linear_vector = { - DICT_LINEAR, free_obstack, add_symbol_nonexpandable, - iterator_first_linear, iterator_next_linear, - iter_name_first_linear, iter_name_next_linear, + DICT_LINEAR, /* type */ + free_obstack, /* free */ + add_symbol_nonexpandable, /* add_symbol */ + iterator_first_linear, /* iteractor_first */ + iterator_next_linear, /* iterator_next */ + iter_name_first_linear, /* iter_name_first */ + iter_name_next_linear, /* iter_name_next */ + size_linear, /* size */ }; -static const struct dict_vtbl dict_linear_expandable_vtbl = +static const struct dict_vector dict_linear_expandable_vector = { - DICT_LINEAR_EXPANDABLE, free_linear_expandable, - add_symbol_linear_expandable, - iterator_first_linear, iterator_next_linear, - iter_name_first_linear, iter_name_next_linear, + DICT_LINEAR_EXPANDABLE, /* type */ + free_linear_expandable, /* free */ + add_symbol_linear_expandable, /* add_symbol */ + iterator_first_linear, /* iteractor_first */ + iterator_next_linear, /* iterator_next */ + iter_name_first_linear, /* iter_name_first */ + iter_name_next_linear, /* iter_name_next */ + size_linear, /* size */ }; /* Declarations of helper functions (i.e. ones that don't go into - vtbls). */ + vectors). */ static struct symbol *iterator_hashed_advance (struct dict_iterator *iter); @@ -331,7 +358,7 @@ dict_create_hashed (struct obstack *obstack, const struct pending *list_counter; retval = obstack_alloc (obstack, sizeof (struct dictionary)); - DICT_VTBL (retval) = &dict_hashed_vtbl; + DICT_VECTOR (retval) = &dict_hashed_vector; /* Calculate the number of symbols, and allocate space for them. */ for (list_counter = symbol_list; @@ -371,7 +398,7 @@ dict_create_hashed_expandable (void) struct dictionary *retval; retval = xmalloc (sizeof (struct dictionary)); - DICT_VTBL (retval) = &dict_hashed_expandable_vtbl; + DICT_VECTOR (retval) = &dict_hashed_expandable_vector; DICT_HASHED_NBUCKETS (retval) = DICT_EXPANDABLE_INITIAL_CAPACITY; DICT_HASHED_BUCKETS (retval) = xcalloc (DICT_EXPANDABLE_INITIAL_CAPACITY, sizeof (struct symbol *)); @@ -395,7 +422,7 @@ dict_create_linear (struct obstack *obstack, const struct pending *list_counter; retval = obstack_alloc (obstack, sizeof (struct dictionary)); - DICT_VTBL (retval) = &dict_linear_vtbl; + DICT_VECTOR (retval) = &dict_linear_vector; /* Calculate the number of symbols, and allocate space for them. */ for (list_counter = symbol_list; @@ -436,7 +463,7 @@ dict_create_linear_expandable (void) struct dictionary *retval; retval = xmalloc (sizeof (struct dictionary)); - DICT_VTBL (retval) = &dict_linear_expandable_vtbl; + DICT_VECTOR (retval) = &dict_linear_expandable_vector; DICT_LINEAR_NSYMS (retval) = 0; DICT_LINEAR_EXPANDABLE_CAPACITY (retval) = DICT_EXPANDABLE_INITIAL_CAPACITY; @@ -455,7 +482,7 @@ dict_create_linear_expandable (void) void dict_free (struct dictionary *dict) { - (DICT_VTBL (dict))->free (dict); + (DICT_VECTOR (dict))->free (dict); } /* Add SYM to DICT. DICT had better be expandable. */ @@ -463,7 +490,7 @@ dict_free (struct dictionary *dict) void dict_add_symbol (struct dictionary *dict, struct symbol *sym) { - (DICT_VTBL (dict))->add_symbol (dict, sym); + (DICT_VECTOR (dict))->add_symbol (dict, sym); } /* Initialize ITERATOR to point at the first symbol in DICT, and @@ -473,7 +500,7 @@ struct symbol * dict_iterator_first (const struct dictionary *dict, struct dict_iterator *iterator) { - return (DICT_VTBL (dict))->iterator_first (dict, iterator); + return (DICT_VECTOR (dict))->iterator_first (dict, iterator); } /* Advance ITERATOR, and return the next symbol, or NULL if there are @@ -482,7 +509,7 @@ dict_iterator_first (const struct dictionary *dict, struct symbol * dict_iterator_next (struct dict_iterator *iterator) { - return (DICT_VTBL (DICT_ITERATOR_DICT (iterator))) + return (DICT_VECTOR (DICT_ITERATOR_DICT (iterator))) ->iterator_next (iterator); } @@ -491,15 +518,21 @@ dict_iter_name_first (const struct dictionary *dict, const char *name, struct dict_iterator *iterator) { - return (DICT_VTBL (dict))->iter_name_first (dict, name, iterator); + return (DICT_VECTOR (dict))->iter_name_first (dict, name, iterator); } struct symbol * dict_iter_name_next (const char *name, struct dict_iterator *iterator) { - return (DICT_VTBL (DICT_ITERATOR_DICT (iterator))) + return (DICT_VECTOR (DICT_ITERATOR_DICT (iterator))) ->iter_name_next (name, iterator); } + +int +dict_size (const struct dictionary *dict) +{ + return (DICT_VECTOR (dict))->size (dict); +} /* Now come functions (well, one function, currently) that are implemented generically by means of the vtable. Typically, they're @@ -643,11 +676,16 @@ insert_symbol_hashed (struct dictionary *dict, hash_index = (msymbol_hash_iw (SYMBOL_NATURAL_NAME (sym)) % DICT_HASHED_NBUCKETS (dict)); - gdb_assert (sym != buckets[hash_index]); sym->hash_next = buckets[hash_index]; buckets[hash_index] = sym; } +static int +size_hashed (const struct dictionary *dict) +{ + return DICT_HASHED_NBUCKETS (dict); +} + /* Functions only for DICT_HASHED_EXPANDABLE. */ static void @@ -670,6 +708,12 @@ add_symbol_hashed_expandable (struct dictionary *dict, DICT_HASHED_EXPANDABLE_NSYMS (dict) = nsyms; } +static int +size_hashed_expandable (const struct dictionary *dict) +{ + return DICT_HASHED_EXPANDABLE_NSYMS (dict); +} + static void expand_hashtable (struct dictionary *dict) { @@ -757,6 +801,12 @@ iter_name_next_linear (const char *name, struct dict_iterator *iterator) return retval; } +static int +size_linear (const struct dictionary *dict) +{ + return DICT_LINEAR_NSYMS (dict); +} + /* Functions only for DICT_LINEAR_EXPANDABLE. */ static void diff --git a/gdb/dictionary.h b/gdb/dictionary.h index eea273b4793..75edd7fb67a 100644 --- a/gdb/dictionary.h +++ b/gdb/dictionary.h @@ -136,6 +136,10 @@ extern struct symbol *dict_iter_name_first (const struct dictionary *dict, extern struct symbol *dict_iter_name_next (const char *name, struct dict_iterator *iterator); +/* Return some notion of the size of the dictionary: the number of + symbols if we have that, the number of hash buckets otherwise. */ + +extern int dict_size (const struct dictionary *dict); /* Macro to loop through all symbols in a dictionary DICT, in no particular order. ITER is a struct dict_iterator (NOTE: __not__ a diff --git a/gdb/dink32-rom.c b/gdb/dink32-rom.c index f62e7129c36..3b10c7caa2e 100644 --- a/gdb/dink32-rom.c +++ b/gdb/dink32-rom.c @@ -142,6 +142,8 @@ dink32_open (char *args, int from_tty) monitor_open (args, &dink32_cmds, from_tty); } +extern initialize_file_ftype _initialize_dink32_rom; /* -Wmissing-prototypes */ + void _initialize_dink32_rom (void) { diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 2cd0984205b..3d396013241 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,65 @@ +2003-06-24 Joel Brobecker + + * gdb.texinfo (Unsupported languages): New section. + (Languages): Add link to new section. + +2003-06-22 Andrew Cagney + + * gdb.texinfo (Contributors): Mention 6.0 release engineer. + +2003-06-22 Daniel Jacobowitz + + * gdbint.texinfo (Coding): Clarify use of gdb_XXX.h headers. + +2003-06-22 Daniel Jacobowitz + + * Makefile.in (SFILES_INCLUDED): Add agentexpr.texi. + * agentexpr.texi: Retitle section, and change it to an appendix. + Comment out texinfo initialization. Factor a @var{} into two + pieces to prevent makeinfo warnings. + * gdb.texinfo: Add Agent Expressions appendix. + +2003-06-19 Daniel Jacobowitz + + * gdbint.texinfo (Native Conditionals): Remove PREPARE_TO_PROCEED. + +2003-06-18 Daniel Jacobowitz + + * gdb.texinfo (Remote Debugging): New section "Connecting to a + remote target". Document the "detach" and "disconnect" commands. + (Server, Netware, Debug Session): Reference "Connecting to a + remote target". + (GDB/MI Target Manipulation): Document "-target-disconnect". + +2003-06-13 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Deprecate + REMOTE_BREAKPOINT, LITTLE_REMOTE_BREAKPOINT, and + BIG_REMOTE_BREAKPOINT. Cross reference BREAKPOINT_FROM_PC. + +2003-06-09 Jim Blandy + + * gdb.texinfo (Separate Debug Files): Remove extra semicolon. + +2003-06-08 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Delete + documentation on FRAME_ARGS_ADDRESS_CORRECT. + +2003-06-08 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Document + "unwind_sp". Cross reference "unwind_sp" and TARGET_READ_SP. + +2003-06-07 Adam Fedor + + * gdb.texinfo: Add Objective-C documentation. + +2003-06-01 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Add "func_addr" + parameter to "push_dummy_call". Rename "dummy_addr" to "bp_addr". + 2003-05-21 Andrew Cagney * gdbint.texinfo (Target Architecture Definition): Delete diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index fcdabc5bf1a..eda637cf19d 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -1,4 +1,4 @@ -##Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2002 +##Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003 ##Free Software Foundation, Inc. # Makefile for GDB documentation. @@ -100,6 +100,7 @@ DVIPS = dvips GDB_DOC_SOURCE_INCLUDES = \ $(srcdir)/fdl.texi \ $(srcdir)/gpl.texi \ + $(srcdir)/agentexpr.texi \ $(READLINE_DIR)/rluser.texinfo \ $(READLINE_DIR)/inc-hist.texinfo GDB_DOC_BUILD_INCLUDES = \ diff --git a/gdb/doc/agentexpr.texi b/gdb/doc/agentexpr.texi index 0135391bac2..79985b7a0ec 100644 --- a/gdb/doc/agentexpr.texi +++ b/gdb/doc/agentexpr.texi @@ -1,14 +1,14 @@ -\input texinfo +@c \input texinfo @c %**start of header -@setfilename agentexpr.info -@settitle GDB Agent Expressions -@setchapternewpage off +@c @setfilename agentexpr.info +@c @settitle GDB Agent Expressions +@c @setchapternewpage off @c %**end of header -Revision: $Id$ +@c Revision: $Id$ -@node The GDB Agent Expression Mechanism -@chapter The GDB Agent Expression Mechanism +@node Agent Expressions +@appendix The GDB Agent Expression Mechanism In some applications, it is not feasable for the debugger to interrupt the program's execution long enough for the developer to learn anything @@ -299,7 +299,7 @@ Pop two integers from the stack; let @var{a} be the next-to-top value, and @var{b} be the top value. Shift @var{a} left by @var{b} bits, and push the result. -@item @code{rsh_signed} (0x0a): @var{a} @var{b} @result{} @var{@code{(signed)}a>>b} +@item @code{rsh_signed} (0x0a): @var{a} @var{b} @result{} @code{(signed)}@var{a>>b} Pop two integers from the stack; let @var{a} be the next-to-top value, and @var{b} be the top value. Shift @var{a} right by @var{b} bits, inserting copies of the top bit at the high end, and push the result. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 9136e653773..05715e137df 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -156,6 +156,7 @@ Copyright (C) 1988-2003 Free Software Foundation, Inc. * Installing GDB:: Installing GDB * Maintenance Commands:: Maintenance Commands * Remote Protocol:: GDB Remote Serial Protocol +* Agent Expressions:: The GDB Agent Expression Mechanism * Copying:: GNU General Public License says how you can copy and share GDB * GNU Free Documentation License:: The license for this documentation @@ -210,6 +211,9 @@ syntax. it may be necessary to refer to some variables with a trailing underscore. +@value{GDBN} can be used to debug programs written in Objective-C, +using either the Apple/NeXT or the GNU Objective-C runtime. + @menu * Free Software:: Freely redistributable software * Contributors:: Contributors to GDB @@ -343,7 +347,7 @@ omitted from this list, we would like to add your names! So that they may not regard their many labors as thankless, we particularly thank those who shepherded @value{GDBN} through major releases: -Andrew Cagney (releases 5.3, 5.2, 5.1 and 5.0); +Andrew Cagney (releases 6.0, 5.3, 5.2, 5.1 and 5.0); Jim Blandy (release 4.18); Jason Molenda (release 4.17); Stan Shebs (release 4.14); @@ -3180,7 +3184,8 @@ end @cindex overloading @cindex symbol overloading -Some programming languages (notably C@t{++}) permit a single function name +Some programming languages (notably C@t{++} and Objective-C) permit a +single function name to be defined several times, for application in different contexts. This is called @dfn{overloading}. When a function name is overloaded, @samp{break @var{function}} is not enough to tell @value{GDBN} where you want @@ -7432,6 +7437,7 @@ language}. * Show:: Displaying the language * Checks:: Type and range checks * Support:: Supported languages +* Unsupported languages:: Unsupported languages @end menu @node Setting @@ -7487,6 +7493,9 @@ C source file @itemx .c++ C@t{++} source file +@item .m +Objective-C source file + @item .f @itemx .F Fortran source file @@ -7762,7 +7771,7 @@ being set automatically by @value{GDBN}. @node Support @section Supported languages -@value{GDBN} supports C, C@t{++}, Fortran, Java, assembly, and Modula-2. +@value{GDBN} supports C, C@t{++}, Objective-C, Fortran, Java, assembly, and Modula-2. @c This is false ... Some @value{GDBN} features may be used in expressions regardless of the language you use: the @value{GDBN} @code{@@} and @code{::} operators, @@ -7779,8 +7788,9 @@ books written on each of these languages; please look to these for a language reference or tutorial. @menu -* C:: C and C@t{++} -* Modula-2:: Modula-2 +* C:: C and C@t{++} +* Objective-C:: Objective-C +* Modula-2:: Modula-2 @end menu @node C @@ -8297,7 +8307,101 @@ available choices, or to finish the type list for you. @xref{Completion,, Command completion}, for details on how to do this. @end table -@node Modula-2 +@node Objective-C +@subsection Objective-C + +@cindex Objective-C +This section provides information about some commands and command +options that are useful for debugging Objective-C code. + +@menu +* Method Names in Commands:: +* The Print Command with Objective-C:: +@end menu + +@node Method Names in Commands, The Print Command with Objective-C, Objective-C, Objective-C +@subsubsection Method Names in Commands + +The following commands have been extended to accept Objective-C method +names as line specifications: + +@kindex clear@r{, and Objective-C} +@kindex break@r{, and Objective-C} +@kindex info line@r{, and Objective-C} +@kindex jump@r{, and Objective-C} +@kindex list@r{, and Objective-C} +@itemize +@item @code{clear} +@item @code{break} +@item @code{info line} +@item @code{jump} +@item @code{list} +@end itemize + +A fully qualified Objective-C method name is specified as + +@smallexample +-[@var{Class} @var{methodName}] +@end smallexample + +where the minus sign is used to indicate an instance method and a plus +sign (not shown) is used to indicate a class method. The +class name @var{Class} and method name @var{methoName} are enclosed in +brackets, similar to the way messages are specified in Objective-C source +code. For example, to set a breakpoint at the @code{create} instance method of +class @code{Fruit} in the program currently being debugged, enter: + +@smallexample +break -[Fruit create] +@end smallexample + +To list ten program lines around the @code{initialize} class method, +enter: + +@smallexample +list +[NSText initialize] +@end smallexample + +In the current version of GDB, the plus or minus sign is required. In +future versions of GDB, the plus or minus sign will be optional, but you +can use it to narrow the search. It is also possible to specify just a +method name: + +@smallexample +break create +@end smallexample + +You must specify the complete method name, including any colons. If +your program's source files contain more than one @code{create} method, +you'll be presented with a numbered list of classes that implement that +method. Indicate your choice by number, or type @samp{0} to exit if +none apply. + +As another example, to clear a breakpoint established at the +@code{makeKeyAndOrderFront:} method of the @code{NSWindow} class, enter: + +@smallexample +clear -[NSWindow makeKeyAndOrderFront:] +@end smallexample + +@node The Print Command with Objective-C +@subsubsection The Print Command With Objective-C + +The print command has also been extended to accept methods. For example: + +@smallexample +print -[object hash] +@end smallexample + +@cindex print an Objective-C object description +will tell gdb to send the -hash message to object and print the +result. Also an additional command has been added, @code{print-object} +or @code{po} for short, which is meant to print the description of an +object. However, this command may only work with certain Objective-C +libraries that have a particular hook function, called +@code{_NSPrintForDebugger} defined. + +@node Modula-2, , Objective-C, Support @subsection Modula-2 @cindex Modula-2, @value{GDBN} support @@ -8740,6 +8844,22 @@ address can be specified by an integral constant, the construct In @value{GDBN} scripts, the Modula-2 inequality operator @code{#} is interpreted as the beginning of a comment. Use @code{<>} instead. +@node Unsupported languages +@section Unsupported languages + +@cindex unsupported languages +@cindex minimal language +In addition to the other fully-supported programming languages, +@value{GDBN} also provides a pseudo-language, called @code{minimal}. +It does not represent a real programming language, but provides a set +of capabilities close to what the C or assembly languages provide. +This should allow most simple operations to be performed while debugging +an application that uses a language currently not supported by @value{GDBN}. + +If the language is set to @code{auto}, @value{GDBN} will automatically +select this language if the current frame corresponds to an unsupported +language. + @node Symbols @chapter Examining the Symbol Table @@ -8937,6 +9057,20 @@ Print the names and data types of all variables (except for local variables) whose names contain a match for regular expression @var{regexp}. +@kindex info classes +@item info classes +@itemx info classes @var{regexp} +Display all Objective-C classes in your program, or +(with the @var{regexp} argument) all those matching a particular regular +expression. + +@kindex info selectors +@item info selectors +@itemx info selectors @var{regexp} +Display all Objective-C selectors in your program, or +(with the @var{regexp} argument) all those matching a particular regular +expression. + @ignore This was never implemented. @kindex info methods @@ -10011,7 +10145,7 @@ gnu_debuglink_crc32 (unsigned long crc, crc = ~crc & 0xffffffff; for (end = buf + len; buf < end; ++buf) crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8); - return ~crc & 0xffffffff;; + return ~crc & 0xffffffff; @} @end smallexample @@ -10397,12 +10531,112 @@ is supported other than to try it. @chapter Debugging remote programs @menu +* Connecting:: Connecting to a remote target * Server:: Using the gdbserver program * NetWare:: Using the gdbserve.nlm program * Remote configuration:: Remote configuration * remote stub:: Implementing a remote stub @end menu +@node Connecting +@section Connecting to a remote target + +On the @value{GDBN} host machine, you will need an unstripped copy of +your program, since @value{GDBN} needs symobl and debugging information. +Start up @value{GDBN} as usual, using the name of the local copy of your +program as the first argument. + +@cindex serial line, @code{target remote} +If you're using a serial line, you may want to give @value{GDBN} the +@w{@samp{--baud}} option, or use the @code{set remotebaud} command +before the @code{target} command. + +After that, use @code{target remote} to establish communications with +the target machine. Its argument specifies how to communicate---either +via a devicename attached to a direct serial line, or a TCP or UDP port +(possibly to a terminal server which in turn has a serial line to the +target). For example, to use a serial line connected to the device +named @file{/dev/ttyb}: + +@smallexample +target remote /dev/ttyb +@end smallexample + +@cindex TCP port, @code{target remote} +To use a TCP connection, use an argument of the form +@code{@var{host}:@var{port}} or @code{tcp:@var{host}:@var{port}}. +For example, to connect to port 2828 on a +terminal server named @code{manyfarms}: + +@smallexample +target remote manyfarms:2828 +@end smallexample + +If your remote target is actually running on the same machine as +your debugger session (e.g.@: a simulator of your target running on +the same host), you can omit the hostname. For example, to connect +to port 1234 on your local machine: + +@smallexample +target remote :1234 +@end smallexample +@noindent + +Note that the colon is still required here. + +@cindex UDP port, @code{target remote} +To use a UDP connection, use an argument of the form +@code{udp:@var{host}:@var{port}}. For example, to connect to UDP port 2828 +on a terminal server named @code{manyfarms}: + +@smallexample +target remote udp:manyfarms:2828 +@end smallexample + +When using a UDP connection for remote debugging, you should keep in mind +that the `U' stands for ``Unreliable''. UDP can silently drop packets on +busy or unreliable networks, which will cause havoc with your debugging +session. + +Now you can use all the usual commands to examine and change data and to +step and continue the remote program. + +@cindex interrupting remote programs +@cindex remote programs, interrupting +Whenever @value{GDBN} is waiting for the remote program, if you type the +interrupt character (often @key{C-C}), @value{GDBN} attempts to stop the +program. This may or may not succeed, depending in part on the hardware +and the serial drivers the remote system uses. If you type the +interrupt character once again, @value{GDBN} displays this prompt: + +@smallexample +Interrupted while waiting for the program. +Give up (and stop debugging it)? (y or n) +@end smallexample + +If you type @kbd{y}, @value{GDBN} abandons the remote debugging session. +(If you decide you want to try again later, you can use @samp{target +remote} again to connect once more.) If you type @kbd{n}, @value{GDBN} +goes back to waiting. + +@table @code +@kindex detach (remote) +@item detach +When you have finished debugging the remote program, you can use the +@code{detach} command to release it from @value{GDBN} control. +Detaching from the target normally resumes its execution, but the results +will depend on your particular remote stub. After the @code{detach} +command, @value{GDBN} is free to connect to another target. + +@kindex disconnect +@item disconnect +The @code{disconnect} command behaves like @code{detach}, except that +the target is generally not resumed. It will wait for @value{GDBN} +(this instance or another one) to connect and continue debugging. After +the @code{disconnect} command, @value{GDBN} is again free to connect to +another target. +@end table + @node Server @section Using the @code{gdbserver} program @@ -10485,34 +10719,15 @@ target> gdbserver @var{comm} --attach @var{pid} @var{pid} is the process ID of a currently running process. It isn't necessary to point @code{gdbserver} at a binary for the running process. -@item On the @value{GDBN} host machine, -you need an unstripped copy of your program, since @value{GDBN} needs -symbols and debugging information. Start up @value{GDBN} as usual, -using the name of the local copy of your program as the first argument. -(You may also need the @w{@samp{--baud}} option if the serial line is -running at anything other than 9600@dmn{bps}.) After that, use @code{target -remote} to establish communications with @code{gdbserver}. Its argument -is either a device name (usually a serial device, like -@file{/dev/ttyb}), or a TCP port descriptor in the form -@code{@var{host}:@var{PORT}}. For example: - -@smallexample -(@value{GDBP}) target remote /dev/ttyb -@end smallexample - -@noindent -communicates with the server via serial line @file{/dev/ttyb}, and - -@smallexample -(@value{GDBP}) target remote the-target:2345 -@end smallexample - -@noindent -communicates via a TCP connection to port 2345 on host @w{@file{the-target}}. +@item On the host machine, +connect to your target (@pxref{Connecting,,Connecting to a remote target}). For TCP connections, you must start up @code{gdbserver} prior to using the @code{target remote} command. Otherwise you may get an error whose text depends on the host system, but which usually looks something like -@samp{Connection refused}. +@samp{Connection refused}. You don't need to use the @code{load} +command in @value{GDBN} when using gdbserver, since the program is +already on the target. + @end table @node NetWare @@ -10554,22 +10769,10 @@ using a 19200@dmn{bps} connection: load gdbserve BOARD=1 PORT=2 BAUD=19200 emacs foo.txt @end smallexample -@item On the @value{GDBN} host machine, -you need an unstripped copy of your program, since @value{GDBN} needs -symbols and debugging information. Start up @value{GDBN} as usual, -using the name of the local copy of your program as the first argument. -(You may also need the @w{@samp{--baud}} option if the serial line is -running at anything other than 9600@dmn{bps}. After that, use @code{target -remote} to establish communications with @code{gdbserve.nlm}. Its -argument is a device name (usually a serial device, like -@file{/dev/ttyb}). For example: - -@smallexample -(@value{GDBP}) target remote /dev/ttyb -@end smallexample +@item +On the @value{GDBN} host machine, connect to your target (@pxref{Connecting,, +Connecting to a remote target}). -@noindent -communications with the server via serial line @file{/dev/ttyb}. @end table @node Remote configuration @@ -10891,87 +11094,11 @@ Download your program to your target machine (or get it there by whatever means the manufacturer provides), and start it. @item -To start remote debugging, run @value{GDBN} on the host machine, and specify -as an executable file the program that is running in the remote machine. -This tells @value{GDBN} how to find your program's symbols and the contents -of its pure text. - -@item -@cindex serial line, @code{target remote} -Establish communication using the @code{target remote} command. -Its argument specifies how to communicate with the target -machine---either via a devicename attached to a direct serial line, or a -TCP or UDP port (usually to a terminal server which in turn has a serial line -to the target). For example, to use a serial line connected to the -device named @file{/dev/ttyb}: - -@smallexample -target remote /dev/ttyb -@end smallexample - -@cindex TCP port, @code{target remote} -To use a TCP connection, use an argument of the form -@code{@var{host}:@var{port}} or @code{tcp:@var{host}:@var{port}}. -For example, to connect to port 2828 on a -terminal server named @code{manyfarms}: - -@smallexample -target remote manyfarms:2828 -@end smallexample - -If your remote target is actually running on the same machine as -your debugger session (e.g.@: a simulator of your target running on -the same host), you can omit the hostname. For example, to connect -to port 1234 on your local machine: - -@smallexample -target remote :1234 -@end smallexample -@noindent - -Note that the colon is still required here. - -@cindex UDP port, @code{target remote} -To use a UDP connection, use an argument of the form -@code{udp:@var{host}:@var{port}}. For example, to connect to UDP port 2828 -on a terminal server named @code{manyfarms}: - -@smallexample -target remote udp:manyfarms:2828 -@end smallexample - -When using a UDP connection for remote debugging, you should keep in mind -that the `U' stands for ``Unreliable''. UDP can silently drop packets on -busy or unreliable networks, which will cause havoc with your debugging -session. +Start @value{GDBN} on the host, and connect to the target +(@pxref{Connecting,,Connecting to a remote target}). @end enumerate -Now you can use all the usual commands to examine and change data and to -step and continue the remote program. - -To resume the remote program and stop debugging it, use the @code{detach} -command. - -@cindex interrupting remote programs -@cindex remote programs, interrupting -Whenever @value{GDBN} is waiting for the remote program, if you type the -interrupt character (often @key{C-C}), @value{GDBN} attempts to stop the -program. This may or may not succeed, depending in part on the hardware -and the serial drivers the remote system uses. If you type the -interrupt character once again, @value{GDBN} displays this prompt: - -@smallexample -Interrupted while waiting for the program. -Give up (and stop debugging it)? (y or n) -@end smallexample - -If you type @kbd{y}, @value{GDBN} abandons the remote debugging session. -(If you decide you want to try again later, you can use @samp{target -remote} again to connect once more.) If you type @kbd{n}, @value{GDBN} -goes back to waiting. - - @node Configurations @chapter Configuration-Specific Information @@ -17276,6 +17403,31 @@ The corresponding @value{GDBN} command is @samp{detach}. @end smallexample +@subheading The @code{-target-disconnect} Command +@findex -target-disconnect + +@subsubheading Synopsis + +@example + -target-disconnect +@end example + +Disconnect from the remote target. There's no output. + +@subsubheading @value{GDBN} command + +The corresponding @value{GDBN} command is @samp{disconnect}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-target-disconnect +^done +(@value{GDBP}) +@end smallexample + + @subheading The @code{-target-download} Command @findex -target-download @@ -19659,7 +19811,7 @@ Toggle debug flag. @cindex @code{D} packet Detach @value{GDBN} from the remote system. Sent to the remote target -before @value{GDBN} disconnects. +before @value{GDBN} disconnects via the @code{detach} command. Reply: @table @samp @@ -21586,6 +21738,8 @@ host is called: <- @code{T02} @end smallexample +@include agentexpr.texi + @include gpl.texi @include fdl.texi diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 90b25750ca7..4f031e0f6b1 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -3012,24 +3012,26 @@ Similar to BREAKPOINT, but used for bi-endian targets. @code{BIG_BREAKPOINT} and @code{LITTLE_BREAKPOINT} have been deprecated in favor of @code{BREAKPOINT_FROM_PC}. -@item REMOTE_BREAKPOINT -@itemx LITTLE_REMOTE_BREAKPOINT -@itemx BIG_REMOTE_BREAKPOINT -@findex BIG_REMOTE_BREAKPOINT -@findex LITTLE_REMOTE_BREAKPOINT -@findex REMOTE_BREAKPOINT -Similar to BREAKPOINT, but used for remote targets. - -@code{BIG_REMOTE_BREAKPOINT} and @code{LITTLE_REMOTE_BREAKPOINT} have been -deprecated in favor of @code{BREAKPOINT_FROM_PC}. +@item DEPRECATED_REMOTE_BREAKPOINT +@itemx DEPRECATED_LITTLE_REMOTE_BREAKPOINT +@itemx DEPRECATED_BIG_REMOTE_BREAKPOINT +@findex DEPRECATED_BIG_REMOTE_BREAKPOINT +@findex DEPRECATED_LITTLE_REMOTE_BREAKPOINT +@findex DEPRECATED_REMOTE_BREAKPOINT +Specify the breakpoint instruction sequence for a remote target. +@code{DEPRECATED_REMOTE_BREAKPOINT}, +@code{DEPRECATED_BIG_REMOTE_BREAKPOINT} and +@code{DEPRECATED_LITTLE_REMOTE_BREAKPOINT} have been deprecated in +favor of @code{BREAKPOINT_FROM_PC} (@pxref{BREAKPOINT_FROM_PC}). @item BREAKPOINT_FROM_PC (@var{pcptr}, @var{lenptr}) @findex BREAKPOINT_FROM_PC -Use the program counter to determine the contents and size of a -breakpoint instruction. It returns a pointer to a string of bytes -that encode a breakpoint instruction, stores the length of the string -to *@var{lenptr}, and adjusts pc (if necessary) to point to the actual -memory location where the breakpoint should be inserted. +@anchor{BREAKPOINT_FROM_PC} Use the program counter to determine the +contents and size of a breakpoint instruction. It returns a pointer to +a string of bytes that encode a breakpoint instruction, stores the +length of the string to @code{*@var{lenptr}}, and adjusts the program +counter (if necessary) to point to the actual memory location where the +breakpoint should be inserted. Although it is common to use a trap instruction for a breakpoint, it's not required; for instance, the bit pattern could be an invalid @@ -3233,10 +3235,6 @@ the direction of stack growth. By default, no frame based stack alignment is performed. -@item FRAME_ARGS_ADDRESS_CORRECT -@findex FRAME_ARGS_ADDRESS_CORRECT -See @file{stack.c}. - @item DEPRECATED_FRAME_CHAIN(@var{frame}) @findex DEPRECATED_FRAME_CHAIN Given @var{frame}, return a pointer to the calling frame. @@ -3291,6 +3289,23 @@ return d10v_make_iaddr (pc); @noindent @xref{DEPRECATED_FRAME_SAVED_PC}, which this method replaces. +@item CORE_ADDR unwind_sp (struct frame_info *@var{this_frame}) +@findex unwind_sp +@anchor{unwind_sp} Return the frame's inner most stack address. This is +commonly refered to as the frame's @dfn{stack pointer}. + +The implementation, which must be frame agnostic (work with any frame), +is typically no more than: + +@smallexample +ULONGEST sp; +frame_unwind_unsigned_register (this_frame, D10V_SP_REGNUM, &sp); +return d10v_make_daddr (sp); +@end smallexample + +@noindent +@xref{TARGET_READ_SP}, which this method replaces. + @item FUNCTION_EPILOGUE_SIZE @findex FUNCTION_EPILOGUE_SIZE For some COFF targets, the @code{x_sym.x_misc.x_fsize} field of the @@ -3678,14 +3693,13 @@ definition is only used in generic code when parsing "$ps".) If defined, used by @code{frame_pop} to remove a stack frame. This method has been superseeded by generic code. -@item push_dummy_call (@var{gdbarch}, @var{regcache}, @var{dummy_addr}, @var{nargs}, @var{args}, @var{sp}, @var{struct_return}, @var{struct_addr}) +@item push_dummy_call (@var{gdbarch}, @var{func_addr}, @var{regcache}, @var{pc_addr}, @var{nargs}, @var{args}, @var{sp}, @var{struct_return}, @var{struct_addr}) @findex push_dummy_call @findex DEPRECATED_PUSH_ARGUMENTS. -@anchor{push_dummy_call} -Define this to push the dummy frame's call to the inferior function onto -the stack. In addition to pushing @var{nargs}, the code should push -@var{struct_addr} (when @var{struct_return}), and the return value (in -the call dummy at @var{dummy_addr}). +@anchor{push_dummy_call} Define this to push the dummy frame's call to +the inferior function onto the stack. In addition to pushing +@var{nargs}, the code should push @var{struct_addr} (when +@var{struct_return}), and the return address (@var{bp_addr}). Returns the updated top-of-stack pointer. @@ -3891,15 +3905,17 @@ Number of bits in a short integer; defaults to @code{2 * TARGET_CHAR_BIT}. @findex write_pc @findex read_sp @findex read_fp -These change the behavior of @code{read_pc}, @code{write_pc}, -@code{read_sp} and @code{deprecated_read_fp}. For most targets, these -may be left undefined. @value{GDBN} will call the read and write -register functions with the relevant @code{_REGNUM} argument. +@anchor{TARGET_READ_SP} These change the behavior of @code{read_pc}, +@code{write_pc}, @code{read_sp} and @code{deprecated_read_fp}. For most +targets, these may be left undefined. @value{GDBN} will call the read +and write register functions with the relevant @code{_REGNUM} argument. These macros are useful when a target keeps one of these registers in a hard to get at place; for example, part in a segment register and part in an ordinary register. +@xref{unwind_sp}, which replaces @code{TARGET_READ_SP}. + @item TARGET_VIRTUAL_FRAME_POINTER(@var{pc}, @var{regp}, @var{offsetp}) @findex TARGET_VIRTUAL_FRAME_POINTER Returns a @code{(register, offset)} pair representing the virtual frame @@ -4478,23 +4494,6 @@ root directory. Define this to be able to, when a breakpoint insertion fails, warn the user that another process may be running with the same executable. -@item PREPARE_TO_PROCEED (@var{select_it}) -@findex PREPARE_TO_PROCEED -This (ugly) macro allows a native configuration to customize the way the -@code{proceed} function in @file{infrun.c} deals with switching between -threads. - -In a multi-threaded task we may select another thread and then continue -or step. But if the old thread was stopped at a breakpoint, it will -immediately cause another breakpoint stop without any execution (i.e. it -will report a breakpoint hit incorrectly). So @value{GDBN} must step over it -first. - -If defined, @code{PREPARE_TO_PROCEED} should check the current thread -against the thread that reported the most recent event. If a step-over -is required, it returns TRUE. If @var{select_it} is non-zero, it should -reselect the old thread. - @item PROC_NAME_FMT @findex PROC_NAME_FMT Defines the format for the name of a @file{/proc} device. Should be @@ -5192,7 +5191,11 @@ of @value{GDBN}) must be added to @file{gdb/config/djgpp/fnchange.lst}. When @value{GDBN} has a local version of a system header file (ex @file{string.h}) the file name based on the POSIX header prefixed with -@file{gdb_} (@file{gdb_string.h}). +@file{gdb_} (@file{gdb_string.h}). These headers should be relatively +independent: they should use only macros defined by @file{configure}, +the compiler, or the host; they should include only system headers; they +should refer only to system types. They may be shared between multiple +programs, e.g.@: @value{GDBN} and @sc{gdbserver}. For other files @samp{-} is used as the separator. diff --git a/gdb/doublest.c b/gdb/doublest.c index 101240b5b6d..09bb15502ba 100644 --- a/gdb/doublest.c +++ b/gdb/doublest.c @@ -404,7 +404,15 @@ convert_doublest_to_floatformat (CONST struct floatformat *fmt, { mant_long <<= 1; mant_long &= 0xffffffffL; - mant_bits -= 1; + /* If we are processing the top 32 mantissa bits of a doublest + so as to convert to a float value with implied integer bit, + we will only be putting 31 of those 32 bits into the + final value due to the discarding of the top bit. In the + case of a small float value where the number of mantissa + bits is less than 32, discarding the top bit does not alter + the number of bits we will be adding to the result. */ + if (mant_bits == 32) + mant_bits -= 1; } if (mant_bits < 32) @@ -625,7 +633,7 @@ floatformat_from_doublest (const struct floatformat *fmt, target-dependent code, the format of floating-point types is known, but not passed on by GDB. This should be fixed. */ -const struct floatformat * +static const struct floatformat * floatformat_from_length (int len) { if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT) diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c index 94413f4baef..9870433c3e1 100644 --- a/gdb/dummy-frame.c +++ b/gdb/dummy-frame.c @@ -99,7 +99,7 @@ find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp) FP against the saved SP and FP. NOTE: If you're trying to fix a problem with GDB not correctly finding a dummy frame, check the comments that go with FRAME_ALIGN() and - SAVE_DUMMY_FRAME_TOS(). */ + UNWIND_DUMMY_ID(). */ if (fp != dummyframe->fp && fp != dummyframe->sp) continue; } @@ -360,10 +360,6 @@ dummy_frame_this_id (struct frame_info *next_frame, just asking for trouble. */ if (gdbarch_unwind_dummy_id_p (current_gdbarch)) { - /* Assume call_function_by_hand(), via SAVE_DUMMY_FRAME_TOS, - previously saved the dummy frame's ID. Things only work if - the two return the same value. */ - gdb_assert (SAVE_DUMMY_FRAME_TOS_P ()); /* Use an architecture specific method to extract the prev's dummy ID from the next frame. Note that this method uses frame_register_unwind to obtain the register values needed to diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c deleted file mode 100644 index 085c91cd311..00000000000 --- a/gdb/dwarf2cfi.c +++ /dev/null @@ -1,1970 +0,0 @@ -/* Stack unwinding code based on dwarf2 frame info for GDB, the GNU debugger. - - Copyright 2001, 2002, 2003 Free Software Foundation, Inc. - - Contributed by Jiri Smid, SuSE Labs. - Based on code written by Daniel Berlin (dan@dberlin.org). - - This file is part of GDB. - - 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. */ - -#include "defs.h" -#include "gdbcore.h" -#include "symtab.h" -#include "symfile.h" -#include "objfiles.h" -#include "target.h" -#include "elf/dwarf2.h" -#include "inferior.h" -#include "regcache.h" -#include "dwarf2cfi.h" -#include "gdb_assert.h" - -/* Common Information Entry - holds information that is shared among many - Frame Descriptors. */ -struct cie_unit -{ - /* Offset of this unit in .debug_frame or .eh_frame. */ - ULONGEST offset; - - /* A null-terminated string that identifies the augmentation to this CIE or - to the FDEs that use it. */ - char *augmentation; - - /* A constant that is factored out of all advance location instructions. */ - unsigned int code_align; - - /* A constant that is factored out of all offset instructions. */ - int data_align; - - /* A constant that indicates which regiter represents the return address - of a function. */ - unsigned char ra; - - /* Indicates how addresses are encoded. */ - unsigned char addr_encoding; - - /* Pointer and length of the cie program. */ - char *data; - unsigned int data_length; - - struct objfile *objfile; - - /* Next in chain. */ - struct cie_unit *next; -}; - -/* Frame Description Entry. */ -struct fde_unit -{ - /* Address of the first location associated with this entry. */ - CORE_ADDR initial_location; - - /* Length of program section described by this entry. */ - CORE_ADDR address_range; - - /* Pointer to asociated CIE. */ - struct cie_unit *cie_ptr; - - /* Pointer and length of the cie program. */ - char *data; - unsigned int data_length; -}; - -struct fde_array -{ - struct fde_unit **array; - int elems; - int array_size; -}; - -struct frame_state_reg -{ - union - { - unsigned int reg; - long offset; - unsigned char *exp; - } - loc; - enum - { - REG_UNSAVED, - REG_SAVED_OFFSET, - REG_SAVED_REG, - REG_SAVED_EXP, - } - how; -}; - -struct frame_state -{ - /* Each register save state can be described in terms of a CFA slot, - another register, or a location expression. */ - struct frame_state_regs - { - struct frame_state_reg *reg; - - /* Used to implement DW_CFA_remember_state. */ - struct frame_state_regs *prev; - } - regs; - - /* The CFA can be described in terms of a reg+offset or a - location expression. */ - long cfa_offset; - int cfa_reg; - unsigned char *cfa_exp; - enum - { - CFA_UNSET, - CFA_REG_OFFSET, - CFA_EXP, - } - cfa_how; - - /* The PC described by the current frame state. */ - CORE_ADDR pc; - - /* The information we care about from the CIE/FDE. */ - int data_align; - unsigned int code_align; - unsigned char retaddr_column; - unsigned char addr_encoding; - - struct objfile *objfile; -}; - -enum ptr_encoding -{ - PE_absptr = DW_EH_PE_absptr, - PE_pcrel = DW_EH_PE_pcrel, - PE_textrel = DW_EH_PE_textrel, - PE_datarel = DW_EH_PE_datarel, - PE_funcrel = DW_EH_PE_funcrel -}; - -#define UNWIND_CONTEXT(fi) ((struct context *) (deprecated_get_frame_context (fi))) - - -static struct cie_unit *cie_chunks; -static struct fde_array fde_chunks; -/* Obstack for allocating temporary storage used during unwind operations. */ -static struct obstack unwind_tmp_obstack; - -extern file_ptr dwarf_frame_offset; -extern unsigned int dwarf_frame_size; -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); - -static struct fde_unit *fde_unit_alloc (void); -static struct cie_unit *cie_unit_alloc (void); -static void fde_chunks_need_space (); - -static void unwind_tmp_obstack_init (); -static void unwind_tmp_obstack_free (); - -static unsigned int read_1u (bfd *abfd, char **p); -static int read_1s (bfd *abfd, char **p); -static unsigned int read_2u (bfd *abfd, char **p); -static int read_2s (bfd *abfd, char **p); -static unsigned int read_4u (bfd *abfd, char **p); -static int read_4s (bfd *abfd, char **p); -static ULONGEST read_8u (bfd *abfd, char **p); -static LONGEST read_8s (bfd *abfd, char **p); - -static ULONGEST read_uleb128 (bfd *abfd, char **p); -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 LONGEST read_initial_length (bfd *abfd, char *buf, int *bytes_read); -static ULONGEST read_length (bfd *abfd, char *buf, int *bytes_read, - int dwarf64); - -static int is_cie (ULONGEST cie_id, int dwarf64); -static int compare_fde_unit (const void *a, const void *b); -void dwarf2_build_frame_info (struct objfile *objfile); - -static void execute_cfa_program (struct objfile *objfile, char *insn_ptr, - char *insn_end, struct context *context, - struct frame_state *fs); -static struct fde_unit *get_fde_for_addr (CORE_ADDR pc); -static void frame_state_for (struct context *context, struct frame_state *fs); -static void get_reg (char *reg, struct context *context, int regnum); -static CORE_ADDR execute_stack_op (struct objfile *objfile, - char *op_ptr, char *op_end, - struct context *context, - CORE_ADDR initial); -static void update_context (struct context *context, struct frame_state *fs, - int chain); - - -/* Memory allocation functions. */ -static struct fde_unit * -fde_unit_alloc (void) -{ - struct fde_unit *fde; - - fde = (struct fde_unit *) xmalloc (sizeof (struct fde_unit)); - memset (fde, 0, sizeof (struct fde_unit)); - return fde; -} - -static struct cie_unit * -cie_unit_alloc (void) -{ - struct cie_unit *cie; - - cie = (struct cie_unit *) xmalloc (sizeof (struct cie_unit)); - memset (cie, 0, sizeof (struct cie_unit)); - return cie; -} - -static void -fde_chunks_need_space (void) -{ - if (fde_chunks.elems < fde_chunks.array_size) - return; - fde_chunks.array_size = - fde_chunks.array_size ? 2 * fde_chunks.array_size : 1024; - fde_chunks.array = - xrealloc (fde_chunks.array, - sizeof (struct fde_unit) * fde_chunks.array_size); -} - -/* Alocate a new `struct context' on temporary obstack. */ -struct context * -context_alloc (void) -{ - struct context *context; - - int regs_size = sizeof (struct context_reg) * NUM_REGS; - - context = (struct context *) obstack_alloc (&unwind_tmp_obstack, - sizeof (struct context)); - memset (context, 0, sizeof (struct context)); - context->reg = (struct context_reg *) obstack_alloc (&unwind_tmp_obstack, - regs_size); - memset (context->reg, 0, regs_size); - return context; -} - -/* Alocate a new `struct frame_state' on temporary obstack. */ -struct frame_state * -frame_state_alloc (void) -{ - struct frame_state *fs; - - int regs_size = sizeof (struct frame_state_reg) * NUM_REGS; - - fs = (struct frame_state *) obstack_alloc (&unwind_tmp_obstack, - sizeof (struct frame_state)); - memset (fs, 0, sizeof (struct frame_state)); - fs->regs.reg = - (struct frame_state_reg *) obstack_alloc (&unwind_tmp_obstack, regs_size); - memset (fs->regs.reg, 0, regs_size); - return fs; -} - -static void -unwind_tmp_obstack_init (void) -{ - obstack_init (&unwind_tmp_obstack); -} - -static void -unwind_tmp_obstack_free (void) -{ - obstack_free (&unwind_tmp_obstack, NULL); - unwind_tmp_obstack_init (); -} - -void -context_cpy (struct context *dst, struct context *src) -{ - int regs_size = sizeof (struct context_reg) * NUM_REGS; - struct context_reg *dreg; - - /* Since `struct context' contains a pointer to an array with - register values, make sure we end up with a copy of that array, - and not with a copy of the pointer to that array. */ - dreg = dst->reg; - *dst = *src; - dst->reg = dreg; - memcpy (dst->reg, src->reg, regs_size); -} - -static unsigned int -read_1u (bfd *abfd, char **p) -{ - unsigned ret; - - ret = bfd_get_8 (abfd, (bfd_byte *) * p); - (*p)++; - return ret; -} - -static int -read_1s (bfd *abfd, char **p) -{ - int ret; - - ret = bfd_get_signed_8 (abfd, (bfd_byte *) * p); - (*p)++; - return ret; -} - -static unsigned int -read_2u (bfd *abfd, char **p) -{ - unsigned ret; - - ret = bfd_get_16 (abfd, (bfd_byte *) * p); - (*p) += 2; - return ret; -} - -static int -read_2s (bfd *abfd, char **p) -{ - int ret; - - ret = bfd_get_signed_16 (abfd, (bfd_byte *) * p); - (*p) += 2; - return ret; -} - -static unsigned int -read_4u (bfd *abfd, char **p) -{ - unsigned int ret; - - ret = bfd_get_32 (abfd, (bfd_byte *) * p); - (*p) += 4; - return ret; -} - -static int -read_4s (bfd *abfd, char **p) -{ - int ret; - - ret = bfd_get_signed_32 (abfd, (bfd_byte *) * p); - (*p) += 4; - return ret; -} - -static ULONGEST -read_8u (bfd *abfd, char **p) -{ - ULONGEST ret; - - ret = bfd_get_64 (abfd, (bfd_byte *) * p); - (*p) += 8; - return ret; -} - -static LONGEST -read_8s (bfd *abfd, char **p) -{ - LONGEST ret; - - ret = bfd_get_signed_64 (abfd, (bfd_byte *) * p); - (*p) += 8; - return ret; -} - -static ULONGEST -read_uleb128 (bfd *abfd, char **p) -{ - ULONGEST ret; - int i, shift; - unsigned char byte; - - ret = 0; - shift = 0; - i = 0; - while (1) - { - byte = bfd_get_8 (abfd, (bfd_byte *) * p); - (*p)++; - ret |= ((unsigned long) (byte & 127) << shift); - if ((byte & 128) == 0) - { - break; - } - shift += 7; - } - return ret; -} - -static LONGEST -read_sleb128 (bfd *abfd, char **p) -{ - LONGEST ret; - int i, shift, size, num_read; - unsigned char byte; - - ret = 0; - shift = 0; - size = 32; - num_read = 0; - i = 0; - while (1) - { - byte = bfd_get_8 (abfd, (bfd_byte *) * p); - (*p)++; - ret |= ((long) (byte & 127) << shift); - shift += 7; - if ((byte & 128) == 0) - { - break; - } - } - if ((shift < size) && (byte & 0x40)) - { - ret |= -(1 << shift); - } - return ret; -} - -static CORE_ADDR -read_pointer (bfd *abfd, char **p) -{ - switch (TARGET_ADDR_BIT / TARGET_CHAR_BIT) - { - case 4: - return read_4u (abfd, p); - case 8: - return read_8u (abfd, p); - default: - error - ("dwarf cfi error: unsupported target address length [in module %s]", - bfd_get_filename (abfd)); - } -} - -/* Read the appropriate amount of data from *P and return the - resulting value based on ENCODING, which the calling function must - provide. */ -static CORE_ADDR -read_encoded_pointer (bfd *abfd, char **p, unsigned char encoding) -{ - CORE_ADDR ret; - - switch (encoding & 0x0f) - { - case DW_EH_PE_absptr: - ret = read_pointer (abfd, p); - break; - - case DW_EH_PE_uleb128: - ret = read_uleb128 (abfd, p); - break; - case DW_EH_PE_sleb128: - ret = read_sleb128 (abfd, p); - break; - - case DW_EH_PE_udata2: - ret = read_2u (abfd, p); - break; - case DW_EH_PE_udata4: - ret = read_4u (abfd, p); - break; - case DW_EH_PE_udata8: - ret = read_8u (abfd, p); - break; - - case DW_EH_PE_sdata2: - ret = read_2s (abfd, p); - break; - case DW_EH_PE_sdata4: - ret = read_4s (abfd, p); - break; - case DW_EH_PE_sdata8: - ret = read_8s (abfd, p); - break; - - default: - internal_error (__FILE__, __LINE__, - "read_encoded_pointer: unknown pointer encoding [in module %s]", - bfd_get_filename (abfd)); - } - - return ret; -} - -/* The variable 'encoding' carries three different flags: - - encoding & 0x0f : size of the address (handled in read_encoded_pointer()) - - encoding & 0x70 : type (absolute, relative, ...) - - encoding & 0x80 : indirect flag (DW_EH_PE_indirect == 0x80). */ -enum ptr_encoding -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); - - switch (encoding & 0x70) - { - case DW_EH_PE_absptr: - case DW_EH_PE_pcrel: - case DW_EH_PE_textrel: - case DW_EH_PE_datarel: - case DW_EH_PE_funcrel: - ret = encoding & 0x70; - break; - default: - internal_error (__FILE__, __LINE__, - "CFI: unknown pointer encoding [in module %s]", - objfile->name); - } - return ret; -} - -static LONGEST -read_initial_length (bfd *abfd, char *buf, int *bytes_read) -{ - LONGEST ret = 0; - - ret = bfd_get_32 (abfd, (bfd_byte *) buf); - - if (ret == 0xffffffff) - { - ret = bfd_get_64 (abfd, (bfd_byte *) buf + 4); - *bytes_read = 12; - } - else - { - *bytes_read = 4; - } - - return ret; -} - -static ULONGEST -read_length (bfd *abfd, char *buf, int *bytes_read, int dwarf64) -{ - if (dwarf64) - { - *bytes_read = 8; - return read_8u (abfd, &buf); - } - else - { - *bytes_read = 4; - return read_4u (abfd, &buf); - } -} - -static void -execute_cfa_program (struct objfile *objfile, char *insn_ptr, char *insn_end, - struct context *context, struct frame_state *fs) -{ - struct frame_state_regs *unused_rs = NULL; - - /* Don't allow remember/restore between CIE and FDE programs. */ - fs->regs.prev = NULL; - - while (insn_ptr < insn_end && fs->pc < context->ra) - { - unsigned char insn = *insn_ptr++; - ULONGEST reg, uoffset; - LONGEST offset; - - if (insn & DW_CFA_advance_loc) - fs->pc += (insn & 0x3f) * fs->code_align; - else if (insn & DW_CFA_offset) - { - reg = insn & 0x3f; - uoffset = read_uleb128 (objfile->obfd, &insn_ptr); - offset = (long) uoffset *fs->data_align; - fs->regs.reg[reg].how = REG_SAVED_OFFSET; - fs->regs.reg[reg].loc.offset = offset; - } - else if (insn & DW_CFA_restore) - { - reg = insn & 0x3f; - fs->regs.reg[reg].how = REG_UNSAVED; - } - else - switch (insn) - { - case DW_CFA_set_loc: - fs->pc = read_encoded_pointer (objfile->obfd, &insn_ptr, - 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); - - break; - - case DW_CFA_advance_loc1: - fs->pc += read_1u (objfile->obfd, &insn_ptr); - break; - case DW_CFA_advance_loc2: - fs->pc += read_2u (objfile->obfd, &insn_ptr); - break; - case DW_CFA_advance_loc4: - fs->pc += read_4u (objfile->obfd, &insn_ptr); - break; - - case DW_CFA_offset_extended: - reg = read_uleb128 (objfile->obfd, &insn_ptr); - uoffset = read_uleb128 (objfile->obfd, &insn_ptr); - offset = (long) uoffset *fs->data_align; - fs->regs.reg[reg].how = REG_SAVED_OFFSET; - fs->regs.reg[reg].loc.offset = offset; - break; - - case DW_CFA_restore_extended: - reg = read_uleb128 (objfile->obfd, &insn_ptr); - fs->regs.reg[reg].how = REG_UNSAVED; - break; - - case DW_CFA_undefined: - case DW_CFA_same_value: - case DW_CFA_nop: - break; - - case DW_CFA_register: - { - ULONGEST reg2; - reg = read_uleb128 (objfile->obfd, &insn_ptr); - reg2 = read_uleb128 (objfile->obfd, &insn_ptr); - fs->regs.reg[reg].how = REG_SAVED_REG; - fs->regs.reg[reg].loc.reg = reg2; - } - break; - - case DW_CFA_remember_state: - { - struct frame_state_regs *new_rs; - if (unused_rs) - { - new_rs = unused_rs; - unused_rs = unused_rs->prev; - } - else - new_rs = xmalloc (sizeof (struct frame_state_regs)); - - *new_rs = fs->regs; - fs->regs.prev = new_rs; - } - break; - - case DW_CFA_restore_state: - { - struct frame_state_regs *old_rs = fs->regs.prev; - fs->regs = *old_rs; - old_rs->prev = unused_rs; - unused_rs = old_rs; - } - break; - - case DW_CFA_def_cfa: - reg = read_uleb128 (objfile->obfd, &insn_ptr); - uoffset = read_uleb128 (objfile->obfd, &insn_ptr); - fs->cfa_reg = reg; - fs->cfa_offset = uoffset; - fs->cfa_how = CFA_REG_OFFSET; - break; - - case DW_CFA_def_cfa_register: - reg = read_uleb128 (objfile->obfd, &insn_ptr); - fs->cfa_reg = reg; - fs->cfa_how = CFA_REG_OFFSET; - break; - - case DW_CFA_def_cfa_offset: - uoffset = read_uleb128 (objfile->obfd, &insn_ptr); - fs->cfa_offset = uoffset; - break; - - case DW_CFA_def_cfa_expression: - uoffset = read_uleb128 (objfile->obfd, &insn_ptr); - fs->cfa_exp = insn_ptr; - fs->cfa_how = CFA_EXP; - insn_ptr += uoffset; - break; - - case DW_CFA_expression: - reg = read_uleb128 (objfile->obfd, &insn_ptr); - uoffset = read_uleb128 (objfile->obfd, &insn_ptr); - fs->regs.reg[reg].how = REG_SAVED_EXP; - fs->regs.reg[reg].loc.exp = insn_ptr; - insn_ptr += uoffset; - break; - - /* From the 2.1 draft. */ - case DW_CFA_offset_extended_sf: - reg = read_uleb128 (objfile->obfd, &insn_ptr); - offset = read_sleb128 (objfile->obfd, &insn_ptr); - offset *= fs->data_align; - fs->regs.reg[reg].how = REG_SAVED_OFFSET; - fs->regs.reg[reg].loc.offset = offset; - break; - - case DW_CFA_def_cfa_sf: - reg = read_uleb128 (objfile->obfd, &insn_ptr); - offset = read_sleb128 (objfile->obfd, &insn_ptr); - fs->cfa_offset = offset; - fs->cfa_reg = reg; - fs->cfa_how = CFA_REG_OFFSET; - break; - - case DW_CFA_def_cfa_offset_sf: - uoffset = read_uleb128 (objfile->obfd, &insn_ptr); - fs->cfa_offset = uoffset; - /* cfa_how deliberately not set. */ - break; - - case DW_CFA_GNU_window_save: - /* ??? Hardcoded for SPARC register window configuration. */ - for (reg = 16; reg < 32; ++reg) - { - fs->regs.reg[reg].how = REG_SAVED_OFFSET; - fs->regs.reg[reg].loc.offset = (reg - 16) * sizeof (void *); - } - break; - - case DW_CFA_GNU_args_size: - uoffset = read_uleb128 (objfile->obfd, &insn_ptr); - context->args_size = uoffset; - break; - - case DW_CFA_GNU_negative_offset_extended: - /* Obsoleted by DW_CFA_offset_extended_sf, but used by - older PowerPC code. */ - reg = read_uleb128 (objfile->obfd, &insn_ptr); - uoffset = read_uleb128 (objfile->obfd, &insn_ptr); - offset = (long) uoffset *fs->data_align; - fs->regs.reg[reg].how = REG_SAVED_OFFSET; - fs->regs.reg[reg].loc.offset = -offset; - break; - - default: - error - ("dwarf cfi error: unknown cfa instruction %d [in module %s]", - insn, objfile->name); - } - } -} - -static struct fde_unit * -get_fde_for_addr (CORE_ADDR pc) -{ - size_t lo, hi; - struct fde_unit *fde = NULL; - lo = 0; - hi = fde_chunks.elems; - - while (lo < hi) - { - size_t i = (lo + hi) / 2; - fde = fde_chunks.array[i]; - if (pc < fde->initial_location) - hi = i; - else if (pc >= fde->initial_location + fde->address_range) - lo = i + 1; - else - return fde; - } - return 0; -} - -static void -frame_state_for (struct context *context, struct frame_state *fs) -{ - struct fde_unit *fde; - struct cie_unit *cie; - - context->args_size = 0; - context->lsda = 0; - - fde = get_fde_for_addr (context->ra - 1); - - if (fde == NULL) - return; - - fs->pc = fde->initial_location; - - gdb_assert (fde->cie_ptr != NULL); - - cie = fde->cie_ptr; - - fs->code_align = cie->code_align; - fs->data_align = cie->data_align; - fs->retaddr_column = cie->ra; - fs->addr_encoding = cie->addr_encoding; - fs->objfile = cie->objfile; - - execute_cfa_program (cie->objfile, cie->data, - cie->data + cie->data_length, context, fs); - execute_cfa_program (cie->objfile, fde->data, - fde->data + fde->data_length, context, fs); -} - -static void -get_reg (char *reg, struct context *context, int regnum) -{ - switch (context->reg[regnum].how) - { - case REG_CTX_UNSAVED: - deprecated_read_register_gen (regnum, reg); - break; - case REG_CTX_SAVED_OFFSET: - target_read_memory (context->cfa + context->reg[regnum].loc.offset, - reg, REGISTER_RAW_SIZE (regnum)); - break; - case REG_CTX_SAVED_REG: - deprecated_read_register_gen (context->reg[regnum].loc.reg, reg); - break; - case REG_CTX_SAVED_ADDR: - target_read_memory (context->reg[regnum].loc.addr, - reg, REGISTER_RAW_SIZE (regnum)); - break; - case REG_CTX_VALUE: - memcpy (reg, &context->reg[regnum].loc.addr, - REGISTER_RAW_SIZE (regnum)); - break; - default: - internal_error (__FILE__, __LINE__, "get_reg: unknown register rule"); - } -} - -/* Decode a DW_OP stack program. Return the top of stack. Push INITIAL - onto the stack to start. */ -static CORE_ADDR -execute_stack_op (struct objfile *objfile, - char *op_ptr, char *op_end, struct context *context, - CORE_ADDR initial) -{ - CORE_ADDR stack[64]; /* ??? Assume this is enough. */ - int stack_elt; - - stack[0] = initial; - stack_elt = 1; - - while (op_ptr < op_end) - { - enum dwarf_location_atom op = *op_ptr++; - CORE_ADDR result; - ULONGEST reg; - LONGEST offset; - - switch (op) - { - case DW_OP_lit0: - case DW_OP_lit1: - case DW_OP_lit2: - case DW_OP_lit3: - case DW_OP_lit4: - case DW_OP_lit5: - case DW_OP_lit6: - case DW_OP_lit7: - case DW_OP_lit8: - case DW_OP_lit9: - case DW_OP_lit10: - case DW_OP_lit11: - case DW_OP_lit12: - case DW_OP_lit13: - case DW_OP_lit14: - case DW_OP_lit15: - case DW_OP_lit16: - case DW_OP_lit17: - case DW_OP_lit18: - case DW_OP_lit19: - case DW_OP_lit20: - case DW_OP_lit21: - case DW_OP_lit22: - case DW_OP_lit23: - case DW_OP_lit24: - case DW_OP_lit25: - case DW_OP_lit26: - case DW_OP_lit27: - case DW_OP_lit28: - case DW_OP_lit29: - case DW_OP_lit30: - case DW_OP_lit31: - result = op - DW_OP_lit0; - break; - - case DW_OP_addr: - result = read_pointer (objfile->obfd, &op_ptr); - break; - - case DW_OP_const1u: - result = read_1u (objfile->obfd, &op_ptr); - break; - case DW_OP_const1s: - result = read_1s (objfile->obfd, &op_ptr); - break; - case DW_OP_const2u: - result = read_2u (objfile->obfd, &op_ptr); - break; - case DW_OP_const2s: - result = read_2s (objfile->obfd, &op_ptr); - break; - case DW_OP_const4u: - result = read_4u (objfile->obfd, &op_ptr); - break; - case DW_OP_const4s: - result = read_4s (objfile->obfd, &op_ptr); - break; - case DW_OP_const8u: - result = read_8u (objfile->obfd, &op_ptr); - break; - case DW_OP_const8s: - result = read_8s (objfile->obfd, &op_ptr); - break; - case DW_OP_constu: - result = read_uleb128 (objfile->obfd, &op_ptr); - break; - case DW_OP_consts: - result = read_sleb128 (objfile->obfd, &op_ptr); - break; - - case DW_OP_reg0: - case DW_OP_reg1: - case DW_OP_reg2: - case DW_OP_reg3: - case DW_OP_reg4: - case DW_OP_reg5: - case DW_OP_reg6: - case DW_OP_reg7: - case DW_OP_reg8: - case DW_OP_reg9: - case DW_OP_reg10: - case DW_OP_reg11: - case DW_OP_reg12: - case DW_OP_reg13: - case DW_OP_reg14: - case DW_OP_reg15: - case DW_OP_reg16: - case DW_OP_reg17: - case DW_OP_reg18: - case DW_OP_reg19: - case DW_OP_reg20: - case DW_OP_reg21: - case DW_OP_reg22: - case DW_OP_reg23: - case DW_OP_reg24: - case DW_OP_reg25: - case DW_OP_reg26: - case DW_OP_reg27: - case DW_OP_reg28: - case DW_OP_reg29: - case DW_OP_reg30: - case DW_OP_reg31: - get_reg ((char *) &result, context, op - DW_OP_reg0); - break; - case DW_OP_regx: - reg = read_uleb128 (objfile->obfd, &op_ptr); - get_reg ((char *) &result, context, reg); - break; - - case DW_OP_breg0: - case DW_OP_breg1: - case DW_OP_breg2: - case DW_OP_breg3: - case DW_OP_breg4: - case DW_OP_breg5: - case DW_OP_breg6: - case DW_OP_breg7: - case DW_OP_breg8: - case DW_OP_breg9: - case DW_OP_breg10: - case DW_OP_breg11: - case DW_OP_breg12: - case DW_OP_breg13: - case DW_OP_breg14: - case DW_OP_breg15: - case DW_OP_breg16: - case DW_OP_breg17: - case DW_OP_breg18: - case DW_OP_breg19: - case DW_OP_breg20: - case DW_OP_breg21: - case DW_OP_breg22: - case DW_OP_breg23: - case DW_OP_breg24: - case DW_OP_breg25: - case DW_OP_breg26: - case DW_OP_breg27: - case DW_OP_breg28: - case DW_OP_breg29: - case DW_OP_breg30: - case DW_OP_breg31: - offset = read_sleb128 (objfile->obfd, &op_ptr); - get_reg ((char *) &result, context, op - DW_OP_breg0); - result += offset; - break; - case DW_OP_bregx: - reg = read_uleb128 (objfile->obfd, &op_ptr); - offset = read_sleb128 (objfile->obfd, &op_ptr); - get_reg ((char *) &result, context, reg); - result += offset; - break; - - case DW_OP_dup: - if (stack_elt < 1) - 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); - 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); - 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); - result = stack[stack_elt - 2]; - break; - - case DW_OP_rot: - { - CORE_ADDR t1, t2, t3; - - if (stack_elt < 3) - 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]; - stack[stack_elt - 1] = t2; - stack[stack_elt - 2] = t3; - stack[stack_elt - 3] = t1; - goto no_push; - } - - case DW_OP_deref: - case DW_OP_deref_size: - case DW_OP_abs: - case DW_OP_neg: - case DW_OP_not: - case DW_OP_plus_uconst: - /* Unary operations. */ - if (--stack_elt < 0) - internal_error (__FILE__, __LINE__, - "execute_stack_op error [in module %s]", - objfile->name); - result = stack[stack_elt]; - - switch (op) - { - case DW_OP_deref: - { - 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); - result = read_memory_unsigned_integer (result, len); - } - break; - - case DW_OP_deref_size: - { - 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); - result = read_memory_unsigned_integer (result, len); - } - break; - - case DW_OP_abs: - if (result < 0) - result = -result; - break; - case DW_OP_neg: - result = -result; - break; - case DW_OP_not: - result = ~result; - break; - case DW_OP_plus_uconst: - result += read_uleb128 (objfile->obfd, &op_ptr); - break; - default: - break; - } - break; - - case DW_OP_and: - case DW_OP_div: - case DW_OP_minus: - case DW_OP_mod: - case DW_OP_mul: - case DW_OP_or: - case DW_OP_plus: - case DW_OP_le: - case DW_OP_ge: - case DW_OP_eq: - case DW_OP_lt: - case DW_OP_gt: - case DW_OP_ne: - { - /* Binary operations. */ - CORE_ADDR first, second; - if ((stack_elt -= 2) < 0) - internal_error (__FILE__, __LINE__, - "execute_stack_op error [in module %s]", - objfile->name); - second = stack[stack_elt]; - first = stack[stack_elt + 1]; - - switch (op) - { - case DW_OP_and: - result = second & first; - break; - case DW_OP_div: - result = (LONGEST) second / (LONGEST) first; - break; - case DW_OP_minus: - result = second - first; - break; - case DW_OP_mod: - result = (LONGEST) second % (LONGEST) first; - break; - case DW_OP_mul: - result = second * first; - break; - case DW_OP_or: - result = second | first; - break; - case DW_OP_plus: - result = second + first; - break; - case DW_OP_shl: - result = second << first; - break; - case DW_OP_shr: - result = second >> first; - break; - case DW_OP_shra: - result = (LONGEST) second >> first; - break; - case DW_OP_xor: - result = second ^ first; - break; - case DW_OP_le: - result = (LONGEST) first <= (LONGEST) second; - break; - case DW_OP_ge: - result = (LONGEST) first >= (LONGEST) second; - break; - case DW_OP_eq: - result = (LONGEST) first == (LONGEST) second; - break; - case DW_OP_lt: - result = (LONGEST) first < (LONGEST) second; - break; - case DW_OP_gt: - result = (LONGEST) first > (LONGEST) second; - break; - case DW_OP_ne: - result = (LONGEST) first != (LONGEST) second; - break; - default: - error - ("execute_stack_op: Unknown DW_OP_ value [in module %s]", - objfile->name); - break; - } - } - break; - - case DW_OP_skip: - offset = read_2s (objfile->obfd, &op_ptr); - op_ptr += offset; - goto no_push; - - case DW_OP_bra: - if (--stack_elt < 0) - 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; - goto no_push; - - case DW_OP_nop: - goto no_push; - - default: - 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); - stack[++stack_elt] = result; - no_push:; - } - - /* 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); - return stack[stack_elt]; -} - -static void -update_context (struct context *context, struct frame_state *fs, int chain) -{ - struct context *orig_context; - CORE_ADDR cfa = 0; - long i; - - unwind_tmp_obstack_init (); - - orig_context = context_alloc (); - context_cpy (orig_context, context); - - /* Compute this frame's CFA. */ - switch (fs->cfa_how) - { - case CFA_REG_OFFSET: - get_reg ((char *) &cfa, context, fs->cfa_reg); - cfa += fs->cfa_offset; - break; - - case CFA_EXP: - /* ??? No way of knowing what register number is the stack pointer - to do the same sort of handling as above. Assume that if the - CFA calculation is so complicated as to require a stack program - that this will not be a problem. */ - { - char *exp = fs->cfa_exp; - ULONGEST len; - - len = read_uleb128 (fs->objfile->obfd, &exp); - cfa = (CORE_ADDR) execute_stack_op (fs->objfile, exp, - exp + len, context, 0); - break; - } - default: - break; - } - context->cfa = cfa; - - if (!chain) - orig_context->cfa = cfa; - - /* Compute the addresses of all registers saved in this frame. */ - for (i = 0; i < NUM_REGS; ++i) - switch (fs->regs.reg[i].how) - { - case REG_UNSAVED: - if (i == SP_REGNUM) - { - context->reg[i].how = REG_CTX_VALUE; - context->reg[i].loc.addr = cfa; - } - else - context->reg[i].how = REG_CTX_UNSAVED; - break; - case REG_SAVED_OFFSET: - context->reg[i].how = REG_CTX_SAVED_OFFSET; - context->reg[i].loc.offset = fs->regs.reg[i].loc.offset; - break; - case REG_SAVED_REG: - switch (orig_context->reg[fs->regs.reg[i].loc.reg].how) - { - case REG_CTX_UNSAVED: - context->reg[i].how = REG_CTX_UNSAVED; - break; - case REG_CTX_SAVED_OFFSET: - context->reg[i].how = REG_CTX_SAVED_OFFSET; - context->reg[i].loc.offset = orig_context->cfa - context->cfa + - orig_context->reg[fs->regs.reg[i].loc.reg].loc.offset; - break; - case REG_CTX_SAVED_REG: - context->reg[i].how = REG_CTX_SAVED_REG; - context->reg[i].loc.reg = - orig_context->reg[fs->regs.reg[i].loc.reg].loc.reg; - break; - case REG_CTX_SAVED_ADDR: - context->reg[i].how = REG_CTX_SAVED_ADDR; - context->reg[i].loc.addr = - orig_context->reg[fs->regs.reg[i].loc.reg].loc.addr; - break; - default: - internal_error (__FILE__, __LINE__, "bad switch 0x%02X", - orig_context->reg[fs->regs.reg[i].loc.reg].how); - } - break; - case REG_SAVED_EXP: - { - char *exp = fs->regs.reg[i].loc.exp; - ULONGEST len; - CORE_ADDR val; - - len = read_uleb128 (fs->objfile->obfd, &exp); - val = execute_stack_op (fs->objfile, exp, exp + len, - orig_context, cfa); - context->reg[i].how = REG_CTX_SAVED_ADDR; - context->reg[i].loc.addr = val; - } - break; - default: - internal_error (__FILE__, __LINE__, "bad switch 0x%02X", - fs->regs.reg[i].how); - } - get_reg ((char *) &context->ra, context, fs->retaddr_column); - unwind_tmp_obstack_free (); -} - -static int -is_cie (ULONGEST cie_id, int dwarf64) -{ - return dwarf64 ? (cie_id == 0xffffffffffffffff) : (cie_id == 0xffffffff); -} - -static int -compare_fde_unit (const void *a, const void *b) -{ - struct fde_unit **first, **second; - first = (struct fde_unit **) a; - second = (struct fde_unit **) b; - if ((*first)->initial_location > (*second)->initial_location) - return 1; - else if ((*first)->initial_location < (*second)->initial_location) - return -1; - else - return 0; -} - -/* Build the cie_chunks and fde_chunks tables from informations - found in .debug_frame and .eh_frame sections. */ -/* We can handle both of these sections almost in the same way, however there - are some exceptions: - - CIE ID is -1 in debug_frame, but 0 in eh_frame - - eh_frame may contain some more information that are used only by gcc - (eg. personality pointer, LSDA pointer, ...). Most of them we can ignore. - - In debug_frame FDE's item cie_id contains offset of it's parent CIE. - In eh_frame FDE's item cie_id is a relative pointer to the parent CIE. - Anyway we don't need to bother with this, because we are smart enough - to keep the pointer to the parent CIE of oncomming FDEs in 'last_cie'. - - Although debug_frame items can contain Augmentation as well as - eh_frame ones, I have never seen them non-empty. Thus only in eh_frame - we can encounter for example non-absolute pointers (Aug. 'R'). - -- mludvig */ -static void -parse_frame_info (struct objfile *objfile, file_ptr frame_offset, - unsigned int frame_size, asection *frame_section, - int eh_frame) -{ - bfd *abfd = objfile->obfd; - asection *curr_section_ptr; - char *start = NULL; - char *end = NULL; - char *frame_buffer = NULL; - char *curr_section_name, *aug_data; - struct cie_unit *last_cie = NULL; - int last_dup_fde = 0; - int aug_len, i; - CORE_ADDR curr_section_vma = 0; - - unwind_tmp_obstack_init (); - - frame_buffer = dwarf2_read_section (objfile, frame_offset, frame_size, - frame_section); - - start = frame_buffer; - end = frame_buffer + frame_size; - - curr_section_name = eh_frame ? ".eh_frame" : ".debug_frame"; - curr_section_ptr = bfd_get_section_by_name (abfd, curr_section_name); - if (curr_section_ptr) - curr_section_vma = curr_section_ptr->vma; - - if (start) - { - while (start < end) - { - unsigned long length; - ULONGEST cie_id; - ULONGEST unit_offset = start - frame_buffer; - int bytes_read, dwarf64; - char *block_end; - - length = read_initial_length (abfd, start, &bytes_read); - start += bytes_read; - dwarf64 = (bytes_read == 12); - block_end = start + length; - - if (length == 0) - { - start = block_end; - continue; - } - - cie_id = read_length (abfd, start, &bytes_read, dwarf64); - start += bytes_read; - - if ((eh_frame && cie_id == 0) || is_cie (cie_id, dwarf64)) - { - struct cie_unit *cie = cie_unit_alloc (); - char *aug; - - cie->objfile = objfile; - cie->next = cie_chunks; - cie_chunks = cie; - - cie->objfile = objfile; - - cie->offset = unit_offset; - - start++; /* version */ - - cie->augmentation = aug = start; - while (*start++); /* Skips last NULL as well */ - - cie->code_align = read_uleb128 (abfd, &start); - cie->data_align = read_sleb128 (abfd, &start); - cie->ra = read_1u (abfd, &start); - - /* Augmentation: - z Indicates that a uleb128 is present to size the - augmentation section. - L Indicates the encoding (and thus presence) of - an LSDA pointer in the FDE augmentation. - R Indicates a non-default pointer encoding for - FDE code pointers. - P Indicates the presence of an encoding + language - personality routine in the CIE augmentation. - - [This info comes from GCC's dwarf2out.c] - */ - if (*aug == 'z') - { - aug_len = read_uleb128 (abfd, &start); - aug_data = start; - start += aug_len; - ++aug; - } - - cie->data = start; - cie->data_length = block_end - cie->data; - - while (*aug != '\0') - { - if (aug[0] == 'e' && aug[1] == 'h') - { - aug_data += sizeof (void *); - aug++; - } - else if (aug[0] == 'R') - cie->addr_encoding = *aug_data++; - else if (aug[0] == 'P') - { - CORE_ADDR pers_addr; - int pers_addr_enc; - - pers_addr_enc = *aug_data++; - /* We don't need pers_addr value and so we - don't care about it's encoding. */ - pers_addr = read_encoded_pointer (abfd, &aug_data, - pers_addr_enc); - } - else if (aug[0] == 'L' && eh_frame) - { - int lsda_addr_enc; - - /* Perhaps we should save this to CIE for later use? - Do we need it for something in GDB? */ - lsda_addr_enc = *aug_data++; - } - else - warning ("CFI warning: unknown augmentation \"%c\"" - " in \"%s\" of\n" - "\t%s", aug[0], curr_section_name, - objfile->name); - aug++; - } - - last_cie = cie; - } - else - { - struct fde_unit *fde; - struct cie_unit *cie; - int dup = 0; - CORE_ADDR init_loc; - - /* We assume that debug_frame is in order - CIE,FDE,CIE,FDE,FDE,... and thus the CIE for this FDE - should be stored in last_cie pointer. If not, we'll - try to find it by the older way. */ - if (last_cie) - cie = last_cie; - else - { - warning ("CFI: last_cie == NULL. " - "Perhaps a malformed %s section in '%s'...?\n", - curr_section_name, objfile->name); - - cie = cie_chunks; - while (cie) - { - if (cie->objfile == objfile) - { - if (eh_frame && - (cie->offset == - (unit_offset + bytes_read - cie_id))) - break; - if (!eh_frame && (cie->offset == cie_id)) - break; - } - - cie = cie->next; - } - if (!cie) - error ("CFI: can't find CIE pointer [in module %s]", - bfd_get_filename (abfd)); - } - - init_loc = read_encoded_pointer (abfd, &start, - cie->addr_encoding); - - switch (pointer_encoding (cie->addr_encoding, objfile)) - { - case PE_absptr: - break; - case PE_pcrel: - /* start-frame_buffer gives offset from - the beginning of actual section. */ - init_loc += curr_section_vma + start - frame_buffer; - break; - default: - warning ("CFI: Unsupported pointer encoding [in module %s]", - bfd_get_filename (abfd)); - } - - /* For relocatable objects we must add an offset telling - where the section is actually mapped in the memory. */ - init_loc += ANOFFSET (objfile->section_offsets, - SECT_OFF_TEXT (objfile)); - - /* If we have both .debug_frame and .eh_frame present in - a file, we must eliminate duplicate FDEs. For now we'll - run through all entries in fde_chunks and check it one - by one. Perhaps in the future we can implement a faster - searching algorithm. */ - /* eh_frame==2 indicates, that this file has an already - parsed .debug_frame too. When eh_frame==1 it means, that no - .debug_frame is present and thus we don't need to check for - duplicities. eh_frame==0 means, that we parse .debug_frame - and don't need to care about duplicate FDEs, because - .debug_frame is parsed first. */ - if (eh_frame == 2) - for (i = 0; eh_frame == 2 && i < fde_chunks.elems; i++) - { - /* We assume that FDEs in .debug_frame and .eh_frame - have the same order (if they are present, of course). - If we find a duplicate entry for one FDE and save - it's index to last_dup_fde it's very likely, that - we'll find an entry for the following FDE right after - the previous one. Thus in many cases we'll run this - loop only once. */ - last_dup_fde = (last_dup_fde + i) % fde_chunks.elems; - if (fde_chunks.array[last_dup_fde]->initial_location - == init_loc) - { - dup = 1; - break; - } - } - - /* Allocate a new entry only if this FDE isn't a duplicate of - something we have already seen. */ - if (!dup) - { - fde_chunks_need_space (); - fde = fde_unit_alloc (); - - fde_chunks.array[fde_chunks.elems++] = fde; - - fde->initial_location = init_loc; - fde->address_range = read_encoded_pointer (abfd, &start, - cie-> - addr_encoding); - - fde->cie_ptr = cie; - - /* Here we intentionally ignore augmentation data - from FDE, because we don't need them. */ - if (cie->augmentation[0] == 'z') - start += read_uleb128 (abfd, &start); - - fde->data = start; - fde->data_length = block_end - start; - } - } - start = block_end; - } - qsort (fde_chunks.array, fde_chunks.elems, - sizeof (struct fde_unit *), compare_fde_unit); - } -} - -/* We must parse both .debug_frame section and .eh_frame because - * not all frames must be present in both of these sections. */ -void -dwarf2_build_frame_info (struct objfile *objfile) -{ - int after_debug_frame = 0; - - /* If we have .debug_frame then the parser is called with - eh_frame==0 for .debug_frame and eh_frame==2 for .eh_frame, - otherwise it's only called once for .eh_frame with argument - eh_frame==1. */ - - if (dwarf_frame_offset) - { - parse_frame_info (objfile, dwarf_frame_offset, - dwarf_frame_size, dwarf_frame_section, - 0 /* = debug_frame */ ); - after_debug_frame = 1; - } - - if (dwarf_eh_frame_offset) - parse_frame_info (objfile, dwarf_eh_frame_offset, dwarf_eh_frame_size, - dwarf_eh_frame_section, - 1 /* = eh_frame */ + after_debug_frame); -} - -/* Return the frame address. */ -CORE_ADDR -cfi_read_fp (void) -{ - struct context *context; - struct frame_state *fs; - CORE_ADDR cfa; - - unwind_tmp_obstack_init (); - - context = context_alloc (); - fs = frame_state_alloc (); - - context->ra = read_pc () + 1; - - frame_state_for (context, fs); - update_context (context, fs, 0); - - cfa = context->cfa; - - unwind_tmp_obstack_free (); - - return cfa; -} - -/* Store the frame address. This function is not used. */ - -void -cfi_write_fp (CORE_ADDR val) -{ - struct context *context; - struct frame_state *fs; - - unwind_tmp_obstack_init (); - - context = context_alloc (); - fs = frame_state_alloc (); - - context->ra = read_pc () + 1; - - frame_state_for (context, fs); - - if (fs->cfa_how == CFA_REG_OFFSET) - { - val -= fs->cfa_offset; - deprecated_write_register_gen (fs->cfa_reg, (char *) &val); - } - else - warning ("Can't write fp."); - - unwind_tmp_obstack_free (); -} - -/* Restore the machine to the state it had before the current frame - was created. */ -void -cfi_pop_frame (struct frame_info *fi) -{ - char regbuf[MAX_REGISTER_SIZE]; - int regnum; - - for (regnum = 0; regnum < NUM_REGS; regnum++) - { - get_reg (regbuf, UNWIND_CONTEXT (fi), regnum); - deprecated_write_register_bytes (REGISTER_BYTE (regnum), regbuf, - REGISTER_RAW_SIZE (regnum)); - } - write_register (PC_REGNUM, UNWIND_CONTEXT (fi)->ra); - - flush_cached_frames (); -} - -/* Determine the address of the calling function's frame. */ -CORE_ADDR -cfi_frame_chain (struct frame_info *fi) -{ - struct context *context; - struct frame_state *fs; - CORE_ADDR cfa; - - unwind_tmp_obstack_init (); - - context = context_alloc (); - fs = frame_state_alloc (); - context_cpy (context, UNWIND_CONTEXT (fi)); - - /* outermost frame */ - if (context->ra == 0) - { - unwind_tmp_obstack_free (); - return 0; - } - - frame_state_for (context, fs); - update_context (context, fs, 1); - - cfa = context->cfa; - unwind_tmp_obstack_free (); - - return cfa; -} - -/* Sets the pc of the frame. */ -CORE_ADDR -cfi_init_frame_pc (int fromleaf, struct frame_info *fi) -{ - if (get_next_frame (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); - return pc; - } - else - return read_pc (); -} - -/* Initialize unwind context informations of the frame. */ -void -cfi_init_extra_frame_info (int fromleaf, struct frame_info *fi) -{ - struct frame_state *fs; - - unwind_tmp_obstack_init (); - - fs = frame_state_alloc (); - 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, - sizeof (struct context_reg) * NUM_REGS); - - if (get_next_frame (fi)) - { - context_cpy (UNWIND_CONTEXT (fi), UNWIND_CONTEXT (get_next_frame (fi))); - frame_state_for (UNWIND_CONTEXT (fi), fs); - update_context (UNWIND_CONTEXT (fi), fs, 1); - } - else - { - UNWIND_CONTEXT (fi)->ra = get_frame_pc (fi) + 1; - frame_state_for (UNWIND_CONTEXT (fi), fs); - update_context (UNWIND_CONTEXT (fi), fs, 0); - } - - unwind_tmp_obstack_free (); -} - -/* Obtain return address of the frame. */ -CORE_ADDR -cfi_get_ra (struct frame_info *fi) -{ - return UNWIND_CONTEXT (fi)->ra; -} - -/* Find register number REGNUM relative to FRAME and put its - (raw) contents in *RAW_BUFFER. Set *OPTIMIZED if the variable - was optimized out (and thus can't be fetched). If the variable - was fetched from memory, set *ADDRP to where it was fetched from, - otherwise it was fetched from a register. - - The argument RAW_BUFFER must point to aligned memory. */ -void -cfi_get_saved_register (char *raw_buffer, - int *optimized, - CORE_ADDR *addrp, - struct frame_info *frame, - int regnum, enum lval_type *lval) -{ - if (!target_has_registers) - error ("No registers."); - - /* Normal systems don't optimize out things with register numbers. */ - if (optimized != NULL) - *optimized = 0; - - if (addrp) /* default assumption: not found in memory */ - *addrp = 0; - - if (!get_next_frame (frame)) - { - deprecated_read_register_gen (regnum, raw_buffer); - if (lval != NULL) - *lval = lval_register; - if (addrp != NULL) - *addrp = REGISTER_BYTE (regnum); - } - else - { - frame = get_next_frame (frame); - switch (UNWIND_CONTEXT (frame)->reg[regnum].how) - { - case REG_CTX_UNSAVED: - deprecated_read_register_gen (regnum, raw_buffer); - if (lval != NULL) - *lval = not_lval; - if (optimized != NULL) - *optimized = 1; - break; - case REG_CTX_SAVED_OFFSET: - target_read_memory (UNWIND_CONTEXT (frame)->cfa + - UNWIND_CONTEXT (frame)->reg[regnum].loc.offset, - raw_buffer, REGISTER_RAW_SIZE (regnum)); - if (lval != NULL) - *lval = lval_memory; - if (addrp != NULL) - *addrp = - UNWIND_CONTEXT (frame)->cfa + - 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); - if (lval != NULL) - *lval = lval_register; - if (addrp != NULL) - *addrp = - REGISTER_BYTE (UNWIND_CONTEXT (frame)->reg[regnum].loc.reg); - break; - case REG_CTX_SAVED_ADDR: - target_read_memory (UNWIND_CONTEXT (frame)->reg[regnum].loc.addr, - raw_buffer, REGISTER_RAW_SIZE (regnum)); - if (lval != NULL) - *lval = lval_memory; - if (addrp != NULL) - *addrp = UNWIND_CONTEXT (frame)->reg[regnum].loc.addr; - break; - case REG_CTX_VALUE: - memcpy (raw_buffer, &UNWIND_CONTEXT (frame)->reg[regnum].loc.addr, - REGISTER_RAW_SIZE (regnum)); - if (lval != NULL) - *lval = not_lval; - if (optimized != NULL) - *optimized = 0; - break; - default: - internal_error (__FILE__, __LINE__, - "cfi_get_saved_register: unknown register rule 0x%02X", - UNWIND_CONTEXT (frame)->reg[regnum].how); - } - } -} - -/* Return the register that the function uses for a frame pointer, - plus any necessary offset to be applied to the register before - any frame pointer offsets. */ -void -cfi_virtual_frame_pointer (CORE_ADDR pc, int *frame_reg, - LONGEST * frame_offset) -{ - struct context *context; - struct frame_state *fs; - - unwind_tmp_obstack_init (); - - context = context_alloc (); - fs = frame_state_alloc (); - - context->ra = read_pc () + 1; - - frame_state_for (context, fs); - - if (fs->cfa_how == CFA_REG_OFFSET) - { - *frame_reg = fs->cfa_reg; - *frame_offset = fs->cfa_offset; - } - else - error ("dwarf cfi error: CFA is not defined as CFA_REG_OFFSET"); - - unwind_tmp_obstack_free (); -} diff --git a/gdb/dwarf2cfi.h b/gdb/dwarf2cfi.h deleted file mode 100644 index 28a329d2349..00000000000 --- a/gdb/dwarf2cfi.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Stack unwinding code based on dwarf2 frame info for GDB, the GNU debugger. - Copyright 2001 - Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#ifndef DWARF2CFI_H -#define DWARF2CFI_H - -struct frame_info; - -struct context_reg -{ - union - { - unsigned int reg; - long offset; - CORE_ADDR addr; - } - loc; - enum - { - REG_CTX_UNSAVED, - REG_CTX_SAVED_OFFSET, - REG_CTX_SAVED_REG, - REG_CTX_SAVED_ADDR, - REG_CTX_VALUE, - } - how; -}; - -/* This is the register and unwind state for a particular frame. */ -struct context -{ - struct context_reg *reg; - - CORE_ADDR cfa; - CORE_ADDR ra; - void *lsda; - int args_size; -}; - -/* Return the frame address. */ -CORE_ADDR cfi_read_fp (); - -/* Store the frame address. */ -void cfi_write_fp (CORE_ADDR val); - -/* Restore the machine to the state it had before the current frame - was created. */ -void cfi_pop_frame (struct frame_info *); - -/* Determine the address of the calling function's frame. */ -CORE_ADDR cfi_frame_chain (struct frame_info *fi); - -/* Sets the pc of the frame. */ -CORE_ADDR cfi_init_frame_pc (int fromleaf, struct frame_info *fi); - -/* Initialize unwind context informations of the frame. */ -void cfi_init_extra_frame_info (int fromleaf, struct frame_info *fi); - -/* Obtain return address of the frame. */ -CORE_ADDR cfi_get_ra (struct frame_info *fi); - -/* Find register number REGNUM relative to FRAME and put its - (raw) contents in *RAW_BUFFER. Set *OPTIMIZED if the variable - was optimized out (and thus can't be fetched). If the variable - was fetched from memory, set *ADDRP to where it was fetched from, - otherwise it was fetched from a register. - - The argument RAW_BUFFER must point to aligned memory. */ -void cfi_get_saved_register (char *raw_buffer, - int *optimized, - CORE_ADDR *addrp, - struct frame_info *frame, - int regnum, enum lval_type *lval); - -/* Return the register that the function uses for a frame pointer, - plus any necessary offset to be applied to the register before - any frame pointer offsets. */ -void cfi_virtual_frame_pointer (CORE_ADDR pc, int *frame_regnum, - LONGEST * frame_offset); - -struct context *context_alloc (); -void context_cpy (struct context *dst, struct context *src); -struct frame_state *frame_state_alloc (); -#endif diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h index 9e6fe808789..0a60edb8237 100644 --- a/gdb/dwarf2expr.h +++ b/gdb/dwarf2expr.h @@ -76,7 +76,7 @@ struct dwarf_expr_context int in_reg; }; -struct dwarf_expr_context *new_dwarf_expr_context (); +struct dwarf_expr_context *new_dwarf_expr_context (void); void free_dwarf_expr_context (struct dwarf_expr_context *ctx); void dwarf_expr_push (struct dwarf_expr_context *ctx, CORE_ADDR value); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index f614eb56636..97b117f2008 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1071,9 +1071,13 @@ dwarf2_locate_sections (bfd *ignore_abfd, asection *sectp, void *ignore_ptr) } else if (STREQ (sectp->name, EH_FRAME_SECTION)) { - dwarf_eh_frame_offset = sectp->filepos; - dwarf_eh_frame_size = bfd_get_section_size_before_reloc (sectp); - dwarf_eh_frame_section = sectp; + flagword aflag = bfd_get_section_flags (ignore_abfd, sectp); + if (aflag & SEC_HAS_CONTENTS) + { + dwarf_eh_frame_offset = sectp->filepos; + dwarf_eh_frame_size = bfd_get_section_size_before_reloc (sectp); + dwarf_eh_frame_section = sectp; + } } else if (STREQ (sectp->name, RANGES_SECTION)) { @@ -2026,6 +2030,8 @@ process_die (struct die_info *die, struct objfile *objfile, of a function and make GDB `next' properly over inlined functions. */ break; case DW_TAG_lexical_block: + case DW_TAG_try_block: + case DW_TAG_catch_block: read_lexical_block_scope (die, objfile, cu_header); break; case DW_TAG_class_type: diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 2780858883c..e6f2a2e6b7e 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -701,7 +701,7 @@ static void read_lexical_block_scope (struct dieinfo *dip, char *thisdie, char *enddie, struct objfile *objfile) { - register struct context_stack *new; + struct context_stack *new; push_context (0, dip->at_low_pc); process_dies (thisdie + dip->die_length, enddie, objfile); @@ -862,7 +862,8 @@ decode_die_type (struct dieinfo *dip) } else if (dip->at_user_def_type) { - if ((type = lookup_utype (dip->at_user_def_type)) == NULL) + type = lookup_utype (dip->at_user_def_type); + if (type == NULL) { type = alloc_utype (dip->at_user_def_type, NULL); } @@ -916,7 +917,8 @@ struct_type (struct dieinfo *dip, char *thisdie, char *enddie, char *nextdie; int anonymous_size; - if ((type = lookup_utype (dip->die_ref)) == NULL) + type = lookup_utype (dip->die_ref); + if (type == NULL) { /* No forward references created an empty type, so install one now */ type = alloc_utype (dip->die_ref, NULL); @@ -977,6 +979,13 @@ struct_type (struct dieinfo *dip, char *thisdie, char *enddie, switch (mbr.die_tag) { case TAG_member: + /* Static fields can be either TAG_global_variable (GCC) or else + TAG_member with no location (Diab). We could treat the latter like + the former... but since we don't support the former, just avoid + crashing on the latter for now. */ + if (mbr.at_location == NULL) + break; + /* Get space to record the next field's data. */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); new->next = list; @@ -1149,7 +1158,8 @@ decode_array_element_type (char *scan) attribute = target_to_host (scan, SIZEOF_ATTRIBUTE, GET_UNSIGNED, current_objfile); scan += SIZEOF_ATTRIBUTE; - if ((nbytes = attribute_size (attribute)) == -1) + nbytes = attribute_size (attribute); + if (nbytes == -1) { bad_array_element_type_complaint (DIE_ID, DIE_NAME, attribute); typep = dwarf_fundamental_type (current_objfile, FT_INTEGER); @@ -1169,7 +1179,8 @@ decode_array_element_type (char *scan) case AT_user_def_type: die_ref = target_to_host (scan, nbytes, GET_UNSIGNED, current_objfile); - if ((typep = lookup_utype (die_ref)) == NULL) + typep = lookup_utype (die_ref); + if (typep == NULL) { typep = alloc_utype (die_ref, NULL); } @@ -1334,14 +1345,16 @@ dwarf_read_array_type (struct dieinfo *dip) "DIE @ 0x%x \"%s\", array not row major; not handled correctly", DIE_ID, DIE_NAME); } - if ((sub = dip->at_subscr_data) != NULL) + sub = dip->at_subscr_data; + if (sub != NULL) { nbytes = attribute_size (AT_subscr_data); blocksz = target_to_host (sub, nbytes, GET_UNSIGNED, current_objfile); subend = sub + nbytes + blocksz; sub += nbytes; type = decode_subscript_data_item (sub, subend); - if ((utype = lookup_utype (dip->die_ref)) == NULL) + utype = lookup_utype (dip->die_ref); + if (utype == NULL) { /* Install user defined type that has not been referenced yet. */ alloc_utype (dip->die_ref, type); @@ -1390,7 +1403,8 @@ read_tag_pointer_type (struct dieinfo *dip) struct type *utype; type = decode_die_type (dip); - if ((utype = lookup_utype (dip->die_ref)) == NULL) + utype = lookup_utype (dip->die_ref); + if (utype == NULL) { utype = lookup_pointer_type (type); alloc_utype (dip->die_ref, utype); @@ -1509,7 +1523,8 @@ read_subroutine_type (struct dieinfo *dip, char *thisdie, char *enddie) /* Check to see if we already have a partially constructed user defined type for this DIE, from a forward reference. */ - if ((ftype = lookup_utype (dip->die_ref)) == NULL) + ftype = lookup_utype (dip->die_ref); + if (ftype == NULL) { /* This is the first reference to one of these types. Make a new one and place it in the user defined types. */ @@ -1623,7 +1638,8 @@ enum_type (struct dieinfo *dip, struct objfile *objfile) int nbytes; int unsigned_enum = 1; - if ((type = lookup_utype (dip->die_ref)) == NULL) + type = lookup_utype (dip->die_ref); + if (type == NULL) { /* No forward references created an empty type, so install one now */ type = alloc_utype (dip->die_ref, NULL); @@ -1643,7 +1659,8 @@ enum_type (struct dieinfo *dip, struct objfile *objfile) { TYPE_LENGTH (type) = dip->at_byte_size; } - if ((scan = dip->at_element_list) != NULL) + scan = dip->at_element_list; + if (scan != NULL) { if (dip->short_element_list) { @@ -1734,7 +1751,7 @@ static void read_func_scope (struct dieinfo *dip, char *thisdie, char *enddie, struct objfile *objfile) { - register struct context_stack *new; + struct context_stack *new; /* AT_name is absent if the function is described with an AT_abstract_origin tag. @@ -2430,7 +2447,8 @@ add_enum_psymbol (struct dieinfo *dip, struct objfile *objfile) unsigned short blocksz; int nbytes; - if ((scan = dip->at_element_list) != NULL) + scan = dip->at_element_list; + if (scan != NULL) { if (dip->short_element_list) { @@ -3143,7 +3161,8 @@ decode_modified_type (char *modifiers, unsigned int modcount, int mtype) nbytes = attribute_size (AT_user_def_type); die_ref = target_to_host (modifiers, nbytes, GET_UNSIGNED, current_objfile); - if ((typep = lookup_utype (die_ref)) == NULL) + typep = lookup_utype (die_ref); + if (typep == NULL) { typep = alloc_utype (die_ref, NULL); } @@ -3179,8 +3198,12 @@ decode_modified_type (char *modifiers, unsigned int modcount, int mtype) DIE_ID, DIE_NAME); /* FIXME */ break; default: - if (!(MOD_lo_user <= (unsigned char) modifier + if (!(MOD_lo_user <= (unsigned char) modifier)) +#if 0 +/* This part of the test would always be true, and it triggers a compiler + warning. */ && (unsigned char) modifier <= MOD_hi_user)) +#endif { complaint (&symfile_complaints, "DIE @ 0x%x \"%s\", unknown type modifier %u", DIE_ID, @@ -3492,7 +3515,8 @@ completedieinfo (struct dieinfo *dip, struct objfile *objfile) { attr = target_to_host (diep, SIZEOF_ATTRIBUTE, GET_UNSIGNED, objfile); diep += SIZEOF_ATTRIBUTE; - if ((nbytes = attribute_size (attr)) == -1) + nbytes = attribute_size (attr); + if (nbytes == -1) { complaint (&symfile_complaints, "DIE @ 0x%x \"%s\", unknown attribute length, skipped remaining attributes", diff --git a/gdb/elfread.c b/gdb/elfread.c index 7aee37cc5db..ff766fb7c26 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -177,7 +177,6 @@ elf_symtab_read (struct objfile *objfile, int dynamic) asymbol **symbol_table; long number_of_symbols; long i; - int index; struct cleanup *back_to; CORE_ADDR symaddr; CORE_ADDR offset; @@ -372,34 +371,40 @@ elf_symtab_read (struct objfile *objfile, int dynamic) } else if (sym->flags & BSF_LOCAL) { - /* Named Local variable in a Data section. Check its - name for stabs-in-elf. The STREQ macro checks the - first character inline, so we only actually do a - strcmp function call on names that start with 'B' - or 'D' */ - index = SECT_OFF_MAX; - if (STREQ ("Bbss.bss", sym->name)) - { - index = SECT_OFF_BSS (objfile); - } - else if (STREQ ("Ddata.data", sym->name)) - { - index = SECT_OFF_DATA (objfile); - } - else if (STREQ ("Drodata.rodata", sym->name)) - { - index = SECT_OFF_RODATA (objfile); - } - if (index != SECT_OFF_MAX) + /* Named Local variable in a Data section. + Check its name for stabs-in-elf. The STREQ + macro checks the first character inline, so + we only actually do a strcmp function call on + names that start with 'B' or 'D'. */ + int special_local_sect; + if (strcmp ("Bbss.bss", sym->name) == 0) + special_local_sect = SECT_OFF_BSS (objfile); + else if (strcmp ("Ddata.data", sym->name) == 0) + special_local_sect = SECT_OFF_DATA (objfile); + else if (strcmp ("Drodata.rodata", sym->name) == 0) + special_local_sect = SECT_OFF_RODATA (objfile); + else + special_local_sect = -1; + if (special_local_sect >= 0) { /* Found a special local symbol. Allocate a sectinfo, if needed, and fill it in. */ if (sectinfo == NULL) { + int max_index; + size_t size; + + max_index + = max (SECT_OFF_BSS (objfile), + max (SECT_OFF_DATA (objfile), + SECT_OFF_RODATA (objfile))); + size = (sizeof (struct stab_section_info) + + (sizeof (CORE_ADDR) + * (max_index - 1))); sectinfo = (struct stab_section_info *) - xmmalloc (objfile->md, sizeof (*sectinfo)); - memset (sectinfo, 0, - sizeof (*sectinfo)); + xmmalloc (objfile->md, size); + memset (sectinfo, 0, size); + sectinfo->num_sections = max_index; if (filesym == NULL) { complaint (&symfile_complaints, @@ -412,36 +417,23 @@ elf_symtab_read (struct objfile *objfile, int dynamic) (char *) filesym->name; } } - if (index != -1) - { - if (sectinfo->sections[index] != 0) - { - complaint (&symfile_complaints, - "duplicated elf/stab section information for %s", - sectinfo->filename); - } - } - else - internal_error (__FILE__, __LINE__, - "Section index uninitialized."); - /* Bfd symbols are section relative. */ + if (sectinfo->sections[special_local_sect] != 0) + complaint (&symfile_complaints, + "duplicated elf/stab section information for %s", + sectinfo->filename); + /* BFD symbols are section relative. */ symaddr = sym->value + sym->section->vma; - /* Relocate non-absolute symbols by the section offset. */ + /* Relocate non-absolute symbols by the + section offset. */ if (sym->section != &bfd_abs_section) - { - symaddr += offset; - } - if (index != -1) - sectinfo->sections[index] = symaddr; - else - internal_error (__FILE__, __LINE__, - "Section index uninitialized."); + symaddr += offset; + sectinfo->sections[special_local_sect] = symaddr; /* The special local symbols don't go in the - minimal symbol table, so ignore this one. */ + minimal symbol table, so ignore this one. */ continue; } /* Not a special stabs-in-elf symbol, do regular - symbol processing. */ + symbol processing. */ if (sym->section->flags & SEC_LOAD) { ms_type = mst_file_data; @@ -740,8 +732,9 @@ elfstab_offset_sections (struct objfile *objfile, struct partial_symtab *pst) /* Found it! Allocate a new psymtab struct, and fill it in. */ maybe->found++; pst->section_offsets = (struct section_offsets *) - obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS); - for (i = 0; i < SECT_OFF_MAX; i++) + obstack_alloc (&objfile->psymbol_obstack, + SIZEOF_N_SECTION_OFFSETS (objfile->num_sections)); + for (i = 0; i < maybe->num_sections; i++) (pst->section_offsets)->offsets[i] = maybe->sections[i]; return; } diff --git a/gdb/event-top.c b/gdb/event-top.c index ceef7b9c9eb..5ab324df758 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -492,10 +492,8 @@ command_handler (char *command) if (display_space) { #ifdef HAVE_SBRK - extern char **environ; char *lim = (char *) sbrk (0); - - space_at_cmd_start = (long) (lim - (char *) &environ); + space_at_cmd_start = lim - lim_at_start; #endif } @@ -538,9 +536,8 @@ command_handler (char *command) if (display_space) { #ifdef HAVE_SBRK - extern char **environ; char *lim = (char *) sbrk (0); - long space_now = lim - (char *) &environ; + long space_now = lim - lim_at_start; long space_diff = space_now - space_at_cmd_start; printf_unfiltered ("Space used: %ld (%c%ld for this command)\n", @@ -577,9 +574,8 @@ command_line_handler_continuation (struct continuation_arg *arg) if (display_space) { #ifdef HAVE_SBRK - extern char **environ; char *lim = (char *) sbrk (0); - long space_now = lim - (char *) &environ; + long space_now = lim - lim_at_start; long space_diff = space_now - space_at_cmd_start; printf_unfiltered ("Space used: %ld (%c%ld for this command)\n", diff --git a/gdb/findvar.c b/gdb/findvar.c index 1cbecc92a30..d379f424c70 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -161,28 +161,6 @@ extract_long_unsigned_integer (const void *addr, int orig_len, LONGEST *pval) } -/* Treat the LEN bytes at ADDR as a target-format address, and return - that address. ADDR is a buffer in the GDB process, not in the - inferior. - - This function should only be used by target-specific code. It - assumes that a pointer has the same representation as that thing's - address represented as an integer. Some machines use word - addresses, or similarly munged things, for certain types of - pointers, so that assumption doesn't hold everywhere. - - Common code should use extract_typed_address instead, or something - else based on POINTER_TO_ADDRESS. */ - -CORE_ADDR -extract_address (const void *addr, int len) -{ - /* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure - whether we want this to be true eventually. */ - return (CORE_ADDR) extract_unsigned_integer (addr, len); -} - - /* Treat the bytes at BUF as a pointer of type TYPE, and return the address it represents. */ CORE_ADDR @@ -306,10 +284,10 @@ value_of_register (int regnum, struct frame_info *frame) /* Convert raw data to virtual format if necessary. */ - if (REGISTER_CONVERTIBLE (regnum)) + if (DEPRECATED_REGISTER_CONVERTIBLE (regnum)) { - REGISTER_CONVERT_TO_VIRTUAL (regnum, register_type (current_gdbarch, regnum), - raw_buffer, VALUE_CONTENTS_RAW (reg_val)); + DEPRECATED_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)) memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer, @@ -646,152 +624,82 @@ addresses have not been bound by the dynamic loader. Try again when executable i struct value * value_from_register (struct type *type, int regnum, struct frame_info *frame) { - char raw_buffer[MAX_REGISTER_SIZE]; - CORE_ADDR addr; - int optim; + struct gdbarch *gdbarch = get_frame_arch (frame); struct value *v = allocate_value (type); - char *value_bytes = 0; - int value_bytes_copied = 0; - int num_storage_locs; - enum lval_type lval; - int len; - CHECK_TYPEDEF (type); - len = TYPE_LENGTH (type); - VALUE_REGNO (v) = regnum; - - num_storage_locs = (len > REGISTER_VIRTUAL_SIZE (regnum) ? - ((len - 1) / REGISTER_RAW_SIZE (regnum)) + 1 : - 1); - - if (num_storage_locs > 1 -#if 0 - // OBSOLETE #ifdef GDB_TARGET_IS_H8500 - // OBSOLETE || TYPE_CODE (type) == TYPE_CODE_PTR - // OBSOLETE #endif -#endif - ) + if (CONVERT_REGISTER_P (regnum, type)) + { + /* The ISA/ABI need to something weird when obtaining the + specified value from this register. It might need to + re-order non-adjacent, starting with REGNUM (see MIPS and + i386). It might need to convert the [float] register into + the corresponding [integer] type (see Alpha). The assumption + is that REGISTER_TO_VALUE populates the entire value + including the location. */ + REGISTER_TO_VALUE (frame, regnum, type, VALUE_CONTENTS_RAW (v)); + VALUE_LVAL (v) = lval_reg_frame_relative; + VALUE_FRAME_ID (v) = get_frame_id (frame); + VALUE_FRAME_REGNUM (v) = regnum; + } + else { - /* Value spread across multiple storage locations. */ - int local_regnum; int mem_stor = 0, reg_stor = 0; int mem_tracking = 1; CORE_ADDR last_addr = 0; CORE_ADDR first_addr = 0; - - value_bytes = (char *) alloca (len + MAX_REGISTER_SIZE); + int first_realnum = regnum; + int len = TYPE_LENGTH (type); + int value_bytes_copied; + int optimized = 0; + char *value_bytes = (char *) alloca (len + MAX_REGISTER_SIZE); /* Copy all of the data out, whereever it may be. */ - -#if 0 - // OBSOLETE #ifdef GDB_TARGET_IS_H8500 - // OBSOLETE /* This piece of hideosity is required because the H8500 treats registers - // OBSOLETE differently depending upon whether they are used as pointers or not. As a - // OBSOLETE pointer, a register needs to have a page register tacked onto the front. - // OBSOLETE An alternate way to do this would be to have gcc output different register - // OBSOLETE numbers for the pointer & non-pointer form of the register. But, it - // OBSOLETE doesn't, so we're stuck with this. */ - // OBSOLETE - // OBSOLETE if (TYPE_CODE (type) == TYPE_CODE_PTR - // OBSOLETE && len > 2) - // OBSOLETE { - // OBSOLETE int page_regnum; - // OBSOLETE - // OBSOLETE switch (regnum) - // OBSOLETE { - // OBSOLETE case R0_REGNUM: - // OBSOLETE case R1_REGNUM: - // OBSOLETE case R2_REGNUM: - // OBSOLETE case R3_REGNUM: - // OBSOLETE page_regnum = SEG_D_REGNUM; - // OBSOLETE break; - // OBSOLETE case R4_REGNUM: - // OBSOLETE case R5_REGNUM: - // OBSOLETE page_regnum = SEG_E_REGNUM; - // OBSOLETE break; - // OBSOLETE case R6_REGNUM: - // OBSOLETE case R7_REGNUM: - // OBSOLETE page_regnum = SEG_T_REGNUM; - // OBSOLETE break; - // OBSOLETE } - // OBSOLETE - // OBSOLETE value_bytes[0] = 0; - // OBSOLETE get_saved_register (value_bytes + 1, - // OBSOLETE &optim, - // OBSOLETE &addr, - // OBSOLETE frame, - // OBSOLETE page_regnum, - // OBSOLETE &lval); - // OBSOLETE - // OBSOLETE if (register_cached (page_regnum) == -1) - // OBSOLETE return NULL; /* register value not available */ - // OBSOLETE - // OBSOLETE if (lval == lval_register) - // OBSOLETE reg_stor++; - // OBSOLETE else - // OBSOLETE mem_stor++; - // OBSOLETE first_addr = addr; - // OBSOLETE last_addr = addr; - // OBSOLETE - // OBSOLETE get_saved_register (value_bytes + 2, - // OBSOLETE &optim, - // OBSOLETE &addr, - // OBSOLETE frame, - // OBSOLETE regnum, - // OBSOLETE &lval); - // OBSOLETE - // OBSOLETE if (register_cached (regnum) == -1) - // OBSOLETE return NULL; /* register value not available */ - // OBSOLETE - // OBSOLETE if (lval == lval_register) - // OBSOLETE reg_stor++; - // OBSOLETE else - // OBSOLETE { - // OBSOLETE mem_stor++; - // OBSOLETE mem_tracking = mem_tracking && (addr == last_addr); - // OBSOLETE } - // OBSOLETE last_addr = addr; - // OBSOLETE } - // OBSOLETE else - // OBSOLETE #endif /* GDB_TARGET_IS_H8500 */ -#endif - for (local_regnum = regnum; - value_bytes_copied < len; - (value_bytes_copied += REGISTER_RAW_SIZE (local_regnum), - ++local_regnum)) - { - int realnum; - frame_register (frame, local_regnum, &optim, &lval, &addr, - &realnum, value_bytes + value_bytes_copied); - - if (register_cached (local_regnum) == -1) - return NULL; /* register value not available */ - - if (regnum == local_regnum) + for (local_regnum = regnum, value_bytes_copied = 0; + value_bytes_copied < len; + (value_bytes_copied += REGISTER_RAW_SIZE (local_regnum), + ++local_regnum)) + { + int realnum; + int optim; + enum lval_type lval; + CORE_ADDR addr; + frame_register (frame, local_regnum, &optim, &lval, &addr, + &realnum, value_bytes + value_bytes_copied); + optimized += optim; + if (register_cached (local_regnum) == -1) + return NULL; /* register value not available */ + + if (regnum == local_regnum) + { first_addr = addr; - if (lval == lval_register) - reg_stor++; - else - { - mem_stor++; - - mem_tracking = - (mem_tracking - && (regnum == local_regnum - || addr == last_addr)); - } - last_addr = addr; - } - + first_realnum = realnum; + } + if (lval == lval_register) + reg_stor++; + else + { + mem_stor++; + + mem_tracking = (mem_tracking + && (regnum == local_regnum + || addr == last_addr)); + } + last_addr = addr; + } + + /* FIXME: cagney/2003-06-04: Shouldn't this always use + lval_reg_frame_relative? If it doesn't and the register's + location changes (say after a resume) then this value is + going to have wrong information. */ if ((reg_stor && mem_stor) || (mem_stor && !mem_tracking)) /* Mixed storage; all of the hassle we just went through was for some good purpose. */ { VALUE_LVAL (v) = lval_reg_frame_relative; - VALUE_FRAME (v) = get_frame_base (frame); + VALUE_FRAME_ID (v) = get_frame_id (frame); VALUE_FRAME_REGNUM (v) = regnum; } else if (mem_stor) @@ -803,67 +711,29 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) { VALUE_LVAL (v) = lval_register; VALUE_ADDRESS (v) = first_addr; + VALUE_REGNO (v) = first_realnum; } else internal_error (__FILE__, __LINE__, "value_from_register: Value not stored anywhere!"); - - VALUE_OPTIMIZED_OUT (v) = optim; - + + VALUE_OPTIMIZED_OUT (v) = optimized; + /* Any structure stored in more than one register will always be - an integral number of registers. Otherwise, you'd need to do + an integral number of registers. Otherwise, you need to do some fiddling with the last register copied here for little endian machines. */ - - /* Copy into the contents section of the value. */ - memcpy (VALUE_CONTENTS_RAW (v), value_bytes, len); - - /* Finally do any conversion necessary when extracting this - type from more than one register. */ -#ifdef REGISTER_CONVERT_TO_TYPE - REGISTER_CONVERT_TO_TYPE (regnum, type, VALUE_CONTENTS_RAW (v)); -#endif - return v; - } - - /* Data is completely contained within a single register. Locate the - register's contents in a real register or in core; - read the data in raw format. */ - - { - int realnum; - frame_register (frame, regnum, &optim, &lval, &addr, &realnum, raw_buffer); - } - - if (register_cached (regnum) == -1) - return NULL; /* register value not available */ - - VALUE_OPTIMIZED_OUT (v) = optim; - VALUE_LVAL (v) = lval; - VALUE_ADDRESS (v) = addr; - - /* Convert the raw register to the corresponding data value's memory - format, if necessary. */ - - if (CONVERT_REGISTER_P (regnum)) - { - REGISTER_TO_VALUE (regnum, type, raw_buffer, VALUE_CONTENTS_RAW (v)); - } - else - { - /* Raw and virtual formats are the same for this register. */ - - if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && len < REGISTER_RAW_SIZE (regnum)) - { - /* Big-endian, and we want less than full size. */ - VALUE_OFFSET (v) = REGISTER_RAW_SIZE (regnum) - len; - } - - memcpy (VALUE_CONTENTS_RAW (v), raw_buffer + VALUE_OFFSET (v), len); + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG + && len < REGISTER_RAW_SIZE (regnum)) + /* Big-endian, and we want less than full size. */ + VALUE_OFFSET (v) = REGISTER_RAW_SIZE (regnum) - len; + else + VALUE_OFFSET (v) = 0; + memcpy (VALUE_CONTENTS_RAW (v), value_bytes + VALUE_OFFSET (v), len); } - return v; } + /* Given a struct symbol for a variable or function, and a stack frame id, diff --git a/gdb/frame-base.c b/gdb/frame-base.c index f7ba4be1903..0865a0ce6c9 100644 --- a/gdb/frame-base.c +++ b/gdb/frame-base.c @@ -24,9 +24,9 @@ #include "frame.h" /* A default frame base implementations. If it wasn't for the old - FRAME_LOCALS_ADDRESS and FRAME_ARGS_ADDRESS, these could be - combined into a single function. All architectures really need to - override this. */ + DEPRECATED_FRAME_LOCALS_ADDRESS and DEPRECATED_FRAME_ARGS_ADDRESS, + these could be combined into a single function. All architectures + really need to override this. */ static CORE_ADDR default_frame_base_address (struct frame_info *next_frame, void **this_cache) @@ -38,25 +38,25 @@ default_frame_base_address (struct frame_info *next_frame, void **this_cache) static CORE_ADDR default_frame_locals_address (struct frame_info *next_frame, void **this_cache) { - struct frame_info *this_frame = get_prev_frame (next_frame); - return FRAME_LOCALS_ADDRESS (this_frame); + if (DEPRECATED_FRAME_LOCALS_ADDRESS_P ()) + { + /* This is bad. The computation of per-frame locals address + should use a per-frame frame-base. */ + struct frame_info *this_frame = get_prev_frame (next_frame); + return DEPRECATED_FRAME_LOCALS_ADDRESS (this_frame); + } + return default_frame_base_address (next_frame, this_cache); } static CORE_ADDR default_frame_args_address (struct frame_info *next_frame, void **this_cache) { - struct frame_info *this_frame = get_prev_frame (next_frame); - /* FRAME_ARGS_ADDRESS_CORRECT is just like FRAME_ARGS_ADDRESS except - that if it is unsure about the answer, it returns 0 instead of - guessing (this happens on the VAX and i960, for example). - - On most machines, we never have to guess about the args address, - so FRAME_ARGS_ADDRESS{,_CORRECT} are the same. */ -#ifdef FRAME_ARGS_ADDRESS_CORRECT - return FRAME_ARGS_ADDRESS_CORRECT (this_frame); -#else - return FRAME_ARGS_ADDRESS (this_frame); -#endif + if (DEPRECATED_FRAME_ARGS_ADDRESS_P ()) + { + struct frame_info *this_frame = get_prev_frame (next_frame); + return DEPRECATED_FRAME_ARGS_ADDRESS (this_frame); + } + return default_frame_base_address (next_frame, this_cache); } const struct frame_base default_frame_base = { @@ -146,6 +146,8 @@ frame_base_find_by_pc (struct gdbarch *gdbarch, CORE_ADDR pc) return table->default_base; } +extern initialize_file_ftype _initialize_frame_base; /* -Wmissing-prototypes */ + void _initialize_frame_base (void) { diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c index c72d24a0b23..921d30b31d5 100644 --- a/gdb/frame-unwind.c +++ b/gdb/frame-unwind.c @@ -98,6 +98,8 @@ frame_unwind_find_by_pc (struct gdbarch *gdbarch, CORE_ADDR pc) return legacy_saved_regs_unwind; } +extern initialize_file_ftype _initialize_frame_unwind; /* -Wmissing-prototypes */ + void _initialize_frame_unwind (void) { diff --git a/gdb/frame.c b/gdb/frame.c index 07e0e5b15b6..eadb77de4c4 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -614,6 +614,41 @@ frame_unwind_register (struct frame_info *frame, int regnum, void *buf) &realnum, buf); } +void +get_frame_register (struct frame_info *frame, + int regnum, void *buf) +{ + frame_unwind_register (frame->next, regnum, buf); +} + +LONGEST +frame_unwind_register_signed (struct frame_info *frame, int regnum) +{ + char buf[MAX_REGISTER_SIZE]; + frame_unwind_register (frame, regnum, buf); + return extract_signed_integer (buf, REGISTER_VIRTUAL_SIZE (regnum)); +} + +LONGEST +get_frame_register_signed (struct frame_info *frame, int regnum) +{ + return frame_unwind_register_signed (frame->next, regnum); +} + +ULONGEST +frame_unwind_register_unsigned (struct frame_info *frame, int regnum) +{ + char buf[MAX_REGISTER_SIZE]; + frame_unwind_register (frame, regnum, buf); + return extract_unsigned_integer (buf, REGISTER_VIRTUAL_SIZE (regnum)); +} + +ULONGEST +get_frame_register_unsigned (struct frame_info *frame, int regnum) +{ + return frame_unwind_register_unsigned (frame->next, regnum); +} + void frame_unwind_signed_register (struct frame_info *frame, int regnum, LONGEST *val) @@ -674,33 +709,33 @@ frame_read_signed_register (struct frame_info *frame, int regnum, } void -generic_unwind_get_saved_register (char *raw_buffer, - int *optimizedp, - CORE_ADDR *addrp, - struct frame_info *frame, - int regnum, - enum lval_type *lvalp) -{ - int optimizedx; - CORE_ADDR addrx; - int realnumx; - enum lval_type lvalx; - - if (!target_has_registers) - error ("No registers."); - - /* Keep things simple, ensure that all the pointers (except valuep) - are non NULL. */ - if (optimizedp == NULL) - optimizedp = &optimizedx; - if (lvalp == NULL) - lvalp = &lvalx; - if (addrp == NULL) - addrp = &addrx; - - gdb_assert (frame != NULL && frame->next != NULL); - frame_register_unwind (frame->next, regnum, optimizedp, lvalp, addrp, - &realnumx, raw_buffer); +put_frame_register (struct frame_info *frame, int regnum, const void *buf) +{ + struct gdbarch *gdbarch = get_frame_arch (frame); + int realnum; + int optim; + enum lval_type lval; + CORE_ADDR addr; + frame_register (frame, regnum, &optim, &lval, &addr, &realnum, NULL); + if (optim) + error ("Attempt to assign to a value that was optimized out."); + switch (lval) + { + case lval_memory: + { + /* FIXME: write_memory doesn't yet take constant buffers. + Arrrg! */ + char tmp[MAX_REGISTER_SIZE]; + memcpy (tmp, buf, register_size (gdbarch, regnum)); + write_memory (addr, tmp, register_size (gdbarch, regnum)); + break; + } + case lval_register: + regcache_cooked_write (current_regcache, realnum, buf); + break; + default: + error ("Attempt to assign to an unmodifiable value."); + } } /* frame_register_read () @@ -778,7 +813,7 @@ frame_map_regnum_to_name (int regnum) /* Create a sentinel frame. */ -struct frame_info * +static struct frame_info * create_sentinel_frame (struct regcache *regcache) { struct frame_info *frame = FRAME_OBSTACK_ZALLOC (struct frame_info); @@ -963,14 +998,13 @@ legacy_saved_regs_prev_register (struct frame_info *next_frame, struct frame_info *frame = next_frame->prev; gdb_assert (frame != NULL); - /* Only (older) architectures that implement the - 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) - DEPRECATED_FRAME_INIT_SAVED_REGS (frame); + { + /* If nothing's initialized the saved regs, do it now. */ + gdb_assert (DEPRECATED_FRAME_INIT_SAVED_REGS_P ()); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); + gdb_assert (get_frame_saved_regs (frame) != NULL); + } if (get_frame_saved_regs (frame) != NULL && get_frame_saved_regs (frame)[regnum] != 0) @@ -1082,8 +1116,6 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized, if (!target_has_registers) error ("No registers."); - gdb_assert (DEPRECATED_FRAME_INIT_SAVED_REGS_P ()); - /* Normal systems don't optimize out things with register numbers. */ if (optimized != NULL) *optimized = 0; @@ -1237,6 +1269,12 @@ get_next_frame (struct frame_info *this_frame) return NULL; } +struct frame_info * +deprecated_get_next_frame_hack (struct frame_info *this_frame) +{ + return this_frame->next; +} + /* Flush the entire frame cache. */ void @@ -1373,10 +1411,6 @@ legacy_get_prev_frame (struct frame_info *this_frame) or some random address on the stack. Trying to use that PC to apply standard frame ID unwind techniques is just asking for trouble. */ - /* Assume call_function_by_hand(), via SAVE_DUMMY_FRAME_TOS, - previously saved the dummy frame's ID. Things only work - if the two return the same value. */ - gdb_assert (SAVE_DUMMY_FRAME_TOS_P ()); /* Use an architecture specific method to extract the prev's dummy ID from the next frame. Note that this method uses frame_register_unwind to obtain the register values @@ -1475,6 +1509,12 @@ legacy_get_prev_frame (struct frame_info *this_frame) /* FIXME: 2002-11-09: There isn't any reason to special case this edge condition. Instead the per-architecture code should hande it locally. */ + /* FIXME: cagney/2003-06-16: This returns the inner most stack + address for the previous frame, that, however, is wrong. It + should be the inner most stack address for the previous to + previous frame. This is because it is the previous to previous + frame's innermost stack address that is constant through out + the lifetime of the previous frame (trust me :-). */ address = get_frame_base (this_frame); else { @@ -1493,8 +1533,29 @@ legacy_get_prev_frame (struct frame_info *this_frame) this to after the ffi test; I'd rather have backtraces from start go curfluy than have an abort called from main not show main. */ - gdb_assert (DEPRECATED_FRAME_CHAIN_P ()); - address = DEPRECATED_FRAME_CHAIN (this_frame); + if (DEPRECATED_FRAME_CHAIN_P ()) + address = DEPRECATED_FRAME_CHAIN (this_frame); + else + { + /* Someone is part way through coverting an old architecture + to the new frame code. Implement FRAME_CHAIN the way the + new frame will. */ + /* Find PREV frame's unwinder. */ + prev->unwind = frame_unwind_find_by_pc (current_gdbarch, + frame_pc_unwind (this_frame)); + /* FIXME: cagney/2003-04-02: Rather than storing the frame's + type in the frame, the unwinder's type should be returned + directly. Unfortunatly, legacy code, called by + legacy_get_prev_frame, explicitly set the frames type + using the method deprecated_set_frame_type(). */ + prev->type = prev->unwind->type; + /* Find PREV frame's ID. */ + prev->unwind->this_id (this_frame, + &prev->prologue_cache, + &prev->this_id.value); + prev->this_id.p = 1; + address = prev->this_id.value.stack_addr; + } if (!legacy_frame_chain_valid (address, this_frame)) { @@ -1637,9 +1698,13 @@ legacy_get_prev_frame (struct frame_info *this_frame) /* Initialize the code used to unwind the frame PREV based on the PC (and probably other architectural information). The PC lets you check things like the debug info at that point (dwarf2cfi?) and - use that to decide how the frame should be unwound. */ - prev->unwind = frame_unwind_find_by_pc (current_gdbarch, - get_frame_pc (prev)); + use that to decide how the frame should be unwound. + + If there isn't a FRAME_CHAIN, the code above will have already + done this. */ + if (prev->unwind == NULL) + prev->unwind = frame_unwind_find_by_pc (current_gdbarch, + get_frame_pc (prev)); /* If the unwinder provides a frame type, use it. Otherwize continue on to that heuristic mess. */ @@ -1647,6 +1712,7 @@ legacy_get_prev_frame (struct frame_info *this_frame) { prev->type = prev->unwind->type; if (prev->type == NORMAL_FRAME) + /* FIXME: cagney/2003-06-16: would get_frame_pc() be better? */ prev->this_id.value.code_addr = get_pc_function_start (prev->this_id.value.code_addr); if (frame_debug) @@ -1944,11 +2010,11 @@ get_prev_frame (struct frame_info *this_frame) Doing this makes it possible for the user to examine a frame that has an invalid frame ID. - The very old VAX frame_args_address_correct() method noted: [...] - For the sake of argument, suppose that the stack is somewhat - trashed (which is one reason that "info frame" exists). So, - return 0 (indicating we don't know the address of the arglist) if - we don't know what frame this frame calls. */ + Some very old VAX code noted: [...] For the sake of argument, + suppose that the stack is somewhat trashed (which is one reason + that "info frame" exists). So, return 0 (indicating we don't + know the address of the arglist) if we don't know what frame this + frame calls. */ /* Link it in. */ this_frame->prev = prev_frame; @@ -2219,6 +2285,68 @@ deprecated_frame_xmalloc_with_cleanup (long sizeof_saved_regs, return frame; } +/* Memory access methods. */ + +void +get_frame_memory (struct frame_info *this_frame, CORE_ADDR addr, void *buf, + int len) +{ + read_memory (addr, buf, len); +} + +LONGEST +get_frame_memory_signed (struct frame_info *this_frame, CORE_ADDR addr, + int len) +{ + return read_memory_integer (addr, len); +} + +ULONGEST +get_frame_memory_unsigned (struct frame_info *this_frame, CORE_ADDR addr, + int len) +{ + return read_memory_unsigned_integer (addr, len); +} + +/* Architecture method. */ + +struct gdbarch * +get_frame_arch (struct frame_info *this_frame) +{ + return current_gdbarch; +} + +/* Stack pointer methods. */ + +CORE_ADDR +get_frame_sp (struct frame_info *this_frame) +{ + return frame_sp_unwind (this_frame->next); +} + +CORE_ADDR +frame_sp_unwind (struct frame_info *next_frame) +{ + /* Normality, an architecture that provides a way of obtaining any + frame inner-most address. */ + if (gdbarch_unwind_sp_p (current_gdbarch)) + return gdbarch_unwind_sp (current_gdbarch, next_frame); + /* Things are looking grim. If it's the inner-most frame and there + is a TARGET_READ_SP then that can be used. */ + if (next_frame->level < 0 && TARGET_READ_SP_P ()) + return TARGET_READ_SP (); + /* Now things are really are grim. Hope that the value returned by + the SP_REGNUM register is meaningful. */ + if (SP_REGNUM >= 0) + { + ULONGEST sp; + frame_unwind_unsigned_register (next_frame, SP_REGNUM, &sp); + return sp; + } + internal_error (__FILE__, __LINE__, "Missing unwind SP method"); +} + + int legacy_frame_p (struct gdbarch *current_gdbarch) { @@ -2226,10 +2354,11 @@ legacy_frame_p (struct gdbarch *current_gdbarch) || DEPRECATED_INIT_FRAME_PC_FIRST_P () || DEPRECATED_INIT_EXTRA_FRAME_INFO_P () || DEPRECATED_FRAME_CHAIN_P () - || !gdbarch_unwind_dummy_id_p (current_gdbarch) - || !SAVE_DUMMY_FRAME_TOS_P ()); + || !gdbarch_unwind_dummy_id_p (current_gdbarch)); } +extern initialize_file_ftype _initialize_frame; /* -Wmissing-prototypes */ + void _initialize_frame (void) { diff --git a/gdb/frame.h b/gdb/frame.h index ba7d5ada20a..2208a3f767c 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -23,6 +23,47 @@ #if !defined (FRAME_H) #define FRAME_H 1 +/* The following is the intended naming schema for frame functions. + It isn't 100% consistent, but it is aproaching that. Frame naming + schema: + + Prefixes: + + get_frame_WHAT...(): Get WHAT from the THIS frame (functionaly + equivalent to THIS->next->unwind->what) + + frame_unwind_WHAT...(): Unwind THIS frame's WHAT from the NEXT + frame. + + put_frame_WHAT...(): Put a value into this frame (unsafe, need to + invalidate the frame / regcache afterwards) (better name more + strongly hinting at its unsafeness) + + safe_....(): Safer version of various functions, doesn't throw an + error (leave this for later?). Returns non-zero if the fetch + succeeds. Return a freshly allocated error message? + + Suffixes: + + void /frame/_WHAT(): Read WHAT's value into the buffer parameter. + + ULONGEST /frame/_WHAT_unsigned(): Return an unsigned value (the + alternative is *frame_unsigned_WHAT). + + LONGEST /frame/_WHAT_signed(): Return WHAT signed value. + + What: + + /frame/_memory* (frame, coreaddr, len [, buf]): Extract/return + *memory. + + /frame/_register* (frame, regnum [, buf]): extract/return register. + + CORE_ADDR /frame/_{pc,sp,...} (frame): Resume address, innner most + stack *address, ... + + */ + struct symtab_and_line; struct frame_unwind; struct frame_base; @@ -154,6 +195,13 @@ extern void select_frame (struct frame_info *); extern struct frame_info *get_prev_frame (struct frame_info *); extern struct frame_info *get_next_frame (struct frame_info *); +/* Given a FRAME, return the true next (more inner, younger) frame. + This one exposes the sentinel frame and, hence, never returns NULL. + It is here strictly to help old targets in their migration path to + the new frame code - the new code requires the NEXT, and not THIS + frame. */ +extern struct frame_info *deprecated_get_next_frame_hack (struct frame_info *); + /* Given a frame's ID, relocate the frame. Returns NULL if the frame is not found. */ extern struct frame_info *frame_find_by_id (struct frame_id id); @@ -166,6 +214,13 @@ extern struct frame_info *frame_find_by_id (struct frame_id id); This replaced: frame->pc; */ extern CORE_ADDR get_frame_pc (struct frame_info *); +/* The frame's inner-most bound. AKA the stack-pointer. Confusingly + known as top-of-stack. */ + +extern CORE_ADDR get_frame_sp (struct frame_info *); +extern CORE_ADDR frame_sp_unwind (struct frame_info *); + + /* Following on from the `resume' address. Return the entry point address of the function containing that resume address, or zero if that function isn't known. */ @@ -289,16 +344,31 @@ extern void frame_register_unwind (struct frame_info *frame, int regnum, CORE_ADDR *addrp, int *realnump, void *valuep); -/* More convenient interface to frame_register_unwind(). */ -/* NOTE: cagney/2002-09-13: Return void as one day these functions may - be changed to return an indication that the read succeeded. */ +/* Fetch a register from this, or unwind a register from the next + frame. Note that the get_frame methods are wrappers to + frame->next->unwind. They all [potentially] throw an error if the + fetch fails. */ extern void frame_unwind_register (struct frame_info *frame, int regnum, void *buf); +extern void get_frame_register (struct frame_info *frame, + int regnum, void *buf); +extern LONGEST frame_unwind_register_signed (struct frame_info *frame, + int regnum); +extern LONGEST get_frame_register_signed (struct frame_info *frame, + int regnum); +extern ULONGEST frame_unwind_register_unsigned (struct frame_info *frame, + int regnum); +extern ULONGEST get_frame_register_unsigned (struct frame_info *frame, + int regnum); + + +/* Use frame_unwind_register_signed. */ extern void frame_unwind_signed_register (struct frame_info *frame, int regnum, LONGEST *val); +/* Use frame_unwind_register_signed. */ extern void frame_unwind_unsigned_register (struct frame_info *frame, int regnum, ULONGEST *val); @@ -316,15 +386,24 @@ extern void frame_register (struct frame_info *frame, int regnum, /* NOTE: cagney/2002-09-13: Return void as one day these functions may be changed to return an indication that the read succeeded. */ +/* Use get_frame_register. */ extern void frame_read_register (struct frame_info *frame, int regnum, void *buf); +/* Use get_frame_register_signed. */ extern void frame_read_signed_register (struct frame_info *frame, int regnum, LONGEST *val); +/* Use get_frame_register_unsigned. */ extern void frame_read_unsigned_register (struct frame_info *frame, int regnum, ULONGEST *val); +/* The reverse. Store a register value relative to the specified + frame. Note: this call makes the frame's state undefined. The + register and frame caches must be flushed. */ +extern void put_frame_register (struct frame_info *frame, int regnum, + const void *buf); + /* Map between a frame register number and its name. A frame register space is a superset of the cooked register space --- it also includes builtin registers. If NAMELEN is negative, use the NAME's @@ -343,6 +422,31 @@ extern CORE_ADDR frame_pc_unwind (struct frame_info *frame); of the caller. */ extern void frame_pop (struct frame_info *frame); +/* Return memory from the specified frame. A frame knows its thread / + LWP and hence can find its way down to a target. The assumption + here is that the current and previous frame share a common address + space. + + If the memory read fails, these methods throw an error. + + NOTE: cagney/2003-06-03: Should there be unwind versions of these + methods? That isn't clear. Can code, for instance, assume that + this and the previous frame's memory or architecture are identical? + If architecture / memory changes are always separated by special + adaptor frames this should be ok. */ + +extern void get_frame_memory (struct frame_info *this_frame, CORE_ADDR addr, + void *buf, int len); +extern LONGEST get_frame_memory_signed (struct frame_info *this_frame, + CORE_ADDR memaddr, int len); +extern ULONGEST get_frame_memory_unsigned (struct frame_info *this_frame, + CORE_ADDR memaddr, int len); + +/* Return this frame's architecture. */ + +extern struct gdbarch *get_frame_arch (struct frame_info *this_frame); + + /* Values for the source flag to be used in print_frame_info_base(). */ enum print_what { @@ -426,9 +530,6 @@ extern CORE_ADDR get_pc_function_start (CORE_ADDR); extern int frameless_look_for_prologue (struct frame_info *); -extern void print_frame_args (struct symbol *, struct frame_info *, - int, struct ui_file *); - extern struct frame_info *find_relative_frame (struct frame_info *, int *); extern void show_and_print_stack_frame (struct frame_info *fi, int level, @@ -463,19 +564,10 @@ extern int generic_pc_in_call_dummy (CORE_ADDR pc, extern char *deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp); -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. - DEPRECATED_GET_SAVED_REGISTER now defaults to the recursive - equivalent - generic_unwind_get_saved_register() - so there is no - need to even set DEPRECATED_GET_SAVED_REGISTER. Architectures that - need to override the register unwind mechanism should modify - frame->unwind(). */ + +/* The DEPRECATED_GET_SAVED_REGISTER architecture interface is + entirely redundant. New architectures should implement per-frame + unwinders (ref "frame-unwind.h"). */ extern void deprecated_generic_get_saved_register (char *, int *, CORE_ADDR *, struct frame_info *, int, enum lval_type *); diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index c26af4d28ee..e4dc885276e 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -30,15 +30,10 @@ extern void _initialize_frv_tdep (void); static gdbarch_init_ftype frv_gdbarch_init; static gdbarch_register_name_ftype frv_register_name; -static gdbarch_register_raw_size_ftype frv_register_raw_size; -static gdbarch_register_virtual_size_ftype frv_register_virtual_size; -static gdbarch_register_virtual_type_ftype frv_register_virtual_type; -static gdbarch_register_byte_ftype frv_register_byte; static gdbarch_breakpoint_from_pc_ftype frv_breakpoint_from_pc; static gdbarch_skip_prologue_ftype frv_skip_prologue; 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; static gdbarch_frameless_function_invocation_ftype frv_frameless_function_invocation; static gdbarch_init_extra_frame_info_ftype stupid_useless_init_extra_frame_info; static gdbarch_push_arguments_ftype frv_push_arguments; @@ -738,18 +733,6 @@ frv_frame_init_saved_regs (struct frame_info *frame) } } -/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of - EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc - and TYPE is the type (which is known to be struct, union or array). - - The frv returns all structs in memory. */ - -static int -frv_use_struct_convention (int gcc_p, struct type *type) -{ - return 1; -} - static void frv_extract_return_value (struct type *type, char *regbuf, char *valbuf) { @@ -762,8 +745,8 @@ frv_extract_return_value (struct type *type, char *regbuf, char *valbuf) static CORE_ADDR frv_extract_struct_value_address (char *regbuf) { - return extract_address (regbuf + frv_register_byte (struct_return_regnum), - 4); + return extract_unsigned_integer (regbuf + frv_register_byte (struct_return_regnum), + 4); } static void @@ -859,7 +842,7 @@ frv_push_arguments (int nargs, struct value **args, CORE_ADDR sp, if (argreg < 14) { - regval = extract_address (val, partial_len); + regval = extract_unsigned_integer (val, partial_len); #if 0 printf(" Argnum %d data %x -> reg %d\n", argnum, (int) regval, argreg); @@ -1059,17 +1042,16 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_name (gdbarch, frv_register_name); set_gdbarch_deprecated_register_size (gdbarch, 4); set_gdbarch_deprecated_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_deprecated_register_byte (gdbarch, frv_register_byte); + set_gdbarch_deprecated_register_raw_size (gdbarch, frv_register_raw_size); set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4); - set_gdbarch_register_virtual_size (gdbarch, frv_register_virtual_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, frv_register_virtual_size); set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4); - set_gdbarch_register_virtual_type (gdbarch, frv_register_virtual_type); + set_gdbarch_deprecated_register_virtual_type (gdbarch, frv_register_virtual_type); set_gdbarch_skip_prologue (gdbarch, frv_skip_prologue); set_gdbarch_breakpoint_from_pc (gdbarch, frv_breakpoint_from_pc); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_frame_args_skip (gdbarch, 0); set_gdbarch_frameless_function_invocation (gdbarch, frv_frameless_function_invocation); @@ -1080,7 +1062,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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_use_struct_convention (gdbarch, always_use_struct_convention); set_gdbarch_deprecated_extract_return_value (gdbarch, frv_extract_return_value); set_gdbarch_deprecated_store_struct_return (gdbarch, frv_store_struct_return); @@ -1099,16 +1081,13 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Settings that should be unnecessary. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); - set_gdbarch_read_pc (gdbarch, generic_target_read_pc); set_gdbarch_write_pc (gdbarch, generic_target_write_pc); - set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_decr_pc_after_break (gdbarch, 0); set_gdbarch_function_start_offset (gdbarch, 0); - set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not); set_gdbarch_remote_translate_xfer_address (gdbarch, frv_remote_translate_xfer_address); diff --git a/gdb/gdb-stabs.h b/gdb/gdb-stabs.h index abe2d3365b6..097f9d94384 100644 --- a/gdb/gdb-stabs.h +++ b/gdb/gdb-stabs.h @@ -29,8 +29,6 @@ #if !defined (GDBSTABS_H) #define GDBSTABS_H -#define SECT_OFF_MAX 64 /* Count of possible values */ - /* The stab_section_info chain remembers info from the ELF symbol table, while psymtabs are being built for the other symbol tables in the objfile. It is destroyed at the complation of psymtab-reading. @@ -39,9 +37,10 @@ struct stab_section_info { char *filename; - CORE_ADDR sections[SECT_OFF_MAX]; struct stab_section_info *next; int found; /* Count of times it's found in searching */ + size_t num_sections; + CORE_ADDR sections[1]; }; /* Information is passed among various dbxread routines for accessing diff --git a/gdb/gdb_assert.h b/gdb/gdb_assert.h index 4f0bcdc9497..9cad74c9cbc 100644 --- a/gdb/gdb_assert.h +++ b/gdb/gdb_assert.h @@ -40,16 +40,19 @@ #else #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L #define ASSERT_FUNCTION __func__ -#else -#define ASSERT_FUNCTION ((const char *) 0) #endif #endif /* This prints an "Assertion failed" message, aksing the user if they want to continue, dump core, or just exit. */ +#if defined (ASSERT_FUNCTION) +#define gdb_assert_fail(assertion, file, line, function) \ + internal_error (file, line, "%s: Assertion `%s' failed.", \ + function, assertion) +#else #define gdb_assert_fail(assertion, file, line, function) \ - internal_error (file, line, "%s%sAssertion `%s' failed.", \ - function ? function : "", function ? ": " : "", \ + internal_error (file, line, "Assertion `%s' failed.", \ assertion) +#endif #endif /* gdb_assert.h */ diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 976ce59ae13..87585dd42c6 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -147,16 +147,13 @@ struct gdbarch int char_signed; gdbarch_read_pc_ftype *read_pc; gdbarch_write_pc_ftype *write_pc; - gdbarch_deprecated_target_read_fp_ftype *deprecated_target_read_fp; gdbarch_read_sp_ftype *read_sp; - gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp; gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer; gdbarch_pseudo_register_read_ftype *pseudo_register_read; gdbarch_pseudo_register_write_ftype *pseudo_register_write; int num_regs; int num_pseudo_regs; int sp_regnum; - int deprecated_fp_regnum; int pc_regnum; int ps_regnum; int fp0_regnum; @@ -167,44 +164,54 @@ struct gdbarch gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum; gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum; gdbarch_register_name_ftype *register_name; - int deprecated_register_size; + gdbarch_register_type_ftype *register_type; + gdbarch_deprecated_register_virtual_type_ftype *deprecated_register_virtual_type; int deprecated_register_bytes; - gdbarch_register_byte_ftype *register_byte; - gdbarch_register_raw_size_ftype *register_raw_size; + gdbarch_deprecated_register_byte_ftype *deprecated_register_byte; + gdbarch_deprecated_register_raw_size_ftype *deprecated_register_raw_size; + gdbarch_deprecated_register_virtual_size_ftype *deprecated_register_virtual_size; int deprecated_max_register_raw_size; - gdbarch_register_virtual_size_ftype *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; - gdbarch_print_vector_info_ftype *print_vector_info; - gdbarch_register_sim_regno_ftype *register_sim_regno; - gdbarch_register_bytes_ok_ftype *register_bytes_ok; - gdbarch_cannot_fetch_register_ftype *cannot_fetch_register; - gdbarch_cannot_store_register_ftype *cannot_store_register; - gdbarch_get_longjmp_target_ftype *get_longjmp_target; + gdbarch_unwind_dummy_id_ftype *unwind_dummy_id; + gdbarch_deprecated_save_dummy_frame_tos_ftype *deprecated_save_dummy_frame_tos; + int deprecated_fp_regnum; + gdbarch_deprecated_target_read_fp_ftype *deprecated_target_read_fp; + gdbarch_push_dummy_call_ftype *push_dummy_call; + gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments; int deprecated_use_generic_dummy_frames; + gdbarch_deprecated_push_return_address_ftype *deprecated_push_return_address; + gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp; + int deprecated_register_size; int call_dummy_location; gdbarch_call_dummy_address_ftype *call_dummy_address; CORE_ADDR deprecated_call_dummy_start_offset; CORE_ADDR deprecated_call_dummy_breakpoint_offset; int deprecated_call_dummy_length; - gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy; LONGEST * deprecated_call_dummy_words; int deprecated_sizeof_call_dummy_words; int deprecated_call_dummy_stack_adjust; gdbarch_deprecated_fix_call_dummy_ftype *deprecated_fix_call_dummy; gdbarch_push_dummy_code_ftype *push_dummy_code; + gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame; + int deprecated_extra_stack_alignment_needed; + 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; + gdbarch_print_vector_info_ftype *print_vector_info; + gdbarch_register_sim_regno_ftype *register_sim_regno; + gdbarch_register_bytes_ok_ftype *register_bytes_ok; + gdbarch_cannot_fetch_register_ftype *cannot_fetch_register; + gdbarch_cannot_store_register_ftype *cannot_store_register; + gdbarch_get_longjmp_target_ftype *get_longjmp_target; + gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy; gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first; gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc; int believe_pcc_promotion; int believe_pcc_promotion_type; gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register; - gdbarch_register_convertible_ftype *register_convertible; - gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual; - gdbarch_register_convert_to_raw_ftype *register_convert_to_raw; + gdbarch_deprecated_register_convertible_ftype *deprecated_register_convertible; + gdbarch_deprecated_register_convert_to_virtual_ftype *deprecated_register_convert_to_virtual; + gdbarch_deprecated_register_convert_to_raw_ftype *deprecated_register_convert_to_raw; gdbarch_convert_register_p_ftype *convert_register_p; gdbarch_register_to_value_ftype *register_to_value; gdbarch_value_to_register_ftype *value_to_register; @@ -212,10 +219,6 @@ struct gdbarch gdbarch_address_to_pointer_ftype *address_to_pointer; gdbarch_integer_to_address_ftype *integer_to_address; gdbarch_return_value_on_stack_ftype *return_value_on_stack; - gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments; - gdbarch_push_dummy_call_ftype *push_dummy_call; - gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame; - gdbarch_deprecated_push_return_address_ftype *deprecated_push_return_address; gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame; gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return; gdbarch_extract_return_value_ftype *extract_return_value; @@ -234,7 +237,6 @@ struct gdbarch gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint; gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint; CORE_ADDR decr_pc_after_break; - gdbarch_prepare_to_proceed_ftype *prepare_to_proceed; CORE_ADDR function_start_offset; gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address; CORE_ADDR frame_args_skip; @@ -243,16 +245,14 @@ struct gdbarch gdbarch_deprecated_frame_chain_valid_ftype *deprecated_frame_chain_valid; gdbarch_deprecated_frame_saved_pc_ftype *deprecated_frame_saved_pc; gdbarch_unwind_pc_ftype *unwind_pc; - gdbarch_frame_args_address_ftype *frame_args_address; - gdbarch_frame_locals_address_ftype *frame_locals_address; + gdbarch_unwind_sp_ftype *unwind_sp; + gdbarch_deprecated_frame_args_address_ftype *deprecated_frame_args_address; + gdbarch_deprecated_frame_locals_address_ftype *deprecated_frame_locals_address; gdbarch_deprecated_saved_pc_after_call_ftype *deprecated_saved_pc_after_call; gdbarch_frame_num_args_ftype *frame_num_args; gdbarch_stack_align_ftype *stack_align; gdbarch_frame_align_ftype *frame_align; - int deprecated_extra_stack_alignment_needed; gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr; - gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos; - gdbarch_unwind_dummy_id_ftype *unwind_dummy_id; int parm_boundary; const struct floatformat * float_format; const struct floatformat * double_format; @@ -280,6 +280,7 @@ struct gdbarch gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name; gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags; gdbarch_register_reggroup_p_ftype *register_reggroup_p; + gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument; }; @@ -292,160 +293,161 @@ struct gdbarch startup_gdbarch = { 1, /* Always initialized. */ /* basic architecture information */ - &bfd_default_arch_struct, - BFD_ENDIAN_BIG, - GDB_OSABI_UNKNOWN, + &bfd_default_arch_struct, /* bfd_arch_info */ + BFD_ENDIAN_BIG, /* byte_order */ + GDB_OSABI_UNKNOWN, /* osabi */ /* target specific vector and its dump routine */ NULL, NULL, /*per-architecture data-pointers and swap regions */ 0, NULL, NULL, /* Multi-arch values */ - 8 * sizeof (short), - 8 * sizeof (int), - 8 * sizeof (long), - 8 * sizeof (LONGEST), - 8 * sizeof (float), - 8 * sizeof (double), - 8 * sizeof (long double), - 8 * sizeof (void*), - 8 * sizeof (void*), - 8 * sizeof (void*), - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - -1, - -1, - -1, - -1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - generic_register_byte, - generic_register_size, - 0, - generic_register_size, - 0, - 0, - 0, - 0, - default_print_registers_info, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - generic_pc_in_call_dummy, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - generic_remote_translate_xfer_address, - 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, - generic_in_function_epilogue_p, - construct_inferior_arguments, - 0, - 0, - 0, - "malloc", - 0, - 0, - 0, - 0, - 0, - default_register_reggroup_p, + 8 * sizeof (short), /* short_bit */ + 8 * sizeof (int), /* int_bit */ + 8 * sizeof (long), /* long_bit */ + 8 * sizeof (LONGEST), /* long_long_bit */ + 8 * sizeof (float), /* float_bit */ + 8 * sizeof (double), /* double_bit */ + 8 * sizeof (long double), /* long_double_bit */ + 8 * sizeof (void*), /* ptr_bit */ + 8 * sizeof (void*), /* addr_bit */ + 8 * sizeof (void*), /* bfd_vma_bit */ + 1, /* char_signed */ + 0, /* read_pc */ + 0, /* write_pc */ + 0, /* read_sp */ + 0, /* virtual_frame_pointer */ + 0, /* pseudo_register_read */ + 0, /* pseudo_register_write */ + 0, /* num_regs */ + 0, /* num_pseudo_regs */ + -1, /* sp_regnum */ + -1, /* pc_regnum */ + -1, /* ps_regnum */ + 0, /* fp0_regnum */ + 0, /* npc_regnum */ + 0, /* stab_reg_to_regnum */ + 0, /* ecoff_reg_to_regnum */ + 0, /* dwarf_reg_to_regnum */ + 0, /* sdb_reg_to_regnum */ + 0, /* dwarf2_reg_to_regnum */ + 0, /* register_name */ + 0, /* register_type */ + 0, /* deprecated_register_virtual_type */ + 0, /* deprecated_register_bytes */ + generic_register_byte, /* deprecated_register_byte */ + generic_register_size, /* deprecated_register_raw_size */ + generic_register_size, /* deprecated_register_virtual_size */ + 0, /* deprecated_max_register_raw_size */ + 0, /* deprecated_max_register_virtual_size */ + 0, /* unwind_dummy_id */ + 0, /* deprecated_save_dummy_frame_tos */ + -1, /* deprecated_fp_regnum */ + 0, /* deprecated_target_read_fp */ + 0, /* push_dummy_call */ + 0, /* deprecated_push_arguments */ + 0, /* deprecated_use_generic_dummy_frames */ + 0, /* deprecated_push_return_address */ + 0, /* deprecated_dummy_write_sp */ + 0, /* deprecated_register_size */ + 0, /* call_dummy_location */ + 0, /* call_dummy_address */ + 0, /* deprecated_call_dummy_start_offset */ + 0, /* deprecated_call_dummy_breakpoint_offset */ + 0, /* deprecated_call_dummy_length */ + 0, /* deprecated_call_dummy_words */ + 0, /* deprecated_sizeof_call_dummy_words */ + 0, /* deprecated_call_dummy_stack_adjust */ + 0, /* deprecated_fix_call_dummy */ + 0, /* push_dummy_code */ + 0, /* deprecated_push_dummy_frame */ + 0, /* deprecated_extra_stack_alignment_needed */ + 0, /* deprecated_do_registers_info */ + default_print_registers_info, /* print_registers_info */ + 0, /* print_float_info */ + 0, /* print_vector_info */ + 0, /* register_sim_regno */ + 0, /* register_bytes_ok */ + 0, /* cannot_fetch_register */ + 0, /* cannot_store_register */ + 0, /* get_longjmp_target */ + generic_pc_in_call_dummy, /* deprecated_pc_in_call_dummy */ + 0, /* deprecated_init_frame_pc_first */ + 0, /* deprecated_init_frame_pc */ + 0, /* believe_pcc_promotion */ + 0, /* believe_pcc_promotion_type */ + 0, /* deprecated_get_saved_register */ + 0, /* deprecated_register_convertible */ + 0, /* deprecated_register_convert_to_virtual */ + 0, /* deprecated_register_convert_to_raw */ + 0, /* convert_register_p */ + 0, /* register_to_value */ + 0, /* value_to_register */ + 0, /* pointer_to_address */ + 0, /* address_to_pointer */ + 0, /* integer_to_address */ + 0, /* return_value_on_stack */ + 0, /* deprecated_pop_frame */ + 0, /* deprecated_store_struct_return */ + 0, /* extract_return_value */ + 0, /* store_return_value */ + 0, /* deprecated_extract_return_value */ + 0, /* deprecated_store_return_value */ + 0, /* extract_struct_value_address */ + 0, /* deprecated_extract_struct_value_address */ + 0, /* use_struct_convention */ + 0, /* deprecated_frame_init_saved_regs */ + 0, /* deprecated_init_extra_frame_info */ + 0, /* skip_prologue */ + 0, /* prologue_frameless_p */ + 0, /* inner_than */ + 0, /* breakpoint_from_pc */ + 0, /* memory_insert_breakpoint */ + 0, /* memory_remove_breakpoint */ + 0, /* decr_pc_after_break */ + 0, /* function_start_offset */ + generic_remote_translate_xfer_address, /* remote_translate_xfer_address */ + 0, /* frame_args_skip */ + 0, /* frameless_function_invocation */ + 0, /* deprecated_frame_chain */ + 0, /* deprecated_frame_chain_valid */ + 0, /* deprecated_frame_saved_pc */ + 0, /* unwind_pc */ + 0, /* unwind_sp */ + get_frame_base, /* deprecated_frame_args_address */ + get_frame_base, /* deprecated_frame_locals_address */ + 0, /* deprecated_saved_pc_after_call */ + 0, /* frame_num_args */ + 0, /* stack_align */ + 0, /* frame_align */ + 0, /* reg_struct_has_addr */ + 0, /* parm_boundary */ + 0, /* float_format */ + 0, /* double_format */ + 0, /* long_double_format */ + 0, /* convert_from_func_ptr_addr */ + 0, /* addr_bits_remove */ + 0, /* smash_text_address */ + 0, /* software_single_step */ + 0, /* print_insn */ + 0, /* skip_trampoline_code */ + 0, /* in_solib_call_trampoline */ + 0, /* in_solib_return_trampoline */ + 0, /* pc_in_sigtramp */ + 0, /* sigtramp_start */ + 0, /* sigtramp_end */ + generic_in_function_epilogue_p, /* in_function_epilogue_p */ + construct_inferior_arguments, /* construct_inferior_arguments */ + 0, /* dwarf2_build_frame_info */ + 0, /* elf_make_msymbol_special */ + 0, /* coff_make_msymbol_special */ + "malloc", /* name_of_malloc */ + 0, /* cannot_step_breakpoint */ + 0, /* have_nonsteppable_watchpoint */ + 0, /* address_class_type_flags */ + 0, /* address_class_type_flags_to_name */ + 0, /* address_class_name_to_type_flags */ + default_register_reggroup_p, /* register_reggroup_p */ + 0, /* fetch_pointer_argument */ /* startup_gdbarch() */ }; @@ -499,13 +501,10 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->ptr_bit = TARGET_INT_BIT; current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address; current_gdbarch->char_signed = -1; - current_gdbarch->read_pc = generic_target_read_pc; current_gdbarch->write_pc = generic_target_write_pc; - current_gdbarch->read_sp = generic_target_read_sp; current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer; current_gdbarch->num_regs = -1; current_gdbarch->sp_regnum = -1; - current_gdbarch->deprecated_fp_regnum = -1; current_gdbarch->pc_regnum = -1; current_gdbarch->ps_regnum = -1; current_gdbarch->fp0_regnum = -1; @@ -516,20 +515,21 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum; current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum; current_gdbarch->register_name = legacy_register_name; - current_gdbarch->register_byte = generic_register_byte; - current_gdbarch->register_raw_size = generic_register_size; - current_gdbarch->register_virtual_size = generic_register_size; - 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; - current_gdbarch->cannot_store_register = cannot_register_not; + current_gdbarch->deprecated_register_byte = generic_register_byte; + current_gdbarch->deprecated_register_raw_size = generic_register_size; + current_gdbarch->deprecated_register_virtual_size = generic_register_size; + current_gdbarch->deprecated_fp_regnum = -1; current_gdbarch->deprecated_use_generic_dummy_frames = 1; current_gdbarch->call_dummy_location = AT_ENTRY_POINT; current_gdbarch->call_dummy_address = entry_point_address; - current_gdbarch->deprecated_pc_in_call_dummy = generic_pc_in_call_dummy; current_gdbarch->deprecated_call_dummy_words = legacy_call_dummy_words; current_gdbarch->deprecated_sizeof_call_dummy_words = legacy_sizeof_call_dummy_words; - current_gdbarch->register_convertible = generic_register_convertible_not; + 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; + current_gdbarch->cannot_store_register = cannot_register_not; + current_gdbarch->deprecated_pc_in_call_dummy = generic_pc_in_call_dummy; + current_gdbarch->deprecated_register_convertible = deprecated_register_convertible_not; current_gdbarch->convert_register_p = legacy_convert_register_p; current_gdbarch->register_to_value = legacy_register_to_value; current_gdbarch->value_to_register = legacy_value_to_register; @@ -543,13 +543,12 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint; current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint; current_gdbarch->decr_pc_after_break = -1; - current_gdbarch->prepare_to_proceed = default_prepare_to_proceed; current_gdbarch->function_start_offset = -1; current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address; current_gdbarch->frame_args_skip = -1; current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not; - current_gdbarch->frame_args_address = get_frame_base; - current_gdbarch->frame_locals_address = get_frame_base; + current_gdbarch->deprecated_frame_args_address = get_frame_base; + current_gdbarch->deprecated_frame_locals_address = get_frame_base; current_gdbarch->convert_from_func_ptr_addr = core_addr_identity; current_gdbarch->addr_bits_remove = core_addr_identity; current_gdbarch->smash_text_address = core_addr_identity; @@ -618,11 +617,9 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of bfd_vma_bit, invalid_p == 0 */ if (gdbarch->char_signed == -1) gdbarch->char_signed = 1; - /* Skip verify of read_pc, invalid_p == 0 */ + /* Skip verify of read_pc, has predicate */ /* Skip verify of write_pc, invalid_p == 0 */ - /* Skip verify of deprecated_target_read_fp, has predicate */ - /* Skip verify of read_sp, invalid_p == 0 */ - /* Skip verify of deprecated_dummy_write_sp, has predicate */ + /* Skip verify of read_sp, has predicate */ /* Skip verify of virtual_frame_pointer, invalid_p == 0 */ /* Skip verify of pseudo_register_read, has predicate */ /* Skip verify of pseudo_register_write, has predicate */ @@ -631,7 +628,6 @@ verify_gdbarch (struct gdbarch *gdbarch) fprintf_unfiltered (log, "\n\tnum_regs"); /* Skip verify of num_pseudo_regs, invalid_p == 0 */ /* Skip verify of sp_regnum, invalid_p == 0 */ - /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */ /* Skip verify of pc_regnum, invalid_p == 0 */ /* Skip verify of ps_regnum, invalid_p == 0 */ /* Skip verify of fp0_regnum, invalid_p == 0 */ @@ -642,13 +638,31 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */ /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */ /* Skip verify of register_name, invalid_p == 0 */ - /* Skip verify of register_byte, has predicate */ - /* Skip verify of register_raw_size, invalid_p == 0 */ + /* Skip verify of register_type, has predicate */ + /* Skip verify of deprecated_register_virtual_type, has predicate */ + /* Skip verify of deprecated_register_byte, has predicate */ + /* Skip verify of deprecated_register_raw_size, invalid_p == 0 */ + /* Skip verify of deprecated_register_virtual_size, invalid_p == 0 */ /* Skip verify of deprecated_max_register_raw_size, has predicate */ - /* Skip verify of register_virtual_size, invalid_p == 0 */ /* 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 unwind_dummy_id, has predicate */ + /* Skip verify of deprecated_save_dummy_frame_tos, has predicate */ + /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */ + /* Skip verify of deprecated_target_read_fp, has predicate */ + /* Skip verify of push_dummy_call, has predicate */ + /* Skip verify of deprecated_push_arguments, has predicate */ + /* Skip verify of deprecated_use_generic_dummy_frames, invalid_p == 0 */ + /* Skip verify of deprecated_push_return_address, has predicate */ + /* Skip verify of deprecated_dummy_write_sp, has predicate */ + /* Skip verify of call_dummy_location, invalid_p == 0 */ + /* Skip verify of call_dummy_address, invalid_p == 0 */ + /* Skip verify of deprecated_call_dummy_words, invalid_p == 0 */ + /* Skip verify of deprecated_sizeof_call_dummy_words, invalid_p == 0 */ + /* Skip verify of deprecated_call_dummy_stack_adjust, has predicate */ + /* Skip verify of deprecated_fix_call_dummy, has predicate */ + /* Skip verify of push_dummy_code, has predicate */ + /* Skip verify of deprecated_push_dummy_frame, has predicate */ + /* Skip verify of deprecated_extra_stack_alignment_needed, invalid_p == 0 */ /* 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 */ @@ -658,21 +672,13 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of cannot_fetch_register, invalid_p == 0 */ /* Skip verify of cannot_store_register, invalid_p == 0 */ /* Skip verify of get_longjmp_target, has predicate */ - /* Skip verify of deprecated_use_generic_dummy_frames, invalid_p == 0 */ - /* Skip verify of call_dummy_location, invalid_p == 0 */ - /* Skip verify of call_dummy_address, invalid_p == 0 */ /* Skip verify of deprecated_pc_in_call_dummy, has predicate */ - /* Skip verify of deprecated_call_dummy_words, invalid_p == 0 */ - /* Skip verify of deprecated_sizeof_call_dummy_words, invalid_p == 0 */ - /* Skip verify of deprecated_call_dummy_stack_adjust, has predicate */ - /* Skip verify of deprecated_fix_call_dummy, has predicate */ - /* Skip verify of push_dummy_code, has predicate */ /* Skip verify of deprecated_init_frame_pc_first, has predicate */ /* Skip verify of deprecated_init_frame_pc, has predicate */ /* Skip verify of deprecated_get_saved_register, has predicate */ - /* Skip verify of register_convertible, invalid_p == 0 */ - /* Skip verify of register_convert_to_virtual, invalid_p == 0 */ - /* Skip verify of register_convert_to_raw, invalid_p == 0 */ + /* Skip verify of deprecated_register_convertible, invalid_p == 0 */ + /* Skip verify of deprecated_register_convert_to_virtual, invalid_p == 0 */ + /* Skip verify of deprecated_register_convert_to_raw, invalid_p == 0 */ /* Skip verify of convert_register_p, invalid_p == 0 */ /* Skip verify of register_to_value, invalid_p == 0 */ /* Skip verify of value_to_register, invalid_p == 0 */ @@ -680,10 +686,6 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of address_to_pointer, invalid_p == 0 */ /* Skip verify of integer_to_address, has predicate */ /* Skip verify of return_value_on_stack, invalid_p == 0 */ - /* Skip verify of deprecated_push_arguments, has predicate */ - /* Skip verify of push_dummy_call, has predicate */ - /* Skip verify of deprecated_push_dummy_frame, has predicate */ - /* Skip verify of deprecated_push_return_address, has predicate */ /* Skip verify of deprecated_pop_frame, has predicate */ /* Skip verify of deprecated_store_struct_return, has predicate */ /* Skip verify of extract_return_value, invalid_p == 0 */ @@ -708,7 +710,6 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->decr_pc_after_break == -1)) fprintf_unfiltered (log, "\n\tdecr_pc_after_break"); - /* Skip verify of prepare_to_proceed, invalid_p == 0 */ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->function_start_offset == -1)) fprintf_unfiltered (log, "\n\tfunction_start_offset"); @@ -721,18 +722,14 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of deprecated_frame_chain_valid, has predicate */ /* Skip verify of deprecated_frame_saved_pc, has predicate */ /* Skip verify of unwind_pc, has predicate */ - /* Skip verify of frame_args_address, invalid_p == 0 */ - /* Skip verify of frame_locals_address, invalid_p == 0 */ + /* Skip verify of unwind_sp, has predicate */ + /* Skip verify of deprecated_frame_args_address, has predicate */ + /* Skip verify of deprecated_frame_locals_address, has predicate */ /* Skip verify of deprecated_saved_pc_after_call, has predicate */ - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->frame_num_args == 0)) - fprintf_unfiltered (log, "\n\tframe_num_args"); + /* Skip verify of frame_num_args, has predicate */ /* Skip verify of stack_align, has predicate */ /* Skip verify of frame_align, has predicate */ - /* Skip verify of deprecated_extra_stack_alignment_needed, invalid_p == 0 */ /* Skip verify of reg_struct_has_addr, has predicate */ - /* Skip verify of save_dummy_frame_tos, has predicate */ - /* Skip verify of unwind_dummy_id, has predicate */ if (gdbarch->float_format == 0) gdbarch->float_format = default_float_format (gdbarch); if (gdbarch->double_format == 0) @@ -762,6 +759,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of address_class_type_flags_to_name, has predicate */ /* Skip verify of address_class_name_to_type_flags, has predicate */ /* Skip verify of register_reggroup_p, invalid_p == 0 */ + /* Skip verify of fetch_pointer_argument, has predicate */ buf = ui_file_xstrdup (log, &dummy); make_cleanup (xfree, buf); if (strlen (buf) > 0) @@ -987,8 +985,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #ifdef CONVERT_REGISTER_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", - "CONVERT_REGISTER_P(regnum)", - XSTRING (CONVERT_REGISTER_P (regnum))); + "CONVERT_REGISTER_P(regnum, type)", + XSTRING (CONVERT_REGISTER_P (regnum, type))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, "gdbarch_dump: CONVERT_REGISTER_P = <0x%08lx>\n", @@ -1171,6 +1169,26 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: DEPRECATED_FP_REGNUM = %d\n", DEPRECATED_FP_REGNUM); #endif +#ifdef DEPRECATED_FRAME_ARGS_ADDRESS_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_FRAME_ARGS_ADDRESS_P()", + XSTRING (DEPRECATED_FRAME_ARGS_ADDRESS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_FRAME_ARGS_ADDRESS_P() = %d\n", + DEPRECATED_FRAME_ARGS_ADDRESS_P ()); +#endif +#ifdef DEPRECATED_FRAME_ARGS_ADDRESS + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_FRAME_ARGS_ADDRESS(fi)", + XSTRING (DEPRECATED_FRAME_ARGS_ADDRESS (fi))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_FRAME_ARGS_ADDRESS = <0x%08lx>\n", + (long) current_gdbarch->deprecated_frame_args_address + /*DEPRECATED_FRAME_ARGS_ADDRESS ()*/); +#endif #ifdef DEPRECATED_FRAME_CHAIN_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1234,6 +1252,26 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->deprecated_frame_init_saved_regs /*DEPRECATED_FRAME_INIT_SAVED_REGS ()*/); #endif +#ifdef DEPRECATED_FRAME_LOCALS_ADDRESS_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_FRAME_LOCALS_ADDRESS_P()", + XSTRING (DEPRECATED_FRAME_LOCALS_ADDRESS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_FRAME_LOCALS_ADDRESS_P() = %d\n", + DEPRECATED_FRAME_LOCALS_ADDRESS_P ()); +#endif +#ifdef DEPRECATED_FRAME_LOCALS_ADDRESS + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_FRAME_LOCALS_ADDRESS(fi)", + XSTRING (DEPRECATED_FRAME_LOCALS_ADDRESS (fi))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_FRAME_LOCALS_ADDRESS = <0x%08lx>\n", + (long) current_gdbarch->deprecated_frame_locals_address + /*DEPRECATED_FRAME_LOCALS_ADDRESS ()*/); +#endif #ifdef DEPRECATED_FRAME_SAVED_PC_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1488,6 +1526,45 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: DEPRECATED_REGISTER_BYTES = %d\n", DEPRECATED_REGISTER_BYTES); #endif +#ifdef DEPRECATED_REGISTER_CONVERTIBLE + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_REGISTER_CONVERTIBLE(nr)", + XSTRING (DEPRECATED_REGISTER_CONVERTIBLE (nr))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_REGISTER_CONVERTIBLE = <0x%08lx>\n", + (long) current_gdbarch->deprecated_register_convertible + /*DEPRECATED_REGISTER_CONVERTIBLE ()*/); +#endif +#ifdef DEPRECATED_REGISTER_CONVERT_TO_RAW +#if GDB_MULTI_ARCH + /* Macro might contain `[{}]' when not multi-arch */ + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_REGISTER_CONVERT_TO_RAW(type, regnum, from, to)", + XSTRING (DEPRECATED_REGISTER_CONVERT_TO_RAW (type, regnum, from, to))); +#endif + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_REGISTER_CONVERT_TO_RAW = <0x%08lx>\n", + (long) current_gdbarch->deprecated_register_convert_to_raw + /*DEPRECATED_REGISTER_CONVERT_TO_RAW ()*/); +#endif +#ifdef DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL +#if GDB_MULTI_ARCH + /* Macro might contain `[{}]' when not multi-arch */ + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)", + XSTRING (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to))); +#endif + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL = <0x%08lx>\n", + (long) current_gdbarch->deprecated_register_convert_to_virtual + /*DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL ()*/); +#endif #ifdef DEPRECATED_REGISTER_SIZE fprintf_unfiltered (file, "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n", @@ -1516,6 +1593,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->deprecated_saved_pc_after_call /*DEPRECATED_SAVED_PC_AFTER_CALL ()*/); #endif +#ifdef DEPRECATED_SAVE_DUMMY_FRAME_TOS_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_SAVE_DUMMY_FRAME_TOS_P()", + XSTRING (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_SAVE_DUMMY_FRAME_TOS_P() = %d\n", + DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ()); +#endif +#ifdef DEPRECATED_SAVE_DUMMY_FRAME_TOS +#if GDB_MULTI_ARCH + /* Macro might contain `[{}]' when not multi-arch */ + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_SAVE_DUMMY_FRAME_TOS(sp)", + XSTRING (DEPRECATED_SAVE_DUMMY_FRAME_TOS (sp))); +#endif + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_SAVE_DUMMY_FRAME_TOS = <0x%08lx>\n", + (long) current_gdbarch->deprecated_save_dummy_frame_tos + /*DEPRECATED_SAVE_DUMMY_FRAME_TOS ()*/); +#endif #ifdef DEPRECATED_SIZEOF_CALL_DUMMY_WORDS fprintf_unfiltered (file, "gdbarch_dump: DEPRECATED_SIZEOF_CALL_DUMMY_WORDS # %s\n", @@ -1693,6 +1793,26 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->extract_struct_value_address /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/); #endif +#ifdef FETCH_POINTER_ARGUMENT_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "FETCH_POINTER_ARGUMENT_P()", + XSTRING (FETCH_POINTER_ARGUMENT_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: FETCH_POINTER_ARGUMENT_P() = %d\n", + FETCH_POINTER_ARGUMENT_P ()); +#endif +#ifdef FETCH_POINTER_ARGUMENT + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "FETCH_POINTER_ARGUMENT(frame, argi, type)", + XSTRING (FETCH_POINTER_ARGUMENT (frame, argi, type))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: FETCH_POINTER_ARGUMENT = <0x%08lx>\n", + (long) current_gdbarch->fetch_pointer_argument + /*FETCH_POINTER_ARGUMENT ()*/); +#endif #ifdef FP0_REGNUM fprintf_unfiltered (file, "gdbarch_dump: FP0_REGNUM # %s\n", @@ -1712,17 +1832,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->frameless_function_invocation /*FRAMELESS_FUNCTION_INVOCATION ()*/); #endif -#ifdef FRAME_ARGS_ADDRESS - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "FRAME_ARGS_ADDRESS(fi)", - XSTRING (FRAME_ARGS_ADDRESS (fi))); - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: FRAME_ARGS_ADDRESS = <0x%08lx>\n", - (long) current_gdbarch->frame_args_address - /*FRAME_ARGS_ADDRESS ()*/); -#endif #ifdef FRAME_ARGS_SKIP fprintf_unfiltered (file, "gdbarch_dump: FRAME_ARGS_SKIP # %s\n", @@ -1731,16 +1840,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n", (long) FRAME_ARGS_SKIP); #endif -#ifdef FRAME_LOCALS_ADDRESS +#ifdef FRAME_NUM_ARGS_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", - "FRAME_LOCALS_ADDRESS(fi)", - XSTRING (FRAME_LOCALS_ADDRESS (fi))); - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: FRAME_LOCALS_ADDRESS = <0x%08lx>\n", - (long) current_gdbarch->frame_locals_address - /*FRAME_LOCALS_ADDRESS ()*/); + "FRAME_NUM_ARGS_P()", + XSTRING (FRAME_NUM_ARGS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: FRAME_NUM_ARGS_P() = %d\n", + FRAME_NUM_ARGS_P ()); #endif #ifdef FRAME_NUM_ARGS fprintf_unfiltered (file, @@ -1933,17 +2040,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: POINTER_TO_ADDRESS = <0x%08lx>\n", (long) current_gdbarch->pointer_to_address /*POINTER_TO_ADDRESS ()*/); -#endif -#ifdef PREPARE_TO_PROCEED - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "PREPARE_TO_PROCEED(select_it)", - XSTRING (PREPARE_TO_PROCEED (select_it))); - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: PREPARE_TO_PROCEED = <0x%08lx>\n", - (long) current_gdbarch->prepare_to_proceed - /*PREPARE_TO_PROCEED ()*/); #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, @@ -2017,7 +2113,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) if (GDB_MULTI_ARCH) fprintf_unfiltered (file, "gdbarch_dump: REGISTER_BYTE = <0x%08lx>\n", - (long) current_gdbarch->register_byte + (long) current_gdbarch->deprecated_register_byte /*REGISTER_BYTE ()*/); #endif #ifdef REGISTER_BYTES_OK_P @@ -2040,45 +2136,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->register_bytes_ok /*REGISTER_BYTES_OK ()*/); #endif -#ifdef REGISTER_CONVERTIBLE - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "REGISTER_CONVERTIBLE(nr)", - XSTRING (REGISTER_CONVERTIBLE (nr))); - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_CONVERTIBLE = <0x%08lx>\n", - (long) current_gdbarch->register_convertible - /*REGISTER_CONVERTIBLE ()*/); -#endif -#ifdef REGISTER_CONVERT_TO_RAW -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "REGISTER_CONVERT_TO_RAW(type, regnum, from, to)", - XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to))); -#endif - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_CONVERT_TO_RAW = <0x%08lx>\n", - (long) current_gdbarch->register_convert_to_raw - /*REGISTER_CONVERT_TO_RAW ()*/); -#endif -#ifdef REGISTER_CONVERT_TO_VIRTUAL -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)", - XSTRING (REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to))); -#endif - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = <0x%08lx>\n", - (long) current_gdbarch->register_convert_to_virtual - /*REGISTER_CONVERT_TO_VIRTUAL ()*/); -#endif #ifdef REGISTER_NAME fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2098,7 +2155,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) if (GDB_MULTI_ARCH) fprintf_unfiltered (file, "gdbarch_dump: REGISTER_RAW_SIZE = <0x%08lx>\n", - (long) current_gdbarch->register_raw_size + (long) current_gdbarch->deprecated_register_raw_size /*REGISTER_RAW_SIZE ()*/); #endif #ifdef REGISTER_SIM_REGNO @@ -2117,8 +2174,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) /* Macro might contain `[{}]' when not multi-arch */ fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", - "REGISTER_TO_VALUE(regnum, type, from, to)", - XSTRING (REGISTER_TO_VALUE (regnum, type, from, to))); + "REGISTER_TO_VALUE(frame, regnum, type, buf)", + XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf))); #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, @@ -2142,7 +2199,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) if (GDB_MULTI_ARCH) fprintf_unfiltered (file, "gdbarch_dump: REGISTER_VIRTUAL_SIZE = <0x%08lx>\n", - (long) current_gdbarch->register_virtual_size + (long) current_gdbarch->deprecated_register_virtual_size /*REGISTER_VIRTUAL_SIZE ()*/); #endif #ifdef REGISTER_VIRTUAL_TYPE_P @@ -2162,7 +2219,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) if (GDB_MULTI_ARCH) fprintf_unfiltered (file, "gdbarch_dump: REGISTER_VIRTUAL_TYPE = <0x%08lx>\n", - (long) current_gdbarch->register_virtual_type + (long) current_gdbarch->deprecated_register_virtual_type /*REGISTER_VIRTUAL_TYPE ()*/); #endif #ifdef REG_STRUCT_HAS_ADDR_P @@ -2200,29 +2257,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->return_value_on_stack /*RETURN_VALUE_ON_STACK ()*/); #endif -#ifdef SAVE_DUMMY_FRAME_TOS_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "SAVE_DUMMY_FRAME_TOS_P()", - XSTRING (SAVE_DUMMY_FRAME_TOS_P ())); - fprintf_unfiltered (file, - "gdbarch_dump: SAVE_DUMMY_FRAME_TOS_P() = %d\n", - SAVE_DUMMY_FRAME_TOS_P ()); -#endif -#ifdef SAVE_DUMMY_FRAME_TOS -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "SAVE_DUMMY_FRAME_TOS(sp)", - XSTRING (SAVE_DUMMY_FRAME_TOS (sp))); -#endif - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = <0x%08lx>\n", - (long) current_gdbarch->save_dummy_frame_tos - /*SAVE_DUMMY_FRAME_TOS ()*/); -#endif #ifdef SDB_REG_TO_REGNUM fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2523,6 +2557,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: TARGET_PTR_BIT = %d\n", TARGET_PTR_BIT); #endif +#ifdef TARGET_READ_PC_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "TARGET_READ_PC_P()", + XSTRING (TARGET_READ_PC_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: TARGET_READ_PC_P() = %d\n", + TARGET_READ_PC_P ()); +#endif #ifdef TARGET_READ_PC fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2534,6 +2577,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->read_pc /*TARGET_READ_PC ()*/); #endif +#ifdef TARGET_READ_SP_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "TARGET_READ_SP_P()", + XSTRING (TARGET_READ_SP_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: TARGET_READ_SP_P() = %d\n", + TARGET_READ_SP_P ()); +#endif #ifdef TARGET_READ_SP fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2597,6 +2649,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: unwind_pc = 0x%08lx\n", (long) current_gdbarch->unwind_pc); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n", + gdbarch_unwind_sp_p (current_gdbarch)); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: unwind_sp = 0x%08lx\n", + (long) current_gdbarch->unwind_sp); #ifdef USE_STRUCT_CONVENTION fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2613,8 +2673,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) /* Macro might contain `[{}]' when not multi-arch */ fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", - "VALUE_TO_REGISTER(type, regnum, from, to)", - XSTRING (VALUE_TO_REGISTER (type, regnum, from, to))); + "VALUE_TO_REGISTER(frame, regnum, type, buf)", + XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf))); #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, @@ -2853,6 +2913,13 @@ set_gdbarch_char_signed (struct gdbarch *gdbarch, gdbarch->char_signed = char_signed; } +int +gdbarch_read_pc_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->read_pc != 0; +} + CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid) { @@ -2892,104 +2959,59 @@ set_gdbarch_write_pc (struct gdbarch *gdbarch, } int -gdbarch_deprecated_target_read_fp_p (struct gdbarch *gdbarch) +gdbarch_read_sp_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_target_read_fp != 0; + return gdbarch->read_sp != 0; } CORE_ADDR -gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch) +gdbarch_read_sp (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_target_read_fp == 0) + if (gdbarch->read_sp == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_target_read_fp invalid"); + "gdbarch: gdbarch_read_sp invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_target_read_fp called\n"); - return gdbarch->deprecated_target_read_fp (); + fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n"); + return gdbarch->read_sp (); } void -set_gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch, - gdbarch_deprecated_target_read_fp_ftype deprecated_target_read_fp) +set_gdbarch_read_sp (struct gdbarch *gdbarch, + gdbarch_read_sp_ftype read_sp) { - gdbarch->deprecated_target_read_fp = deprecated_target_read_fp; + gdbarch->read_sp = read_sp; } -CORE_ADDR -gdbarch_read_sp (struct gdbarch *gdbarch) +void +gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset) { gdb_assert (gdbarch != NULL); - if (gdbarch->read_sp == 0) + if (gdbarch->virtual_frame_pointer == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_read_sp invalid"); + "gdbarch: gdbarch_virtual_frame_pointer invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n"); - return gdbarch->read_sp (); + fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n"); + gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset); } void -set_gdbarch_read_sp (struct gdbarch *gdbarch, - gdbarch_read_sp_ftype read_sp) +set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, + gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer) { - gdbarch->read_sp = read_sp; + gdbarch->virtual_frame_pointer = virtual_frame_pointer; } int -gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch) +gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_dummy_write_sp != 0; + return gdbarch->pseudo_register_read != 0; } void -gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_dummy_write_sp == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_dummy_write_sp invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_dummy_write_sp called\n"); - gdbarch->deprecated_dummy_write_sp (val); -} - -void -set_gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, - gdbarch_deprecated_dummy_write_sp_ftype deprecated_dummy_write_sp) -{ - gdbarch->deprecated_dummy_write_sp = deprecated_dummy_write_sp; -} - -void -gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->virtual_frame_pointer == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_virtual_frame_pointer invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n"); - gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset); -} - -void -set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, - gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer) -{ - gdbarch->virtual_frame_pointer = virtual_frame_pointer; -} - -int -gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->pseudo_register_read != 0; -} - -void -gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf) +gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf) { gdb_assert (gdbarch != NULL); if (gdbarch->pseudo_register_read == 0) @@ -3086,23 +3108,6 @@ set_gdbarch_sp_regnum (struct gdbarch *gdbarch, gdbarch->sp_regnum = sp_regnum; } -int -gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */ - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n"); - return gdbarch->deprecated_fp_regnum; -} - -void -set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, - int deprecated_fp_regnum) -{ - gdbarch->deprecated_fp_regnum = deprecated_fp_regnum; -} - int gdbarch_pc_regnum (struct gdbarch *gdbarch) { @@ -3286,19 +3291,55 @@ set_gdbarch_register_name (struct gdbarch *gdbarch, } int -gdbarch_deprecated_register_size (struct gdbarch *gdbarch) +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_deprecated_register_size called\n"); - return gdbarch->deprecated_register_size; + fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n"); + return gdbarch->register_type (gdbarch, reg_nr); } void -set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, - int deprecated_register_size) +set_gdbarch_register_type (struct gdbarch *gdbarch, + gdbarch_register_type_ftype register_type) { - gdbarch->deprecated_register_size = deprecated_register_size; + gdbarch->register_type = register_type; +} + +int +gdbarch_deprecated_register_virtual_type_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_register_virtual_type != 0; +} + +struct type * +gdbarch_deprecated_register_virtual_type (struct gdbarch *gdbarch, int reg_nr) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->deprecated_register_virtual_type == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_deprecated_register_virtual_type invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_virtual_type called\n"); + return gdbarch->deprecated_register_virtual_type (reg_nr); +} + +void +set_gdbarch_deprecated_register_virtual_type (struct gdbarch *gdbarch, + gdbarch_deprecated_register_virtual_type_ftype deprecated_register_virtual_type) +{ + gdbarch->deprecated_register_virtual_type = deprecated_register_virtual_type; } int @@ -3318,49 +3359,68 @@ set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch, } int -gdbarch_register_byte_p (struct gdbarch *gdbarch) +gdbarch_deprecated_register_byte_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_register_byte != generic_register_byte; +} + +int +gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, int reg_nr) { gdb_assert (gdbarch != NULL); - return gdbarch->register_byte != generic_register_byte; + if (gdbarch->deprecated_register_byte == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_deprecated_register_byte invalid"); + /* Ignore predicate (gdbarch->deprecated_register_byte != generic_register_byte). */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_byte called\n"); + return gdbarch->deprecated_register_byte (reg_nr); +} + +void +set_gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, + gdbarch_deprecated_register_byte_ftype deprecated_register_byte) +{ + gdbarch->deprecated_register_byte = deprecated_register_byte; } int -gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr) +gdbarch_deprecated_register_raw_size (struct gdbarch *gdbarch, int reg_nr) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_byte == 0) + if (gdbarch->deprecated_register_raw_size == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_byte invalid"); - /* Ignore predicate (gdbarch->register_byte != generic_register_byte). */ + "gdbarch: gdbarch_deprecated_register_raw_size invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n"); - return gdbarch->register_byte (reg_nr); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_raw_size called\n"); + return gdbarch->deprecated_register_raw_size (reg_nr); } void -set_gdbarch_register_byte (struct gdbarch *gdbarch, - gdbarch_register_byte_ftype register_byte) +set_gdbarch_deprecated_register_raw_size (struct gdbarch *gdbarch, + gdbarch_deprecated_register_raw_size_ftype deprecated_register_raw_size) { - gdbarch->register_byte = register_byte; + gdbarch->deprecated_register_raw_size = deprecated_register_raw_size; } int -gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr) +gdbarch_deprecated_register_virtual_size (struct gdbarch *gdbarch, int reg_nr) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_raw_size == 0) + if (gdbarch->deprecated_register_virtual_size == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_raw_size invalid"); + "gdbarch: gdbarch_deprecated_register_virtual_size invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n"); - return gdbarch->register_raw_size (reg_nr); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_virtual_size called\n"); + return gdbarch->deprecated_register_virtual_size (reg_nr); } void -set_gdbarch_register_raw_size (struct gdbarch *gdbarch, - gdbarch_register_raw_size_ftype register_raw_size) +set_gdbarch_deprecated_register_virtual_size (struct gdbarch *gdbarch, + gdbarch_deprecated_register_virtual_size_ftype deprecated_register_virtual_size) { - gdbarch->register_raw_size = register_raw_size; + gdbarch->deprecated_register_virtual_size = deprecated_register_virtual_size; } int @@ -3386,25 +3446,6 @@ set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch, gdbarch->deprecated_max_register_raw_size = deprecated_max_register_raw_size; } -int -gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->register_virtual_size == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_virtual_size invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n"); - return gdbarch->register_virtual_size (reg_nr); -} - -void -set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, - gdbarch_register_virtual_size_ftype register_virtual_size) -{ - gdbarch->register_virtual_size = register_virtual_size; -} - int gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch) { @@ -3429,278 +3470,235 @@ set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch, } int -gdbarch_register_virtual_type_p (struct gdbarch *gdbarch) +gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->register_virtual_type != 0; + return gdbarch->unwind_dummy_id != 0; } -struct type * -gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr) +struct frame_id +gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_virtual_type == 0) + if (gdbarch->unwind_dummy_id == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_virtual_type invalid"); + "gdbarch: gdbarch_unwind_dummy_id invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n"); - return gdbarch->register_virtual_type (reg_nr); + fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n"); + return gdbarch->unwind_dummy_id (gdbarch, info); } void -set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, - gdbarch_register_virtual_type_ftype register_virtual_type) +set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, + gdbarch_unwind_dummy_id_ftype unwind_dummy_id) { - gdbarch->register_virtual_type = register_virtual_type; + gdbarch->unwind_dummy_id = unwind_dummy_id; } int -gdbarch_register_type_p (struct gdbarch *gdbarch) +gdbarch_deprecated_save_dummy_frame_tos_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->register_type != 0; + return gdbarch->deprecated_save_dummy_frame_tos != 0; } -struct type * -gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr) +void +gdbarch_deprecated_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_type == 0) + if (gdbarch->deprecated_save_dummy_frame_tos == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_type invalid"); + "gdbarch: gdbarch_deprecated_save_dummy_frame_tos invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n"); - return gdbarch->register_type (gdbarch, reg_nr); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_save_dummy_frame_tos called\n"); + gdbarch->deprecated_save_dummy_frame_tos (sp); } void -set_gdbarch_register_type (struct gdbarch *gdbarch, - gdbarch_register_type_ftype register_type) +set_gdbarch_deprecated_save_dummy_frame_tos (struct gdbarch *gdbarch, + gdbarch_deprecated_save_dummy_frame_tos_ftype deprecated_save_dummy_frame_tos) { - gdbarch->register_type = register_type; + gdbarch->deprecated_save_dummy_frame_tos = deprecated_save_dummy_frame_tos; } int -gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch) +gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_do_registers_info != 0; + /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n"); + return gdbarch->deprecated_fp_regnum; } void -gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs) +set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, + int deprecated_fp_regnum) { - gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_do_registers_info == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_do_registers_info invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_do_registers_info called\n"); - gdbarch->deprecated_do_registers_info (reg_nr, fpregs); + gdbarch->deprecated_fp_regnum = deprecated_fp_regnum; } -void -set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, - gdbarch_deprecated_do_registers_info_ftype deprecated_do_registers_info) +int +gdbarch_deprecated_target_read_fp_p (struct gdbarch *gdbarch) { - gdbarch->deprecated_do_registers_info = deprecated_do_registers_info; + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_target_read_fp != 0; } -void -gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all) +CORE_ADDR +gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->print_registers_info == 0) + if (gdbarch->deprecated_target_read_fp == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_print_registers_info invalid"); + "gdbarch: gdbarch_deprecated_target_read_fp invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n"); - gdbarch->print_registers_info (gdbarch, file, frame, regnum, all); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_target_read_fp called\n"); + return gdbarch->deprecated_target_read_fp (); } void -set_gdbarch_print_registers_info (struct gdbarch *gdbarch, - gdbarch_print_registers_info_ftype print_registers_info) +set_gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch, + gdbarch_deprecated_target_read_fp_ftype deprecated_target_read_fp) { - gdbarch->print_registers_info = print_registers_info; + gdbarch->deprecated_target_read_fp = deprecated_target_read_fp; } int -gdbarch_print_float_info_p (struct gdbarch *gdbarch) +gdbarch_push_dummy_call_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->print_float_info != 0; + return gdbarch->push_dummy_call != 0; } -void -gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) +CORE_ADDR +gdbarch_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { gdb_assert (gdbarch != NULL); - if (gdbarch->print_float_info == 0) + if (gdbarch->push_dummy_call == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_print_float_info invalid"); + "gdbarch: gdbarch_push_dummy_call invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n"); - gdbarch->print_float_info (gdbarch, file, frame, args); + fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n"); + return gdbarch->push_dummy_call (gdbarch, func_addr, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr); } void -set_gdbarch_print_float_info (struct gdbarch *gdbarch, - gdbarch_print_float_info_ftype print_float_info) +set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, + gdbarch_push_dummy_call_ftype push_dummy_call) { - gdbarch->print_float_info = print_float_info; + gdbarch->push_dummy_call = push_dummy_call; } int -gdbarch_print_vector_info_p (struct gdbarch *gdbarch) +gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->print_vector_info != 0; + return gdbarch->deprecated_push_arguments != 0; } -void -gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) +CORE_ADDR +gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { gdb_assert (gdbarch != NULL); - if (gdbarch->print_vector_info == 0) + if (gdbarch->deprecated_push_arguments == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_print_vector_info invalid"); + "gdbarch: gdbarch_deprecated_push_arguments invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n"); - gdbarch->print_vector_info (gdbarch, file, frame, args); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_arguments called\n"); + return gdbarch->deprecated_push_arguments (nargs, args, sp, struct_return, struct_addr); } void -set_gdbarch_print_vector_info (struct gdbarch *gdbarch, - gdbarch_print_vector_info_ftype print_vector_info) +set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, + gdbarch_deprecated_push_arguments_ftype deprecated_push_arguments) { - gdbarch->print_vector_info = print_vector_info; + gdbarch->deprecated_push_arguments = deprecated_push_arguments; } int -gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr) +gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_sim_regno == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_sim_regno invalid"); + /* Skip verify of deprecated_use_generic_dummy_frames, invalid_p == 0 */ if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n"); - return gdbarch->register_sim_regno (reg_nr); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_generic_dummy_frames called\n"); + return gdbarch->deprecated_use_generic_dummy_frames; } void -set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, - gdbarch_register_sim_regno_ftype register_sim_regno) +set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch, + int deprecated_use_generic_dummy_frames) { - gdbarch->register_sim_regno = register_sim_regno; + gdbarch->deprecated_use_generic_dummy_frames = deprecated_use_generic_dummy_frames; } int -gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch) +gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->register_bytes_ok != 0; + return gdbarch->deprecated_push_return_address != 0; } -int -gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes) +CORE_ADDR +gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_bytes_ok == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_bytes_ok invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n"); - return gdbarch->register_bytes_ok (nr_bytes); -} - -void -set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, - gdbarch_register_bytes_ok_ftype register_bytes_ok) -{ - gdbarch->register_bytes_ok = register_bytes_ok; -} - -int -gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->cannot_fetch_register == 0) + if (gdbarch->deprecated_push_return_address == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_cannot_fetch_register invalid"); + "gdbarch: gdbarch_deprecated_push_return_address invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n"); - return gdbarch->cannot_fetch_register (regnum); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_return_address called\n"); + return gdbarch->deprecated_push_return_address (pc, sp); } void -set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, - gdbarch_cannot_fetch_register_ftype cannot_fetch_register) +set_gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, + gdbarch_deprecated_push_return_address_ftype deprecated_push_return_address) { - gdbarch->cannot_fetch_register = cannot_fetch_register; + gdbarch->deprecated_push_return_address = deprecated_push_return_address; } int -gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum) +gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->cannot_store_register == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_cannot_store_register invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n"); - return gdbarch->cannot_store_register (regnum); + return gdbarch->deprecated_dummy_write_sp != 0; } void -set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, - gdbarch_cannot_store_register_ftype cannot_store_register) -{ - gdbarch->cannot_store_register = cannot_store_register; -} - -int -gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->get_longjmp_target != 0; -} - -int -gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc) +gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val) { gdb_assert (gdbarch != NULL); - if (gdbarch->get_longjmp_target == 0) + if (gdbarch->deprecated_dummy_write_sp == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_get_longjmp_target invalid"); + "gdbarch: gdbarch_deprecated_dummy_write_sp invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n"); - return gdbarch->get_longjmp_target (pc); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_dummy_write_sp called\n"); + gdbarch->deprecated_dummy_write_sp (val); } void -set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, - gdbarch_get_longjmp_target_ftype get_longjmp_target) +set_gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, + gdbarch_deprecated_dummy_write_sp_ftype deprecated_dummy_write_sp) { - gdbarch->get_longjmp_target = get_longjmp_target; + gdbarch->deprecated_dummy_write_sp = deprecated_dummy_write_sp; } int -gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch) +gdbarch_deprecated_register_size (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - /* Skip verify of deprecated_use_generic_dummy_frames, invalid_p == 0 */ if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_generic_dummy_frames called\n"); - return gdbarch->deprecated_use_generic_dummy_frames; + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n"); + return gdbarch->deprecated_register_size; } void -set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch, - int deprecated_use_generic_dummy_frames) +set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, + int deprecated_register_size) { - gdbarch->deprecated_use_generic_dummy_frames = deprecated_use_generic_dummy_frames; + gdbarch->deprecated_register_size = deprecated_register_size; } int @@ -3787,33 +3785,6 @@ set_gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch, gdbarch->deprecated_call_dummy_length = deprecated_call_dummy_length; } -int -gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy; -} - -int -gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_pc_in_call_dummy == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_pc_in_call_dummy invalid"); - /* Ignore predicate (gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy). */ - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pc_in_call_dummy called\n"); - return gdbarch->deprecated_pc_in_call_dummy (pc, sp, frame_address); -} - -void -set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, - gdbarch_deprecated_pc_in_call_dummy_ftype deprecated_pc_in_call_dummy) -{ - gdbarch->deprecated_pc_in_call_dummy = deprecated_pc_in_call_dummy; -} - LONGEST * gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch) { @@ -3882,45 +3853,321 @@ void gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_fix_call_dummy == 0) + if (gdbarch->deprecated_fix_call_dummy == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_deprecated_fix_call_dummy invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fix_call_dummy called\n"); + gdbarch->deprecated_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p); +} + +void +set_gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, + gdbarch_deprecated_fix_call_dummy_ftype deprecated_fix_call_dummy) +{ + gdbarch->deprecated_fix_call_dummy = deprecated_fix_call_dummy; +} + +int +gdbarch_push_dummy_code_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->push_dummy_code != 0; +} + +CORE_ADDR +gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->push_dummy_code == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_push_dummy_code invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n"); + return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr); +} + +void +set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, + gdbarch_push_dummy_code_ftype push_dummy_code) +{ + gdbarch->push_dummy_code = push_dummy_code; +} + +int +gdbarch_deprecated_push_dummy_frame_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_push_dummy_frame != 0; +} + +void +gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->deprecated_push_dummy_frame == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_deprecated_push_dummy_frame invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_dummy_frame called\n"); + gdbarch->deprecated_push_dummy_frame (); +} + +void +set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch, + gdbarch_deprecated_push_dummy_frame_ftype deprecated_push_dummy_frame) +{ + gdbarch->deprecated_push_dummy_frame = deprecated_push_dummy_frame; +} + +int +gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + /* Skip verify of deprecated_extra_stack_alignment_needed, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extra_stack_alignment_needed called\n"); + return gdbarch->deprecated_extra_stack_alignment_needed; +} + +void +set_gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch, + int deprecated_extra_stack_alignment_needed) +{ + gdbarch->deprecated_extra_stack_alignment_needed = deprecated_extra_stack_alignment_needed; +} + +int +gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_do_registers_info != 0; +} + +void +gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->deprecated_do_registers_info == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_deprecated_do_registers_info invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_do_registers_info called\n"); + gdbarch->deprecated_do_registers_info (reg_nr, fpregs); +} + +void +set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, + gdbarch_deprecated_do_registers_info_ftype deprecated_do_registers_info) +{ + gdbarch->deprecated_do_registers_info = deprecated_do_registers_info; +} + +void +gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->print_registers_info == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_print_registers_info invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n"); + gdbarch->print_registers_info (gdbarch, file, frame, regnum, all); +} + +void +set_gdbarch_print_registers_info (struct gdbarch *gdbarch, + gdbarch_print_registers_info_ftype print_registers_info) +{ + gdbarch->print_registers_info = print_registers_info; +} + +int +gdbarch_print_float_info_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->print_float_info != 0; +} + +void +gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->print_float_info == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_print_float_info invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n"); + gdbarch->print_float_info (gdbarch, file, frame, args); +} + +void +set_gdbarch_print_float_info (struct gdbarch *gdbarch, + gdbarch_print_float_info_ftype print_float_info) +{ + gdbarch->print_float_info = print_float_info; +} + +int +gdbarch_print_vector_info_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->print_vector_info != 0; +} + +void +gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->print_vector_info == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_print_vector_info invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n"); + gdbarch->print_vector_info (gdbarch, file, frame, args); +} + +void +set_gdbarch_print_vector_info (struct gdbarch *gdbarch, + gdbarch_print_vector_info_ftype print_vector_info) +{ + gdbarch->print_vector_info = print_vector_info; +} + +int +gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->register_sim_regno == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_sim_regno invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n"); + return gdbarch->register_sim_regno (reg_nr); +} + +void +set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, + gdbarch_register_sim_regno_ftype register_sim_regno) +{ + gdbarch->register_sim_regno = register_sim_regno; +} + +int +gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->register_bytes_ok != 0; +} + +int +gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->register_bytes_ok == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_bytes_ok invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n"); + return gdbarch->register_bytes_ok (nr_bytes); +} + +void +set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, + gdbarch_register_bytes_ok_ftype register_bytes_ok) +{ + gdbarch->register_bytes_ok = register_bytes_ok; +} + +int +gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->cannot_fetch_register == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_cannot_fetch_register invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n"); + return gdbarch->cannot_fetch_register (regnum); +} + +void +set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, + gdbarch_cannot_fetch_register_ftype cannot_fetch_register) +{ + gdbarch->cannot_fetch_register = cannot_fetch_register; +} + +int +gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->cannot_store_register == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_cannot_store_register invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n"); + return gdbarch->cannot_store_register (regnum); +} + +void +set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, + gdbarch_cannot_store_register_ftype cannot_store_register) +{ + gdbarch->cannot_store_register = cannot_store_register; +} + +int +gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->get_longjmp_target != 0; +} + +int +gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->get_longjmp_target == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_fix_call_dummy invalid"); + "gdbarch: gdbarch_get_longjmp_target invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fix_call_dummy called\n"); - gdbarch->deprecated_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p); + fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n"); + return gdbarch->get_longjmp_target (pc); } void -set_gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, - gdbarch_deprecated_fix_call_dummy_ftype deprecated_fix_call_dummy) +set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, + gdbarch_get_longjmp_target_ftype get_longjmp_target) { - gdbarch->deprecated_fix_call_dummy = deprecated_fix_call_dummy; + gdbarch->get_longjmp_target = get_longjmp_target; } int -gdbarch_push_dummy_code_p (struct gdbarch *gdbarch) +gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->push_dummy_code != 0; + return gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy; } -CORE_ADDR -gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr) +int +gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) { gdb_assert (gdbarch != NULL); - if (gdbarch->push_dummy_code == 0) + if (gdbarch->deprecated_pc_in_call_dummy == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_push_dummy_code invalid"); + "gdbarch: gdbarch_deprecated_pc_in_call_dummy invalid"); + /* Ignore predicate (gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy). */ if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n"); - return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pc_in_call_dummy called\n"); + return gdbarch->deprecated_pc_in_call_dummy (pc, sp, frame_address); } void -set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, - gdbarch_push_dummy_code_ftype push_dummy_code) +set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, + gdbarch_deprecated_pc_in_call_dummy_ftype deprecated_pc_in_call_dummy) { - gdbarch->push_dummy_code = push_dummy_code; + gdbarch->deprecated_pc_in_call_dummy = deprecated_pc_in_call_dummy; } int @@ -4034,64 +4281,64 @@ set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, } int -gdbarch_register_convertible (struct gdbarch *gdbarch, int nr) +gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, int nr) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_convertible == 0) + if (gdbarch->deprecated_register_convertible == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_convertible invalid"); + "gdbarch: gdbarch_deprecated_register_convertible invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n"); - return gdbarch->register_convertible (nr); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_convertible called\n"); + return gdbarch->deprecated_register_convertible (nr); } void -set_gdbarch_register_convertible (struct gdbarch *gdbarch, - gdbarch_register_convertible_ftype register_convertible) +set_gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, + gdbarch_deprecated_register_convertible_ftype deprecated_register_convertible) { - gdbarch->register_convertible = register_convertible; + gdbarch->deprecated_register_convertible = deprecated_register_convertible; } void -gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to) +gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_convert_to_virtual == 0) + if (gdbarch->deprecated_register_convert_to_virtual == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_convert_to_virtual invalid"); + "gdbarch: gdbarch_deprecated_register_convert_to_virtual invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n"); - gdbarch->register_convert_to_virtual (regnum, type, from, to); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_convert_to_virtual called\n"); + gdbarch->deprecated_register_convert_to_virtual (regnum, type, from, to); } void -set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, - gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual) +set_gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, + gdbarch_deprecated_register_convert_to_virtual_ftype deprecated_register_convert_to_virtual) { - gdbarch->register_convert_to_virtual = register_convert_to_virtual; + gdbarch->deprecated_register_convert_to_virtual = deprecated_register_convert_to_virtual; } void -gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to) +gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, const char *from, char *to) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_convert_to_raw == 0) + if (gdbarch->deprecated_register_convert_to_raw == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_convert_to_raw invalid"); + "gdbarch: gdbarch_deprecated_register_convert_to_raw invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n"); - gdbarch->register_convert_to_raw (type, regnum, from, to); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_convert_to_raw called\n"); + gdbarch->deprecated_register_convert_to_raw (type, regnum, from, to); } void -set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, - gdbarch_register_convert_to_raw_ftype register_convert_to_raw) +set_gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, + gdbarch_deprecated_register_convert_to_raw_ftype deprecated_register_convert_to_raw) { - gdbarch->register_convert_to_raw = register_convert_to_raw; + gdbarch->deprecated_register_convert_to_raw = deprecated_register_convert_to_raw; } int -gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum) +gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) { gdb_assert (gdbarch != NULL); if (gdbarch->convert_register_p == 0) @@ -4099,7 +4346,7 @@ gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum) "gdbarch: gdbarch_convert_register_p invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n"); - return gdbarch->convert_register_p (regnum); + return gdbarch->convert_register_p (regnum, type); } void @@ -4110,7 +4357,7 @@ set_gdbarch_convert_register_p (struct gdbarch *gdbarch, } void -gdbarch_register_to_value (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to) +gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, void *buf) { gdb_assert (gdbarch != NULL); if (gdbarch->register_to_value == 0) @@ -4118,7 +4365,7 @@ gdbarch_register_to_value (struct gdbarch *gdbarch, int regnum, struct type *typ "gdbarch: gdbarch_register_to_value invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n"); - gdbarch->register_to_value (regnum, type, from, to); + gdbarch->register_to_value (frame, regnum, type, buf); } void @@ -4129,7 +4376,7 @@ set_gdbarch_register_to_value (struct gdbarch *gdbarch, } void -gdbarch_value_to_register (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to) +gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const void *buf) { gdb_assert (gdbarch != NULL); if (gdbarch->value_to_register == 0) @@ -4137,7 +4384,7 @@ gdbarch_value_to_register (struct gdbarch *gdbarch, struct type *type, int regnu "gdbarch: gdbarch_value_to_register invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n"); - gdbarch->value_to_register (type, regnum, from, to); + gdbarch->value_to_register (frame, regnum, type, buf); } void @@ -4230,110 +4477,6 @@ set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch->return_value_on_stack = return_value_on_stack; } -int -gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_push_arguments != 0; -} - -CORE_ADDR -gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_push_arguments == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_push_arguments invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_arguments called\n"); - return gdbarch->deprecated_push_arguments (nargs, args, sp, struct_return, struct_addr); -} - -void -set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, - gdbarch_deprecated_push_arguments_ftype deprecated_push_arguments) -{ - gdbarch->deprecated_push_arguments = deprecated_push_arguments; -} - -int -gdbarch_push_dummy_call_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->push_dummy_call != 0; -} - -CORE_ADDR -gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->push_dummy_call == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_push_dummy_call invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n"); - return gdbarch->push_dummy_call (gdbarch, regcache, dummy_addr, nargs, args, sp, struct_return, struct_addr); -} - -void -set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, - gdbarch_push_dummy_call_ftype push_dummy_call) -{ - gdbarch->push_dummy_call = push_dummy_call; -} - -int -gdbarch_deprecated_push_dummy_frame_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_push_dummy_frame != 0; -} - -void -gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_push_dummy_frame == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_push_dummy_frame invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_dummy_frame called\n"); - gdbarch->deprecated_push_dummy_frame (); -} - -void -set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch, - gdbarch_deprecated_push_dummy_frame_ftype deprecated_push_dummy_frame) -{ - gdbarch->deprecated_push_dummy_frame = deprecated_push_dummy_frame; -} - -int -gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_push_return_address != 0; -} - -CORE_ADDR -gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_push_return_address == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_push_return_address invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_return_address called\n"); - return gdbarch->deprecated_push_return_address (pc, sp); -} - -void -set_gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, - gdbarch_deprecated_push_return_address_ftype deprecated_push_return_address) -{ - gdbarch->deprecated_push_return_address = deprecated_push_return_address; -} - int gdbarch_deprecated_pop_frame_p (struct gdbarch *gdbarch) { @@ -4718,25 +4861,6 @@ set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, gdbarch->decr_pc_after_break = decr_pc_after_break; } -int -gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->prepare_to_proceed == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_prepare_to_proceed invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_prepare_to_proceed called\n"); - return gdbarch->prepare_to_proceed (select_it); -} - -void -set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, - gdbarch_prepare_to_proceed_ftype prepare_to_proceed) -{ - gdbarch->prepare_to_proceed = prepare_to_proceed; -} - CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch) { @@ -4917,42 +5041,84 @@ set_gdbarch_unwind_pc (struct gdbarch *gdbarch, gdbarch->unwind_pc = unwind_pc; } +int +gdbarch_unwind_sp_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->unwind_sp != 0; +} + +CORE_ADDR +gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->unwind_sp == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_unwind_sp invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n"); + return gdbarch->unwind_sp (gdbarch, next_frame); +} + +void +set_gdbarch_unwind_sp (struct gdbarch *gdbarch, + gdbarch_unwind_sp_ftype unwind_sp) +{ + gdbarch->unwind_sp = unwind_sp; +} + +int +gdbarch_deprecated_frame_args_address_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_frame_args_address != get_frame_base; +} + CORE_ADDR -gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi) +gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi) { gdb_assert (gdbarch != NULL); - if (gdbarch->frame_args_address == 0) + if (gdbarch->deprecated_frame_args_address == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_frame_args_address invalid"); + "gdbarch: gdbarch_deprecated_frame_args_address invalid"); + /* Ignore predicate (gdbarch->deprecated_frame_args_address != get_frame_base). */ if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n"); - return gdbarch->frame_args_address (fi); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_args_address called\n"); + return gdbarch->deprecated_frame_args_address (fi); } void -set_gdbarch_frame_args_address (struct gdbarch *gdbarch, - gdbarch_frame_args_address_ftype frame_args_address) +set_gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch, + gdbarch_deprecated_frame_args_address_ftype deprecated_frame_args_address) +{ + gdbarch->deprecated_frame_args_address = deprecated_frame_args_address; +} + +int +gdbarch_deprecated_frame_locals_address_p (struct gdbarch *gdbarch) { - gdbarch->frame_args_address = frame_args_address; + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_frame_locals_address != get_frame_base; } CORE_ADDR -gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi) +gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi) { gdb_assert (gdbarch != NULL); - if (gdbarch->frame_locals_address == 0) + if (gdbarch->deprecated_frame_locals_address == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_frame_locals_address invalid"); + "gdbarch: gdbarch_deprecated_frame_locals_address invalid"); + /* Ignore predicate (gdbarch->deprecated_frame_locals_address != get_frame_base). */ if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n"); - return gdbarch->frame_locals_address (fi); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_locals_address called\n"); + return gdbarch->deprecated_frame_locals_address (fi); } void -set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, - gdbarch_frame_locals_address_ftype frame_locals_address) +set_gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch, + gdbarch_deprecated_frame_locals_address_ftype deprecated_frame_locals_address) { - gdbarch->frame_locals_address = frame_locals_address; + gdbarch->deprecated_frame_locals_address = deprecated_frame_locals_address; } int @@ -4981,6 +5147,13 @@ set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch->deprecated_saved_pc_after_call = deprecated_saved_pc_after_call; } +int +gdbarch_frame_num_args_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->frame_num_args != 0; +} + int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame) { @@ -5052,23 +5225,6 @@ set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch->frame_align = frame_align; } -int -gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - /* Skip verify of deprecated_extra_stack_alignment_needed, invalid_p == 0 */ - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extra_stack_alignment_needed called\n"); - return gdbarch->deprecated_extra_stack_alignment_needed; -} - -void -set_gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch, - int deprecated_extra_stack_alignment_needed) -{ - gdbarch->deprecated_extra_stack_alignment_needed = deprecated_extra_stack_alignment_needed; -} - int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch) { @@ -5095,58 +5251,6 @@ set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch->reg_struct_has_addr = reg_struct_has_addr; } -int -gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->save_dummy_frame_tos != 0; -} - -void -gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->save_dummy_frame_tos == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_save_dummy_frame_tos invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n"); - gdbarch->save_dummy_frame_tos (sp); -} - -void -set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, - gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos) -{ - gdbarch->save_dummy_frame_tos = save_dummy_frame_tos; -} - -int -gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->unwind_dummy_id != 0; -} - -struct frame_id -gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch->unwind_dummy_id == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_unwind_dummy_id invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n"); - return gdbarch->unwind_dummy_id (gdbarch, info); -} - -void -set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, - gdbarch_unwind_dummy_id_ftype unwind_dummy_id) -{ - gdbarch->unwind_dummy_id = unwind_dummy_id; -} - int gdbarch_parm_boundary (struct gdbarch *gdbarch) { @@ -5691,6 +5795,32 @@ set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, gdbarch->register_reggroup_p = register_reggroup_p; } +int +gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->fetch_pointer_argument != 0; +} + +CORE_ADDR +gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->fetch_pointer_argument == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_fetch_pointer_argument invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n"); + return gdbarch->fetch_pointer_argument (frame, argi, type); +} + +void +set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, + gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument) +{ + gdbarch->fetch_pointer_argument = fetch_pointer_argument; +} + /* Keep a registry of per-architecture data-pointers required by GDB modules. */ diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index e80836f2a33..4dd7cfa9d7f 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -69,33 +69,27 @@ extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbar #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ARCHITECTURE) #error "Non multi-arch definition of TARGET_ARCHITECTURE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ARCHITECTURE) +#if !defined (TARGET_ARCHITECTURE) #define TARGET_ARCHITECTURE (gdbarch_bfd_arch_info (current_gdbarch)) #endif -#endif extern int gdbarch_byte_order (struct gdbarch *gdbarch); /* set_gdbarch_byte_order() - not applicable - pre-initialized. */ #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BYTE_ORDER) #error "Non multi-arch definition of TARGET_BYTE_ORDER" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BYTE_ORDER) +#if !defined (TARGET_BYTE_ORDER) #define TARGET_BYTE_ORDER (gdbarch_byte_order (current_gdbarch)) #endif -#endif extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch); /* set_gdbarch_osabi() - not applicable - pre-initialized. */ #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_OSABI) #error "Non multi-arch definition of TARGET_OSABI" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_OSABI) +#if !defined (TARGET_OSABI) #define TARGET_OSABI (gdbarch_osabi (current_gdbarch)) #endif -#endif /* The following are initialized by the target dependent code. */ @@ -116,11 +110,9 @@ extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_SHORT_BIT) #error "Non multi-arch definition of TARGET_SHORT_BIT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_SHORT_BIT) +#if !defined (TARGET_SHORT_BIT) #define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch)) #endif -#endif /* Number of bits in an int or unsigned int for the target machine. */ @@ -134,11 +126,9 @@ extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_INT_BIT) #error "Non multi-arch definition of TARGET_INT_BIT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_INT_BIT) +#if !defined (TARGET_INT_BIT) #define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch)) #endif -#endif /* Number of bits in a long or unsigned long for the target machine. */ @@ -152,11 +142,9 @@ extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_BIT) #error "Non multi-arch definition of TARGET_LONG_BIT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_BIT) +#if !defined (TARGET_LONG_BIT) #define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch)) #endif -#endif /* Number of bits in a long long or unsigned long long for the target machine. */ @@ -171,11 +159,9 @@ extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bi #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_LONG_BIT) #error "Non multi-arch definition of TARGET_LONG_LONG_BIT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_LONG_BIT) +#if !defined (TARGET_LONG_LONG_BIT) #define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch)) #endif -#endif /* Number of bits in a float for the target machine. */ @@ -189,11 +175,9 @@ extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_BIT) #error "Non multi-arch definition of TARGET_FLOAT_BIT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_BIT) +#if !defined (TARGET_FLOAT_BIT) #define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch)) #endif -#endif /* Number of bits in a double for the target machine. */ @@ -207,11 +191,9 @@ extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_BIT) #error "Non multi-arch definition of TARGET_DOUBLE_BIT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_BIT) +#if !defined (TARGET_DOUBLE_BIT) #define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch)) #endif -#endif /* Number of bits in a long double for the target machine. */ @@ -225,11 +207,9 @@ extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_doubl #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_BIT) #error "Non multi-arch definition of TARGET_LONG_DOUBLE_BIT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_BIT) +#if !defined (TARGET_LONG_DOUBLE_BIT) #define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch)) #endif -#endif /* For most targets, a pointer on the target and its representation as an address in GDB have the same size and "look the same". For such a @@ -251,11 +231,9 @@ extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PTR_BIT) #error "Non multi-arch definition of TARGET_PTR_BIT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PTR_BIT) +#if !defined (TARGET_PTR_BIT) #define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch)) #endif -#endif /* addr_bit is the size of a target address as represented in gdb */ @@ -269,11 +247,9 @@ extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ADDR_BIT) #error "Non multi-arch definition of TARGET_ADDR_BIT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ADDR_BIT) +#if !defined (TARGET_ADDR_BIT) #define TARGET_ADDR_BIT (gdbarch_addr_bit (current_gdbarch)) #endif -#endif /* Number of bits in a BFD_VMA for the target object file format. */ @@ -287,11 +263,9 @@ extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BFD_VMA_BIT) #error "Non multi-arch definition of TARGET_BFD_VMA_BIT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BFD_VMA_BIT) +#if !defined (TARGET_BFD_VMA_BIT) #define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch)) #endif -#endif /* One if `char' acts like `signed char', zero if `unsigned char'. */ @@ -305,15 +279,33 @@ extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_CHAR_SIGNED) #error "Non multi-arch definition of TARGET_CHAR_SIGNED" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_CHAR_SIGNED) +#if !defined (TARGET_CHAR_SIGNED) #define TARGET_CHAR_SIGNED (gdbarch_char_signed (current_gdbarch)) #endif + +#if defined (TARGET_READ_PC) +/* Legacy for systems yet to multi-arch TARGET_READ_PC */ +#if !defined (TARGET_READ_PC_P) +#define TARGET_READ_PC_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC_P) +#define TARGET_READ_PC_P() (0) +#endif + +extern int gdbarch_read_pc_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC_P) +#error "Non multi-arch definition of TARGET_READ_PC" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC_P) +#define TARGET_READ_PC_P() (gdbarch_read_pc_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC) -#define TARGET_READ_PC(ptid) (generic_target_read_pc (ptid)) +#define TARGET_READ_PC(ptid) (internal_error (__FILE__, __LINE__, "TARGET_READ_PC"), 0) #endif typedef CORE_ADDR (gdbarch_read_pc_ftype) (ptid_t ptid); @@ -322,11 +314,9 @@ extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC) #error "Non multi-arch definition of TARGET_READ_PC" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC) +#if !defined (TARGET_READ_PC) #define TARGET_READ_PC(ptid) (gdbarch_read_pc (current_gdbarch, ptid)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_PC) @@ -339,55 +329,35 @@ extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftyp #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_PC) #error "Non multi-arch definition of TARGET_WRITE_PC" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_PC) +#if !defined (TARGET_WRITE_PC) #define TARGET_WRITE_PC(val, ptid) (gdbarch_write_pc (current_gdbarch, val, ptid)) #endif -#endif -/* This is simply not needed. See value_of_builtin_frame_fp_reg and - call_function_by_hand. */ +/* UNWIND_SP is a direct replacement for TARGET_READ_SP. */ -#if defined (DEPRECATED_TARGET_READ_FP) -/* Legacy for systems yet to multi-arch DEPRECATED_TARGET_READ_FP */ -#if !defined (DEPRECATED_TARGET_READ_FP_P) -#define DEPRECATED_TARGET_READ_FP_P() (1) +#if defined (TARGET_READ_SP) +/* Legacy for systems yet to multi-arch TARGET_READ_SP */ +#if !defined (TARGET_READ_SP_P) +#define TARGET_READ_SP_P() (1) #endif #endif /* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_TARGET_READ_FP_P) -#define DEPRECATED_TARGET_READ_FP_P() (0) -#endif - -extern int gdbarch_deprecated_target_read_fp_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_TARGET_READ_FP_P) -#error "Non multi-arch definition of DEPRECATED_TARGET_READ_FP" -#endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_TARGET_READ_FP_P) -#define DEPRECATED_TARGET_READ_FP_P() (gdbarch_deprecated_target_read_fp_p (current_gdbarch)) -#endif - -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_TARGET_READ_FP) -#define DEPRECATED_TARGET_READ_FP() (internal_error (__FILE__, __LINE__, "DEPRECATED_TARGET_READ_FP"), 0) +#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP_P) +#define TARGET_READ_SP_P() (0) #endif -typedef CORE_ADDR (gdbarch_deprecated_target_read_fp_ftype) (void); -extern CORE_ADDR gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch); -extern void set_gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch, gdbarch_deprecated_target_read_fp_ftype *deprecated_target_read_fp); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_TARGET_READ_FP) -#error "Non multi-arch definition of DEPRECATED_TARGET_READ_FP" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_TARGET_READ_FP) -#define DEPRECATED_TARGET_READ_FP() (gdbarch_deprecated_target_read_fp (current_gdbarch)) +extern int gdbarch_read_sp_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP_P) +#error "Non multi-arch definition of TARGET_READ_SP" #endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP_P) +#define TARGET_READ_SP_P() (gdbarch_read_sp_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP) -#define TARGET_READ_SP() (generic_target_read_sp ()) +#define TARGET_READ_SP() (internal_error (__FILE__, __LINE__, "TARGET_READ_SP"), 0) #endif typedef CORE_ADDR (gdbarch_read_sp_ftype) (void); @@ -396,50 +366,9 @@ extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP) #error "Non multi-arch definition of TARGET_READ_SP" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP) +#if !defined (TARGET_READ_SP) #define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch)) #endif -#endif - -/* The dummy call frame SP should be set by push_dummy_call. */ - -#if defined (DEPRECATED_DUMMY_WRITE_SP) -/* Legacy for systems yet to multi-arch DEPRECATED_DUMMY_WRITE_SP */ -#if !defined (DEPRECATED_DUMMY_WRITE_SP_P) -#define DEPRECATED_DUMMY_WRITE_SP_P() (1) -#endif -#endif - -/* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP_P) -#define DEPRECATED_DUMMY_WRITE_SP_P() (0) -#endif - -extern int gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP_P) -#error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP" -#endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DUMMY_WRITE_SP_P) -#define DEPRECATED_DUMMY_WRITE_SP_P() (gdbarch_deprecated_dummy_write_sp_p (current_gdbarch)) -#endif - -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP) -#define DEPRECATED_DUMMY_WRITE_SP(val) (internal_error (__FILE__, __LINE__, "DEPRECATED_DUMMY_WRITE_SP"), 0) -#endif - -typedef void (gdbarch_deprecated_dummy_write_sp_ftype) (CORE_ADDR val); -extern void gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val); -extern void set_gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP) -#error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DUMMY_WRITE_SP) -#define DEPRECATED_DUMMY_WRITE_SP(val) (gdbarch_deprecated_dummy_write_sp (current_gdbarch, val)) -#endif -#endif /* Function for getting target's idea of a frame pointer. FIXME: GDB's whole scheme for dealing with "frames" and "frame pointers" needs a @@ -456,11 +385,9 @@ extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_ #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_VIRTUAL_FRAME_POINTER) #error "Non multi-arch definition of TARGET_VIRTUAL_FRAME_POINTER" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_VIRTUAL_FRAME_POINTER) +#if !defined (TARGET_VIRTUAL_FRAME_POINTER) #define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (gdbarch_virtual_frame_pointer (current_gdbarch, pc, frame_regnum, frame_offset)) #endif -#endif extern int gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch); @@ -479,11 +406,9 @@ extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_REGS) #error "Non multi-arch definition of NUM_REGS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_REGS) +#if !defined (NUM_REGS) #define NUM_REGS (gdbarch_num_regs (current_gdbarch)) #endif -#endif /* This macro gives the number of pseudo-registers that live in the register namespace but do not get fetched or stored on the target. @@ -500,15 +425,14 @@ extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_PSEUDO_REGS) #error "Non multi-arch definition of NUM_PSEUDO_REGS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_PSEUDO_REGS) +#if !defined (NUM_PSEUDO_REGS) #define NUM_PSEUDO_REGS (gdbarch_num_pseudo_regs (current_gdbarch)) #endif -#endif /* GDB's standard (or well known) register numbers. These can map onto a real register or a pseudo (computed) register or not be defined at - all (-1). */ + all (-1). + SP_REGNUM will hopefully be replaced by UNWIND_SP. */ /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (SP_REGNUM) @@ -520,30 +444,9 @@ extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SP_REGNUM) #error "Non multi-arch definition of SP_REGNUM" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SP_REGNUM) +#if !defined (SP_REGNUM) #define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch)) #endif -#endif - -/* This is simply not needed. See value_of_builtin_frame_fp_reg and - call_function_by_hand. */ - -/* Default (value) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FP_REGNUM) -#define DEPRECATED_FP_REGNUM (-1) -#endif - -extern int gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch); -extern void set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, int deprecated_fp_regnum); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FP_REGNUM) -#error "Non multi-arch definition of DEPRECATED_FP_REGNUM" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FP_REGNUM) -#define DEPRECATED_FP_REGNUM (gdbarch_deprecated_fp_regnum (current_gdbarch)) -#endif -#endif /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (PC_REGNUM) @@ -555,11 +458,9 @@ extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_REGNUM) #error "Non multi-arch definition of PC_REGNUM" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_REGNUM) +#if !defined (PC_REGNUM) #define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch)) #endif -#endif /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (PS_REGNUM) @@ -571,11 +472,9 @@ extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PS_REGNUM) #error "Non multi-arch definition of PS_REGNUM" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PS_REGNUM) +#if !defined (PS_REGNUM) #define PS_REGNUM (gdbarch_ps_regnum (current_gdbarch)) #endif -#endif /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (FP0_REGNUM) @@ -587,11 +486,9 @@ extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP0_REGNUM) #error "Non multi-arch definition of FP0_REGNUM" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP0_REGNUM) +#if !defined (FP0_REGNUM) #define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch)) #endif -#endif /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (NPC_REGNUM) @@ -603,11 +500,9 @@ extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NPC_REGNUM) #error "Non multi-arch definition of NPC_REGNUM" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NPC_REGNUM) +#if !defined (NPC_REGNUM) #define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch)) #endif -#endif /* Convert stab register number (from `r' declaration) to a gdb REGNUM. */ @@ -622,11 +517,9 @@ extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sta #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STAB_REG_TO_REGNUM) #error "Non multi-arch definition of STAB_REG_TO_REGNUM" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STAB_REG_TO_REGNUM) +#if !defined (STAB_REG_TO_REGNUM) #define STAB_REG_TO_REGNUM(stab_regnr) (gdbarch_stab_reg_to_regnum (current_gdbarch, stab_regnr)) #endif -#endif /* Provide a default mapping from a ecoff register number to a gdb REGNUM. */ @@ -641,11 +534,9 @@ extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ec #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ECOFF_REG_TO_REGNUM) #error "Non multi-arch definition of ECOFF_REG_TO_REGNUM" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ECOFF_REG_TO_REGNUM) +#if !defined (ECOFF_REG_TO_REGNUM) #define ECOFF_REG_TO_REGNUM(ecoff_regnr) (gdbarch_ecoff_reg_to_regnum (current_gdbarch, ecoff_regnr)) #endif -#endif /* Provide a default mapping from a DWARF register number to a gdb REGNUM. */ @@ -660,11 +551,9 @@ extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dw #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF_REG_TO_REGNUM) #error "Non multi-arch definition of DWARF_REG_TO_REGNUM" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF_REG_TO_REGNUM) +#if !defined (DWARF_REG_TO_REGNUM) #define DWARF_REG_TO_REGNUM(dwarf_regnr) (gdbarch_dwarf_reg_to_regnum (current_gdbarch, dwarf_regnr)) #endif -#endif /* Convert from an sdb register number to an internal gdb register number. This should be defined in tm.h, if REGISTER_NAMES is not set up @@ -681,11 +570,9 @@ extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_ #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SDB_REG_TO_REGNUM) #error "Non multi-arch definition of SDB_REG_TO_REGNUM" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SDB_REG_TO_REGNUM) +#if !defined (SDB_REG_TO_REGNUM) #define SDB_REG_TO_REGNUM(sdb_regnr) (gdbarch_sdb_reg_to_regnum (current_gdbarch, sdb_regnr)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (DWARF2_REG_TO_REGNUM) @@ -698,11 +585,9 @@ extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_d #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_REG_TO_REGNUM) #error "Non multi-arch definition of DWARF2_REG_TO_REGNUM" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_REG_TO_REGNUM) +#if !defined (DWARF2_REG_TO_REGNUM) #define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf2_regnr)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (REGISTER_NAME) @@ -715,21 +600,58 @@ extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_NAME) #error "Non multi-arch definition of REGISTER_NAME" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_NAME) +#if !defined (REGISTER_NAME) #define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr)) #endif + +/* REGISTER_TYPE is a direct replacement for REGISTER_VIRTUAL_TYPE. */ + +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); + +/* REGISTER_TYPE is a direct replacement for REGISTER_VIRTUAL_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 -extern int gdbarch_deprecated_register_size (struct gdbarch *gdbarch); -extern void set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, int deprecated_register_size); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_SIZE) -#error "Non multi-arch definition of DEPRECATED_REGISTER_SIZE" +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_TYPE_P) +#define REGISTER_VIRTUAL_TYPE_P() (0) #endif -#if !defined (DEPRECATED_REGISTER_SIZE) -#define DEPRECATED_REGISTER_SIZE (gdbarch_deprecated_register_size (current_gdbarch)) + +extern int gdbarch_deprecated_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_deprecated_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_deprecated_register_virtual_type_ftype) (int reg_nr); +extern struct type * gdbarch_deprecated_register_virtual_type (struct gdbarch *gdbarch, int reg_nr); +extern void set_gdbarch_deprecated_register_virtual_type (struct gdbarch *gdbarch, gdbarch_deprecated_register_virtual_type_ftype *deprecated_register_virtual_type); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE) +#error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE" +#endif +#if !defined (REGISTER_VIRTUAL_TYPE) +#define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_deprecated_register_virtual_type (current_gdbarch, reg_nr)) +#endif + +/* DEPRECATED_REGISTER_BYTES can be deleted. The value is computed + from REGISTER_TYPE. */ + extern int gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch); extern void set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch, int deprecated_register_bytes); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_BYTES) @@ -739,11 +661,13 @@ extern void set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch, int #define DEPRECATED_REGISTER_BYTES (gdbarch_deprecated_register_bytes (current_gdbarch)) #endif -/* NOTE: cagney/2002-05-02: This function with predicate has a valid - (callable) initial value. As a consequence, even when the predicate - is false, the corresponding function works. This simplifies the - migration process - old code, calling REGISTER_BYTE, doesn't need to - be modified. */ +/* If the value returned by DEPRECATED_REGISTER_BYTE agrees with the + register offsets computed using just REGISTER_TYPE, this can be + deleted. See: maint print registers. NOTE: cagney/2002-05-02: This + function with predicate has a valid (callable) initial value. As a + consequence, even when the predicate is false, the corresponding + function works. This simplifies the migration process - old code, + calling DEPRECATED_REGISTER_BYTE, doesn't need to be modified. */ #if defined (REGISTER_BYTE) /* Legacy for systems yet to multi-arch REGISTER_BYTE */ @@ -757,12 +681,12 @@ extern void set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch, int #define REGISTER_BYTE_P() (0) #endif -extern int gdbarch_register_byte_p (struct gdbarch *gdbarch); +extern int gdbarch_deprecated_register_byte_p (struct gdbarch *gdbarch); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE_P) #error "Non multi-arch definition of REGISTER_BYTE" #endif #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE_P) -#define REGISTER_BYTE_P() (gdbarch_register_byte_p (current_gdbarch)) +#define REGISTER_BYTE_P() (gdbarch_deprecated_register_byte_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ @@ -770,41 +694,58 @@ extern int gdbarch_register_byte_p (struct gdbarch *gdbarch); #define REGISTER_BYTE(reg_nr) (generic_register_byte (reg_nr)) #endif -typedef int (gdbarch_register_byte_ftype) (int reg_nr); -extern int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr); -extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte); +typedef int (gdbarch_deprecated_register_byte_ftype) (int reg_nr); +extern int gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, int reg_nr); +extern void set_gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, gdbarch_deprecated_register_byte_ftype *deprecated_register_byte); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE) #error "Non multi-arch definition of REGISTER_BYTE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE) -#define REGISTER_BYTE(reg_nr) (gdbarch_register_byte (current_gdbarch, reg_nr)) -#endif +#if !defined (REGISTER_BYTE) +#define REGISTER_BYTE(reg_nr) (gdbarch_deprecated_register_byte (current_gdbarch, reg_nr)) #endif -/* The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and - REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE. */ +/* If all registers have identical raw and virtual sizes and those + sizes agree with the value computed from REGISTER_TYPE, + DEPRECATED_REGISTER_RAW_SIZE can be deleted. See: maint print + registers. */ /* 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)) #endif -typedef int (gdbarch_register_raw_size_ftype) (int reg_nr); -extern int gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr); -extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size); +typedef int (gdbarch_deprecated_register_raw_size_ftype) (int reg_nr); +extern int gdbarch_deprecated_register_raw_size (struct gdbarch *gdbarch, int reg_nr); +extern void set_gdbarch_deprecated_register_raw_size (struct gdbarch *gdbarch, gdbarch_deprecated_register_raw_size_ftype *deprecated_register_raw_size); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_RAW_SIZE) #error "Non multi-arch definition of REGISTER_RAW_SIZE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_RAW_SIZE) -#define REGISTER_RAW_SIZE(reg_nr) (gdbarch_register_raw_size (current_gdbarch, reg_nr)) +#if !defined (REGISTER_RAW_SIZE) +#define REGISTER_RAW_SIZE(reg_nr) (gdbarch_deprecated_register_raw_size (current_gdbarch, reg_nr)) +#endif + +/* If all registers have identical raw and virtual sizes and those + sizes agree with the value computed from REGISTER_TYPE, + DEPRECATED_REGISTER_VIRTUAL_SIZE can be deleted. See: maint print + registers. */ + +/* 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)) +#endif + +typedef int (gdbarch_deprecated_register_virtual_size_ftype) (int reg_nr); +extern int gdbarch_deprecated_register_virtual_size (struct gdbarch *gdbarch, int reg_nr); +extern void set_gdbarch_deprecated_register_virtual_size (struct gdbarch *gdbarch, gdbarch_deprecated_register_virtual_size_ftype *deprecated_register_virtual_size); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_SIZE) +#error "Non multi-arch definition of REGISTER_VIRTUAL_SIZE" #endif +#if !defined (REGISTER_VIRTUAL_SIZE) +#define REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_deprecated_register_virtual_size (current_gdbarch, reg_nr)) #endif -/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and - DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by - MAX_REGISTER_SIZE (a constant). */ +/* DEPRECATED_MAX_REGISTER_RAW_SIZE can be deleted. It has been + replaced by the constant MAX_REGISTER_SIZE. */ #if defined (DEPRECATED_MAX_REGISTER_RAW_SIZE) /* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_RAW_SIZE */ @@ -836,35 +777,12 @@ extern void set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarc #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 (DEPRECATED_MAX_REGISTER_RAW_SIZE) +#if !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, 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)) -#endif - -typedef int (gdbarch_register_virtual_size_ftype) (int reg_nr); -extern int gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr); -extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_SIZE) -#error "Non multi-arch definition of REGISTER_VIRTUAL_SIZE" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_SIZE) -#define REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_register_virtual_size (current_gdbarch, reg_nr)) -#endif -#endif -/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and - DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by - MAX_REGISTER_SIZE (a constant). */ +/* DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE can be deleted. It has been + replaced by the constant MAX_REGISTER_SIZE. */ #if defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE) /* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE */ @@ -896,265 +814,259 @@ extern void set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gd #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 (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE) +#if !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, REGISTER_VIRTUAL_SIZE and - REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE. */ +/* See gdbint.texinfo, and PUSH_DUMMY_CALL. */ -#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) +extern int gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch); + +typedef struct frame_id (gdbarch_unwind_dummy_id_ftype) (struct gdbarch *gdbarch, struct frame_info *info); +extern struct frame_id gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info); +extern void set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, gdbarch_unwind_dummy_id_ftype *unwind_dummy_id); + +/* Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete + SAVE_DUMMY_FRAME_TOS. */ + +#if defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS) +/* Legacy for systems yet to multi-arch DEPRECATED_SAVE_DUMMY_FRAME_TOS */ +#if !defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P) +#define DEPRECATED_SAVE_DUMMY_FRAME_TOS_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) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P) +#define DEPRECATED_SAVE_DUMMY_FRAME_TOS_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" +extern int gdbarch_deprecated_save_dummy_frame_tos_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P) +#error "Non multi-arch definition of DEPRECATED_SAVE_DUMMY_FRAME_TOS" #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)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P) +#define DEPRECATED_SAVE_DUMMY_FRAME_TOS_P() (gdbarch_deprecated_save_dummy_frame_tos_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) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS) +#define DEPRECATED_SAVE_DUMMY_FRAME_TOS(sp) (internal_error (__FILE__, __LINE__, "DEPRECATED_SAVE_DUMMY_FRAME_TOS"), 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); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE) -#error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE" +typedef void (gdbarch_deprecated_save_dummy_frame_tos_ftype) (CORE_ADDR sp); +extern void gdbarch_deprecated_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp); +extern void set_gdbarch_deprecated_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_deprecated_save_dummy_frame_tos_ftype *deprecated_save_dummy_frame_tos); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS) +#error "Non multi-arch definition of DEPRECATED_SAVE_DUMMY_FRAME_TOS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE) -#define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_register_virtual_type (current_gdbarch, reg_nr)) +#if !defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS) +#define DEPRECATED_SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_deprecated_save_dummy_frame_tos (current_gdbarch, sp)) #endif + +/* Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete + DEPRECATED_FP_REGNUM. */ + +/* Default (value) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FP_REGNUM) +#define DEPRECATED_FP_REGNUM (-1) #endif -extern int gdbarch_register_type_p (struct gdbarch *gdbarch); +extern int gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch); +extern void set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, int deprecated_fp_regnum); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FP_REGNUM) +#error "Non multi-arch definition of DEPRECATED_FP_REGNUM" +#endif +#if !defined (DEPRECATED_FP_REGNUM) +#define DEPRECATED_FP_REGNUM (gdbarch_deprecated_fp_regnum (current_gdbarch)) +#endif -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); +/* Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete + DEPRECATED_TARGET_READ_FP. */ -#if defined (DEPRECATED_DO_REGISTERS_INFO) -/* Legacy for systems yet to multi-arch DEPRECATED_DO_REGISTERS_INFO */ -#if !defined (DEPRECATED_DO_REGISTERS_INFO_P) -#define DEPRECATED_DO_REGISTERS_INFO_P() (1) +#if defined (DEPRECATED_TARGET_READ_FP) +/* Legacy for systems yet to multi-arch DEPRECATED_TARGET_READ_FP */ +#if !defined (DEPRECATED_TARGET_READ_FP_P) +#define DEPRECATED_TARGET_READ_FP_P() (1) #endif #endif /* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DO_REGISTERS_INFO_P) -#define DEPRECATED_DO_REGISTERS_INFO_P() (0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_TARGET_READ_FP_P) +#define DEPRECATED_TARGET_READ_FP_P() (0) #endif -extern int gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO_P) -#error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO" +extern int gdbarch_deprecated_target_read_fp_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_TARGET_READ_FP_P) +#error "Non multi-arch definition of DEPRECATED_TARGET_READ_FP" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DO_REGISTERS_INFO_P) -#define DEPRECATED_DO_REGISTERS_INFO_P() (gdbarch_deprecated_do_registers_info_p (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_TARGET_READ_FP_P) +#define DEPRECATED_TARGET_READ_FP_P() (gdbarch_deprecated_target_read_fp_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DO_REGISTERS_INFO) -#define DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs) (internal_error (__FILE__, __LINE__, "DEPRECATED_DO_REGISTERS_INFO"), 0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_TARGET_READ_FP) +#define DEPRECATED_TARGET_READ_FP() (internal_error (__FILE__, __LINE__, "DEPRECATED_TARGET_READ_FP"), 0) #endif -typedef void (gdbarch_deprecated_do_registers_info_ftype) (int reg_nr, int fpregs); -extern void gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs); -extern void set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO) -#error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO" +typedef CORE_ADDR (gdbarch_deprecated_target_read_fp_ftype) (void); +extern CORE_ADDR gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch); +extern void set_gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch, gdbarch_deprecated_target_read_fp_ftype *deprecated_target_read_fp); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_TARGET_READ_FP) +#error "Non multi-arch definition of DEPRECATED_TARGET_READ_FP" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DO_REGISTERS_INFO) -#define DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_deprecated_do_registers_info (current_gdbarch, reg_nr, fpregs)) +#if !defined (DEPRECATED_TARGET_READ_FP) +#define DEPRECATED_TARGET_READ_FP() (gdbarch_deprecated_target_read_fp (current_gdbarch)) #endif -#endif - -typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all); -extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all); -extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info); -extern int gdbarch_print_float_info_p (struct gdbarch *gdbarch); +/* See gdbint.texinfo. See infcall.c. New, all singing all dancing, + replacement for DEPRECATED_PUSH_ARGUMENTS. */ -typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); -extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); -extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info); +extern int gdbarch_push_dummy_call_p (struct gdbarch *gdbarch); -extern int gdbarch_print_vector_info_p (struct gdbarch *gdbarch); +typedef CORE_ADDR (gdbarch_push_dummy_call_ftype) (struct gdbarch *gdbarch, CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); +extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); +extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call); -typedef void (gdbarch_print_vector_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); -extern void gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); -extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_print_vector_info_ftype *print_vector_info); +/* PUSH_DUMMY_CALL is a direct replacement for DEPRECATED_PUSH_ARGUMENTS. */ -/* MAP a GDB RAW register number onto a simulator register number. See - also include/...-sim.h. */ +#if defined (DEPRECATED_PUSH_ARGUMENTS) +/* Legacy for systems yet to multi-arch DEPRECATED_PUSH_ARGUMENTS */ +#if !defined (DEPRECATED_PUSH_ARGUMENTS_P) +#define DEPRECATED_PUSH_ARGUMENTS_P() (1) +#endif +#endif -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (REGISTER_SIM_REGNO) -#define REGISTER_SIM_REGNO(reg_nr) (legacy_register_sim_regno (reg_nr)) +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_ARGUMENTS_P) +#define DEPRECATED_PUSH_ARGUMENTS_P() (0) #endif -typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr); -extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr); -extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIM_REGNO) -#error "Non multi-arch definition of REGISTER_SIM_REGNO" +extern int gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS_P) +#error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIM_REGNO) -#define REGISTER_SIM_REGNO(reg_nr) (gdbarch_register_sim_regno (current_gdbarch, reg_nr)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_ARGUMENTS_P) +#define DEPRECATED_PUSH_ARGUMENTS_P() (gdbarch_deprecated_push_arguments_p (current_gdbarch)) #endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_ARGUMENTS) +#define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_ARGUMENTS"), 0) #endif -#if defined (REGISTER_BYTES_OK) -/* Legacy for systems yet to multi-arch REGISTER_BYTES_OK */ -#if !defined (REGISTER_BYTES_OK_P) -#define REGISTER_BYTES_OK_P() (1) +typedef CORE_ADDR (gdbarch_deprecated_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); +extern CORE_ADDR gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); +extern void set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS) +#error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS" #endif +#if !defined (DEPRECATED_PUSH_ARGUMENTS) +#define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_deprecated_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr)) #endif -/* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK_P) -#define REGISTER_BYTES_OK_P() (0) +/* DEPRECATED_USE_GENERIC_DUMMY_FRAMES can be deleted. Always true. */ + +/* Default (value) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) +#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (1) #endif -extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK_P) -#error "Non multi-arch definition of REGISTER_BYTES_OK" +extern int gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch); +extern void set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch, int deprecated_use_generic_dummy_frames); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) +#error "Non multi-arch definition of DEPRECATED_USE_GENERIC_DUMMY_FRAMES" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P) -#define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch)) +#if !defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) +#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (gdbarch_deprecated_use_generic_dummy_frames (current_gdbarch)) #endif -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK) -#define REGISTER_BYTES_OK(nr_bytes) (internal_error (__FILE__, __LINE__, "REGISTER_BYTES_OK"), 0) -#endif +/* Implement PUSH_RETURN_ADDRESS, and then merge in + DEPRECATED_PUSH_RETURN_ADDRESS. */ -typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes); -extern int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes); -extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_register_bytes_ok_ftype *register_bytes_ok); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK) -#error "Non multi-arch definition of REGISTER_BYTES_OK" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK) -#define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes)) +#if defined (DEPRECATED_PUSH_RETURN_ADDRESS) +/* Legacy for systems yet to multi-arch DEPRECATED_PUSH_RETURN_ADDRESS */ +#if !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) +#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (1) #endif #endif -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (CANNOT_FETCH_REGISTER) -#define CANNOT_FETCH_REGISTER(regnum) (cannot_register_not (regnum)) +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) +#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (0) #endif -typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum); -extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum); -extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_FETCH_REGISTER) -#error "Non multi-arch definition of CANNOT_FETCH_REGISTER" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_FETCH_REGISTER) -#define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum)) +extern int gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) +#error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS" #endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) +#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (gdbarch_deprecated_push_return_address_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STORE_REGISTER) -#define CANNOT_STORE_REGISTER(regnum) (cannot_register_not (regnum)) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_RETURN_ADDRESS) +#define DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp) (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_RETURN_ADDRESS"), 0) #endif -typedef int (gdbarch_cannot_store_register_ftype) (int regnum); -extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum); -extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STORE_REGISTER) -#error "Non multi-arch definition of CANNOT_STORE_REGISTER" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STORE_REGISTER) -#define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum)) +typedef CORE_ADDR (gdbarch_deprecated_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp); +extern CORE_ADDR gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp); +extern void set_gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, gdbarch_deprecated_push_return_address_ftype *deprecated_push_return_address); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS) +#error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS" #endif +#if !defined (DEPRECATED_PUSH_RETURN_ADDRESS) +#define DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_deprecated_push_return_address (current_gdbarch, pc, sp)) #endif -/* setjmp/longjmp support. */ +/* Implement PUSH_DUMMY_CALL, then merge in DEPRECATED_DUMMY_WRITE_SP. */ -#if defined (GET_LONGJMP_TARGET) -/* Legacy for systems yet to multi-arch GET_LONGJMP_TARGET */ -#if !defined (GET_LONGJMP_TARGET_P) -#define GET_LONGJMP_TARGET_P() (1) +#if defined (DEPRECATED_DUMMY_WRITE_SP) +/* Legacy for systems yet to multi-arch DEPRECATED_DUMMY_WRITE_SP */ +#if !defined (DEPRECATED_DUMMY_WRITE_SP_P) +#define DEPRECATED_DUMMY_WRITE_SP_P() (1) #endif #endif /* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET_P) -#define GET_LONGJMP_TARGET_P() (0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP_P) +#define DEPRECATED_DUMMY_WRITE_SP_P() (0) #endif -extern int gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET_P) -#error "Non multi-arch definition of GET_LONGJMP_TARGET" +extern int gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP_P) +#error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET_P) -#define GET_LONGJMP_TARGET_P() (gdbarch_get_longjmp_target_p (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DUMMY_WRITE_SP_P) +#define DEPRECATED_DUMMY_WRITE_SP_P() (gdbarch_deprecated_dummy_write_sp_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET) -#define GET_LONGJMP_TARGET(pc) (internal_error (__FILE__, __LINE__, "GET_LONGJMP_TARGET"), 0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP) +#define DEPRECATED_DUMMY_WRITE_SP(val) (internal_error (__FILE__, __LINE__, "DEPRECATED_DUMMY_WRITE_SP"), 0) #endif -typedef int (gdbarch_get_longjmp_target_ftype) (CORE_ADDR *pc); -extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc); -extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET) -#error "Non multi-arch definition of GET_LONGJMP_TARGET" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET) -#define GET_LONGJMP_TARGET(pc) (gdbarch_get_longjmp_target (current_gdbarch, pc)) +typedef void (gdbarch_deprecated_dummy_write_sp_ftype) (CORE_ADDR val); +extern void gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val); +extern void set_gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP) +#error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP" #endif +#if !defined (DEPRECATED_DUMMY_WRITE_SP) +#define DEPRECATED_DUMMY_WRITE_SP(val) (gdbarch_deprecated_dummy_write_sp (current_gdbarch, val)) #endif -/* Non multi-arch DUMMY_FRAMES are a mess (multi-arch ones are not that - much better but at least they are vaguely consistent). The headers - and body contain convoluted #if/#else sequences for determine how - things should be compiled. Instead of trying to mimic that - behaviour here (and hence entrench it further) gdbarch simply - reqires that these methods be set up from the word go. This also - avoids any potential problems with moving beyond multi-arch partial. */ - -/* Default (value) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) -#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (1) -#endif +/* DEPRECATED_REGISTER_SIZE can be deleted. */ -extern int gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch); -extern void set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch, int deprecated_use_generic_dummy_frames); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) -#error "Non multi-arch definition of DEPRECATED_USE_GENERIC_DUMMY_FRAMES" +extern int gdbarch_deprecated_register_size (struct gdbarch *gdbarch); +extern void set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, int deprecated_register_size); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_SIZE) +#error "Non multi-arch definition of DEPRECATED_REGISTER_SIZE" #endif -#if !defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) -#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (gdbarch_deprecated_use_generic_dummy_frames (current_gdbarch)) +#if !defined (DEPRECATED_REGISTER_SIZE) +#define DEPRECATED_REGISTER_SIZE (gdbarch_deprecated_register_size (current_gdbarch)) #endif -/* Replaced by push_dummy_code. */ - /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_LOCATION) #define CALL_DUMMY_LOCATION (AT_ENTRY_POINT) @@ -1169,8 +1081,6 @@ extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_d #define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch)) #endif -/* Replaced by push_dummy_code. */ - /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_ADDRESS) #define CALL_DUMMY_ADDRESS() (entry_point_address ()) @@ -1182,13 +1092,11 @@ extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_cal #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_ADDRESS) #error "Non multi-arch definition of CALL_DUMMY_ADDRESS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_ADDRESS) +#if !defined (CALL_DUMMY_ADDRESS) #define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch)) #endif -#endif -/* Replaced by push_dummy_code. */ +/* DEPRECATED_CALL_DUMMY_START_OFFSET can be deleted. */ extern CORE_ADDR gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch); extern void set_gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_call_dummy_start_offset); @@ -1199,7 +1107,7 @@ extern void set_gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdba #define DEPRECATED_CALL_DUMMY_START_OFFSET (gdbarch_deprecated_call_dummy_start_offset (current_gdbarch)) #endif -/* Replaced by push_dummy_code. */ +/* DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET can be deleted. */ extern CORE_ADDR gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch); extern void set_gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_call_dummy_breakpoint_offset); @@ -1210,7 +1118,7 @@ extern void set_gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch #define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch)) #endif -/* Replaced by push_dummy_code. */ +/* DEPRECATED_CALL_DUMMY_LENGTH can be deleted. */ extern int gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch); extern void set_gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch, int deprecated_call_dummy_length); @@ -1221,50 +1129,7 @@ extern void set_gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch, i #define DEPRECATED_CALL_DUMMY_LENGTH (gdbarch_deprecated_call_dummy_length (current_gdbarch)) #endif -/* NOTE: cagney/2002-11-24: This function with predicate has a valid - (callable) initial value. As a consequence, even when the predicate - is false, the corresponding function works. This simplifies the - migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(), - doesn't need to be modified. */ - -#if defined (DEPRECATED_PC_IN_CALL_DUMMY) -/* Legacy for systems yet to multi-arch DEPRECATED_PC_IN_CALL_DUMMY */ -#if !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) -#define DEPRECATED_PC_IN_CALL_DUMMY_P() (1) -#endif -#endif - -/* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) -#define DEPRECATED_PC_IN_CALL_DUMMY_P() (0) -#endif - -extern int gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY_P) -#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY" -#endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) -#define DEPRECATED_PC_IN_CALL_DUMMY_P() (gdbarch_deprecated_pc_in_call_dummy_p (current_gdbarch)) -#endif - -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY) -#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (generic_pc_in_call_dummy (pc, sp, frame_address)) -#endif - -typedef int (gdbarch_deprecated_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); -extern int gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); -extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY) -#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY) -#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_deprecated_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address)) -#endif -#endif - -/* Replaced by push_dummy_code. */ +/* DEPRECATED_CALL_DUMMY_WORDS can be deleted. */ /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_WORDS) @@ -1280,7 +1145,7 @@ extern void set_gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch, LO #define DEPRECATED_CALL_DUMMY_WORDS (gdbarch_deprecated_call_dummy_words (current_gdbarch)) #endif -/* Replaced by push_dummy_code. */ +/* Implement PUSH_DUMMY_CALL, then delete DEPRECATED_SIZEOF_CALL_DUMMY_WORDS. */ /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS) @@ -1296,7 +1161,7 @@ extern void set_gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdba #define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS (gdbarch_deprecated_sizeof_call_dummy_words (current_gdbarch)) #endif -/* Replaced by push_dummy_code. */ +/* Implement PUSH_DUMMY_CALL, then delete DEPRECATED_CALL_DUMMY_STACK_ADJUST. */ #if defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) /* Legacy for systems yet to multi-arch DEPRECATED_CALL_DUMMY_STACK_ADJUST */ @@ -1328,13 +1193,12 @@ extern void set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdba #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) #error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_STACK_ADJUST" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) +#if !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) #define DEPRECATED_CALL_DUMMY_STACK_ADJUST (gdbarch_deprecated_call_dummy_stack_adjust (current_gdbarch)) #endif -#endif -/* Replaced by push_dummy_code. */ +/* DEPRECATED_FIX_CALL_DUMMY can be deleted. For the SPARC, implement + PUSH_DUMMY_CODE and set CALL_DUMMY_LOCATION to ON_STACK. */ #if defined (DEPRECATED_FIX_CALL_DUMMY) /* Legacy for systems yet to multi-arch DEPRECATED_FIX_CALL_DUMMY */ @@ -1367,11 +1231,9 @@ extern void set_gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, gdba #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FIX_CALL_DUMMY) #error "Non multi-arch definition of DEPRECATED_FIX_CALL_DUMMY" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FIX_CALL_DUMMY) +#if !defined (DEPRECATED_FIX_CALL_DUMMY) #define DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_deprecated_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p)) #endif -#endif /* This is a replacement for DEPRECATED_FIX_CALL_DUMMY et.al. */ @@ -1381,446 +1243,572 @@ typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (struct gdbarch *gdbarch, CORE extern CORE_ADDR gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr); extern void set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype *push_dummy_code); -#if defined (DEPRECATED_INIT_FRAME_PC_FIRST) -/* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC_FIRST */ -#if !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) -#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (1) +/* Implement PUSH_DUMMY_CALL, then delete DEPRECATED_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_INIT_FRAME_PC_FIRST_P) -#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_DUMMY_FRAME_P) +#define DEPRECATED_PUSH_DUMMY_FRAME_P() (0) #endif -extern int gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) -#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST" +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_INIT_FRAME_PC_FIRST_P) -#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (gdbarch_deprecated_init_frame_pc_first_p (current_gdbarch)) +#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_INIT_FRAME_PC_FIRST) -#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC_FIRST"), 0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_DUMMY_FRAME) +#define DEPRECATED_PUSH_DUMMY_FRAME (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_DUMMY_FRAME"), 0) #endif -typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev); -extern CORE_ADDR gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); -extern void set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST) -#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST" +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 (DEPRECATED_INIT_FRAME_PC_FIRST) -#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_deprecated_init_frame_pc_first (current_gdbarch, fromleaf, prev)) +#if !defined (DEPRECATED_PUSH_DUMMY_FRAME) +#define DEPRECATED_PUSH_DUMMY_FRAME (gdbarch_deprecated_push_dummy_frame (current_gdbarch)) #endif + +/* Implement PUSH_DUMMY_CALL, then delete + DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED. */ + +/* Default (value) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) +#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (0) #endif -#if defined (DEPRECATED_INIT_FRAME_PC) -/* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC */ -#if !defined (DEPRECATED_INIT_FRAME_PC_P) -#define DEPRECATED_INIT_FRAME_PC_P() (1) +extern int gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch); +extern void set_gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch, int deprecated_extra_stack_alignment_needed); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) +#error "Non multi-arch definition of DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED" +#endif +#if !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) +#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_deprecated_extra_stack_alignment_needed (current_gdbarch)) +#endif + +#if defined (DEPRECATED_DO_REGISTERS_INFO) +/* Legacy for systems yet to multi-arch DEPRECATED_DO_REGISTERS_INFO */ +#if !defined (DEPRECATED_DO_REGISTERS_INFO_P) +#define DEPRECATED_DO_REGISTERS_INFO_P() (1) #endif #endif /* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_P) -#define DEPRECATED_INIT_FRAME_PC_P() (0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DO_REGISTERS_INFO_P) +#define DEPRECATED_DO_REGISTERS_INFO_P() (0) #endif -extern int gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_P) -#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC" +extern int gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO_P) +#error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_P) -#define DEPRECATED_INIT_FRAME_PC_P() (gdbarch_deprecated_init_frame_pc_p (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DO_REGISTERS_INFO_P) +#define DEPRECATED_DO_REGISTERS_INFO_P() (gdbarch_deprecated_do_registers_info_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC) -#define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC"), 0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DO_REGISTERS_INFO) +#define DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs) (internal_error (__FILE__, __LINE__, "DEPRECATED_DO_REGISTERS_INFO"), 0) #endif -typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev); -extern CORE_ADDR gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); -extern void set_gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC) -#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC) -#define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (gdbarch_deprecated_init_frame_pc (current_gdbarch, fromleaf, prev)) +typedef void (gdbarch_deprecated_do_registers_info_ftype) (int reg_nr, int fpregs); +extern void gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs); +extern void set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO) +#error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO" #endif +#if !defined (DEPRECATED_DO_REGISTERS_INFO) +#define DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_deprecated_do_registers_info (current_gdbarch, reg_nr, fpregs)) #endif -extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch); -extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION) -#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION) -#define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch)) -#endif +typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all); +extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all); +extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info); + +extern int gdbarch_print_float_info_p (struct gdbarch *gdbarch); + +typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); +extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); +extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info); + +extern int gdbarch_print_vector_info_p (struct gdbarch *gdbarch); + +typedef void (gdbarch_print_vector_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); +extern void gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); +extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_print_vector_info_ftype *print_vector_info); + +/* MAP a GDB RAW register number onto a simulator register number. See + also include/...-sim.h. */ + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_SIM_REGNO) +#define REGISTER_SIM_REGNO(reg_nr) (legacy_register_sim_regno (reg_nr)) #endif -extern int gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch); -extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int believe_pcc_promotion_type); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION_TYPE) -#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION_TYPE" +typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr); +extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr); +extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIM_REGNO) +#error "Non multi-arch definition of REGISTER_SIM_REGNO" #endif -#if !defined (BELIEVE_PCC_PROMOTION_TYPE) -#define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch)) +#if !defined (REGISTER_SIM_REGNO) +#define REGISTER_SIM_REGNO(reg_nr) (gdbarch_register_sim_regno (current_gdbarch, reg_nr)) #endif -#if defined (DEPRECATED_GET_SAVED_REGISTER) -/* Legacy for systems yet to multi-arch DEPRECATED_GET_SAVED_REGISTER */ -#if !defined (DEPRECATED_GET_SAVED_REGISTER_P) -#define DEPRECATED_GET_SAVED_REGISTER_P() (1) +#if defined (REGISTER_BYTES_OK) +/* Legacy for systems yet to multi-arch REGISTER_BYTES_OK */ +#if !defined (REGISTER_BYTES_OK_P) +#define REGISTER_BYTES_OK_P() (1) #endif #endif /* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER_P) -#define DEPRECATED_GET_SAVED_REGISTER_P() (0) +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK_P) +#define REGISTER_BYTES_OK_P() (0) #endif -extern int gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER_P) -#error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER" +extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK_P) +#error "Non multi-arch definition of REGISTER_BYTES_OK" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_GET_SAVED_REGISTER_P) -#define DEPRECATED_GET_SAVED_REGISTER_P() (gdbarch_deprecated_get_saved_register_p (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P) +#define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER) -#define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (internal_error (__FILE__, __LINE__, "DEPRECATED_GET_SAVED_REGISTER"), 0) +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK) +#define REGISTER_BYTES_OK(nr_bytes) (internal_error (__FILE__, __LINE__, "REGISTER_BYTES_OK"), 0) #endif -typedef void (gdbarch_deprecated_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); -extern void gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); -extern void set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER) -#error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_GET_SAVED_REGISTER) -#define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_deprecated_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval)) +typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes); +extern int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes); +extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_register_bytes_ok_ftype *register_bytes_ok); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK) +#error "Non multi-arch definition of REGISTER_BYTES_OK" #endif +#if !defined (REGISTER_BYTES_OK) +#define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERTIBLE) -#define REGISTER_CONVERTIBLE(nr) (generic_register_convertible_not (nr)) +#if (!GDB_MULTI_ARCH) && !defined (CANNOT_FETCH_REGISTER) +#define CANNOT_FETCH_REGISTER(regnum) (cannot_register_not (regnum)) #endif -typedef int (gdbarch_register_convertible_ftype) (int nr); -extern int gdbarch_register_convertible (struct gdbarch *gdbarch, int nr); -extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERTIBLE) -#error "Non multi-arch definition of REGISTER_CONVERTIBLE" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERTIBLE) -#define REGISTER_CONVERTIBLE(nr) (gdbarch_register_convertible (current_gdbarch, nr)) +typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum); +extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum); +extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_FETCH_REGISTER) +#error "Non multi-arch definition of CANNOT_FETCH_REGISTER" #endif +#if !defined (CANNOT_FETCH_REGISTER) +#define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_VIRTUAL) -#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_VIRTUAL"), 0) +#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STORE_REGISTER) +#define CANNOT_STORE_REGISTER(regnum) (cannot_register_not (regnum)) #endif -typedef void (gdbarch_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to); -extern void gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to); -extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_VIRTUAL) -#error "Non multi-arch definition of REGISTER_CONVERT_TO_VIRTUAL" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_VIRTUAL) -#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_register_convert_to_virtual (current_gdbarch, regnum, type, from, to)) +typedef int (gdbarch_cannot_store_register_ftype) (int regnum); +extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum); +extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STORE_REGISTER) +#error "Non multi-arch definition of CANNOT_STORE_REGISTER" #endif +#if !defined (CANNOT_STORE_REGISTER) +#define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum)) #endif -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_RAW) -#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_RAW"), 0) +/* setjmp/longjmp support. */ + +#if defined (GET_LONGJMP_TARGET) +/* Legacy for systems yet to multi-arch GET_LONGJMP_TARGET */ +#if !defined (GET_LONGJMP_TARGET_P) +#define GET_LONGJMP_TARGET_P() (1) +#endif #endif -typedef void (gdbarch_register_convert_to_raw_ftype) (struct type *type, int regnum, char *from, char *to); -extern void gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to); -extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_RAW) -#error "Non multi-arch definition of REGISTER_CONVERT_TO_RAW" +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET_P) +#define GET_LONGJMP_TARGET_P() (0) #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_RAW) -#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_register_convert_to_raw (current_gdbarch, type, regnum, from, to)) + +extern int gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET_P) +#error "Non multi-arch definition of GET_LONGJMP_TARGET" #endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET_P) +#define GET_LONGJMP_TARGET_P() (gdbarch_get_longjmp_target_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (CONVERT_REGISTER_P) -#define CONVERT_REGISTER_P(regnum) (legacy_convert_register_p (regnum)) +#if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET) +#define GET_LONGJMP_TARGET(pc) (internal_error (__FILE__, __LINE__, "GET_LONGJMP_TARGET"), 0) #endif -typedef int (gdbarch_convert_register_p_ftype) (int regnum); -extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum); -extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p); -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_REGISTER_P) -#error "Non multi-arch definition of CONVERT_REGISTER_P" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_REGISTER_P) -#define CONVERT_REGISTER_P(regnum) (gdbarch_convert_register_p (current_gdbarch, regnum)) +typedef int (gdbarch_get_longjmp_target_ftype) (CORE_ADDR *pc); +extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc); +extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET) +#error "Non multi-arch definition of GET_LONGJMP_TARGET" #endif +#if !defined (GET_LONGJMP_TARGET) +#define GET_LONGJMP_TARGET(pc) (gdbarch_get_longjmp_target (current_gdbarch, pc)) #endif -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (REGISTER_TO_VALUE) -#define REGISTER_TO_VALUE(regnum, type, from, to) (legacy_register_to_value (regnum, type, from, to)) +/* NOTE: cagney/2002-11-24: This function with predicate has a valid + (callable) initial value. As a consequence, even when the predicate + is false, the corresponding function works. This simplifies the + migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(), + doesn't need to be modified. */ + +#if defined (DEPRECATED_PC_IN_CALL_DUMMY) +/* Legacy for systems yet to multi-arch DEPRECATED_PC_IN_CALL_DUMMY */ +#if !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) +#define DEPRECATED_PC_IN_CALL_DUMMY_P() (1) +#endif #endif -typedef void (gdbarch_register_to_value_ftype) (int regnum, struct type *type, char *from, char *to); -extern void gdbarch_register_to_value (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to); -extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value); -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_TO_VALUE) -#error "Non multi-arch definition of REGISTER_TO_VALUE" +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) +#define DEPRECATED_PC_IN_CALL_DUMMY_P() (0) #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_TO_VALUE) -#define REGISTER_TO_VALUE(regnum, type, from, to) (gdbarch_register_to_value (current_gdbarch, regnum, type, from, to)) + +extern int gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY_P) +#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY" #endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) +#define DEPRECATED_PC_IN_CALL_DUMMY_P() (gdbarch_deprecated_pc_in_call_dummy_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (VALUE_TO_REGISTER) -#define VALUE_TO_REGISTER(type, regnum, from, to) (legacy_value_to_register (type, regnum, from, to)) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY) +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (generic_pc_in_call_dummy (pc, sp, frame_address)) #endif -typedef void (gdbarch_value_to_register_ftype) (struct type *type, int regnum, char *from, char *to); -extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to); -extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register); -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (VALUE_TO_REGISTER) -#error "Non multi-arch definition of VALUE_TO_REGISTER" +typedef int (gdbarch_deprecated_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); +extern int gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); +extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY) +#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY" +#endif +#if !defined (DEPRECATED_PC_IN_CALL_DUMMY) +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_deprecated_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address)) +#endif + +#if defined (DEPRECATED_INIT_FRAME_PC_FIRST) +/* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC_FIRST */ +#if !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) +#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) +#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (0) #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (VALUE_TO_REGISTER) -#define VALUE_TO_REGISTER(type, regnum, from, to) (gdbarch_value_to_register (current_gdbarch, type, regnum, from, to)) + +extern int gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) +#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST" #endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) +#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (gdbarch_deprecated_init_frame_pc_first_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (POINTER_TO_ADDRESS) -#define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf)) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST) +#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC_FIRST"), 0) #endif -typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, const void *buf); -extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf); -extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POINTER_TO_ADDRESS) -#error "Non multi-arch definition of POINTER_TO_ADDRESS" +typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev); +extern CORE_ADDR gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); +extern void set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST) +#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POINTER_TO_ADDRESS) -#define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf)) +#if !defined (DEPRECATED_INIT_FRAME_PC_FIRST) +#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_deprecated_init_frame_pc_first (current_gdbarch, fromleaf, prev)) +#endif + +#if defined (DEPRECATED_INIT_FRAME_PC) +/* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC */ +#if !defined (DEPRECATED_INIT_FRAME_PC_P) +#define DEPRECATED_INIT_FRAME_PC_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_P) +#define DEPRECATED_INIT_FRAME_PC_P() (0) +#endif + +extern int gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_P) +#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC" #endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_P) +#define DEPRECATED_INIT_FRAME_PC_P() (gdbarch_deprecated_init_frame_pc_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_TO_POINTER) -#define ADDRESS_TO_POINTER(type, buf, addr) (unsigned_address_to_pointer (type, buf, addr)) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC) +#define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC"), 0) #endif -typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr); -extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr); -extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_TO_POINTER) -#error "Non multi-arch definition of ADDRESS_TO_POINTER" +typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev); +extern CORE_ADDR gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); +extern void set_gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC) +#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_TO_POINTER) -#define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr)) +#if !defined (DEPRECATED_INIT_FRAME_PC) +#define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (gdbarch_deprecated_init_frame_pc (current_gdbarch, fromleaf, prev)) +#endif + +extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch); +extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION) +#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION" #endif +#if !defined (BELIEVE_PCC_PROMOTION) +#define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch)) #endif -#if defined (INTEGER_TO_ADDRESS) -/* Legacy for systems yet to multi-arch INTEGER_TO_ADDRESS */ -#if !defined (INTEGER_TO_ADDRESS_P) -#define INTEGER_TO_ADDRESS_P() (1) +extern int gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch); +extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int believe_pcc_promotion_type); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION_TYPE) +#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION_TYPE" +#endif +#if !defined (BELIEVE_PCC_PROMOTION_TYPE) +#define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch)) +#endif + +#if defined (DEPRECATED_GET_SAVED_REGISTER) +/* Legacy for systems yet to multi-arch DEPRECATED_GET_SAVED_REGISTER */ +#if !defined (DEPRECATED_GET_SAVED_REGISTER_P) +#define DEPRECATED_GET_SAVED_REGISTER_P() (1) #endif #endif /* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS_P) -#define INTEGER_TO_ADDRESS_P() (0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER_P) +#define DEPRECATED_GET_SAVED_REGISTER_P() (0) #endif -extern int gdbarch_integer_to_address_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS_P) -#error "Non multi-arch definition of INTEGER_TO_ADDRESS" +extern int gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER_P) +#error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS_P) -#define INTEGER_TO_ADDRESS_P() (gdbarch_integer_to_address_p (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_GET_SAVED_REGISTER_P) +#define DEPRECATED_GET_SAVED_REGISTER_P() (gdbarch_deprecated_get_saved_register_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS) -#define INTEGER_TO_ADDRESS(type, buf) (internal_error (__FILE__, __LINE__, "INTEGER_TO_ADDRESS"), 0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER) +#define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (internal_error (__FILE__, __LINE__, "DEPRECATED_GET_SAVED_REGISTER"), 0) #endif -typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct type *type, void *buf); -extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf); -extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype *integer_to_address); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS) -#error "Non multi-arch definition of INTEGER_TO_ADDRESS" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS) -#define INTEGER_TO_ADDRESS(type, buf) (gdbarch_integer_to_address (current_gdbarch, type, buf)) +typedef void (gdbarch_deprecated_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); +extern void gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); +extern void set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER) +#error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER" #endif +#if !defined (DEPRECATED_GET_SAVED_REGISTER) +#define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_deprecated_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval)) #endif +/* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al. + For raw <-> cooked register conversions, replaced by pseudo registers. */ + /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (RETURN_VALUE_ON_STACK) -#define RETURN_VALUE_ON_STACK(type) (generic_return_value_on_stack_not (type)) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_REGISTER_CONVERTIBLE) +#define DEPRECATED_REGISTER_CONVERTIBLE(nr) (deprecated_register_convertible_not (nr)) #endif -typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type); -extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type); -extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (RETURN_VALUE_ON_STACK) -#error "Non multi-arch definition of RETURN_VALUE_ON_STACK" +typedef int (gdbarch_deprecated_register_convertible_ftype) (int nr); +extern int gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, int nr); +extern void set_gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, gdbarch_deprecated_register_convertible_ftype *deprecated_register_convertible); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERTIBLE) +#error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERTIBLE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (RETURN_VALUE_ON_STACK) -#define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type)) +#if !defined (DEPRECATED_REGISTER_CONVERTIBLE) +#define DEPRECATED_REGISTER_CONVERTIBLE(nr) (gdbarch_deprecated_register_convertible (current_gdbarch, nr)) +#endif + +/* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al. + For raw <-> cooked register conversions, replaced by pseudo registers. */ + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL) +#define DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error (__FILE__, __LINE__, "DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL"), 0) +#endif + +typedef void (gdbarch_deprecated_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to); +extern void gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to); +extern void set_gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_deprecated_register_convert_to_virtual_ftype *deprecated_register_convert_to_virtual); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL) +#error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL" #endif +#if !defined (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL) +#define DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_deprecated_register_convert_to_virtual (current_gdbarch, regnum, type, from, to)) #endif -/* Replaced by PUSH_DUMMY_CALL */ +/* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al. + For raw <-> cooked register conversions, replaced by pseudo registers. */ -#if defined (DEPRECATED_PUSH_ARGUMENTS) -/* Legacy for systems yet to multi-arch DEPRECATED_PUSH_ARGUMENTS */ -#if !defined (DEPRECATED_PUSH_ARGUMENTS_P) -#define DEPRECATED_PUSH_ARGUMENTS_P() (1) +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_REGISTER_CONVERT_TO_RAW) +#define DEPRECATED_REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error (__FILE__, __LINE__, "DEPRECATED_REGISTER_CONVERT_TO_RAW"), 0) #endif + +typedef void (gdbarch_deprecated_register_convert_to_raw_ftype) (struct type *type, int regnum, const char *from, char *to); +extern void gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, const char *from, char *to); +extern void set_gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_deprecated_register_convert_to_raw_ftype *deprecated_register_convert_to_raw); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERT_TO_RAW) +#error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERT_TO_RAW" +#endif +#if !defined (DEPRECATED_REGISTER_CONVERT_TO_RAW) +#define DEPRECATED_REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_deprecated_register_convert_to_raw (current_gdbarch, type, regnum, from, to)) #endif -/* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_ARGUMENTS_P) -#define DEPRECATED_PUSH_ARGUMENTS_P() (0) +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (CONVERT_REGISTER_P) +#define CONVERT_REGISTER_P(regnum, type) (legacy_convert_register_p (regnum, type)) #endif -extern int gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS_P) -#error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS" +typedef int (gdbarch_convert_register_p_ftype) (int regnum, struct type *type); +extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type); +extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p); +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_REGISTER_P) +#error "Non multi-arch definition of CONVERT_REGISTER_P" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_ARGUMENTS_P) -#define DEPRECATED_PUSH_ARGUMENTS_P() (gdbarch_deprecated_push_arguments_p (current_gdbarch)) +#if !defined (CONVERT_REGISTER_P) +#define CONVERT_REGISTER_P(regnum, type) (gdbarch_convert_register_p (current_gdbarch, regnum, type)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_ARGUMENTS) -#define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_ARGUMENTS"), 0) +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_TO_VALUE) +#define REGISTER_TO_VALUE(frame, regnum, type, buf) (legacy_register_to_value (frame, regnum, type, buf)) #endif -typedef CORE_ADDR (gdbarch_deprecated_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); -extern CORE_ADDR gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); -extern void set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS) -#error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_ARGUMENTS) -#define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_deprecated_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr)) +typedef void (gdbarch_register_to_value_ftype) (struct frame_info *frame, int regnum, struct type *type, void *buf); +extern void gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, void *buf); +extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value); +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_TO_VALUE) +#error "Non multi-arch definition of REGISTER_TO_VALUE" #endif +#if !defined (REGISTER_TO_VALUE) +#define REGISTER_TO_VALUE(frame, regnum, type, buf) (gdbarch_register_to_value (current_gdbarch, frame, regnum, type, buf)) #endif -extern int gdbarch_push_dummy_call_p (struct gdbarch *gdbarch); - -typedef CORE_ADDR (gdbarch_push_dummy_call_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); -extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); -extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call); +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (VALUE_TO_REGISTER) +#define VALUE_TO_REGISTER(frame, regnum, type, buf) (legacy_value_to_register (frame, regnum, type, buf)) +#endif -#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) +typedef void (gdbarch_value_to_register_ftype) (struct frame_info *frame, int regnum, struct type *type, const void *buf); +extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const void *buf); +extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register); +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (VALUE_TO_REGISTER) +#error "Non multi-arch definition of VALUE_TO_REGISTER" #endif +#if !defined (VALUE_TO_REGISTER) +#define VALUE_TO_REGISTER(frame, regnum, type, buf) (gdbarch_value_to_register (current_gdbarch, frame, regnum, type, buf)) #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) +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (POINTER_TO_ADDRESS) +#define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf)) #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" +typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, const void *buf); +extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf); +extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POINTER_TO_ADDRESS) +#error "Non multi-arch definition of POINTER_TO_ADDRESS" #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)) +#if !defined (POINTER_TO_ADDRESS) +#define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf)) #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) +#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_TO_POINTER) +#define ADDRESS_TO_POINTER(type, buf, addr) (unsigned_address_to_pointer (type, buf, addr)) #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 (DEPRECATED_PUSH_DUMMY_FRAME) -#define DEPRECATED_PUSH_DUMMY_FRAME (gdbarch_deprecated_push_dummy_frame (current_gdbarch)) +typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr); +extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr); +extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_TO_POINTER) +#error "Non multi-arch definition of ADDRESS_TO_POINTER" #endif +#if !defined (ADDRESS_TO_POINTER) +#define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr)) #endif -/* NOTE: This can be handled directly in push_dummy_call. */ - -#if defined (DEPRECATED_PUSH_RETURN_ADDRESS) -/* Legacy for systems yet to multi-arch DEPRECATED_PUSH_RETURN_ADDRESS */ -#if !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) -#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (1) +#if defined (INTEGER_TO_ADDRESS) +/* Legacy for systems yet to multi-arch INTEGER_TO_ADDRESS */ +#if !defined (INTEGER_TO_ADDRESS_P) +#define INTEGER_TO_ADDRESS_P() (1) #endif #endif /* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) -#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (0) +#if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS_P) +#define INTEGER_TO_ADDRESS_P() (0) #endif -extern int gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) -#error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS" +extern int gdbarch_integer_to_address_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS_P) +#error "Non multi-arch definition of INTEGER_TO_ADDRESS" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) -#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (gdbarch_deprecated_push_return_address_p (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS_P) +#define INTEGER_TO_ADDRESS_P() (gdbarch_integer_to_address_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_RETURN_ADDRESS) -#define DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp) (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_RETURN_ADDRESS"), 0) +#if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS) +#define INTEGER_TO_ADDRESS(type, buf) (internal_error (__FILE__, __LINE__, "INTEGER_TO_ADDRESS"), 0) #endif -typedef CORE_ADDR (gdbarch_deprecated_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp); -extern CORE_ADDR gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp); -extern void set_gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, gdbarch_deprecated_push_return_address_ftype *deprecated_push_return_address); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS) -#error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS" +typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct type *type, void *buf); +extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf); +extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype *integer_to_address); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS) +#error "Non multi-arch definition of INTEGER_TO_ADDRESS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_RETURN_ADDRESS) -#define DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_deprecated_push_return_address (current_gdbarch, pc, sp)) +#if !defined (INTEGER_TO_ADDRESS) +#define INTEGER_TO_ADDRESS(type, buf) (gdbarch_integer_to_address (current_gdbarch, type, buf)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (RETURN_VALUE_ON_STACK) +#define RETURN_VALUE_ON_STACK(type) (generic_return_value_on_stack_not (type)) #endif + +typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type); +extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type); +extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (RETURN_VALUE_ON_STACK) +#error "Non multi-arch definition of RETURN_VALUE_ON_STACK" +#endif +#if !defined (RETURN_VALUE_ON_STACK) +#define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type)) #endif #if defined (DEPRECATED_POP_FRAME) @@ -1854,11 +1842,9 @@ extern void set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch, gdbarch_d #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_POP_FRAME) #error "Non multi-arch definition of DEPRECATED_POP_FRAME" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_POP_FRAME) +#if !defined (DEPRECATED_POP_FRAME) #define DEPRECATED_POP_FRAME (gdbarch_deprecated_pop_frame (current_gdbarch)) #endif -#endif /* NOTE: cagney/2003-03-24: Replaced by PUSH_ARGUMENTS. */ @@ -1893,11 +1879,9 @@ extern void set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_STRUCT_RETURN) #error "Non multi-arch definition of DEPRECATED_STORE_STRUCT_RETURN" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_STRUCT_RETURN) +#if !defined (DEPRECATED_STORE_STRUCT_RETURN) #define DEPRECATED_STORE_STRUCT_RETURN(addr, sp) (gdbarch_deprecated_store_struct_return (current_gdbarch, addr, sp)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (EXTRACT_RETURN_VALUE) @@ -1910,11 +1894,9 @@ extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_e #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE) #error "Non multi-arch definition of EXTRACT_RETURN_VALUE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE) +#if !defined (EXTRACT_RETURN_VALUE) #define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regcache, valbuf)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (STORE_RETURN_VALUE) @@ -1927,11 +1909,9 @@ extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_sto #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_RETURN_VALUE) #error "Non multi-arch definition of STORE_RETURN_VALUE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_RETURN_VALUE) +#if !defined (STORE_RETURN_VALUE) #define STORE_RETURN_VALUE(type, regcache, valbuf) (gdbarch_store_return_value (current_gdbarch, type, regcache, valbuf)) #endif -#endif typedef void (gdbarch_deprecated_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf); extern void gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf); @@ -1939,11 +1919,9 @@ extern void set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_RETURN_VALUE) #error "Non multi-arch definition of DEPRECATED_EXTRACT_RETURN_VALUE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_RETURN_VALUE) +#if !defined (DEPRECATED_EXTRACT_RETURN_VALUE) #define DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_deprecated_extract_return_value (current_gdbarch, type, regbuf, valbuf)) #endif -#endif typedef void (gdbarch_deprecated_store_return_value_ftype) (struct type *type, char *valbuf); extern void gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf); @@ -1951,11 +1929,9 @@ extern void set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_RETURN_VALUE) #error "Non multi-arch definition of DEPRECATED_STORE_RETURN_VALUE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_RETURN_VALUE) +#if !defined (DEPRECATED_STORE_RETURN_VALUE) #define DEPRECATED_STORE_RETURN_VALUE(type, valbuf) (gdbarch_deprecated_store_return_value (current_gdbarch, type, valbuf)) #endif -#endif #if defined (EXTRACT_STRUCT_VALUE_ADDRESS) /* Legacy for systems yet to multi-arch EXTRACT_STRUCT_VALUE_ADDRESS */ @@ -1988,11 +1964,9 @@ extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, g #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS) #error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS) +#if !defined (EXTRACT_STRUCT_VALUE_ADDRESS) #define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_extract_struct_value_address (current_gdbarch, regcache)) #endif -#endif #if defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) /* Legacy for systems yet to multi-arch DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS */ @@ -2025,11 +1999,9 @@ extern void set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) #error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) +#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_deprecated_extract_struct_value_address (current_gdbarch, regbuf)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (USE_STRUCT_CONVENTION) @@ -2042,11 +2014,9 @@ extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_ #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (USE_STRUCT_CONVENTION) #error "Non multi-arch definition of USE_STRUCT_CONVENTION" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (USE_STRUCT_CONVENTION) +#if !defined (USE_STRUCT_CONVENTION) #define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type)) #endif -#endif #if defined (DEPRECATED_FRAME_INIT_SAVED_REGS) /* Legacy for systems yet to multi-arch DEPRECATED_FRAME_INIT_SAVED_REGS */ @@ -2079,11 +2049,9 @@ extern void set_gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarc #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 (DEPRECATED_FRAME_INIT_SAVED_REGS) +#if !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 (DEPRECATED_INIT_EXTRA_FRAME_INFO) /* Legacy for systems yet to multi-arch DEPRECATED_INIT_EXTRA_FRAME_INFO */ @@ -2116,11 +2084,9 @@ extern void set_gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarc #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 (DEPRECATED_INIT_EXTRA_FRAME_INFO) +#if !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 typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip); extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip); @@ -2128,11 +2094,9 @@ extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_pro #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_PROLOGUE) #error "Non multi-arch definition of SKIP_PROLOGUE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_PROLOGUE) +#if !defined (SKIP_PROLOGUE) #define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (PROLOGUE_FRAMELESS_P) @@ -2145,11 +2109,9 @@ extern void set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, gdbarch_p #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PROLOGUE_FRAMELESS_P) #error "Non multi-arch definition of PROLOGUE_FRAMELESS_P" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PROLOGUE_FRAMELESS_P) +#if !defined (PROLOGUE_FRAMELESS_P) #define PROLOGUE_FRAMELESS_P(ip) (gdbarch_prologue_frameless_p (current_gdbarch, ip)) #endif -#endif typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs); extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs); @@ -2157,11 +2119,9 @@ extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INNER_THAN) #error "Non multi-arch definition of INNER_THAN" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INNER_THAN) +#if !defined (INNER_THAN) #define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs)) #endif -#endif typedef const unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr); extern const unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr); @@ -2169,11 +2129,9 @@ extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_bre #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC) #error "Non multi-arch definition of BREAKPOINT_FROM_PC" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BREAKPOINT_FROM_PC) +#if !defined (BREAKPOINT_FROM_PC) #define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (MEMORY_INSERT_BREAKPOINT) @@ -2186,11 +2144,9 @@ extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbar #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_INSERT_BREAKPOINT) #error "Non multi-arch definition of MEMORY_INSERT_BREAKPOINT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_INSERT_BREAKPOINT) +#if !defined (MEMORY_INSERT_BREAKPOINT) #define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (gdbarch_memory_insert_breakpoint (current_gdbarch, addr, contents_cache)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (MEMORY_REMOVE_BREAKPOINT) @@ -2203,50 +2159,27 @@ extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbar #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_REMOVE_BREAKPOINT) #error "Non multi-arch definition of MEMORY_REMOVE_BREAKPOINT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_REMOVE_BREAKPOINT) +#if !defined (MEMORY_REMOVE_BREAKPOINT) #define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (gdbarch_memory_remove_breakpoint (current_gdbarch, addr, contents_cache)) #endif -#endif extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch); extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DECR_PC_AFTER_BREAK) #error "Non multi-arch definition of DECR_PC_AFTER_BREAK" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DECR_PC_AFTER_BREAK) +#if !defined (DECR_PC_AFTER_BREAK) #define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch)) #endif -#endif - -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (PREPARE_TO_PROCEED) -#define PREPARE_TO_PROCEED(select_it) (default_prepare_to_proceed (select_it)) -#endif - -typedef int (gdbarch_prepare_to_proceed_ftype) (int select_it); -extern int gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it); -extern void set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, gdbarch_prepare_to_proceed_ftype *prepare_to_proceed); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PREPARE_TO_PROCEED) -#error "Non multi-arch definition of PREPARE_TO_PROCEED" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PREPARE_TO_PROCEED) -#define PREPARE_TO_PROCEED(select_it) (gdbarch_prepare_to_proceed (current_gdbarch, select_it)) -#endif -#endif extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch); extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FUNCTION_START_OFFSET) #error "Non multi-arch definition of FUNCTION_START_OFFSET" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FUNCTION_START_OFFSET) +#if !defined (FUNCTION_START_OFFSET) #define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch)) #endif -#endif typedef void (gdbarch_remote_translate_xfer_address_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); @@ -2257,11 +2190,9 @@ extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR fram #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_SKIP) #error "Non multi-arch definition of FRAME_ARGS_SKIP" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_SKIP) +#if !defined (FRAME_ARGS_SKIP) #define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (FRAMELESS_FUNCTION_INVOCATION) @@ -2274,11 +2205,9 @@ extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAMELESS_FUNCTION_INVOCATION) #error "Non multi-arch definition of FRAMELESS_FUNCTION_INVOCATION" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAMELESS_FUNCTION_INVOCATION) +#if !defined (FRAMELESS_FUNCTION_INVOCATION) #define FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_frameless_function_invocation (current_gdbarch, fi)) #endif -#endif #if defined (DEPRECATED_FRAME_CHAIN) /* Legacy for systems yet to multi-arch DEPRECATED_FRAME_CHAIN */ @@ -2311,11 +2240,9 @@ extern void set_gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, gdbarch #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN) #error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN) +#if !defined (DEPRECATED_FRAME_CHAIN) #define DEPRECATED_FRAME_CHAIN(frame) (gdbarch_deprecated_frame_chain (current_gdbarch, frame)) #endif -#endif #if defined (DEPRECATED_FRAME_CHAIN_VALID) /* Legacy for systems yet to multi-arch DEPRECATED_FRAME_CHAIN_VALID */ @@ -2348,11 +2275,9 @@ extern void set_gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, g #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_VALID) #error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN_VALID" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_VALID) +#if !defined (DEPRECATED_FRAME_CHAIN_VALID) #define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_deprecated_frame_chain_valid (current_gdbarch, chain, thisframe)) #endif -#endif /* DEPRECATED_FRAME_SAVED_PC has been replaced by UNWIND_PC. Please note, per UNWIND_PC's doco, that while the two have similar @@ -2389,11 +2314,9 @@ extern void set_gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, gdba #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_SAVED_PC) #error "Non multi-arch definition of DEPRECATED_FRAME_SAVED_PC" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_SAVED_PC) +#if !defined (DEPRECATED_FRAME_SAVED_PC) #define DEPRECATED_FRAME_SAVED_PC(fi) (gdbarch_deprecated_frame_saved_pc (current_gdbarch, fi)) #endif -#endif extern int gdbarch_unwind_pc_p (struct gdbarch *gdbarch); @@ -2401,38 +2324,86 @@ typedef CORE_ADDR (gdbarch_unwind_pc_ftype) (struct gdbarch *gdbarch, struct fra extern CORE_ADDR gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame); extern void set_gdbarch_unwind_pc (struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype *unwind_pc); -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (FRAME_ARGS_ADDRESS) -#define FRAME_ARGS_ADDRESS(fi) (get_frame_base (fi)) +extern int gdbarch_unwind_sp_p (struct gdbarch *gdbarch); + +typedef CORE_ADDR (gdbarch_unwind_sp_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame); +extern CORE_ADDR gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame); +extern void set_gdbarch_unwind_sp (struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype *unwind_sp); + +/* DEPRECATED_FRAME_ARGS_ADDRESS as been replaced by the per-frame + frame-base. Enable frame-base before frame-unwind. */ + +#if defined (DEPRECATED_FRAME_ARGS_ADDRESS) +/* Legacy for systems yet to multi-arch DEPRECATED_FRAME_ARGS_ADDRESS */ +#if !defined (DEPRECATED_FRAME_ARGS_ADDRESS_P) +#define DEPRECATED_FRAME_ARGS_ADDRESS_P() (1) +#endif #endif -typedef CORE_ADDR (gdbarch_frame_args_address_ftype) (struct frame_info *fi); -extern CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi); -extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_ADDRESS) -#error "Non multi-arch definition of FRAME_ARGS_ADDRESS" +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_ARGS_ADDRESS_P) +#define DEPRECATED_FRAME_ARGS_ADDRESS_P() (0) #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_ADDRESS) -#define FRAME_ARGS_ADDRESS(fi) (gdbarch_frame_args_address (current_gdbarch, fi)) + +extern int gdbarch_deprecated_frame_args_address_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_ARGS_ADDRESS_P) +#error "Non multi-arch definition of DEPRECATED_FRAME_ARGS_ADDRESS" #endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_ARGS_ADDRESS_P) +#define DEPRECATED_FRAME_ARGS_ADDRESS_P() (gdbarch_deprecated_frame_args_address_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (FRAME_LOCALS_ADDRESS) -#define FRAME_LOCALS_ADDRESS(fi) (get_frame_base (fi)) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_ARGS_ADDRESS) +#define DEPRECATED_FRAME_ARGS_ADDRESS(fi) (get_frame_base (fi)) +#endif + +typedef CORE_ADDR (gdbarch_deprecated_frame_args_address_ftype) (struct frame_info *fi); +extern CORE_ADDR gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi); +extern void set_gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch, gdbarch_deprecated_frame_args_address_ftype *deprecated_frame_args_address); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_ARGS_ADDRESS) +#error "Non multi-arch definition of DEPRECATED_FRAME_ARGS_ADDRESS" +#endif +#if !defined (DEPRECATED_FRAME_ARGS_ADDRESS) +#define DEPRECATED_FRAME_ARGS_ADDRESS(fi) (gdbarch_deprecated_frame_args_address (current_gdbarch, fi)) +#endif + +/* DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame + frame-base. Enable frame-base before frame-unwind. */ + +#if defined (DEPRECATED_FRAME_LOCALS_ADDRESS) +/* Legacy for systems yet to multi-arch DEPRECATED_FRAME_LOCALS_ADDRESS */ +#if !defined (DEPRECATED_FRAME_LOCALS_ADDRESS_P) +#define DEPRECATED_FRAME_LOCALS_ADDRESS_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_LOCALS_ADDRESS_P) +#define DEPRECATED_FRAME_LOCALS_ADDRESS_P() (0) #endif -typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) (struct frame_info *fi); -extern CORE_ADDR gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi); -extern void set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_LOCALS_ADDRESS) -#error "Non multi-arch definition of FRAME_LOCALS_ADDRESS" +extern int gdbarch_deprecated_frame_locals_address_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_LOCALS_ADDRESS_P) +#error "Non multi-arch definition of DEPRECATED_FRAME_LOCALS_ADDRESS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_LOCALS_ADDRESS) -#define FRAME_LOCALS_ADDRESS(fi) (gdbarch_frame_locals_address (current_gdbarch, fi)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_LOCALS_ADDRESS_P) +#define DEPRECATED_FRAME_LOCALS_ADDRESS_P() (gdbarch_deprecated_frame_locals_address_p (current_gdbarch)) #endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_LOCALS_ADDRESS) +#define DEPRECATED_FRAME_LOCALS_ADDRESS(fi) (get_frame_base (fi)) +#endif + +typedef CORE_ADDR (gdbarch_deprecated_frame_locals_address_ftype) (struct frame_info *fi); +extern CORE_ADDR gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi); +extern void set_gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch, gdbarch_deprecated_frame_locals_address_ftype *deprecated_frame_locals_address); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_LOCALS_ADDRESS) +#error "Non multi-arch definition of DEPRECATED_FRAME_LOCALS_ADDRESS" +#endif +#if !defined (DEPRECATED_FRAME_LOCALS_ADDRESS) +#define DEPRECATED_FRAME_LOCALS_ADDRESS(fi) (gdbarch_deprecated_frame_locals_address (current_gdbarch, fi)) #endif #if defined (DEPRECATED_SAVED_PC_AFTER_CALL) @@ -2466,10 +2437,33 @@ extern void set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVED_PC_AFTER_CALL) #error "Non multi-arch definition of DEPRECATED_SAVED_PC_AFTER_CALL" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SAVED_PC_AFTER_CALL) +#if !defined (DEPRECATED_SAVED_PC_AFTER_CALL) #define DEPRECATED_SAVED_PC_AFTER_CALL(frame) (gdbarch_deprecated_saved_pc_after_call (current_gdbarch, frame)) #endif + +#if defined (FRAME_NUM_ARGS) +/* Legacy for systems yet to multi-arch FRAME_NUM_ARGS */ +#if !defined (FRAME_NUM_ARGS_P) +#define FRAME_NUM_ARGS_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (FRAME_NUM_ARGS_P) +#define FRAME_NUM_ARGS_P() (0) +#endif + +extern int gdbarch_frame_num_args_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS_P) +#error "Non multi-arch definition of FRAME_NUM_ARGS" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS_P) +#define FRAME_NUM_ARGS_P() (gdbarch_frame_num_args_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (FRAME_NUM_ARGS) +#define FRAME_NUM_ARGS(frame) (internal_error (__FILE__, __LINE__, "FRAME_NUM_ARGS"), 0) #endif typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame); @@ -2478,11 +2472,9 @@ extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_n #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS) #error "Non multi-arch definition of FRAME_NUM_ARGS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS) +#if !defined (FRAME_NUM_ARGS) #define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame)) #endif -#endif #if defined (STACK_ALIGN) /* Legacy for systems yet to multi-arch STACK_ALIGN */ @@ -2515,11 +2507,9 @@ extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_alig #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN) #error "Non multi-arch definition of STACK_ALIGN" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN) +#if !defined (STACK_ALIGN) #define STACK_ALIGN(sp) (gdbarch_stack_align (current_gdbarch, sp)) #endif -#endif extern int gdbarch_frame_align_p (struct gdbarch *gdbarch); @@ -2527,24 +2517,6 @@ typedef CORE_ADDR (gdbarch_frame_align_ftype) (struct gdbarch *gdbarch, CORE_ADD extern CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address); extern void set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align); -/* NOTE: cagney/2003-03-24: This is better handled by PUSH_ARGUMENTS. */ - -/* Default (value) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) -#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (0) -#endif - -extern int gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch); -extern void set_gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch, int deprecated_extra_stack_alignment_needed); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) -#error "Non multi-arch definition of DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) -#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_deprecated_extra_stack_alignment_needed (current_gdbarch)) -#endif -#endif - #if defined (REG_STRUCT_HAS_ADDR) /* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */ #if !defined (REG_STRUCT_HAS_ADDR_P) @@ -2576,68 +2548,18 @@ extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_re #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR) #error "Non multi-arch definition of REG_STRUCT_HAS_ADDR" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR) +#if !defined (REG_STRUCT_HAS_ADDR) #define REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_reg_struct_has_addr (current_gdbarch, gcc_p, type)) #endif -#endif - -/* FIXME: kettenis/2003-03-08: This should be replaced by a function - parametrized with (at least) the regcache. */ - -#if defined (SAVE_DUMMY_FRAME_TOS) -/* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */ -#if !defined (SAVE_DUMMY_FRAME_TOS_P) -#define SAVE_DUMMY_FRAME_TOS_P() (1) -#endif -#endif - -/* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS_P) -#define SAVE_DUMMY_FRAME_TOS_P() (0) -#endif - -extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS_P) -#error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS" -#endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS_P) -#define SAVE_DUMMY_FRAME_TOS_P() (gdbarch_save_dummy_frame_tos_p (current_gdbarch)) -#endif - -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS) -#define SAVE_DUMMY_FRAME_TOS(sp) (internal_error (__FILE__, __LINE__, "SAVE_DUMMY_FRAME_TOS"), 0) -#endif - -typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp); -extern void gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp); -extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS) -#error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS) -#define SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_save_dummy_frame_tos (current_gdbarch, sp)) -#endif -#endif - -extern int gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch); - -typedef struct frame_id (gdbarch_unwind_dummy_id_ftype) (struct gdbarch *gdbarch, struct frame_info *info); -extern struct frame_id gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info); -extern void set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, gdbarch_unwind_dummy_id_ftype *unwind_dummy_id); extern int gdbarch_parm_boundary (struct gdbarch *gdbarch); extern void set_gdbarch_parm_boundary (struct gdbarch *gdbarch, int parm_boundary); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PARM_BOUNDARY) #error "Non multi-arch definition of PARM_BOUNDARY" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PARM_BOUNDARY) +#if !defined (PARM_BOUNDARY) #define PARM_BOUNDARY (gdbarch_parm_boundary (current_gdbarch)) #endif -#endif /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_FORMAT) @@ -2649,11 +2571,9 @@ extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floa #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_FORMAT) #error "Non multi-arch definition of TARGET_FLOAT_FORMAT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_FORMAT) +#if !defined (TARGET_FLOAT_FORMAT) #define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch)) #endif -#endif /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_FORMAT) @@ -2665,11 +2585,9 @@ extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct flo #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_FORMAT) #error "Non multi-arch definition of TARGET_DOUBLE_FORMAT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_FORMAT) +#if !defined (TARGET_DOUBLE_FORMAT) #define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch)) #endif -#endif /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_FORMAT) @@ -2681,11 +2599,9 @@ extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struc #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_FORMAT) #error "Non multi-arch definition of TARGET_LONG_DOUBLE_FORMAT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_FORMAT) +#if !defined (TARGET_LONG_DOUBLE_FORMAT) #define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (CONVERT_FROM_FUNC_PTR_ADDR) @@ -2698,11 +2614,9 @@ extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdb #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_FROM_FUNC_PTR_ADDR) #error "Non multi-arch definition of CONVERT_FROM_FUNC_PTR_ADDR" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_FROM_FUNC_PTR_ADDR) +#if !defined (CONVERT_FROM_FUNC_PTR_ADDR) #define CONVERT_FROM_FUNC_PTR_ADDR(addr) (gdbarch_convert_from_func_ptr_addr (current_gdbarch, addr)) #endif -#endif /* On some machines there are bits in addresses which are not really part of the address, but are used by the kernel, the hardware, etc. @@ -2725,11 +2639,9 @@ extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_ #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDR_BITS_REMOVE) #error "Non multi-arch definition of ADDR_BITS_REMOVE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDR_BITS_REMOVE) +#if !defined (ADDR_BITS_REMOVE) #define ADDR_BITS_REMOVE(addr) (gdbarch_addr_bits_remove (current_gdbarch, addr)) #endif -#endif /* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into ADDR_BITS_REMOVE. */ @@ -2745,11 +2657,9 @@ extern void set_gdbarch_smash_text_address (struct gdbarch *gdbarch, gdbarch_sma #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SMASH_TEXT_ADDRESS) #error "Non multi-arch definition of SMASH_TEXT_ADDRESS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SMASH_TEXT_ADDRESS) +#if !defined (SMASH_TEXT_ADDRESS) #define SMASH_TEXT_ADDRESS(addr) (gdbarch_smash_text_address (current_gdbarch, addr)) #endif -#endif /* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if the target needs software single step. An ISA method to implement it. @@ -2791,11 +2701,9 @@ extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_s #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP) #error "Non multi-arch definition of SOFTWARE_SINGLE_STEP" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP) +#if !defined (SOFTWARE_SINGLE_STEP) #define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (TARGET_PRINT_INSN) @@ -2808,11 +2716,9 @@ extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_ #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PRINT_INSN) #error "Non multi-arch definition of TARGET_PRINT_INSN" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PRINT_INSN) +#if !defined (TARGET_PRINT_INSN) #define TARGET_PRINT_INSN(vma, info) (gdbarch_print_insn (current_gdbarch, vma, info)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (SKIP_TRAMPOLINE_CODE) @@ -2825,11 +2731,9 @@ extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_s #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_TRAMPOLINE_CODE) #error "Non multi-arch definition of SKIP_TRAMPOLINE_CODE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_TRAMPOLINE_CODE) +#if !defined (SKIP_TRAMPOLINE_CODE) #define SKIP_TRAMPOLINE_CODE(pc) (gdbarch_skip_trampoline_code (current_gdbarch, pc)) #endif -#endif /* For SVR4 shared libraries, each call goes through a small piece of trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates @@ -2846,11 +2750,9 @@ extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbar #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_CALL_TRAMPOLINE) #error "Non multi-arch definition of IN_SOLIB_CALL_TRAMPOLINE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_CALL_TRAMPOLINE) +#if !defined (IN_SOLIB_CALL_TRAMPOLINE) #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (gdbarch_in_solib_call_trampoline (current_gdbarch, pc, name)) #endif -#endif /* Some systems also have trampoline code for returning from shared libs. */ @@ -2865,11 +2767,9 @@ extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdb #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_RETURN_TRAMPOLINE) #error "Non multi-arch definition of IN_SOLIB_RETURN_TRAMPOLINE" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_RETURN_TRAMPOLINE) +#if !defined (IN_SOLIB_RETURN_TRAMPOLINE) #define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (gdbarch_in_solib_return_trampoline (current_gdbarch, pc, name)) #endif -#endif /* Sigtramp is a routine that the kernel calls (which then calls the signal handler). On most machines it is a library routine that is @@ -2903,11 +2803,9 @@ extern void set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, gdbarch_pc_in_s #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_SIGTRAMP) #error "Non multi-arch definition of PC_IN_SIGTRAMP" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_SIGTRAMP) +#if !defined (PC_IN_SIGTRAMP) #define PC_IN_SIGTRAMP(pc, name) (gdbarch_pc_in_sigtramp (current_gdbarch, pc, name)) #endif -#endif #if defined (SIGTRAMP_START) /* Legacy for systems yet to multi-arch SIGTRAMP_START */ @@ -2940,11 +2838,9 @@ extern void set_gdbarch_sigtramp_start (struct gdbarch *gdbarch, gdbarch_sigtram #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_START) #error "Non multi-arch definition of SIGTRAMP_START" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_START) +#if !defined (SIGTRAMP_START) #define SIGTRAMP_START(pc) (gdbarch_sigtramp_start (current_gdbarch, pc)) #endif -#endif #if defined (SIGTRAMP_END) /* Legacy for systems yet to multi-arch SIGTRAMP_END */ @@ -2977,11 +2873,9 @@ extern void set_gdbarch_sigtramp_end (struct gdbarch *gdbarch, gdbarch_sigtramp_ #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_END) #error "Non multi-arch definition of SIGTRAMP_END" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_END) +#if !defined (SIGTRAMP_END) #define SIGTRAMP_END(pc) (gdbarch_sigtramp_end (current_gdbarch, pc)) #endif -#endif /* A target might have problems with watchpoints as soon as the stack frame of the current function has been destroyed. This mostly happens @@ -3041,11 +2935,9 @@ extern void set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, gdbarc #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO) #error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO) +#if !defined (DWARF2_BUILD_FRAME_INFO) #define DWARF2_BUILD_FRAME_INFO(objfile) (gdbarch_dwarf2_build_frame_info (current_gdbarch, objfile)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (ELF_MAKE_MSYMBOL_SPECIAL) @@ -3058,11 +2950,9 @@ extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, gdbar #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ELF_MAKE_MSYMBOL_SPECIAL) #error "Non multi-arch definition of ELF_MAKE_MSYMBOL_SPECIAL" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ELF_MAKE_MSYMBOL_SPECIAL) +#if !defined (ELF_MAKE_MSYMBOL_SPECIAL) #define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (gdbarch_elf_make_msymbol_special (current_gdbarch, sym, msym)) #endif -#endif /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (COFF_MAKE_MSYMBOL_SPECIAL) @@ -3075,11 +2965,9 @@ extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdba #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COFF_MAKE_MSYMBOL_SPECIAL) #error "Non multi-arch definition of COFF_MAKE_MSYMBOL_SPECIAL" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COFF_MAKE_MSYMBOL_SPECIAL) +#if !defined (COFF_MAKE_MSYMBOL_SPECIAL) #define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (gdbarch_coff_make_msymbol_special (current_gdbarch, val, msym)) #endif -#endif /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (NAME_OF_MALLOC) @@ -3091,11 +2979,9 @@ extern void set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, const char * na #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NAME_OF_MALLOC) #error "Non multi-arch definition of NAME_OF_MALLOC" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NAME_OF_MALLOC) +#if !defined (NAME_OF_MALLOC) #define NAME_OF_MALLOC (gdbarch_name_of_malloc (current_gdbarch)) #endif -#endif /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (CANNOT_STEP_BREAKPOINT) @@ -3107,11 +2993,9 @@ extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int can #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STEP_BREAKPOINT) #error "Non multi-arch definition of CANNOT_STEP_BREAKPOINT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STEP_BREAKPOINT) +#if !defined (CANNOT_STEP_BREAKPOINT) #define CANNOT_STEP_BREAKPOINT (gdbarch_cannot_step_breakpoint (current_gdbarch)) #endif -#endif /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (HAVE_NONSTEPPABLE_WATCHPOINT) @@ -3123,11 +3007,9 @@ extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, i #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (HAVE_NONSTEPPABLE_WATCHPOINT) #error "Non multi-arch definition of HAVE_NONSTEPPABLE_WATCHPOINT" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (HAVE_NONSTEPPABLE_WATCHPOINT) +#if !defined (HAVE_NONSTEPPABLE_WATCHPOINT) #define HAVE_NONSTEPPABLE_WATCHPOINT (gdbarch_have_nonsteppable_watchpoint (current_gdbarch)) #endif -#endif #if defined (ADDRESS_CLASS_TYPE_FLAGS) /* Legacy for systems yet to multi-arch ADDRESS_CLASS_TYPE_FLAGS */ @@ -3160,11 +3042,9 @@ extern void set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, gdbar #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS) #error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_TYPE_FLAGS) +#if !defined (ADDRESS_CLASS_TYPE_FLAGS) #define ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class) (gdbarch_address_class_type_flags (current_gdbarch, byte_size, dwarf2_addr_class)) #endif -#endif extern int gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch); @@ -3184,6 +3064,43 @@ typedef int (gdbarch_register_reggroup_p_ftype) (struct gdbarch *gdbarch, int re extern int gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup); extern void set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype *register_reggroup_p); +/* Fetch the pointer to the ith function argument. */ + +#if defined (FETCH_POINTER_ARGUMENT) +/* Legacy for systems yet to multi-arch FETCH_POINTER_ARGUMENT */ +#if !defined (FETCH_POINTER_ARGUMENT_P) +#define FETCH_POINTER_ARGUMENT_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (FETCH_POINTER_ARGUMENT_P) +#define FETCH_POINTER_ARGUMENT_P() (0) +#endif + +extern int gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_POINTER_ARGUMENT_P) +#error "Non multi-arch definition of FETCH_POINTER_ARGUMENT" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_POINTER_ARGUMENT_P) +#define FETCH_POINTER_ARGUMENT_P() (gdbarch_fetch_pointer_argument_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (FETCH_POINTER_ARGUMENT) +#define FETCH_POINTER_ARGUMENT(frame, argi, type) (internal_error (__FILE__, __LINE__, "FETCH_POINTER_ARGUMENT"), 0) +#endif + +typedef CORE_ADDR (gdbarch_fetch_pointer_argument_ftype) (struct frame_info *frame, int argi, struct type *type); +extern CORE_ADDR gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type); +extern void set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_POINTER_ARGUMENT) +#error "Non multi-arch definition of FETCH_POINTER_ARGUMENT" +#endif +#if !defined (FETCH_POINTER_ARGUMENT) +#define FETCH_POINTER_ARGUMENT(frame, argi, type) (gdbarch_fetch_pointer_argument (current_gdbarch, frame, argi, type)) +#endif + extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch); diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index f6106e4f372..494b916ffe4 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -426,14 +426,10 @@ v:2:TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE # One if \`char' acts like \`signed char', zero if \`unsigned char'. v:2:TARGET_CHAR_SIGNED:int:char_signed::::1:-1:1:::: # -f:2:TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid::0:generic_target_read_pc::0 +F:2:TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid f:2:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, ptid_t ptid:val, ptid::0:generic_target_write_pc::0 -# This is simply not needed. See value_of_builtin_frame_fp_reg and -# call_function_by_hand. -F::DEPRECATED_TARGET_READ_FP:CORE_ADDR:deprecated_target_read_fp:void -f:2:TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:generic_target_read_sp::0 -# The dummy call frame SP should be set by push_dummy_call. -F:2:DEPRECATED_DUMMY_WRITE_SP:void:deprecated_dummy_write_sp:CORE_ADDR val:val +# UNWIND_SP is a direct replacement for TARGET_READ_SP. +F:2:TARGET_READ_SP:CORE_ADDR:read_sp:void # Function for getting target's idea of a frame pointer. FIXME: GDB's # whole scheme for dealing with "frames" and "frame pointers" needs a # serious shakedown. @@ -452,10 +448,8 @@ v:2:NUM_PSEUDO_REGS:int:num_pseudo_regs::::0:0::0::: # GDB's standard (or well known) register numbers. These can map onto # a real register or a pseudo (computed) register or not be defined at # all (-1). +# SP_REGNUM will hopefully be replaced by UNWIND_SP. v:2:SP_REGNUM:int:sp_regnum::::-1:-1::0 -# This is simply not needed. See value_of_builtin_frame_fp_reg and -# call_function_by_hand. -v:2:DEPRECATED_FP_REGNUM:int:deprecated_fp_regnum::::-1:-1::0 v:2:PC_REGNUM:int:pc_regnum::::-1:-1::0 v:2:PS_REGNUM:int:ps_regnum::::-1:-1::0 v:2:FP0_REGNUM:int:fp0_regnum::::0:-1::0 @@ -472,33 +466,90 @@ f:2:DWARF_REG_TO_REGNUM:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr:::no f:2:SDB_REG_TO_REGNUM:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr:::no_op_reg_to_regnum::0 f:2:DWARF2_REG_TO_REGNUM:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr:::no_op_reg_to_regnum::0 f:2:REGISTER_NAME:const char *:register_name:int regnr:regnr:::legacy_register_name::0 -v::DEPRECATED_REGISTER_SIZE:int:deprecated_register_size + +# REGISTER_TYPE is a direct replacement for REGISTER_VIRTUAL_TYPE. +M:2:REGISTER_TYPE:struct type *:register_type:int reg_nr:reg_nr::0: +# REGISTER_TYPE is a direct replacement for REGISTER_VIRTUAL_TYPE. +F:2:REGISTER_VIRTUAL_TYPE:struct type *:deprecated_register_virtual_type:int reg_nr:reg_nr::0:0 +# DEPRECATED_REGISTER_BYTES can be deleted. The value is computed +# from REGISTER_TYPE. v::DEPRECATED_REGISTER_BYTES:int:deprecated_register_bytes -# NOTE: cagney/2002-05-02: This function with predicate has a valid -# (callable) initial value. As a consequence, even when the predicate -# is false, the corresponding function works. This simplifies the -# migration process - old code, calling REGISTER_BYTE, doesn't need to -# be modified. -F::REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte -# The methods REGISTER_VIRTUAL_TYPE, 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 -# The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and -# DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by -# MAX_REGISTER_SIZE (a constant). +# If the value returned by DEPRECATED_REGISTER_BYTE agrees with the +# register offsets computed using just REGISTER_TYPE, this can be +# deleted. See: maint print registers. NOTE: cagney/2002-05-02: This +# function with predicate has a valid (callable) initial value. As a +# consequence, even when the predicate is false, the corresponding +# function works. This simplifies the migration process - old code, +# calling DEPRECATED_REGISTER_BYTE, doesn't need to be modified. +F::REGISTER_BYTE:int:deprecated_register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte +# If all registers have identical raw and virtual sizes and those +# sizes agree with the value computed from REGISTER_TYPE, +# DEPRECATED_REGISTER_RAW_SIZE can be deleted. See: maint print +# registers. +f:2:REGISTER_RAW_SIZE:int:deprecated_register_raw_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0 +# If all registers have identical raw and virtual sizes and those +# sizes agree with the value computed from REGISTER_TYPE, +# DEPRECATED_REGISTER_VIRTUAL_SIZE can be deleted. See: maint print +# registers. +f:2:REGISTER_VIRTUAL_SIZE:int:deprecated_register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0 +# DEPRECATED_MAX_REGISTER_RAW_SIZE can be deleted. It has been +# replaced by the constant MAX_REGISTER_SIZE. V:2:DEPRECATED_MAX_REGISTER_RAW_SIZE:int:deprecated_max_register_raw_size -# The methods REGISTER_VIRTUAL_TYPE, 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 -# The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and -# DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by -# MAX_REGISTER_SIZE (a constant). +# DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE can be deleted. It has been +# replaced by the constant MAX_REGISTER_SIZE. V:2:DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE:int:deprecated_max_register_virtual_size -# The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and -# REGISTER_RAW_SIZE are 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: -# + +# See gdbint.texinfo, and PUSH_DUMMY_CALL. +M::UNWIND_DUMMY_ID:struct frame_id:unwind_dummy_id:struct frame_info *info:info::0:0 +# Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete +# SAVE_DUMMY_FRAME_TOS. +F:2:DEPRECATED_SAVE_DUMMY_FRAME_TOS:void:deprecated_save_dummy_frame_tos:CORE_ADDR sp:sp +# Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete +# DEPRECATED_FP_REGNUM. +v:2:DEPRECATED_FP_REGNUM:int:deprecated_fp_regnum::::-1:-1::0 +# Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete +# DEPRECATED_TARGET_READ_FP. +F::DEPRECATED_TARGET_READ_FP:CORE_ADDR:deprecated_target_read_fp:void + +# See gdbint.texinfo. See infcall.c. New, all singing all dancing, +# replacement for DEPRECATED_PUSH_ARGUMENTS. +M::PUSH_DUMMY_CALL:CORE_ADDR:push_dummy_call:CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:func_addr, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr +# PUSH_DUMMY_CALL is a direct replacement for DEPRECATED_PUSH_ARGUMENTS. +F:2:DEPRECATED_PUSH_ARGUMENTS:CORE_ADDR:deprecated_push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr +# DEPRECATED_USE_GENERIC_DUMMY_FRAMES can be deleted. Always true. +v::DEPRECATED_USE_GENERIC_DUMMY_FRAMES:int:deprecated_use_generic_dummy_frames:::::1::0 +# Implement PUSH_RETURN_ADDRESS, and then merge in +# DEPRECATED_PUSH_RETURN_ADDRESS. +F:2:DEPRECATED_PUSH_RETURN_ADDRESS:CORE_ADDR:deprecated_push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0 +# Implement PUSH_DUMMY_CALL, then merge in DEPRECATED_DUMMY_WRITE_SP. +F:2:DEPRECATED_DUMMY_WRITE_SP:void:deprecated_dummy_write_sp:CORE_ADDR val:val +# DEPRECATED_REGISTER_SIZE can be deleted. +v::DEPRECATED_REGISTER_SIZE:int:deprecated_register_size +v::CALL_DUMMY_LOCATION:int:call_dummy_location:::::AT_ENTRY_POINT::0 +f::CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void::::entry_point_address::0 +# DEPRECATED_CALL_DUMMY_START_OFFSET can be deleted. +v::DEPRECATED_CALL_DUMMY_START_OFFSET:CORE_ADDR:deprecated_call_dummy_start_offset +# DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET can be deleted. +v::DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:deprecated_call_dummy_breakpoint_offset +# DEPRECATED_CALL_DUMMY_LENGTH can be deleted. +v::DEPRECATED_CALL_DUMMY_LENGTH:int:deprecated_call_dummy_length +# DEPRECATED_CALL_DUMMY_WORDS can be deleted. +v::DEPRECATED_CALL_DUMMY_WORDS:LONGEST *:deprecated_call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx +# Implement PUSH_DUMMY_CALL, then delete DEPRECATED_SIZEOF_CALL_DUMMY_WORDS. +v::DEPRECATED_SIZEOF_CALL_DUMMY_WORDS:int:deprecated_sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0 +# Implement PUSH_DUMMY_CALL, then delete DEPRECATED_CALL_DUMMY_STACK_ADJUST. +V:2:DEPRECATED_CALL_DUMMY_STACK_ADJUST:int:deprecated_call_dummy_stack_adjust::::0 +# DEPRECATED_FIX_CALL_DUMMY can be deleted. For the SPARC, implement +# PUSH_DUMMY_CODE and set CALL_DUMMY_LOCATION to ON_STACK. +F::DEPRECATED_FIX_CALL_DUMMY:void:deprecated_fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p +# This is a replacement for DEPRECATED_FIX_CALL_DUMMY et.al. +M::PUSH_DUMMY_CODE:CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr:sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr: +# Implement PUSH_DUMMY_CALL, then delete DEPRECATED_PUSH_DUMMY_FRAME. +F:2:DEPRECATED_PUSH_DUMMY_FRAME:void:deprecated_push_dummy_frame:void:-:::0 +# Implement PUSH_DUMMY_CALL, then delete +# DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED. +v:2:DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED:int:deprecated_extra_stack_alignment_needed::::0:0::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 M:2:PRINT_FLOAT_INFO:void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args @@ -511,41 +562,12 @@ f:2:CANNOT_FETCH_REGISTER:int:cannot_fetch_register:int regnum:regnum:::cannot_r f:2:CANNOT_STORE_REGISTER:int:cannot_store_register:int regnum:regnum:::cannot_register_not::0 # setjmp/longjmp support. F:2:GET_LONGJMP_TARGET:int:get_longjmp_target:CORE_ADDR *pc:pc::0:0 -# -# Non multi-arch DUMMY_FRAMES are a mess (multi-arch ones are not that -# much better but at least they are vaguely consistent). The headers -# and body contain convoluted #if/#else sequences for determine how -# things should be compiled. Instead of trying to mimic that -# behaviour here (and hence entrench it further) gdbarch simply -# reqires that these methods be set up from the word go. This also -# avoids any potential problems with moving beyond multi-arch partial. -v::DEPRECATED_USE_GENERIC_DUMMY_FRAMES:int:deprecated_use_generic_dummy_frames:::::1::0 -# Replaced by push_dummy_code. -v::CALL_DUMMY_LOCATION:int:call_dummy_location:::::AT_ENTRY_POINT::0 -# Replaced by push_dummy_code. -f::CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void::::entry_point_address::0 -# Replaced by push_dummy_code. -v::DEPRECATED_CALL_DUMMY_START_OFFSET:CORE_ADDR:deprecated_call_dummy_start_offset -# Replaced by push_dummy_code. -v::DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:deprecated_call_dummy_breakpoint_offset -# Replaced by push_dummy_code. -v::DEPRECATED_CALL_DUMMY_LENGTH:int:deprecated_call_dummy_length # NOTE: cagney/2002-11-24: This function with predicate has a valid # (callable) initial value. As a consequence, even when the predicate # is false, the corresponding function works. This simplifies the # migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(), # doesn't need to be modified. F::DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::generic_pc_in_call_dummy:generic_pc_in_call_dummy -# Replaced by push_dummy_code. -v::DEPRECATED_CALL_DUMMY_WORDS:LONGEST *:deprecated_call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx -# Replaced by push_dummy_code. -v::DEPRECATED_SIZEOF_CALL_DUMMY_WORDS:int:deprecated_sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0 -# Replaced by push_dummy_code. -V:2:DEPRECATED_CALL_DUMMY_STACK_ADJUST:int:deprecated_call_dummy_stack_adjust::::0 -# Replaced by push_dummy_code. -F::DEPRECATED_FIX_CALL_DUMMY:void:deprecated_fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p -# This is a replacement for DEPRECATED_FIX_CALL_DUMMY et.al. -M::PUSH_DUMMY_CODE:CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr:sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr: F:2:DEPRECATED_INIT_FRAME_PC_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev # @@ -553,25 +575,25 @@ v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion::::::: v::BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type::::::: F:2:DEPRECATED_GET_SAVED_REGISTER:void:deprecated_get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval # -f:2:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr:::generic_register_convertible_not::0 -f:2:REGISTER_CONVERT_TO_VIRTUAL:void:register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0 -f:2:REGISTER_CONVERT_TO_RAW:void:register_convert_to_raw:struct type *type, int regnum, char *from, char *to:type, regnum, from, to:::0::0 +# For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al. +# For raw <-> cooked register conversions, replaced by pseudo registers. +f:2:DEPRECATED_REGISTER_CONVERTIBLE:int:deprecated_register_convertible:int nr:nr:::deprecated_register_convertible_not::0 +# For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al. +# For raw <-> cooked register conversions, replaced by pseudo registers. +f:2:DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL:void:deprecated_register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0 +# For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al. +# For raw <-> cooked register conversions, replaced by pseudo registers. +f:2:DEPRECATED_REGISTER_CONVERT_TO_RAW:void:deprecated_register_convert_to_raw:struct type *type, int regnum, const char *from, char *to:type, regnum, from, to:::0::0 # -f:1:CONVERT_REGISTER_P:int:convert_register_p:int regnum:regnum::0:legacy_convert_register_p::0 -f:1:REGISTER_TO_VALUE:void:register_to_value:int regnum, struct type *type, char *from, char *to:regnum, type, from, to::0:legacy_register_to_value::0 -f:1:VALUE_TO_REGISTER:void:value_to_register:struct type *type, int regnum, char *from, char *to:type, regnum, from, to::0:legacy_value_to_register::0 +f:1:CONVERT_REGISTER_P:int:convert_register_p:int regnum, struct type *type:regnum, type::0:legacy_convert_register_p::0 +f:1:REGISTER_TO_VALUE:void:register_to_value:struct frame_info *frame, int regnum, struct type *type, void *buf:frame, regnum, type, buf::0:legacy_register_to_value::0 +f:1:VALUE_TO_REGISTER:void:value_to_register:struct frame_info *frame, int regnum, struct type *type, const void *buf:frame, regnum, type, buf::0:legacy_value_to_register::0 # f:2:POINTER_TO_ADDRESS:CORE_ADDR:pointer_to_address:struct type *type, const void *buf:type, buf:::unsigned_pointer_to_address::0 f:2:ADDRESS_TO_POINTER:void:address_to_pointer:struct type *type, void *buf, CORE_ADDR addr:type, buf, addr:::unsigned_address_to_pointer::0 F:2:INTEGER_TO_ADDRESS:CORE_ADDR:integer_to_address:struct type *type, void *buf:type, buf # f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0 -# Replaced by PUSH_DUMMY_CALL -F:2:DEPRECATED_PUSH_ARGUMENTS:CORE_ADDR:deprecated_push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr -M::PUSH_DUMMY_CALL:CORE_ADDR:push_dummy_call:struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:regcache, dummy_addr, nargs, args, sp, struct_return, struct_addr -F:2:DEPRECATED_PUSH_DUMMY_FRAME:void:deprecated_push_dummy_frame:void:-:::0 -# NOTE: This can be handled directly in push_dummy_call. -F:2:DEPRECATED_PUSH_RETURN_ADDRESS:CORE_ADDR:deprecated_push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0 F:2:DEPRECATED_POP_FRAME:void:deprecated_pop_frame:void:-:::0 # NOTE: cagney/2003-03-24: Replaced by PUSH_ARGUMENTS. F:2:DEPRECATED_STORE_STRUCT_RETURN:void:deprecated_store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0 @@ -595,7 +617,6 @@ f::BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0 f:2:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0 v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1 -f:2:PREPARE_TO_PROCEED:int:prepare_to_proceed:int select_it:select_it::0:default_prepare_to_proceed::0 v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:-1 # m::REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:regcache, gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0 @@ -609,20 +630,19 @@ F:2:DEPRECATED_FRAME_CHAIN_VALID:int:deprecated_frame_chain_valid:CORE_ADDR chai # interfaces they have very different underlying implementations. F:2:DEPRECATED_FRAME_SAVED_PC:CORE_ADDR:deprecated_frame_saved_pc:struct frame_info *fi:fi::0:0 M::UNWIND_PC:CORE_ADDR:unwind_pc:struct frame_info *next_frame:next_frame: -f:2:FRAME_ARGS_ADDRESS:CORE_ADDR:frame_args_address:struct frame_info *fi:fi::0:get_frame_base::0 -f:2:FRAME_LOCALS_ADDRESS:CORE_ADDR:frame_locals_address:struct frame_info *fi:fi::0:get_frame_base::0 +M::UNWIND_SP:CORE_ADDR:unwind_sp:struct frame_info *next_frame:next_frame: +# DEPRECATED_FRAME_ARGS_ADDRESS as been replaced by the per-frame +# frame-base. Enable frame-base before frame-unwind. +F::DEPRECATED_FRAME_ARGS_ADDRESS:CORE_ADDR:deprecated_frame_args_address:struct frame_info *fi:fi::get_frame_base:get_frame_base +# DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame +# frame-base. Enable frame-base before frame-unwind. +F::DEPRECATED_FRAME_LOCALS_ADDRESS:CORE_ADDR:deprecated_frame_locals_address:struct frame_info *fi:fi::get_frame_base:get_frame_base F::DEPRECATED_SAVED_PC_AFTER_CALL:CORE_ADDR:deprecated_saved_pc_after_call:struct frame_info *frame:frame -f:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame::0:0 +F:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame # F:2:STACK_ALIGN:CORE_ADDR:stack_align:CORE_ADDR sp:sp::0:0 M:::CORE_ADDR:frame_align:CORE_ADDR address:address -# NOTE: cagney/2003-03-24: This is better handled by PUSH_ARGUMENTS. -v:2:DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED:int:deprecated_extra_stack_alignment_needed::::0:0::0::: F:2:REG_STRUCT_HAS_ADDR:int:reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type::0:0 -# FIXME: kettenis/2003-03-08: This should be replaced by a function -# parametrized with (at least) the regcache. -F:2:SAVE_DUMMY_FRAME_TOS:void:save_dummy_frame_tos:CORE_ADDR sp:sp::0:0 -M::UNWIND_DUMMY_ID:struct frame_id:unwind_dummy_id:struct frame_info *info:info::0:0 v:2:PARM_BOUNDARY:int:parm_boundary # v:2:TARGET_FLOAT_FORMAT:const struct floatformat *:float_format::::::default_float_format (gdbarch)::%s:(TARGET_FLOAT_FORMAT)->name @@ -716,6 +736,8 @@ M:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:const char *:address_class_type_flags_to_na M:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:const char *name, int *type_flags_ptr:name, type_flags_ptr # Is a register in a group m:::int:register_reggroup_p:int regnum, struct reggroup *reggroup:regnum, reggroup:::default_register_reggroup_p::0 +# Fetch the pointer to the ith function argument. +F::FETCH_POINTER_ARGUMENT:CORE_ADDR:fetch_pointer_argument:struct frame_info *frame, int argi, struct type *type:frame, argi, type::::::::: EOF } @@ -853,11 +875,9 @@ do printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n" printf "#error \"Non multi-arch definition of ${macro}\"\n" printf "#endif\n" - printf "#if GDB_MULTI_ARCH\n" - printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro})\n" + printf "#if !defined (${macro})\n" printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n" printf "#endif\n" - printf "#endif\n" fi done @@ -924,18 +944,9 @@ do printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n" printf "#error \"Non multi-arch definition of ${macro}\"\n" printf "#endif\n" - if test "${level}" = "" - then - printf "#if !defined (${macro})\n" - printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n" - printf "#endif\n" - else - printf "#if GDB_MULTI_ARCH\n" - printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro})\n" - printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n" - printf "#endif\n" - printf "#endif\n" - fi + printf "#if !defined (${macro})\n" + printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n" + printf "#endif\n" fi if class_is_function_p then @@ -982,8 +993,16 @@ do printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n" printf "#error \"Non multi-arch definition of ${macro}\"\n" printf "#endif\n" - printf "#if GDB_MULTI_ARCH\n" - printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro})\n" + if [ "x${actual}" = "x" ] + then + d="#define ${macro}() (gdbarch_${function} (current_gdbarch))" + elif [ "x${actual}" = "x-" ] + then + d="#define ${macro} (gdbarch_${function} (current_gdbarch))" + else + d="#define ${macro}(${actual}) (gdbarch_${function} (current_gdbarch, ${actual}))" + fi + printf "#if !defined (${macro})\n" if [ "x${actual}" = "x" ] then printf "#define ${macro}() (gdbarch_${function} (current_gdbarch))\n" @@ -994,7 +1013,6 @@ do printf "#define ${macro}(${actual}) (gdbarch_${function} (current_gdbarch, ${actual}))\n" fi printf "#endif\n" - printf "#endif\n" fi fi done @@ -1403,7 +1421,7 @@ function_list | while do_read do if class_is_info_p then - printf " ${staticdefault},\n" + printf " ${staticdefault}, /* ${function} */\n" fi done cat < +2003-06-20 Daniel Jacobowitz - * low-nbsd.c (fetch_inferior_registers): - (store_inferior_registers): + * Makefile.in (SFILES): Update. + * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c, + low-sun3.c: Remove files. + +2003-06-17 Daniel Jacobowitz + + * linux-low.c: Move comment to linux_thread_alive where it belonged. + (linux_detach_one_process, linux_detach): New functions. + (linux_target_ops): Add linux_detach. + * server.c (main): Handle 'D' packet. + * target.h (struct target_ops): Add "detach" member. + (detach_inferior): Define. + +2003-06-13 Mark Kettenis + + From Kelley Cook : + * configure.srv: Accept i[34567]86 variants. + +2003-06-05 Daniel Jacobowitz + + * linux-low.c (linux_wait_for_event): Correct comment typos. + (linux_resume_one_process): Call check_removed_breakpoint. + (linux_send_signal): New function. + (linux_target_ops): Add linux_send_signal. + * remote-utils.c (putpkt, input_interrupt): Use send_signal instead + of kill. + * target.h (struct target_ops): Add send_signal. + +2003-05-29 Jim Blandy + + * linux-low.c (usr_store_inferior_registers): Transfer buf in + PTRACE_XFER_TYPE-sized chunks, not int-sized chunks. Otherwise, + if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing + away part of the register's value. 2003-03-26 Daniel Jacobowitz diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 763c21ed7b2..80667f9c6ce 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -113,10 +113,16 @@ LINTFLAGS= $(BFD_CFLAGS) # All source files that go into linking GDB remote server. -SFILES = $(srcdir)/low-hppabsd.c $(srcdir)/low-linux.c $(srcdir)/low-lynx.c \ - $(srcdir)/low-nbsd.c $(srcdir)/low-sim.c $(srcdir)/low-sparc.c \ - $(srcdir)/low-sun3.c $(srcdir)/utils.c $(srcdir)/server.c \ - $(srcdir)/remote-utils.c +SFILES= $(srcdir)/gdbreplay.c $(srcdir)/inferiors.c \ + $(srcdir)/mem-break.c $(srcdir)/proc-service.c $(srcdir)/regcache.c \ + $(srcdir)/remote-utils.c $(srcdir)/server.c $(srcdir)/target.c \ + $(srcdir)/thread-db.c $(srcdir)/utils.c \ + $(srcdir)/linux-arm-low.c $(srcdir)/linux-i386-low.c \ + $(srcdir)/i387-fp.c \ + $(srcdir)/linux-ia64-low.c $(srcdir)/linux-low.c \ + $(srcdir)/linux-m68k-low.c $(srcdir)/linux-mips-low.c \ + $(srcdir)/linux-ppc-low.c $(srcdir)/linux-s390-low.c \ + $(srcdir)/linux-sh-low.c $(srcdir)/linux-x86-64-low.c DEPFILES = @GDBSERVER_DEPFILES@ diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv index 28dc2aad1f6..6ab60e93549 100644 --- a/gdb/gdbserver/configure.srv +++ b/gdb/gdbserver/configure.srv @@ -23,7 +23,7 @@ case "${target}" in srv_linux_usrregs=yes srv_linux_thread_db=yes ;; - i[3456]86-*-linux*) srv_regobj=reg-i386-linux.o + i[34567]86-*-linux*) srv_regobj=reg-i386-linux.o srv_tgtobj="linux-low.o linux-i386-low.o i387-fp.o" srv_linux_usrregs=yes srv_linux_regsets=yes diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 95bf9697739..c700d40ba3a 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -234,13 +234,28 @@ linux_kill_one_process (struct inferior_list_entry *entry) } while (WIFSTOPPED (wstat)); } -/* Return nonzero if the given thread is still alive. */ static void linux_kill (void) { for_each_inferior (&all_threads, linux_kill_one_process); } +static void +linux_detach_one_process (struct inferior_list_entry *entry) +{ + struct thread_info *thread = (struct thread_info *) entry; + struct process_info *process = get_thread_process (thread); + + ptrace (PTRACE_DETACH, pid_of (process), 0, 0); +} + +static void +linux_detach (void) +{ + for_each_inferior (&all_threads, linux_detach_one_process); +} + +/* Return nonzero if the given thread is still alive. */ static int linux_thread_alive (int tid) { @@ -399,7 +414,7 @@ linux_wait_for_event (struct thread_info *child) /* Check for a process with a pending status. */ /* It is possible that the user changed the pending task's registers since it stopped. We correctly handle the change of PC if we hit a breakpoint - (in check_removed_breakpoints); signals should be reported anyway. */ + (in check_removed_breakpoint); signals should be reported anyway. */ if (child == NULL) { event_child = (struct process_info *) @@ -541,7 +556,7 @@ linux_wait_for_event (struct thread_info *child) if (check_breakpoints (stop_pc) != 0) { /* We hit one of our own breakpoints. We mark it as a pending - breakpoint, so that check_removed_breakpoints () will do the PC + breakpoint, so that check_removed_breakpoint () will do the PC adjustment for us at the appropriate time. */ event_child->pending_is_breakpoint = 1; event_child->pending_stop_pc = stop_pc; @@ -587,7 +602,7 @@ linux_wait_for_event (struct thread_info *child) will give us a new action for this thread, but clear it for consistency anyway. It's safe to clear the stepping flag because the only consumer of get_stop_pc () after this point - is check_removed_breakpoints, and pending_is_breakpoint is not + is check_removed_breakpoint, and pending_is_breakpoint is not set. It might be wiser to use a step_completed flag instead. */ if (event_child->stepping) { @@ -786,7 +801,7 @@ linux_resume_one_process (struct inferior_list_entry *entry, process->pending_signals = p_sig; } - if (process->status_pending_p) + if (process->status_pending_p && !check_removed_breakpoint (process)) return; saved_inferior = current_inferior; @@ -976,7 +991,7 @@ usr_store_inferior_registers (int regno) { errno = 0; ptrace (PTRACE_POKEUSER, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, - *(int *) (buf + i)); + *(PTRACE_XFER_TYPE *) (buf + i)); if (errno != 0) { if ((*the_low_target.cannot_store_register) (regno) == 0) @@ -989,7 +1004,7 @@ usr_store_inferior_registers (int regno) return; } } - regaddr += sizeof (int); + regaddr += sizeof (PTRACE_XFER_TYPE); } } else @@ -1228,11 +1243,28 @@ linux_look_up_symbols (void) #endif } +static void +linux_send_signal (int signum) +{ + extern int signal_pid; + + if (cont_thread > 0) + { + struct process_info *process; + + process = get_thread_process (current_inferior); + kill (process->lwpid, signum); + } + else + kill (signal_pid, signum); +} + static struct target_ops linux_target_ops = { linux_create_inferior, linux_attach, linux_kill, + linux_detach, linux_thread_alive, linux_resume, linux_wait, @@ -1241,6 +1273,7 @@ static struct target_ops linux_target_ops = { linux_read_memory, linux_write_memory, linux_look_up_symbols, + linux_send_signal, }; static void diff --git a/gdb/gdbserver/low-hppabsd.c b/gdb/gdbserver/low-hppabsd.c deleted file mode 100644 index 3287923d113..00000000000 --- a/gdb/gdbserver/low-hppabsd.c +++ /dev/null @@ -1,355 +0,0 @@ -/* Low level interface to ptrace, for the remote server for GDB. - Copyright 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "server.h" -#include -#include "frame.h" -#include "inferior.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/***************Begin MY defs*********************/ -static char my_registers[REGISTER_BYTES]; -char *registers = my_registers; -/***************End MY defs*********************/ - -#include -#include - -extern int errno; - -/* Start an inferior process and returns its pid. - ALLARGS is a vector of program-name and args. */ - -int -create_inferior (char *program, char **allargs) -{ - int pid; - - pid = fork (); - if (pid < 0) - perror_with_name ("fork"); - - if (pid == 0) - { - ptrace (PT_TRACE_ME, 0, 0, 0, 0); - - execv (program, allargs); - - fprintf (stderr, "Cannot exec %s: %s.\n", program, - errno < sys_nerr ? sys_errlist[errno] : "unknown error"); - fflush (stderr); - _exit (0177); - } - - return pid; -} - -/* Kill the inferior process. Make us have no inferior. */ - -void -kill_inferior (void) -{ - if (inferior_pid == 0) - return; - ptrace (8, inferior_pid, 0, 0, 0); - wait (0); -/*************inferior_died ();****VK**************/ -} - -/* Attaching is not supported. */ -int -myattach (int pid) -{ - return -1; -} - -/* Return nonzero if the given thread is still alive. */ -int -mythread_alive (int pid) -{ - return 1; -} - -/* Wait for process, returns status */ - -unsigned char -mywait (char *status) -{ - int pid; - union wait w; - - enable_async_io (); - pid = waitpid (inferior_pid, &w, 0); - disable_async_io (); - if (pid != inferior_pid) - perror_with_name ("wait"); - - if (WIFEXITED (w)) - { - fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w)); - *status = 'W'; - return ((unsigned char) WEXITSTATUS (w)); - } - else if (!WIFSTOPPED (w)) - { - fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w)); - *status = 'X'; - return ((unsigned char) WTERMSIG (w)); - } - - fetch_inferior_registers (0); - - *status = 'T'; - return ((unsigned char) WSTOPSIG (w)); -} - -/* Resume execution of the inferior process. - If STEP is nonzero, single-step it. - If SIGNAL is nonzero, give it that signal. */ - -void -myresume (int step, int signal) -{ - errno = 0; - ptrace (step ? PT_STEP : PT_CONTINUE, inferior_pid, 1, signal, 0); - if (errno) - perror_with_name ("ptrace"); -} - - -#if !defined (offsetof) -#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) -#endif - -/* U_REGS_OFFSET is the offset of the registers within the u area. */ -#if !defined (U_REGS_OFFSET) -#define U_REGS_OFFSET \ - ptrace (PT_READ_U, inferior_pid, \ - (PTRACE_ARG3_TYPE) (offsetof (struct user, u_ar0)), 0) \ - - KERNEL_U_ADDR -#endif - -CORE_ADDR -register_addr (int regno, CORE_ADDR blockend) -{ - CORE_ADDR addr; - - if (regno < 0 || regno >= NUM_REGS) - error ("Invalid register number %d.", regno); - - REGISTER_U_ADDR (addr, blockend, regno); - - return addr; -} - -/* Fetch one register. */ - -static void -fetch_register (int regno) -{ - register unsigned int regaddr; - char buf[MAX_REGISTER_RAW_SIZE]; - register int i; - - /* Offset of registers within the u area. */ - unsigned int offset; - - offset = U_REGS_OFFSET; - - regaddr = register_addr (regno, offset); - for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) - { - errno = 0; - *(int *) ®isters[regno * 4 + i] = ptrace (PT_RUREGS, inferior_pid, - (PTRACE_ARG3_TYPE) regaddr, 0, 0); - regaddr += sizeof (int); - if (errno != 0) - { - /* Warning, not error, in case we are attached; sometimes the - kernel doesn't let us at the registers. */ - char *err = strerror (errno); - char *msg = alloca (strlen (err) + 128); - sprintf (msg, "reading register %d: %s", regno, err); - error (msg); - goto error_exit; - } - } -error_exit:; -} - -/* Fetch all registers, or just one, from the child process. */ - -void -fetch_inferior_registers (int regno) -{ - if (regno == -1 || regno == 0) - for (regno = 0; regno < NUM_REGS; regno++) - fetch_register (regno); - else - fetch_register (regno); -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ - -void -store_inferior_registers (int regno) -{ - register unsigned int regaddr; - char buf[80]; - extern char registers[]; - register int i; - unsigned int offset = U_REGS_OFFSET; - int scratch; - - if (regno >= 0) - { - if (CANNOT_STORE_REGISTER (regno)) - return; - regaddr = register_addr (regno, offset); - errno = 0; - if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM) - { - scratch = *(int *) ®isters[REGISTER_BYTE (regno)] | 0x3; - ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, - scratch, 0); - if (errno != 0) - { - /* Error, even if attached. Failing to write these two - registers is pretty serious. */ - sprintf (buf, "writing register number %d", regno); - perror_with_name (buf); - } - } - else - for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) - { - errno = 0; - ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, - *(int *) ®isters[REGISTER_BYTE (regno) + i], 0); - if (errno != 0) - { - /* Warning, not error, in case we are attached; sometimes the - kernel doesn't let us at the registers. */ - char *err = strerror (errno); - char *msg = alloca (strlen (err) + 128); - sprintf (msg, "writing register %d: %s", - regno, err); - error (msg); - return; - } - regaddr += sizeof (int); - } - } - else - for (regno = 0; regno < NUM_REGS; regno++) - store_inferior_registers (regno); -} - -/* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory - in the NEW_SUN_PTRACE case. - It ought to be straightforward. But it appears that writing did - not write the data that I specified. I cannot understand where - it got the data that it actually did write. */ - -/* Copy LEN bytes from inferior's memory starting at MEMADDR - to debugger memory starting at MYADDR. */ - -void -read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int); - /* Allocate buffer of that many longwords. */ - register int *buffer = (int *) alloca (count * sizeof (int)); - - /* Read all the longwords */ - for (i = 0; i < count; i++, addr += sizeof (int)) - { - buffer[i] = ptrace (1, inferior_pid, addr, 0, 0); - } - - /* Copy appropriate bytes out of the buffer. */ - memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len); -} - -/* Copy LEN bytes of data from debugger memory at MYADDR - to inferior's memory at MEMADDR. - On failure (cannot write the inferior) - returns the value of errno. */ - -int -write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int); - /* Allocate buffer of that many longwords. */ - register int *buffer = (int *) alloca (count * sizeof (int)); - extern int errno; - - /* Fill start and end extra bytes of buffer with existing memory data. */ - - buffer[0] = ptrace (1, inferior_pid, addr, 0, 0); - - if (count > 1) - { - buffer[count - 1] - = ptrace (1, inferior_pid, - addr + (count - 1) * sizeof (int), 0, 0); - } - - /* Copy data to be written over corresponding part of buffer */ - - memcpy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len); - - /* Write the entire buffer. */ - - for (i = 0; i < count; i++, addr += sizeof (int)) - { - errno = 0; - ptrace (4, inferior_pid, addr, buffer[i], 0); - if (errno) - return errno; - } - - return 0; -} - -void -initialize_low (void) -{ -} diff --git a/gdb/gdbserver/low-lynx.c b/gdb/gdbserver/low-lynx.c deleted file mode 100644 index 90e18db5e39..00000000000 --- a/gdb/gdbserver/low-lynx.c +++ /dev/null @@ -1,745 +0,0 @@ -/* Low level interface to ptrace, for the remote server for GDB. - Copyright 1986, 1987, 1993, 1994, 1995, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "server.h" -#include "frame.h" -#include "inferior.h" - -#include -#include -#include -#define LYNXOS -#include -#include -#include -#include -#ifndef __LYNXOS -#define __LYNXOS -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static char my_registers[REGISTER_BYTES]; -char *registers = my_registers; - -#include - -/* Start an inferior process and returns its pid. - ALLARGS is a vector of program-name and args. */ - -int -create_inferior (char *program, char **allargs) -{ - int pid; - - pid = fork (); - if (pid < 0) - perror_with_name ("fork"); - - if (pid == 0) - { - int pgrp; - - /* Switch child to it's own process group so that signals won't - directly affect gdbserver. */ - - pgrp = getpid (); - setpgrp (0, pgrp); - ioctl (0, TIOCSPGRP, &pgrp); - - ptrace (PTRACE_TRACEME, 0, (PTRACE_ARG3_TYPE) 0, 0); - - execv (program, allargs); - - fprintf (stderr, "GDBserver (process %d): Cannot exec %s: %s.\n", - getpid (), program, - errno < sys_nerr ? sys_errlist[errno] : "unknown error"); - fflush (stderr); - _exit (0177); - } - - return pid; -} - -/* Attaching is not supported. */ -int -myattach (int pid) -{ - return -1; -} - -/* Kill the inferior process. Make us have no inferior. */ - -void -kill_inferior (void) -{ - if (inferior_pid == 0) - return; - ptrace (PTRACE_KILL, inferior_pid, 0, 0); - wait (0); - - inferior_pid = 0; -} - -/* Return nonzero if the given thread is still alive. */ -int -mythread_alive (int pid) -{ - /* Arggh. Apparently pthread_kill only works for threads within - the process that calls pthread_kill. - - We want to avoid the lynx signal extensions as they simply don't - map well to the generic gdb interface we want to keep. - - All we want to do is determine if a particular thread is alive; - it appears as if we can just make a harmless thread specific - ptrace call to do that. */ - return (ptrace (PTRACE_THREADUSER, - BUILDPID (PIDGET (inferior_pid), pid), 0, 0) != -1); -} - -/* Wait for process, returns status */ - -unsigned char -mywait (char *status) -{ - int pid; - union wait w; - - while (1) - { - enable_async_io (); - - pid = wait (&w); - - disable_async_io (); - - if (pid != PIDGET (inferior_pid)) - perror_with_name ("wait"); - - thread_from_wait = w.w_tid; - inferior_pid = BUILDPID (inferior_pid, w.w_tid); - - if (WIFSTOPPED (w) - && WSTOPSIG (w) == SIGTRAP) - { - int realsig; - - realsig = ptrace (PTRACE_GETTRACESIG, inferior_pid, - (PTRACE_ARG3_TYPE) 0, 0); - - if (realsig == SIGNEWTHREAD) - { - /* It's a new thread notification. Nothing to do here since - the machine independent code in wait_for_inferior will - add the thread to the thread list and restart the thread - when pid != inferior_pid and pid is not in the thread list. - We don't even want to muck with realsig -- the code in - wait_for_inferior expects SIGTRAP. */ - ; - } - } - break; - } - - if (WIFEXITED (w)) - { - *status = 'W'; - return ((unsigned char) WEXITSTATUS (w)); - } - else if (!WIFSTOPPED (w)) - { - *status = 'X'; - return ((unsigned char) WTERMSIG (w)); - } - - fetch_inferior_registers (0); - - *status = 'T'; - return ((unsigned char) WSTOPSIG (w)); -} - -/* Resume execution of the inferior process. - If STEP is nonzero, single-step it. - If SIGNAL is nonzero, give it that signal. */ - -void -myresume (int step, int signal) -{ - errno = 0; - ptrace (step ? PTRACE_SINGLESTEP_ONE : PTRACE_CONT, - BUILDPID (inferior_pid, cont_thread == -1 ? 0 : cont_thread), - 1, signal); - if (errno) - perror_with_name ("ptrace"); -} - -#undef offsetof -#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) - -/* Mapping between GDB register #s and offsets into econtext. Must be - consistent with REGISTER_NAMES macro in various tmXXX.h files. */ - -#define X(ENTRY)(offsetof(struct econtext, ENTRY)) - -#ifdef I386 -/* Mappings from tm-i386v.h */ - -static int regmap[] = -{ - X (eax), - X (ecx), - X (edx), - X (ebx), - X (esp), /* sp */ - X (ebp), /* fp */ - X (esi), - X (edi), - X (eip), /* pc */ - X (flags), /* ps */ - X (cs), - X (ss), - X (ds), - X (es), - X (ecode), /* Lynx doesn't give us either fs or gs, so */ - X (fault), /* we just substitute these two in the hopes - that they are useful. */ -}; -#endif - -#ifdef M68K -/* Mappings from tm-m68k.h */ - -static int regmap[] = -{ - X (regs[0]), /* d0 */ - X (regs[1]), /* d1 */ - X (regs[2]), /* d2 */ - X (regs[3]), /* d3 */ - X (regs[4]), /* d4 */ - X (regs[5]), /* d5 */ - X (regs[6]), /* d6 */ - X (regs[7]), /* d7 */ - X (regs[8]), /* a0 */ - X (regs[9]), /* a1 */ - X (regs[10]), /* a2 */ - X (regs[11]), /* a3 */ - X (regs[12]), /* a4 */ - X (regs[13]), /* a5 */ - X (regs[14]), /* fp */ - 0, /* sp */ - X (status), /* ps */ - X (pc), - - X (fregs[0 * 3]), /* fp0 */ - X (fregs[1 * 3]), /* fp1 */ - X (fregs[2 * 3]), /* fp2 */ - X (fregs[3 * 3]), /* fp3 */ - X (fregs[4 * 3]), /* fp4 */ - X (fregs[5 * 3]), /* fp5 */ - X (fregs[6 * 3]), /* fp6 */ - X (fregs[7 * 3]), /* fp7 */ - - X (fcregs[0]), /* fpcontrol */ - X (fcregs[1]), /* fpstatus */ - X (fcregs[2]), /* fpiaddr */ - X (ssw), /* fpcode */ - X (fault), /* fpflags */ -}; -#endif - -#ifdef SPARC -/* Mappings from tm-sparc.h */ - -#define FX(ENTRY)(offsetof(struct fcontext, ENTRY)) - -static int regmap[] = -{ - -1, /* g0 */ - X (g1), - X (g2), - X (g3), - X (g4), - -1, /* g5->g7 aren't saved by Lynx */ - -1, - -1, - - X (o[0]), - X (o[1]), - X (o[2]), - X (o[3]), - X (o[4]), - X (o[5]), - X (o[6]), /* sp */ - X (o[7]), /* ra */ - - -1, -1, -1, -1, -1, -1, -1, -1, /* l0 -> l7 */ - - -1, -1, -1, -1, -1, -1, -1, -1, /* i0 -> i7 */ - - FX (f.fregs[0]), /* f0 */ - FX (f.fregs[1]), - FX (f.fregs[2]), - FX (f.fregs[3]), - FX (f.fregs[4]), - FX (f.fregs[5]), - FX (f.fregs[6]), - FX (f.fregs[7]), - FX (f.fregs[8]), - FX (f.fregs[9]), - FX (f.fregs[10]), - FX (f.fregs[11]), - FX (f.fregs[12]), - FX (f.fregs[13]), - FX (f.fregs[14]), - FX (f.fregs[15]), - FX (f.fregs[16]), - FX (f.fregs[17]), - FX (f.fregs[18]), - FX (f.fregs[19]), - FX (f.fregs[20]), - FX (f.fregs[21]), - FX (f.fregs[22]), - FX (f.fregs[23]), - FX (f.fregs[24]), - FX (f.fregs[25]), - FX (f.fregs[26]), - FX (f.fregs[27]), - FX (f.fregs[28]), - FX (f.fregs[29]), - FX (f.fregs[30]), - FX (f.fregs[31]), - - X (y), - X (psr), - X (wim), - X (tbr), - X (pc), - X (npc), - FX (fsr), /* fpsr */ - -1, /* cpsr */ -}; -#endif - -#ifdef SPARC - -/* This routine handles some oddball cases for Sparc registers and LynxOS. - In partucular, it causes refs to G0, g5->7, and all fp regs to return zero. - It also handles knows where to find the I & L regs on the stack. */ - -void -fetch_inferior_registers (int regno) -{ -#if 0 - int whatregs = 0; - -#define WHATREGS_FLOAT 1 -#define WHATREGS_GEN 2 -#define WHATREGS_STACK 4 - - if (regno == -1) - whatregs = WHATREGS_FLOAT | WHATREGS_GEN | WHATREGS_STACK; - else if (regno >= L0_REGNUM && regno <= I7_REGNUM) - whatregs = WHATREGS_STACK; - else if (regno >= FP0_REGNUM && regno < FP0_REGNUM + 32) - whatregs = WHATREGS_FLOAT; - else - whatregs = WHATREGS_GEN; - - if (whatregs & WHATREGS_GEN) - { - struct econtext ec; /* general regs */ - char buf[MAX_REGISTER_RAW_SIZE]; - int retval; - int i; - - errno = 0; - retval = ptrace (PTRACE_GETREGS, - BUILDPID (inferior_pid, general_thread), - (PTRACE_ARG3_TYPE) & ec, - 0); - if (errno) - perror_with_name ("Sparc fetch_inferior_registers(ptrace)"); - - memset (buf, 0, REGISTER_RAW_SIZE (G0_REGNUM)); - supply_register (G0_REGNUM, buf); - supply_register (TBR_REGNUM, (char *) &ec.tbr); - - memcpy (®isters[REGISTER_BYTE (G1_REGNUM)], &ec.g1, - 4 * REGISTER_RAW_SIZE (G1_REGNUM)); - for (i = G1_REGNUM; i <= G1_REGNUM + 3; i++) - register_valid[i] = 1; - - supply_register (PS_REGNUM, (char *) &ec.psr); - supply_register (Y_REGNUM, (char *) &ec.y); - supply_register (PC_REGNUM, (char *) &ec.pc); - supply_register (NPC_REGNUM, (char *) &ec.npc); - supply_register (WIM_REGNUM, (char *) &ec.wim); - - memcpy (®isters[REGISTER_BYTE (O0_REGNUM)], ec.o, - 8 * REGISTER_RAW_SIZE (O0_REGNUM)); - for (i = O0_REGNUM; i <= O0_REGNUM + 7; i++) - register_valid[i] = 1; - } - - if (whatregs & WHATREGS_STACK) - { - CORE_ADDR sp; - int i; - - sp = read_register (SP_REGNUM); - - target_xfer_memory (sp + FRAME_SAVED_I0, - ®isters[REGISTER_BYTE (I0_REGNUM)], - 8 * REGISTER_RAW_SIZE (I0_REGNUM), 0); - for (i = I0_REGNUM; i <= I7_REGNUM; i++) - register_valid[i] = 1; - - target_xfer_memory (sp + FRAME_SAVED_L0, - ®isters[REGISTER_BYTE (L0_REGNUM)], - 8 * REGISTER_RAW_SIZE (L0_REGNUM), 0); - for (i = L0_REGNUM; i <= L0_REGNUM + 7; i++) - register_valid[i] = 1; - } - - if (whatregs & WHATREGS_FLOAT) - { - struct fcontext fc; /* fp regs */ - int retval; - int i; - - errno = 0; - retval = ptrace (PTRACE_GETFPREGS, BUILDPID (inferior_pid, general_thread), (PTRACE_ARG3_TYPE) & fc, - 0); - if (errno) - perror_with_name ("Sparc fetch_inferior_registers(ptrace)"); - - memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], fc.f.fregs, - 32 * REGISTER_RAW_SIZE (FP0_REGNUM)); - for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++) - register_valid[i] = 1; - - supply_register (FPS_REGNUM, (char *) &fc.fsr); - } -#endif -} - -/* This routine handles storing of the I & L regs for the Sparc. The trick - here is that they actually live on the stack. The really tricky part is - that when changing the stack pointer, the I & L regs must be written to - where the new SP points, otherwise the regs will be incorrect when the - process is started up again. We assume that the I & L regs are valid at - this point. */ - -void -store_inferior_registers (int regno) -{ -#if 0 - int whatregs = 0; - - if (regno == -1) - whatregs = WHATREGS_FLOAT | WHATREGS_GEN | WHATREGS_STACK; - else if (regno >= L0_REGNUM && regno <= I7_REGNUM) - whatregs = WHATREGS_STACK; - else if (regno >= FP0_REGNUM && regno < FP0_REGNUM + 32) - whatregs = WHATREGS_FLOAT; - else if (regno == SP_REGNUM) - whatregs = WHATREGS_STACK | WHATREGS_GEN; - else - whatregs = WHATREGS_GEN; - - if (whatregs & WHATREGS_GEN) - { - struct econtext ec; /* general regs */ - int retval; - - ec.tbr = read_register (TBR_REGNUM); - memcpy (&ec.g1, ®isters[REGISTER_BYTE (G1_REGNUM)], - 4 * REGISTER_RAW_SIZE (G1_REGNUM)); - - ec.psr = read_register (PS_REGNUM); - ec.y = read_register (Y_REGNUM); - ec.pc = read_register (PC_REGNUM); - ec.npc = read_register (NPC_REGNUM); - ec.wim = read_register (WIM_REGNUM); - - memcpy (ec.o, ®isters[REGISTER_BYTE (O0_REGNUM)], - 8 * REGISTER_RAW_SIZE (O0_REGNUM)); - - errno = 0; - retval = ptrace (PTRACE_SETREGS, BUILDPID (inferior_pid, general_thread), (PTRACE_ARG3_TYPE) & ec, - 0); - if (errno) - perror_with_name ("Sparc fetch_inferior_registers(ptrace)"); - } - - if (whatregs & WHATREGS_STACK) - { - int regoffset; - CORE_ADDR sp; - - sp = read_register (SP_REGNUM); - - if (regno == -1 || regno == SP_REGNUM) - { - if (!register_valid[L0_REGNUM + 5]) - abort (); - target_xfer_memory (sp + FRAME_SAVED_I0, - ®isters[REGISTER_BYTE (I0_REGNUM)], - 8 * REGISTER_RAW_SIZE (I0_REGNUM), 1); - - target_xfer_memory (sp + FRAME_SAVED_L0, - ®isters[REGISTER_BYTE (L0_REGNUM)], - 8 * REGISTER_RAW_SIZE (L0_REGNUM), 1); - } - else if (regno >= L0_REGNUM && regno <= I7_REGNUM) - { - if (!register_valid[regno]) - abort (); - if (regno >= L0_REGNUM && regno <= L0_REGNUM + 7) - regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM) - + FRAME_SAVED_L0; - else - regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (I0_REGNUM) - + FRAME_SAVED_I0; - target_xfer_memory (sp + regoffset, ®isters[REGISTER_BYTE (regno)], - REGISTER_RAW_SIZE (regno), 1); - } - } - - if (whatregs & WHATREGS_FLOAT) - { - struct fcontext fc; /* fp regs */ - int retval; - -/* We read fcontext first so that we can get good values for fq_t... */ - errno = 0; - retval = ptrace (PTRACE_GETFPREGS, BUILDPID (inferior_pid, general_thread), (PTRACE_ARG3_TYPE) & fc, - 0); - if (errno) - perror_with_name ("Sparc fetch_inferior_registers(ptrace)"); - - memcpy (fc.f.fregs, ®isters[REGISTER_BYTE (FP0_REGNUM)], - 32 * REGISTER_RAW_SIZE (FP0_REGNUM)); - - fc.fsr = read_register (FPS_REGNUM); - - errno = 0; - retval = ptrace (PTRACE_SETFPREGS, BUILDPID (inferior_pid, general_thread), (PTRACE_ARG3_TYPE) & fc, - 0); - if (errno) - perror_with_name ("Sparc fetch_inferior_registers(ptrace)"); - } -#endif -} -#endif /* SPARC */ - -#ifndef SPARC - -/* Return the offset relative to the start of the per-thread data to the - saved context block. */ - -static unsigned long -lynx_registers_addr (void) -{ - CORE_ADDR stblock; - int ecpoff = offsetof (st_t, ecp); - CORE_ADDR ecp; - - errno = 0; - stblock = (CORE_ADDR) ptrace (PTRACE_THREADUSER, BUILDPID (inferior_pid, general_thread), - (PTRACE_ARG3_TYPE) 0, 0); - if (errno) - perror_with_name ("PTRACE_THREADUSER"); - - ecp = (CORE_ADDR) ptrace (PTRACE_PEEKTHREAD, BUILDPID (inferior_pid, general_thread), - (PTRACE_ARG3_TYPE) ecpoff, 0); - if (errno) - perror_with_name ("lynx_registers_addr(PTRACE_PEEKTHREAD)"); - - return ecp - stblock; -} - -/* Fetch one or more registers from the inferior. REGNO == -1 to get - them all. We actually fetch more than requested, when convenient, - marking them as valid so we won't fetch them again. */ - -void -fetch_inferior_registers (int ignored) -{ - int regno; - unsigned long reg; - unsigned long ecp; - - ecp = lynx_registers_addr (); - - for (regno = 0; regno < NUM_REGS; regno++) - { - int ptrace_fun = PTRACE_PEEKTHREAD; - -#ifdef PTRACE_PEEKUSP - ptrace_fun = regno == SP_REGNUM ? PTRACE_PEEKUSP : PTRACE_PEEKTHREAD; -#endif - - errno = 0; - reg = ptrace (ptrace_fun, BUILDPID (inferior_pid, general_thread), - (PTRACE_ARG3_TYPE) (ecp + regmap[regno]), 0); - if (errno) - perror_with_name ("fetch_inferior_registers(PTRACE_PEEKTHREAD)"); - - *(unsigned long *) ®isters[REGISTER_BYTE (regno)] = reg; - } -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ - -void -store_inferior_registers (int ignored) -{ - int regno; - unsigned long reg; - unsigned long ecp; - - ecp = lynx_registers_addr (); - - for (regno = 0; regno < NUM_REGS; regno++) - { - int ptrace_fun = PTRACE_POKEUSER; - -#ifdef PTRACE_POKEUSP - ptrace_fun = regno == SP_REGNUM ? PTRACE_POKEUSP : PTRACE_POKEUSER; -#endif - - reg = *(unsigned long *) ®isters[REGISTER_BYTE (regno)]; - - errno = 0; - ptrace (ptrace_fun, BUILDPID (inferior_pid, general_thread), - (PTRACE_ARG3_TYPE) (ecp + regmap[regno]), reg); - if (errno) - perror_with_name ("PTRACE_POKEUSER"); - } -} - -#endif /* ! SPARC */ - -/* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory - in the NEW_SUN_PTRACE case. - It ought to be straightforward. But it appears that writing did - not write the data that I specified. I cannot understand where - it got the data that it actually did write. */ - -/* Copy LEN bytes from inferior's memory starting at MEMADDR - to debugger memory starting at MYADDR. */ - -void -read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int); - /* Allocate buffer of that many longwords. */ - register int *buffer = (int *) alloca (count * sizeof (int)); - - /* Read all the longwords */ - for (i = 0; i < count; i++, addr += sizeof (int)) - { - buffer[i] = ptrace (PTRACE_PEEKTEXT, BUILDPID (inferior_pid, general_thread), addr, 0); - } - - /* Copy appropriate bytes out of the buffer. */ - memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len); -} - -/* Copy LEN bytes of data from debugger memory at MYADDR - to inferior's memory at MEMADDR. - On failure (cannot write the inferior) - returns the value of errno. */ - -int -write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int); - /* Allocate buffer of that many longwords. */ - register int *buffer = (int *) alloca (count * sizeof (int)); - extern int errno; - - /* Fill start and end extra bytes of buffer with existing memory data. */ - - buffer[0] = ptrace (PTRACE_PEEKTEXT, BUILDPID (inferior_pid, general_thread), addr, 0); - - if (count > 1) - { - buffer[count - 1] - = ptrace (PTRACE_PEEKTEXT, BUILDPID (inferior_pid, general_thread), - addr + (count - 1) * sizeof (int), 0); - } - - /* Copy data to be written over corresponding part of buffer */ - - memcpy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len); - - /* Write the entire buffer. */ - - for (i = 0; i < count; i++, addr += sizeof (int)) - { - while (1) - { - errno = 0; - ptrace (PTRACE_POKETEXT, BUILDPID (inferior_pid, general_thread), addr, buffer[i]); - if (errno) - { - fprintf (stderr, "\ -ptrace (PTRACE_POKETEXT): errno=%d, pid=0x%x, addr=0x%x, buffer[i] = 0x%x\n", - errno, BUILDPID (inferior_pid, general_thread), - addr, buffer[i]); - fprintf (stderr, "Sleeping for 1 second\n"); - sleep (1); - } - else - break; - } - } - - return 0; -} - -void -initialize_low (void) -{ -} diff --git a/gdb/gdbserver/low-nbsd.c b/gdb/gdbserver/low-nbsd.c deleted file mode 100644 index 8bec0d98e57..00000000000 --- a/gdb/gdbserver/low-nbsd.c +++ /dev/null @@ -1,599 +0,0 @@ -/* Low level interface to ptrace, for the remote server for GDB. - Copyright 1986, 1987, 1993, 2000, 2001, 2002 Free Software Foundation, Inc. - -This file is part of GDB. - -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. */ - -#include "server.h" -#include -#include -#include "frame.h" -#include "inferior.h" - -#include -#include - -/***************Begin MY defs*********************/ -static char my_registers[REGISTER_BYTES]; -char *registers = my_registers; -/***************End MY defs*********************/ - -#include -#include - -#define RF(dst, src) \ - memcpy(®isters[REGISTER_BYTE(dst)], &src, sizeof(src)) - -#define RS(src, dst) \ - memcpy(&dst, ®isters[REGISTER_BYTE(src)], sizeof(dst)) - -#ifdef __i386__ -struct env387 - { - unsigned short control; - unsigned short r0; - unsigned short status; - unsigned short r1; - unsigned short tag; - unsigned short r2; - unsigned long eip; - unsigned short code_seg; - unsigned short opcode; - unsigned long operand; - unsigned short operand_seg; - unsigned short r3; - unsigned char regs[8][10]; - }; - -/* i386_register_raw_size[i] is the number of bytes of storage in the - actual machine representation for register i. */ -int i386_register_raw_size[MAX_NUM_REGS] = { - 4, 4, 4, 4, - 4, 4, 4, 4, - 4, 4, 4, 4, - 4, 4, 4, 4, - 10, 10, 10, 10, - 10, 10, 10, 10, - 4, 4, 4, 4, - 4, 4, 4, 4, - 16, 16, 16, 16, - 16, 16, 16, 16, - 4 -}; - -int i386_register_byte[MAX_NUM_REGS]; - -static void -initialize_arch (void) -{ - /* Initialize the table saying where each register starts in the - register file. */ - { - int i, offset; - - offset = 0; - for (i = 0; i < MAX_NUM_REGS; i++) - { - i386_register_byte[i] = offset; - offset += i386_register_raw_size[i]; - } - } -} -#endif /* !__i386__ */ - -#ifdef __m68k__ -static void -initialize_arch (void) -{ -} -#endif /* !__m68k__ */ - -#ifdef __ns32k__ -static void -initialize_arch (void) -{ -} -#endif /* !__ns32k__ */ - -#ifdef __powerpc__ -#include "ppc-tdep.h" - -static void -initialize_arch (void) -{ -} -#endif /* !__powerpc__ */ - - -/* Start an inferior process and returns its pid. - ALLARGS is a vector of program-name and args. */ - -int -create_inferior (char *program, char **allargs) -{ - int pid; - - pid = fork (); - if (pid < 0) - perror_with_name ("fork"); - - if (pid == 0) - { - ptrace (PT_TRACE_ME, 0, 0, 0); - - execv (program, allargs); - - fprintf (stderr, "Cannot exec %s: %s.\n", program, - errno < sys_nerr ? sys_errlist[errno] : "unknown error"); - fflush (stderr); - _exit (0177); - } - - return pid; -} - -/* Attaching is not supported. */ -int -myattach (int pid) -{ - return -1; -} - -/* Kill the inferior process. Make us have no inferior. */ - -void -kill_inferior (void) -{ - if (inferior_pid == 0) - return; - ptrace (PT_KILL, inferior_pid, 0, 0); - wait (0); - /*************inferior_died ();****VK**************/ -} - -/* Return nonzero if the given thread is still alive. */ -int -mythread_alive (int pid) -{ - return 1; -} - -/* Wait for process, returns status */ - -unsigned char -mywait (char *status) -{ - int pid; - int w; - - enable_async_io (); - pid = waitpid (inferior_pid, &w, 0); - disable_async_io (); - if (pid != inferior_pid) - perror_with_name ("wait"); - - if (WIFEXITED (w)) - { - fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w)); - *status = 'W'; - return ((unsigned char) WEXITSTATUS (w)); - } - else if (!WIFSTOPPED (w)) - { - fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w)); - *status = 'X'; - return ((unsigned char) WTERMSIG (w)); - } - - fetch_inferior_registers (0); - - *status = 'T'; - return ((unsigned char) WSTOPSIG (w)); -} - -/* Resume execution of the inferior process. - If STEP is nonzero, single-step it. - If SIGNAL is nonzero, give it that signal. */ - -void -myresume (int step, int signal) -{ - errno = 0; - ptrace (step ? PT_STEP : PT_CONTINUE, inferior_pid, - (PTRACE_ARG3_TYPE) 1, signal); - if (errno) - perror_with_name ("ptrace"); -} - - -#ifdef __i386__ -/* Fetch one or more registers from the inferior. REGNO == -1 to get - them all. We actually fetch more than requested, when convenient, - marking them as valid so we won't fetch them again. */ - -void -fetch_inferior_registers (int ignored) -{ - struct reg inferior_registers; - struct env387 inferior_fp_registers; - - ptrace (PT_GETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_registers, 0); - ptrace (PT_GETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0); - - RF ( 0, inferior_registers.r_eax); - RF ( 1, inferior_registers.r_ecx); - RF ( 2, inferior_registers.r_edx); - RF ( 3, inferior_registers.r_ebx); - RF ( 4, inferior_registers.r_esp); - RF ( 5, inferior_registers.r_ebp); - RF ( 6, inferior_registers.r_esi); - RF ( 7, inferior_registers.r_edi); - RF ( 8, inferior_registers.r_eip); - RF ( 9, inferior_registers.r_eflags); - RF (10, inferior_registers.r_cs); - RF (11, inferior_registers.r_ss); - RF (12, inferior_registers.r_ds); - RF (13, inferior_registers.r_es); - RF (14, inferior_registers.r_fs); - RF (15, inferior_registers.r_gs); - - RF (FP0_REGNUM, inferior_fp_registers.regs[0]); - RF (FP0_REGNUM + 1, inferior_fp_registers.regs[1]); - RF (FP0_REGNUM + 2, inferior_fp_registers.regs[2]); - RF (FP0_REGNUM + 3, inferior_fp_registers.regs[3]); - RF (FP0_REGNUM + 4, inferior_fp_registers.regs[4]); - RF (FP0_REGNUM + 5, inferior_fp_registers.regs[5]); - RF (FP0_REGNUM + 6, inferior_fp_registers.regs[6]); - RF (FP0_REGNUM + 7, inferior_fp_registers.regs[7]); - - RF (FCTRL_REGNUM, inferior_fp_registers.control); - RF (FSTAT_REGNUM, inferior_fp_registers.status); - RF (FTAG_REGNUM, inferior_fp_registers.tag); - RF (FCS_REGNUM, inferior_fp_registers.code_seg); - RF (FCOFF_REGNUM, inferior_fp_registers.eip); - RF (FDS_REGNUM, inferior_fp_registers.operand_seg); - RF (FDOFF_REGNUM, inferior_fp_registers.operand); - RF (FOP_REGNUM, inferior_fp_registers.opcode); -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ - -void -store_inferior_registers (int ignored) -{ - struct reg inferior_registers; - struct env387 inferior_fp_registers; - - RS ( 0, inferior_registers.r_eax); - RS ( 1, inferior_registers.r_ecx); - RS ( 2, inferior_registers.r_edx); - RS ( 3, inferior_registers.r_ebx); - RS ( 4, inferior_registers.r_esp); - RS ( 5, inferior_registers.r_ebp); - RS ( 6, inferior_registers.r_esi); - RS ( 7, inferior_registers.r_edi); - RS ( 8, inferior_registers.r_eip); - RS ( 9, inferior_registers.r_eflags); - RS (10, inferior_registers.r_cs); - RS (11, inferior_registers.r_ss); - RS (12, inferior_registers.r_ds); - RS (13, inferior_registers.r_es); - RS (14, inferior_registers.r_fs); - RS (15, inferior_registers.r_gs); - - RS (FP0_REGNUM, inferior_fp_registers.regs[0]); - RS (FP0_REGNUM + 1, inferior_fp_registers.regs[1]); - RS (FP0_REGNUM + 2, inferior_fp_registers.regs[2]); - RS (FP0_REGNUM + 3, inferior_fp_registers.regs[3]); - RS (FP0_REGNUM + 4, inferior_fp_registers.regs[4]); - RS (FP0_REGNUM + 5, inferior_fp_registers.regs[5]); - RS (FP0_REGNUM + 6, inferior_fp_registers.regs[6]); - RS (FP0_REGNUM + 7, inferior_fp_registers.regs[7]); - - RS (FCTRL_REGNUM, inferior_fp_registers.control); - RS (FSTAT_REGNUM, inferior_fp_registers.status); - RS (FTAG_REGNUM, inferior_fp_registers.tag); - RS (FCS_REGNUM, inferior_fp_registers.code_seg); - RS (FCOFF_REGNUM, inferior_fp_registers.eip); - RS (FDS_REGNUM, inferior_fp_registers.operand_seg); - RS (FDOFF_REGNUM, inferior_fp_registers.operand); - RS (FOP_REGNUM, inferior_fp_registers.opcode); - - ptrace (PT_SETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_registers, 0); - ptrace (PT_SETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0); -} -#endif /* !__i386__ */ - -#ifdef __m68k__ -/* Fetch one or more registers from the inferior. REGNO == -1 to get - them all. We actually fetch more than requested, when convenient, - marking them as valid so we won't fetch them again. */ - -void -fetch_inferior_registers (int regno) -{ - struct reg inferior_registers; - struct fpreg inferior_fp_registers; - - ptrace (PT_GETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_registers, 0); - memcpy (®isters[REGISTER_BYTE (0)], &inferior_registers, - sizeof (inferior_registers)); - - ptrace (PT_GETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0); - memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, - sizeof (inferior_fp_registers)); -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ - -void -store_inferior_registers (int regno) -{ - struct reg inferior_registers; - struct fpreg inferior_fp_registers; - - memcpy (&inferior_registers, ®isters[REGISTER_BYTE (0)], - sizeof (inferior_registers)); - ptrace (PT_SETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_registers, 0); - - memcpy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof (inferior_fp_registers)); - ptrace (PT_SETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0); -} -#endif /* !__m68k__ */ - - -#ifdef __ns32k__ -/* Fetch one or more registers from the inferior. REGNO == -1 to get - them all. We actually fetch more than requested, when convenient, - marking them as valid so we won't fetch them again. */ - -void -fetch_inferior_registers (int regno) -{ - struct reg inferior_registers; - struct fpreg inferior_fpregisters; - - ptrace (PT_GETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_registers, 0); - ptrace (PT_GETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_fpregisters, 0); - - RF (R0_REGNUM + 0, inferior_registers.r_r0); - RF (R0_REGNUM + 1, inferior_registers.r_r1); - RF (R0_REGNUM + 2, inferior_registers.r_r2); - RF (R0_REGNUM + 3, inferior_registers.r_r3); - RF (R0_REGNUM + 4, inferior_registers.r_r4); - RF (R0_REGNUM + 5, inferior_registers.r_r5); - RF (R0_REGNUM + 6, inferior_registers.r_r6); - RF (R0_REGNUM + 7, inferior_registers.r_r7); - - RF (SP_REGNUM, inferior_registers.r_sp); - RF (DEPRECATED_FP_REGNUM, inferior_registers.r_fp); - RF (PC_REGNUM, inferior_registers.r_pc); - RF (PS_REGNUM, inferior_registers.r_psr); - - RF (FPS_REGNUM, inferior_fpregisters.r_fsr); - RF (FP0_REGNUM + 0, inferior_fpregisters.r_freg[0]); - RF (FP0_REGNUM + 2, inferior_fpregisters.r_freg[2]); - RF (FP0_REGNUM + 4, inferior_fpregisters.r_freg[4]); - RF (FP0_REGNUM + 6, inferior_fpregisters.r_freg[6]); - RF (LP0_REGNUM + 1, inferior_fpregisters.r_freg[1]); - RF (LP0_REGNUM + 3, inferior_fpregisters.r_freg[3]); - RF (LP0_REGNUM + 5, inferior_fpregisters.r_freg[5]); - RF (LP0_REGNUM + 7, inferior_fpregisters.r_freg[7]); -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ - -void -store_inferior_registers (int regno) -{ - struct reg inferior_registers; - struct fpreg inferior_fpregisters; - - RS (R0_REGNUM + 0, inferior_registers.r_r0); - RS (R0_REGNUM + 1, inferior_registers.r_r1); - RS (R0_REGNUM + 2, inferior_registers.r_r2); - RS (R0_REGNUM + 3, inferior_registers.r_r3); - RS (R0_REGNUM + 4, inferior_registers.r_r4); - RS (R0_REGNUM + 5, inferior_registers.r_r5); - RS (R0_REGNUM + 6, inferior_registers.r_r6); - RS (R0_REGNUM + 7, inferior_registers.r_r7); - - RS (SP_REGNUM, inferior_registers.r_sp); - RS (DEPRECATED_FP_REGNUM, inferior_registers.r_fp); - RS (PC_REGNUM, inferior_registers.r_pc); - RS (PS_REGNUM, inferior_registers.r_psr); - - RS (FPS_REGNUM, inferior_fpregisters.r_fsr); - RS (FP0_REGNUM + 0, inferior_fpregisters.r_freg[0]); - RS (FP0_REGNUM + 2, inferior_fpregisters.r_freg[2]); - RS (FP0_REGNUM + 4, inferior_fpregisters.r_freg[4]); - RS (FP0_REGNUM + 6, inferior_fpregisters.r_freg[6]); - RS (LP0_REGNUM + 1, inferior_fpregisters.r_freg[1]); - RS (LP0_REGNUM + 3, inferior_fpregisters.r_freg[3]); - RS (LP0_REGNUM + 5, inferior_fpregisters.r_freg[5]); - RS (LP0_REGNUM + 7, inferior_fpregisters.r_freg[7]); - - ptrace (PT_SETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_registers, 0); - ptrace (PT_SETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_fpregisters, 0); - -} -#endif /* !__ns32k__ */ - -#ifdef __powerpc__ -/* Fetch one or more registers from the inferior. REGNO == -1 to get - them all. We actually fetch more than requested, when convenient, - marking them as valid so we won't fetch them again. */ - -void -fetch_inferior_registers (int regno) -{ - struct reg inferior_registers; -#ifdef PT_GETFPREGS - struct fpreg inferior_fp_registers; -#endif - int i; - - ptrace (PT_GETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_registers, 0); - for (i = 0; i < 32; i++) - RF (i, inferior_registers.fixreg[i]); - RF (PPC_LR_REGNUM, inferior_registers.lr); - RF (PPC_CR_REGNUM, inferior_registers.cr); - RF (PPC_XER_REGNUM, inferior_registers.xer); - RF (PPC_CTR_REGNUM, inferior_registers.ctr); - RF (PC_REGNUM, inferior_registers.pc); - -#ifdef PT_GETFPREGS - ptrace (PT_GETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0); - for (i = 0; i < 32; i++) - RF (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]); -#endif -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ - -void -store_inferior_registers (int regno) -{ - struct reg inferior_registers; -#ifdef PT_SETFPREGS - struct fpreg inferior_fp_registers; -#endif - int i; - - for (i = 0; i < 32; i++) - RS (i, inferior_registers.fixreg[i]); - RS (PPC_LR_REGNUM, inferior_registers.lr); - RS (PPC_CR_REGNUM, inferior_registers.cr); - RS (PPC_XER_REGNUM, inferior_registers.xer); - RS (PPC_CTR_REGNUM, inferior_registers.ctr); - RS (PC_REGNUM, inferior_registers.pc); - ptrace (PT_SETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_registers, 0); - -#ifdef PT_SETFPREGS - for (i = 0; i < 32; i++) - RS (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]); - ptrace (PT_SETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0); -#endif -} -#endif /* !__powerpc__ */ - -/* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory - in the NEW_SUN_PTRACE case. - It ought to be straightforward. But it appears that writing did - not write the data that I specified. I cannot understand where - it got the data that it actually did write. */ - -/* Copy LEN bytes from inferior's memory starting at MEMADDR - to debugger memory starting at MYADDR. */ - -void -read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int); - /* Allocate buffer of that many longwords. */ - register int *buffer = (int *) alloca (count * sizeof (int)); - - /* Read all the longwords */ - for (i = 0; i < count; i++, addr += sizeof (int)) - { - buffer[i] = ptrace (PT_READ_D, inferior_pid, (PTRACE_ARG3_TYPE) addr, 0); - } - - /* Copy appropriate bytes out of the buffer. */ - memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len); -} - -/* Copy LEN bytes of data from debugger memory at MYADDR - to inferior's memory at MEMADDR. - On failure (cannot write the inferior) - returns the value of errno. */ - -int -write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int); - /* Allocate buffer of that many longwords. */ - register int *buffer = (int *) alloca (count * sizeof (int)); - extern int errno; - - /* Fill start and end extra bytes of buffer with existing memory data. */ - - buffer[0] = ptrace (PT_READ_D, inferior_pid, (PTRACE_ARG3_TYPE) addr, 0); - - if (count > 1) - { - buffer[count - 1] - = ptrace (PT_READ_D, inferior_pid, - (PTRACE_ARG3_TYPE) addr + (count - 1) * sizeof (int), 0); - } - - /* Copy data to be written over corresponding part of buffer */ - - memcpy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len); - - /* Write the entire buffer. */ - - for (i = 0; i < count; i++, addr += sizeof (int)) - { - errno = 0; - ptrace (PT_WRITE_D, inferior_pid, (PTRACE_ARG3_TYPE) addr, buffer[i]); - if (errno) - return errno; - } - - return 0; -} - -void -initialize_low (void) -{ - initialize_arch (); -} diff --git a/gdb/gdbserver/low-sim.c b/gdb/gdbserver/low-sim.c deleted file mode 100644 index 86a040621d9..00000000000 --- a/gdb/gdbserver/low-sim.c +++ /dev/null @@ -1,269 +0,0 @@ -/* Low level interface to simulators, for the remote server for GDB. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "server.h" -#include "bfd.h" -#include "callback.h" /* GDB simulator callback interface */ -#include "remote-sim.h" /* GDB simulator interface */ - -extern int remote_debug; - -extern host_callback default_callback; /* in sim/common/callback.c */ - -static char my_registers[REGISTER_BYTES] __attribute__ ((aligned)); -char * registers = my_registers; - -int target_byte_order; /* used by simulator */ - -/* We record the result of sim_open so we can pass it - back to the other sim_foo routines. */ -static SIM_DESC gdbsim_desc = 0; - -/* This version of "load" should be usable for any simulator that - does not support loading itself. */ - -static void -mygeneric_load (bfd *loadfile_bfd) -{ - asection *s; - - for (s = loadfile_bfd->sections; s; s = s->next) - { - if (s->flags & SEC_LOAD) - { - bfd_size_type size; - - size = bfd_get_section_size_before_reloc (s); - if (size > 0) - { - char *buffer; - bfd_vma lma; /* use load address, not virtual address */ - - buffer = xmalloc (size); - lma = s->lma; - - /* Is this really necessary? I guess it gives the user something - to look at during a long download. */ - printf ("Loading section %s, size 0x%lx lma 0x%lx\n", - bfd_get_section_name (loadfile_bfd, s), - (unsigned long) size, - (unsigned long) lma); /* chops high 32 bits. FIXME!! */ - - bfd_get_section_contents (loadfile_bfd, s, buffer, 0, size); - - write_inferior_memory (lma, buffer, size); - free (buffer); - } - } - } - - printf ("Start address 0x%lx\n", - (unsigned long) loadfile_bfd->start_address); - - /* We were doing this in remote-mips.c, I suspect it is right - for other targets too. */ - /* write_pc (loadfile_bfd->start_address); *//* FIXME!! */ -} - -int -create_inferior (char *program, char **argv) -{ - bfd *abfd; - int pid = 0; - char **new_argv; - int nargs; - - abfd = bfd_openr (program, 0); - if (!abfd) - { - fprintf (stderr, "gdbserver: can't open %s: %s\n", - program, bfd_errmsg (bfd_get_error ())); - exit (1); - } - - if (!bfd_check_format (abfd, bfd_object)) - { - fprintf (stderr, "gdbserver: unknown load format for %s: %s\n", - program, bfd_errmsg (bfd_get_error ())); - exit (1); - } - - /* Add "-E big" or "-E little" to the argument list depending on the - endianness of the program to be loaded. */ - for (nargs = 0; argv[nargs] != NULL; nargs++) /* count the args */ - ; - new_argv = alloca (sizeof (char *) * (nargs + 3)); /* allocate new args */ - for (nargs = 0; argv[nargs] != NULL; nargs++) /* copy old to new */ - new_argv[nargs] = argv[nargs]; - new_argv[nargs] = "-E"; - new_argv[nargs + 1] = bfd_big_endian (abfd) ? "big" : "little"; - new_argv[nargs + 2] = NULL; - argv = new_argv; - - /* Create an instance of the simulator. */ - default_callback.init (&default_callback); - gdbsim_desc = sim_open (SIM_OPEN_STANDALONE, &default_callback, abfd, argv); - if (gdbsim_desc == 0) - exit (1); - - /* Load the program into the simulator. */ - if (abfd) - if (sim_load (gdbsim_desc, program, NULL, 0) == SIM_RC_FAIL) - mygeneric_load (abfd); - - /* Create an inferior process in the simulator. This initializes SP. */ - sim_create_inferior (gdbsim_desc, abfd, argv, /* env */ NULL); - sim_resume (gdbsim_desc, 1, 0); /* execute one instr */ - return pid; -} - -/* Attaching is not supported. */ -int -myattach (int pid) -{ - return -1; -} - -/* Kill the inferior process. Make us have no inferior. */ - -void -kill_inferior (void) -{ - sim_close (gdbsim_desc, 0); - default_callback.shutdown (&default_callback); -} - -/* Fetch one register. */ - -static void -fetch_register (int regno) -{ - sim_fetch_register (gdbsim_desc, regno, ®isters[REGISTER_BYTE (regno)], - REGISTER_RAW_SIZE (regno)); -} - -/* Fetch all registers, or just one, from the child process. */ - -void -fetch_inferior_registers (int regno) -{ - if (regno == -1 || regno == 0) - for (regno = 0; regno < NUM_REGS /*-NUM_FREGS*/ ; regno++) - fetch_register (regno); - else - fetch_register (regno); -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ - -void -store_inferior_registers (int regno) -{ - if (regno == -1) - { - for (regno = 0; regno < NUM_REGS; regno++) - store_inferior_registers (regno); - } - else - sim_store_register (gdbsim_desc, regno, ®isters[REGISTER_BYTE (regno)], - REGISTER_RAW_SIZE (regno)); -} - -/* Return nonzero if the given thread is still alive. */ -int -mythread_alive (int pid) -{ - return 1; -} - -/* Wait for process, returns status */ - -unsigned char -mywait (char *status) -{ - int sigrc; - enum sim_stop reason; - - sim_stop_reason (gdbsim_desc, &reason, &sigrc); - switch (reason) - { - case sim_exited: - if (remote_debug) - printf ("\nChild exited with retcode = %x \n", sigrc); - *status = 'W'; - return sigrc; - -#if 0 - case sim_stopped: - if (remote_debug) - printf ("\nChild terminated with signal = %x \n", sigrc); - *status = 'X'; - return sigrc; -#endif - - default: /* should this be sim_signalled or sim_stopped? FIXME!! */ - if (remote_debug) - printf ("\nChild received signal = %x \n", sigrc); - fetch_inferior_registers (0); - *status = 'T'; - return (unsigned char) sigrc; - } -} - -/* Resume execution of the inferior process. - If STEP is nonzero, single-step it. - If SIGNAL is nonzero, give it that signal. */ - -void -myresume (int step, int signo) -{ - /* Should be using target_signal_to_host() or signal numbers in target.h - to convert GDB signal number to target signal number. */ - sim_resume (gdbsim_desc, step, signo); -} - -/* Copy LEN bytes from inferior's memory starting at MEMADDR - to debugger memory starting at MYADDR. */ - -void -read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - sim_read (gdbsim_desc, memaddr, myaddr, len); -} - -/* Copy LEN bytes of data from debugger memory at MYADDR - to inferior's memory at MEMADDR. - On failure (cannot write the inferior) - returns the value of errno. */ - -int -write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - sim_write (gdbsim_desc, memaddr, myaddr, len); /* should check for error. FIXME!! */ - return 0; -} - -void -initialize_low (void) -{ -} diff --git a/gdb/gdbserver/low-sparc.c b/gdb/gdbserver/low-sparc.c deleted file mode 100644 index 4b03140e128..00000000000 --- a/gdb/gdbserver/low-sparc.c +++ /dev/null @@ -1,314 +0,0 @@ -/* Low level interface to ptrace, for the remote server for GDB. - Copyright 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "server.h" -#include -#include "frame.h" -#include "inferior.h" -/*************************** -#include "initialize.h" -****************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -/***************Begin MY defs*********************/ -static char my_registers[REGISTER_BYTES]; -char *registers = my_registers; -/***************End MY defs*********************/ - -#include -#include - -extern int sys_nerr; -extern char **sys_errlist; -extern int errno; - -/* Start an inferior process and returns its pid. - ALLARGS is a vector of program-name and args. */ - -int -create_inferior (char *program, char **allargs) -{ - int pid; - - pid = fork (); - if (pid < 0) - perror_with_name ("fork"); - - if (pid == 0) - { - ptrace (PTRACE_TRACEME); - - execv (program, allargs); - - fprintf (stderr, "Cannot exec %s: %s.\n", program, - errno < sys_nerr ? sys_errlist[errno] : "unknown error"); - fflush (stderr); - _exit (0177); - } - - return pid; -} - -/* Attaching is not supported. */ -int -myattach (int pid) -{ - return -1; -} - -/* Kill the inferior process. Make us have no inferior. */ - -void -kill_inferior (void) -{ - if (inferior_pid == 0) - return; - ptrace (8, inferior_pid, 0, 0); - wait (0); -/*************inferior_died ();****VK**************/ -} - -/* Return nonzero if the given thread is still alive. */ -int -mythread_alive (int pid) -{ - return 1; -} - -/* Wait for process, returns status */ - -unsigned char -mywait (char *status) -{ - int pid; - union wait w; - - enable_async_io (); - pid = waitpid (inferior_pid, &w, 0); - disable_async_io (); - if (pid != inferior_pid) - perror_with_name ("wait"); - - if (WIFEXITED (w)) - { - fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w)); - *status = 'W'; - return ((unsigned char) WEXITSTATUS (w)); - } - else if (!WIFSTOPPED (w)) - { - fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w)); - *status = 'X'; - return ((unsigned char) WTERMSIG (w)); - } - - fetch_inferior_registers (0); - - *status = 'T'; - return ((unsigned char) WSTOPSIG (w)); -} - -/* Resume execution of the inferior process. - If STEP is nonzero, single-step it. - If SIGNAL is nonzero, give it that signal. */ - -void -myresume (int step, int signal) -{ - errno = 0; - ptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, inferior_pid, 1, signal); - if (errno) - perror_with_name ("ptrace"); -} - -/* Fetch one or more registers from the inferior. REGNO == -1 to get - them all. We actually fetch more than requested, when convenient, - marking them as valid so we won't fetch them again. */ - -void -fetch_inferior_registers (int ignored) -{ - struct regs inferior_registers; - struct fp_status inferior_fp_registers; - int i; - - /* Global and Out regs are fetched directly, as well as the control - registers. If we're getting one of the in or local regs, - and the stack pointer has not yet been fetched, - we have to do that first, since they're found in memory relative - to the stack pointer. */ - - if (ptrace (PTRACE_GETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_registers, 0)) - perror ("ptrace_getregs"); - - registers[REGISTER_BYTE (0)] = 0; - memcpy (®isters[REGISTER_BYTE (1)], &inferior_registers.r_g1, - 15 * REGISTER_RAW_SIZE (G0_REGNUM)); - *(int *) ®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; - *(int *) ®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc; - *(int *) ®isters[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc; - *(int *) ®isters[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y; - - /* Floating point registers */ - - if (ptrace (PTRACE_GETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_fp_registers, - 0)) - perror ("ptrace_getfpregs"); - memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, - sizeof inferior_fp_registers.fpu_fr); - - /* These regs are saved on the stack by the kernel. Only read them - all (16 ptrace calls!) if we really need them. */ - - read_inferior_memory (*(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)], - ®isters[REGISTER_BYTE (L0_REGNUM)], - 16 * REGISTER_RAW_SIZE (L0_REGNUM)); -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ - -void -store_inferior_registers (int ignored) -{ - struct regs inferior_registers; - struct fp_status inferior_fp_registers; - CORE_ADDR sp = *(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)]; - - write_inferior_memory (sp, ®isters[REGISTER_BYTE (L0_REGNUM)], - 16 * REGISTER_RAW_SIZE (L0_REGNUM)); - - memcpy (&inferior_registers.r_g1, ®isters[REGISTER_BYTE (G1_REGNUM)], - 15 * REGISTER_RAW_SIZE (G1_REGNUM)); - - inferior_registers.r_ps = - *(int *) ®isters[REGISTER_BYTE (PS_REGNUM)]; - inferior_registers.r_pc = - *(int *) ®isters[REGISTER_BYTE (PC_REGNUM)]; - inferior_registers.r_npc = - *(int *) ®isters[REGISTER_BYTE (NPC_REGNUM)]; - inferior_registers.r_y = - *(int *) ®isters[REGISTER_BYTE (Y_REGNUM)]; - - if (ptrace (PTRACE_SETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_registers, 0)) - perror ("ptrace_setregs"); - - memcpy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.fpu_fr); - - if (ptrace (PTRACE_SETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0)) - perror ("ptrace_setfpregs"); -} - -/* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory - in the NEW_SUN_PTRACE case. - It ought to be straightforward. But it appears that writing did - not write the data that I specified. I cannot understand where - it got the data that it actually did write. */ - -/* Copy LEN bytes from inferior's memory starting at MEMADDR - to debugger memory starting at MYADDR. */ - -void -read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int); - /* Allocate buffer of that many longwords. */ - register int *buffer = (int *) alloca (count * sizeof (int)); - - /* Read all the longwords */ - for (i = 0; i < count; i++, addr += sizeof (int)) - { - buffer[i] = ptrace (1, inferior_pid, addr, 0); - } - - /* Copy appropriate bytes out of the buffer. */ - memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len); -} - -/* Copy LEN bytes of data from debugger memory at MYADDR - to inferior's memory at MEMADDR. - On failure (cannot write the inferior) - returns the value of errno. */ - -int -write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int); - /* Allocate buffer of that many longwords. */ - register int *buffer = (int *) alloca (count * sizeof (int)); - extern int errno; - - /* Fill start and end extra bytes of buffer with existing memory data. */ - - buffer[0] = ptrace (1, inferior_pid, addr, 0); - - if (count > 1) - { - buffer[count - 1] - = ptrace (1, inferior_pid, - addr + (count - 1) * sizeof (int), 0); - } - - /* Copy data to be written over corresponding part of buffer */ - - bcopy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len); - - /* Write the entire buffer. */ - - for (i = 0; i < count; i++, addr += sizeof (int)) - { - errno = 0; - ptrace (4, inferior_pid, addr, buffer[i]); - if (errno) - return errno; - } - - return 0; -} - -void -initialize_low (void) -{ -} diff --git a/gdb/gdbserver/low-sun3.c b/gdb/gdbserver/low-sun3.c deleted file mode 100644 index ccaded826cc..00000000000 --- a/gdb/gdbserver/low-sun3.c +++ /dev/null @@ -1,291 +0,0 @@ -/* Low level interface to ptrace, for the remote server for GDB. - Copyright 1986, 1987, 1993, 1994, 1995, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "server.h" -#include "" -#include "frame.h" -#include "inferior.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/***************Begin MY defs*********************/ -static char my_registers[REGISTER_BYTES]; -char *registers = my_registers; -/***************End MY defs*********************/ - -#include -#include - -extern int sys_nerr; -extern char **sys_errlist; -extern int errno; - -/* Start an inferior process and returns its pid. - ALLARGS is a vector of program-name and args. */ - -int -create_inferior (char *program, char **allargs) -{ - int pid; - - pid = fork (); - if (pid < 0) - perror_with_name ("fork"); - - if (pid == 0) - { - ptrace (PTRACE_TRACEME); - - execv (program, allargs); - - fprintf (stderr, "Cannot exec %s: %s.\n", program, - errno < sys_nerr ? sys_errlist[errno] : "unknown error"); - fflush (stderr); - _exit (0177); - } - - return pid; -} - -/* Attaching is not supported. */ -int -myattach (int pid) -{ - return -1; -} - -/* Kill the inferior process. Make us have no inferior. */ - -void -kill_inferior (void) -{ - if (inferior_pid == 0) - return; - ptrace (8, inferior_pid, 0, 0); - wait (0); -/*************inferior_died ();****VK**************/ -} - -/* Return nonzero if the given thread is still alive. */ -int -mythread_alive (int pid) -{ - return 1; -} - -/* Wait for process, returns status */ - -unsigned char -mywait (char *status) -{ - int pid; - union wait w; - - pid = wait (&w); - if (pid != inferior_pid) - perror_with_name ("wait"); - - if (WIFEXITED (w)) - { - fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w)); - *status = 'W'; - return ((unsigned char) WEXITSTATUS (w)); - } - else if (!WIFSTOPPED (w)) - { - fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w)); - *status = 'X'; - return ((unsigned char) WTERMSIG (w)); - } - - fetch_inferior_registers (0); - - *status = 'T'; - return ((unsigned char) WSTOPSIG (w)); -} - -/* Resume execution of the inferior process. - If STEP is nonzero, single-step it. - If SIGNAL is nonzero, give it that signal. */ - -void -myresume (int step, int signal) -{ - errno = 0; - ptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, inferior_pid, 1, signal); - if (errno) - perror_with_name ("ptrace"); -} - -/* Fetch one or more registers from the inferior. REGNO == -1 to get - them all. We actually fetch more than requested, when convenient, - marking them as valid so we won't fetch them again. */ - -void -fetch_inferior_registers (int ignored) -{ - struct regs inferior_registers; - struct fp_status inferior_fp_registers; - - ptrace (PTRACE_GETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_registers); -#ifdef FP0_REGNUM - ptrace (PTRACE_GETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_fp_registers); -#endif - - memcpy (registers, &inferior_registers, 16 * 4); -#ifdef FP0_REGNUM - memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, - sizeof inferior_fp_registers.fps_regs); -#endif - *(int *) ®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; - *(int *) ®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc; -#ifdef FP0_REGNUM - memcpy - (®isters[REGISTER_BYTE (FPC_REGNUM)], - &inferior_fp_registers.fps_control, - sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs); -#endif -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ - -void -store_inferior_registers (int ignored) -{ - struct regs inferior_registers; - struct fp_status inferior_fp_registers; - - memcpy (&inferior_registers, registers, 16 * 4); -#ifdef FP0_REGNUM - memcpy (&inferior_fp_registers, - ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.fps_regs); -#endif - inferior_registers.r_ps = *(int *) ®isters[REGISTER_BYTE (PS_REGNUM)]; - inferior_registers.r_pc = *(int *) ®isters[REGISTER_BYTE (PC_REGNUM)]; - -#ifdef FP0_REGNUM - memcpy (&inferior_fp_registers.fps_control, - ®isters[REGISTER_BYTE (FPC_REGNUM)], - (sizeof inferior_fp_registers - - sizeof inferior_fp_registers.fps_regs)); -#endif - - ptrace (PTRACE_SETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_registers); -#if FP0_REGNUM - ptrace (PTRACE_SETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) & inferior_fp_registers); -#endif -} - -/* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory - in the NEW_SUN_PTRACE case. - It ought to be straightforward. But it appears that writing did - not write the data that I specified. I cannot understand where - it got the data that it actually did write. */ - -/* Copy LEN bytes from inferior's memory starting at MEMADDR - to debugger memory starting at MYADDR. */ - -void -read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int); - /* Allocate buffer of that many longwords. */ - register int *buffer = (int *) alloca (count * sizeof (int)); - - /* Read all the longwords */ - for (i = 0; i < count; i++, addr += sizeof (int)) - { - buffer[i] = ptrace (1, inferior_pid, addr, 0); - } - - /* Copy appropriate bytes out of the buffer. */ - memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len); -} - -/* Copy LEN bytes of data from debugger memory at MYADDR - to inferior's memory at MEMADDR. - On failure (cannot write the inferior) - returns the value of errno. */ - -int -write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int); - /* Allocate buffer of that many longwords. */ - register int *buffer = (int *) alloca (count * sizeof (int)); - extern int errno; - - /* Fill start and end extra bytes of buffer with existing memory data. */ - - buffer[0] = ptrace (1, inferior_pid, addr, 0); - - if (count > 1) - { - buffer[count - 1] - = ptrace (1, inferior_pid, - addr + (count - 1) * sizeof (int), 0); - } - - /* Copy data to be written over corresponding part of buffer */ - - memcpy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len); - - /* Write the entire buffer. */ - - for (i = 0; i < count; i++, addr += sizeof (int)) - { - errno = 0; - ptrace (4, inferior_pid, addr, buffer[i]); - if (errno) - return errno; - } - - return 0; -} - -void -initialize_low (void) -{ -} diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index d5699379bd5..eb56c1039a8 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -46,8 +46,6 @@ static int remote_desc; extern int using_threads; extern int debug_threads; -extern int signal_pid; - /* Open a connection to a remote debugger. NAME is the filename used for communication. */ @@ -326,7 +324,7 @@ putpkt (char *buf) /* Check for an input interrupt while we're here. */ if (buf3[0] == '\003') - kill (signal_pid, SIGINT); + (*the_target->send_signal) (SIGINT); } while (buf3[0] != '+'); @@ -363,7 +361,7 @@ input_interrupt (int unused) return; } - kill (signal_pid, SIGINT); + (*the_target->send_signal) (SIGINT); } } diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index d0963ba9de9..81fde5b7f73 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -217,6 +217,28 @@ main (int argc, char *argv[]) case 'd': remote_debug = !remote_debug; break; + case 'D': + fprintf (stderr, "Detaching from inferior\n"); + detach_inferior (); + write_ok (own_buf); + putpkt (own_buf); + remote_close (); + + /* If we are attached, then we can exit. Otherwise, we need to + hang around doing nothing, until the child is gone. */ + if (!attached) + { + int status, ret; + + do { + ret = waitpid (signal_pid, &status, 0); + if (WIFEXITED (status) || WIFSIGNALED (status)) + break; + } while (ret != -1 || errno != ECHILD); + } + + exit (0); + case '!': if (attached == 0) { diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h index e554c0ac7e1..1c47a3aedb3 100644 --- a/gdb/gdbserver/target.h +++ b/gdb/gdbserver/target.h @@ -48,6 +48,10 @@ struct target_ops void (*kill) (void); + /* Detach from all inferiors. */ + + void (*detach) (void); + /* Return 1 iff the thread with process ID PID is alive. */ int (*thread_alive) (int pid); @@ -104,6 +108,9 @@ struct target_ops symbols. */ void (*look_up_symbols) (void); + + /* Send a signal to the inferior process, however is appropriate. */ + void (*send_signal) (int); }; extern struct target_ops *the_target; @@ -119,6 +126,9 @@ void set_target_ops (struct target_ops *); #define kill_inferior() \ (*the_target->kill) () +#define detach_inferior() \ + (*the_target->detach) () + #define mythread_alive(pid) \ (*the_target->thread_alive) (pid) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 78abf12a9e0..fcefcd4c41a 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -60,6 +60,7 @@ struct type *builtin_type_long_double; struct type *builtin_type_complex; struct type *builtin_type_double_complex; struct type *builtin_type_string; +struct type *builtin_type_int0; struct type *builtin_type_int8; struct type *builtin_type_uint8; struct type *builtin_type_int16; @@ -434,7 +435,7 @@ address_space_int_to_name (int space_flag) /* Create a new type with instance flags NEW_FLAGS, based on TYPE. If STORAGE is non-NULL, create the new type instance there. */ -struct type * +static struct type * make_qualified_type (struct type *type, int new_flags, struct type *storage) { @@ -1668,7 +1669,7 @@ check_typedef (struct type *type) /* Parse a type expression in the string [P..P+LENGTH). If an error occurs, silently return builtin_type_void. */ -struct type * +static struct type * safe_parse_type (char *p, int length) { struct ui_file *saved_gdb_stderr; @@ -3417,6 +3418,10 @@ build_gdbtypes (void) init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, "string", (struct objfile *) NULL); + builtin_type_int0 = + init_type (TYPE_CODE_INT, 0 / 8, + 0, + "int0_t", (struct objfile *) NULL); builtin_type_int8 = init_type (TYPE_CODE_INT, 8 / 8, 0, diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 0d173e05df4..caeab83688f 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -957,7 +957,10 @@ extern struct type *builtin_type_CORE_ADDR; (cf MIPS). */ extern struct type *builtin_type_bfd_vma; -/* Explicit sizes - see C9X for naming scheme */ +/* Explicit sizes - see C9X for naming scheme. The "int0" + is for when an architecture needs to describe a register that has + no size. */ +extern struct type *builtin_type_int0; extern struct type *builtin_type_int8; extern struct type *builtin_type_uint8; extern struct type *builtin_type_int16; diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index 8be456f7ea1..9b63616488c 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -62,6 +62,7 @@ #include "gdbcore.h" #include "gdbthread.h" #include "gdb_assert.h" +#include "gdb_obstack.h" #include "gnu-nat.h" diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index 47d6e125880..da04c7416c0 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -184,7 +184,7 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, } -struct type * +static struct type * gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc) { struct type *known_type; @@ -401,6 +401,8 @@ init_gnuv2_ops (void) gnu_v2_abi_ops.baseclass_offset = gnuv2_baseclass_offset; } +extern initialize_file_ftype _initialize_gnu_v2_abi; /* -Wmissing-prototypes */ + void _initialize_gnu_v2_abi (void) { diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index da2a2d60450..bbfd1185201 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -372,7 +372,7 @@ gnuv3_virtual_fn_field (struct value **value_p, to (the address of)(ARG) + OFFSET. -1 is returned on error. */ -int +static int gnuv3_baseclass_offset (struct type *type, int index, char *valaddr, CORE_ADDR address) { @@ -447,6 +447,7 @@ init_gnuv3_ops (void) gnu_v3_abi_ops.baseclass_offset = gnuv3_baseclass_offset; } +extern initialize_file_ftype _initialize_gnu_v3_abi; /* -Wmissing-prototypes */ void _initialize_gnu_v3_abi (void) diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 0559805da03..1253b4d6ca1 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -40,12 +40,8 @@ struct frame_extra_info { CORE_ADDR from_pc; - CORE_ADDR args_pointer; - CORE_ADDR locals_pointer; }; -#define E_NUM_REGS (h8300smode ? 14 : 13) - enum { h8300_reg_size = 2, @@ -57,7 +53,8 @@ enum enum gdb_regnum { E_R0_REGNUM, E_ER0_REGNUM = E_R0_REGNUM, E_ARG0_REGNUM = E_R0_REGNUM, - E_R1_REGNUM, E_ER1_REGNUM = E_R1_REGNUM, + E_RET0_REGNUM = E_R0_REGNUM, + E_R1_REGNUM, E_ER1_REGNUM = E_R1_REGNUM, E_RET1_REGNUM = E_R1_REGNUM, E_R2_REGNUM, E_ER2_REGNUM = E_R2_REGNUM, E_ARGLAST_REGNUM = E_R2_REGNUM, E_R3_REGNUM, E_ER3_REGNUM = E_R3_REGNUM, E_R4_REGNUM, E_ER4_REGNUM = E_R4_REGNUM, @@ -69,9 +66,16 @@ enum gdb_regnum E_CYCLES_REGNUM, E_TICK_REGNUM, E_EXR_REGNUM = E_TICK_REGNUM, E_INST_REGNUM, E_TICKS_REGNUM = E_INST_REGNUM, - E_INSTS_REGNUM + E_INSTS_REGNUM, + E_MACH_REGNUM, + E_MACL_REGNUM, + E_SBR_REGNUM, + E_VBR_REGNUM }; +#define E_PSEUDO_CCR_REGNUM (NUM_REGS) +#define E_PSEUDO_EXR_REGNUM (NUM_REGS+1) + #define UNSIGNED_SHORT(X) ((X) & 0xffff) #define IS_PUSH(x) ((x & 0xfff0)==0x6df0) @@ -90,13 +94,23 @@ enum gdb_regnum An argument register spill is an instruction that moves an argument from the register in which it was passed to the stack slot in which it really lives. It is a byte, word, or longword move from an - argument register to a negative offset from the frame pointer. */ + argument register to a negative offset from the frame pointer. + + CV, 2003-06-16: Or, in optimized code or when the `register' qualifier + is used, it could be a byte, word or long move to registers r3-r5. */ static int h8300_is_argument_spill (CORE_ADDR pc) { int w = read_memory_unsigned_integer (pc, 2); + if (((w & 0xff88) == 0x0c88 /* mov.b Rsl, Rdl */ + || (w & 0xff88) == 0x0d00 /* mov.w Rs, Rd */ + || (w & 0xff88) == 0x0f80) /* mov.l Rs, Rd */ + && (w & 0x70) <= 0x20 /* Rs is R0, R1 or R2 */ + && (w & 0x7) >= 0x3 && (w & 0x7) <= 0x5)/* Rd is R3, R4 or R5 */ + return 2; + if ((w & 0xfff0) == 0x6ee0 /* mov.b Rs,@(d:16,er6) */ && 8 <= (w & 0xf) && (w & 0xf) <= 10) /* Rs is R0L, R1L, or R2L */ { @@ -239,6 +253,17 @@ h8300_skip_prologue (CORE_ADDR start_pc) if (IS_SUBL_SP (w)) start_pc += 6 + adjust; + /* Skip past another possible stm insn for registers R3 to R5 (possibly used + for register qualified arguments. */ + w = read_memory_unsigned_integer (start_pc, 2); + /* First look for push insns. */ + if (w == 0x0110 || w == 0x0120 || w == 0x0130) + { + w = read_memory_unsigned_integer (start_pc + 2, 2); + if (IS_PUSH (w) && (w & 0xf) >= 0x3 && (w & 0xf) <= 0x5) + start_pc += 4; + } + /* Check for spilling an argument register to the stack frame. This could also be an initializing store from non-prologue code, but I don't think there's any harm in skipping that. */ @@ -253,24 +278,15 @@ h8300_skip_prologue (CORE_ADDR start_pc) return start_pc; } -static int -gdb_print_insn_h8300 (bfd_vma memaddr, disassemble_info * info) -{ - if (h8300smode) - return print_insn_h8300s (memaddr, info); - else if (h8300hmode) - return print_insn_h8300h (memaddr, info); - else - return print_insn_h8300 (memaddr, info); -} - /* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or is not the address of a valid instruction, the address of the next instruction beyond ADDR otherwise. *PWORD1 receives the first word of the instruction. */ static CORE_ADDR -h8300_next_prologue_insn (CORE_ADDR addr, CORE_ADDR lim, unsigned short* pword1) +h8300_next_prologue_insn (CORE_ADDR addr, + CORE_ADDR lim, + unsigned short* pword1) { char buf[2]; if (addr < lim + 8) @@ -338,7 +354,7 @@ h8300_examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit, next_ip = h8300_next_prologue_insn (ip, limit, &insn_word); - if (insn_word == 0x0100) + if (insn_word == 0x0100) /* mov.l */ { insn_word = read_memory_unsigned_integer (ip + 2, 2); adjust = 2; @@ -439,10 +455,6 @@ h8300_examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit, break; } - /* The args are always reffed based from the stack pointer */ - get_frame_extra_info (fi)->args_pointer = after_prolog_fp; - /* Locals are always reffed based from the fp */ - get_frame_extra_info (fi)->locals_pointer = after_prolog_fp; /* The PC is at a known place */ get_frame_extra_info (fi)->from_pc = read_memory_unsigned_integer (after_prolog_fp + BINWORD, BINWORD); @@ -452,7 +464,8 @@ h8300_examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit, if (have_fp) /* We keep the old FP in the SP spot */ - fsr[E_SP_REGNUM] = read_memory_unsigned_integer (fsr[E_FP_REGNUM], BINWORD); + fsr[E_SP_REGNUM] = read_memory_unsigned_integer (fsr[E_FP_REGNUM], + BINWORD); else fsr[E_SP_REGNUM] = after_prolog_fp + auto_depth; @@ -470,10 +483,12 @@ h8300_frame_init_saved_regs (struct frame_info *fi) /* Find the beginning of this function, so we can analyze its prologue. */ - if (find_pc_partial_function (get_frame_pc (fi), NULL, &func_addr, &func_end)) + if (find_pc_partial_function (get_frame_pc (fi), NULL, + &func_addr, &func_end)) { struct symtab_and_line sal = find_pc_line (func_addr, 0); - CORE_ADDR limit = (sal.end && sal.end < get_frame_pc (fi)) ? sal.end : get_frame_pc (fi); + CORE_ADDR limit = (sal.end && sal.end < get_frame_pc (fi)) + ? sal.end : get_frame_pc (fi); /* This will fill in fields in fi. */ h8300_examine_prologue (func_addr, limit, get_frame_base (fi), get_frame_saved_regs (fi), fi); @@ -489,7 +504,8 @@ h8300_frame_init_saved_regs (struct frame_info *fi) 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. */ + the function prologue to determine the caller's sp value, and + return it. */ static CORE_ADDR h8300_frame_chain (struct frame_info *thisframe) @@ -532,8 +548,6 @@ h8300_init_extra_frame_info (int fromleaf, struct frame_info *fi) { frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); get_frame_extra_info (fi)->from_pc = 0; - get_frame_extra_info (fi)->args_pointer = 0; /* Unknown */ - get_frame_extra_info (fi)->locals_pointer = 0; /* Unknown */ if (!get_frame_pc (fi)) { @@ -544,34 +558,13 @@ h8300_init_extra_frame_info (int fromleaf, struct frame_info *fi) } } -static CORE_ADDR -h8300_frame_locals_address (struct frame_info *fi) -{ - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi), - get_frame_base (fi))) - return (CORE_ADDR) 0; /* Not sure what else to do... */ - return get_frame_extra_info (fi)->locals_pointer; -} - -/* Return the address of the argument block for the frame - described by FI. Returns 0 if the address is unknown. */ - -static CORE_ADDR -h8300_frame_args_address (struct frame_info *fi) -{ - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi), - get_frame_base (fi))) - return (CORE_ADDR) 0; /* Not sure what else to do... */ - return get_frame_extra_info (fi)->args_pointer; -} - /* Round N up or down to the nearest multiple of UNIT. Evaluate N only once, UNIT several times. UNIT must be a power of two. */ #define round_up(n, unit) (((n) + (unit) - 1) & -(unit)) #define round_down(n, unit) ((n) & -(unit)) -/* Function: push_arguments +/* Function: push_dummy_call Setup the function arguments for calling a function in the inferior. In this discussion, a `word' is 16 bits on the H8/300s, and 32 bits on the H8/300H. @@ -636,12 +629,14 @@ h8300_frame_args_address (struct frame_info *fi) to begin with. */ static CORE_ADDR -h8300_push_arguments (int nargs, struct value **args, CORE_ADDR sp, - int struct_return, CORE_ADDR struct_addr) +h8300_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, + struct regcache *regcache, CORE_ADDR bp_addr, int nargs, + struct value **args, CORE_ADDR sp, int struct_return, + CORE_ADDR struct_addr) { - int stack_align, stack_alloc, stack_offset; + int stack_alloc = 0, stack_offset = 0; int wordsize = BINWORD; - int reg; + int reg = E_ARG0_REGNUM; int argument; /* First, make sure the stack is properly aligned. */ @@ -649,22 +644,18 @@ h8300_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* Now make sure there's space on the stack for the arguments. We may over-allocate a little here, but that won't hurt anything. */ - stack_alloc = 0; for (argument = 0; argument < nargs; argument++) stack_alloc += round_up (TYPE_LENGTH (VALUE_TYPE (args[argument])), wordsize); sp -= stack_alloc; /* Now load as many arguments as possible into registers, and push - the rest onto the stack. */ - reg = E_ARG0_REGNUM; - stack_offset = 0; - - /* If we're returning a structure by value, then we must pass a + the rest onto the stack. + If we're returning a structure by value, then we must pass a pointer to the buffer for the return value as an invisible first argument. */ if (struct_return) - write_register (reg++, struct_addr); + regcache_cooked_write_unsigned (regcache, reg++, struct_addr); for (argument = 0; argument < nargs; argument++) { @@ -706,8 +697,9 @@ h8300_push_arguments (int nargs, struct value **args, CORE_ADDR sp, for (offset = 0; offset < padded_len; offset += wordsize) { - ULONGEST word = extract_address (padded + offset, wordsize); - write_register (reg++, word); + ULONGEST word = extract_unsigned_integer (padded + offset, + wordsize); + regcache_cooked_write_unsigned (regcache, reg++, word); } } } @@ -723,24 +715,13 @@ h8300_push_arguments (int nargs, struct value **args, CORE_ADDR sp, } } - return sp; -} + /* Store return address. */ + sp -= wordsize; + write_memory_unsigned_integer (sp, wordsize, bp_addr); -/* Function: push_return_address - 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, ie. the target will not actually be executing - a JSR/BSR instruction. */ + /* Update stack pointer. */ + regcache_cooked_write_unsigned (regcache, E_SP_REGNUM, sp); -static CORE_ADDR -h8300_push_return_address (CORE_ADDR pc, CORE_ADDR sp) -{ - unsigned char buf[4]; - int wordsize = BINWORD; - - sp -= wordsize; - store_unsigned_integer (buf, wordsize, CALL_DUMMY_ADDRESS ()); - write_memory (sp, buf, wordsize); return sp; } @@ -769,8 +750,8 @@ h8300_pop_frame (void) actual value we want, not the address of the value we want. */ if (get_frame_saved_regs (frame)[regno] && regno != E_SP_REGNUM) write_register (regno, - read_memory_integer (get_frame_saved_regs (frame)[regno], - BINWORD)); + read_memory_integer + (get_frame_saved_regs (frame)[regno], BINWORD)); else if (get_frame_saved_regs (frame)[regno] && regno == E_SP_REGNUM) write_register (regno, get_frame_base (frame) + 2 * BINWORD); } @@ -786,68 +767,105 @@ h8300_pop_frame (void) Copy that into VALBUF. Be sure to account for CPU type. */ static void -h8300_extract_return_value (struct type *type, char *regbuf, char *valbuf) +h8300_extract_return_value (struct type *type, struct regcache *regcache, + void *valbuf) { - int wordsize = BINWORD; int len = TYPE_LENGTH (type); + ULONGEST c; switch (len) { - case 1: /* (char) */ - case 2: /* (short), (int) */ - memcpy (valbuf, regbuf + REGISTER_BYTE (0) + (wordsize - len), len); - break; - case 4: /* (long), (float) */ - if (wordsize == 4) - { - memcpy (valbuf, regbuf + REGISTER_BYTE (0), 4); - } - else - { - memcpy (valbuf, regbuf + REGISTER_BYTE (0), 2); - memcpy (valbuf + 2, regbuf + REGISTER_BYTE (1), 2); - } - 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; + case 1: + case 2: + regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c); + store_unsigned_integer (valbuf, len, c); + break; + case 4: /* Needs two registers on plain H8/300 */ + regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c); + store_unsigned_integer (valbuf, 2, c); + regcache_cooked_read_unsigned (regcache, E_RET1_REGNUM, &c); + store_unsigned_integer ((void*)((char *)valbuf + 2), 2, c); + break; + case 8: /* long long, double and long double are all defined + as 4 byte types so far so this shouldn't happen. */ + error ("I don't know how a 8 byte value is returned."); + break; } } +static void +h8300h_extract_return_value (struct type *type, struct regcache *regcache, + void *valbuf) +{ + int len = TYPE_LENGTH (type); + ULONGEST c; + + switch (len) + { + case 1: + case 2: + case 4: + regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c); + store_unsigned_integer (valbuf, len, c); + break; + case 8: /* long long, double and long double are all defined + as 4 byte types so far so this shouldn't happen. */ + error ("I don't know how a 8 byte value is returned."); + break; + } +} + + /* Function: store_return_value Place the appropriate value in the appropriate registers. Primarily used by the RETURN command. */ static void -h8300_store_return_value (struct type *type, char *valbuf) +h8300_store_return_value (struct type *type, struct regcache *regcache, + const void *valbuf) { - int regval; - int wordsize = BINWORD; int len = TYPE_LENGTH (type); + ULONGEST val; 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); - if (wordsize == 4) - { - write_register (0, regval); - } - else - { - 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; + case 1: + case 2: + val = extract_unsigned_integer (valbuf, len); + regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, val); + break; + case 4: /* long, float */ + val = extract_unsigned_integer (valbuf, len); + regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, + (val >> 16) &0xffff); + regcache_cooked_write_unsigned (regcache, E_RET1_REGNUM, val & 0xffff); + break; + case 8: /* long long, double and long double are all defined + as 4 byte types so far so this shouldn't happen. */ + error ("I don't know how to return a 8 byte value."); + break; + } +} + +static void +h8300h_store_return_value (struct type *type, struct regcache *regcache, + const void *valbuf) +{ + int len = TYPE_LENGTH (type); + ULONGEST val; + + switch (len) + { + case 1: + case 2: + case 4: /* long, float */ + val = extract_unsigned_integer (valbuf, len); + regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, val); + break; + case 8: /* long long, double and long double are all defined + as 4 byte types so far so this shouldn't happen. */ + error ("I don't know how to return a 8 byte value."); + break; } } @@ -856,21 +874,51 @@ static struct cmd_list_element *setmachinelist; static const char * h8300_register_name (int regno) { - /* The register names change depending on whether the h8300h processor + /* The register names change depending on which h8300 processor type is selected. */ - static char *h8300_register_names[] = { + static char *register_names[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", - "sp", "ccr","pc","cycles", "tick", "inst", "" + "sp", "","pc","cycles", "tick", "inst", + "ccr", /* pseudo register */ }; - static char *h8300s_register_names[] = { + if (regno < 0 + || regno >= (sizeof (register_names) / sizeof (*register_names))) + internal_error (__FILE__, __LINE__, + "h8300_register_name: illegal register number %d", regno); + else + return register_names[regno]; +} + +static const char * +h8300s_register_name (int regno) +{ + static char *register_names[] = { "er0", "er1", "er2", "er3", "er4", "er5", "er6", - "sp", "ccr", "pc", "cycles", "exr", "tick", "inst" + "sp", "", "pc", "cycles", "", "tick", "inst", + "mach", "macl", + "ccr", "exr" /* pseudo registers */ }; - char **register_names = - h8300smode ? h8300s_register_names : h8300_register_names; - if (regno < 0 || regno >= E_NUM_REGS) + if (regno < 0 + || regno >= (sizeof (register_names) / sizeof (*register_names))) internal_error (__FILE__, __LINE__, - "h8300_register_name: illegal register number %d", regno); + "h8300s_register_name: illegal register number %d", regno); + else + return register_names[regno]; +} + +static const char * +h8300sx_register_name (int regno) +{ + static char *register_names[] = { + "er0", "er1", "er2", "er3", "er4", "er5", "er6", + "sp", "", "pc", "cycles", "", "tick", "inst", + "mach", "macl", "sbr", "vbr", + "ccr", "exr" /* pseudo registers */ + }; + if (regno < 0 + || regno >= (sizeof (register_names) / sizeof (*register_names))) + internal_error (__FILE__, __LINE__, + "h8300sx_register_name: illegal register number %d", regno); else return register_names[regno]; } @@ -879,44 +927,30 @@ static void h8300_print_register (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regno) { - ULONGEST rval; - long val; - const char *name = h8300_register_name (regno); + LONGEST rval; + const char *name = gdbarch_register_name (gdbarch, regno); if (!name || !*name) return; - /* FIXME: cagney/2002-10-22: The code below assumes that VAL is at - least 4 bytes (32 bits) in size and hence is large enough to hold - the largest h8300 register. Should instead be using ULONGEST and - the phex() functions. */ - gdb_assert (sizeof (val) >= 4); - frame_read_unsigned_register (frame, regno, &rval); - val = rval; + frame_read_signed_register (frame, regno, &rval); fprintf_filtered (file, "%-14s ", name); - if (h8300hmode) + if (regno == E_PSEUDO_CCR_REGNUM || (regno == E_PSEUDO_EXR_REGNUM && h8300smode)) { - if (val) - fprintf_filtered (file, "0x%08lx %-8ld", val, val); - else - fprintf_filtered (file, "0x%-8lx %-8ld", val, val); + fprintf_filtered (file, "0x%02x ", (unsigned char)rval); + print_longest (file, 'u', 1, rval); } else { - if (val) - fprintf_filtered (file, "0x%04lx %-4ld", val, val); - else - fprintf_filtered (file, "0x%-4lx %-4ld", val, val); + fprintf_filtered (file, "0x%s ", phex ((ULONGEST)rval, BINWORD)); + print_longest (file, 'd', 1, rval); } - if (regno == E_CCR_REGNUM) + if (regno == E_PSEUDO_CCR_REGNUM) { /* CCR register */ int C, Z, N, V; - unsigned char b[h8300h_reg_size]; - unsigned char l; - frame_register_read (deprecated_selected_frame, regno, b); - l = b[REGISTER_VIRTUAL_SIZE (E_CCR_REGNUM) - 1]; + unsigned char l = rval & 0xff; fprintf_filtered (file, "\t"); fprintf_filtered (file, "I-%d ", (l & 0x80) != 0); fprintf_filtered (file, "UI-%d ", (l & 0x40) != 0); @@ -951,13 +985,10 @@ h8300_print_register (struct gdbarch *gdbarch, struct ui_file *file, if ((Z | (N ^ V)) == 1) fprintf_filtered (file, "<= "); } - else if (regno == E_EXR_REGNUM && h8300smode) + else if (regno == E_PSEUDO_EXR_REGNUM && h8300smode) { /* EXR register */ - unsigned char b[h8300h_reg_size]; - unsigned char l; - frame_register_read (deprecated_selected_frame, regno, b); - l = b[REGISTER_VIRTUAL_SIZE (E_EXR_REGNUM) - 1]; + unsigned char l = rval & 0xff; fprintf_filtered (file, "\t"); fprintf_filtered (file, "T-%d - - - ", (l & 0x80) != 0); fprintf_filtered (file, "I2-%d ", (l & 4) != 0); @@ -972,10 +1003,41 @@ h8300_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regno, int cpregs) { if (regno < 0) - for (regno = 0; regno < E_NUM_REGS; ++regno) - h8300_print_register (gdbarch, file, frame, regno); + { + for (regno = E_R0_REGNUM; regno <= E_SP_REGNUM; ++regno) + h8300_print_register (gdbarch, file, frame, regno); + h8300_print_register (gdbarch, file, frame, E_PSEUDO_CCR_REGNUM); + h8300_print_register (gdbarch, file, frame, E_PC_REGNUM); + if (h8300smode) + { + h8300_print_register (gdbarch, file, frame, E_PSEUDO_EXR_REGNUM); + if (h8300sxmode) + { + h8300_print_register (gdbarch, file, frame, E_SBR_REGNUM); + h8300_print_register (gdbarch, file, frame, E_VBR_REGNUM); + } + h8300_print_register (gdbarch, file, frame, E_MACH_REGNUM); + h8300_print_register (gdbarch, file, frame, E_MACL_REGNUM); + h8300_print_register (gdbarch, file, frame, E_CYCLES_REGNUM); + h8300_print_register (gdbarch, file, frame, E_TICKS_REGNUM); + h8300_print_register (gdbarch, file, frame, E_INSTS_REGNUM); + } + else + { + h8300_print_register (gdbarch, file, frame, E_CYCLES_REGNUM); + h8300_print_register (gdbarch, file, frame, E_TICK_REGNUM); + h8300_print_register (gdbarch, file, frame, E_INST_REGNUM); + } + } else - h8300_print_register (gdbarch, file, frame, regno); + { + if (regno == E_CCR_REGNUM) + h8300_print_register (gdbarch, file, frame, E_PSEUDO_CCR_REGNUM); + else if (regno == E_PSEUDO_EXR_REGNUM && h8300smode) + h8300_print_register (gdbarch, file, frame, E_PSEUDO_EXR_REGNUM); + else + h8300_print_register (gdbarch, file, frame, regno); + } } static CORE_ADDR @@ -984,56 +1046,83 @@ h8300_saved_pc_after_call (struct frame_info *ignore) return read_memory_unsigned_integer (read_register (E_SP_REGNUM), BINWORD); } -static int -h8300_register_byte (int regno) +static struct type * +h8300_register_type (struct gdbarch *gdbarch, int regno) { - if (regno < 0 || regno >= E_NUM_REGS) + if (regno < 0 || regno >= NUM_REGS + NUM_PSEUDO_REGS) internal_error (__FILE__, __LINE__, - "h8300_register_byte: illegal register number %d", regno); + "h8300_register_type: illegal register number %d", + regno); else - return regno * BINWORD; + { + switch (regno) + { + case E_PC_REGNUM: + return builtin_type_void_func_ptr; + case E_SP_REGNUM: + case E_FP_REGNUM: + return builtin_type_void_data_ptr; + default: + if (regno == E_PSEUDO_CCR_REGNUM) + return builtin_type_uint8; + else if (regno == E_PSEUDO_EXR_REGNUM) + return builtin_type_uint8; + else if (h8300hmode) + return builtin_type_int32; + else + return builtin_type_int16; + } + } } -static int -h8300_register_raw_size (int regno) +static void +h8300_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, + int regno, void *buf) { - if (regno < 0 || regno >= E_NUM_REGS) - internal_error (__FILE__, __LINE__, - "h8300_register_raw_size: illegal register number %d", - regno); + if (regno == E_PSEUDO_CCR_REGNUM) + regcache_raw_read (regcache, E_CCR_REGNUM, buf); + else if (regno == E_PSEUDO_EXR_REGNUM) + regcache_raw_read (regcache, E_EXR_REGNUM, buf); else - return BINWORD; + regcache_raw_read (regcache, regno, buf); } -static struct type * -h8300_register_virtual_type (int regno) +static void +h8300_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, + int regno, const void *buf) { - if (regno < 0 || regno >= E_NUM_REGS) - internal_error (__FILE__, __LINE__, - "h8300_register_virtual_type: illegal register number %d", - regno); + if (regno == E_PSEUDO_CCR_REGNUM) + regcache_raw_write (regcache, E_CCR_REGNUM, buf); + else if (regno == E_PSEUDO_EXR_REGNUM) + regcache_raw_write (regcache, E_EXR_REGNUM, buf); else - return h8300hmode ? - builtin_type_unsigned_long : builtin_type_unsigned_short; + regcache_raw_write (regcache, regno, buf); } -static void -h8300_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) -{ - write_register (0, addr); +static int +h8300_dbg_reg_to_regnum (int regno) +{ + if (regno == E_CCR_REGNUM) + return E_PSEUDO_CCR_REGNUM; + return regno; } static int -h8300_use_struct_convention (int gcc_p, struct type *type) +h8300s_dbg_reg_to_regnum (int regno) { - return 1; + if (regno == E_CCR_REGNUM) + return E_PSEUDO_CCR_REGNUM; + if (regno == E_EXR_REGNUM) + return E_PSEUDO_EXR_REGNUM; + return regno; } static CORE_ADDR -h8300_extract_struct_value_address (char *regbuf) +h8300_extract_struct_value_address (struct regcache *regcache) { - return extract_address (regbuf + h8300_register_byte (E_ARG0_REGNUM), - h8300_register_raw_size (E_ARG0_REGNUM)); + ULONGEST addr; + regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &addr); + return addr; } const static unsigned char * @@ -1046,6 +1135,22 @@ h8300_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) return breakpoint; } +static CORE_ADDR +h8300_push_dummy_code (struct gdbarch *gdbarch, + CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, + struct value **args, int nargs, + struct type *value_type, + CORE_ADDR *real_pc, CORE_ADDR *bp_addr) +{ + /* Allocate space sufficient for a breakpoint. */ + sp = (sp - 2) & ~1; + /* Store the address of that breakpoint */ + *bp_addr = sp; + /* h8300 always starts the call at the callee's entry point. */ + *real_pc = funaddr; + return sp; +} + static void h8300_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) @@ -1057,7 +1162,6 @@ No floating-point info available for this processor.\n"); static struct gdbarch * h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { - static LONGEST call_dummy_words[1] = { 0 }; struct gdbarch_tdep *tdep = NULL; struct gdbarch *gdbarch; @@ -1072,23 +1176,85 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (info.bfd_arch_info->arch != bfd_arch_h8300) return NULL; + gdbarch = gdbarch_alloc (&info, 0); + switch (info.bfd_arch_info->mach) { - case bfd_mach_h8300: - h8300smode = 0; - h8300hmode = 0; - break; - case bfd_mach_h8300h: - h8300smode = 0; - h8300hmode = 1; - break; - case bfd_mach_h8300s: - h8300smode = 1; - h8300hmode = 1; - break; + case bfd_mach_h8300: + h8300sxmode = 0; + h8300smode = 0; + h8300hmode = 0; + set_gdbarch_num_regs (gdbarch, 13); + set_gdbarch_num_pseudo_regs (gdbarch, 1); + set_gdbarch_ecoff_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum); + set_gdbarch_dwarf_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum); + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum); + set_gdbarch_stab_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum); + set_gdbarch_register_name (gdbarch, h8300_register_name); + set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT); + set_gdbarch_addr_bit (gdbarch, 2 * TARGET_CHAR_BIT); + set_gdbarch_extract_return_value (gdbarch, h8300_extract_return_value); + set_gdbarch_store_return_value (gdbarch, h8300_store_return_value); + set_gdbarch_print_insn (gdbarch, print_insn_h8300); + break; + case bfd_mach_h8300h: + case bfd_mach_h8300hn: + h8300sxmode = 0; + h8300smode = 0; + h8300hmode = 1; + set_gdbarch_num_regs (gdbarch, 13); + set_gdbarch_num_pseudo_regs (gdbarch, 1); + set_gdbarch_ecoff_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum); + set_gdbarch_dwarf_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum); + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum); + set_gdbarch_stab_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum); + set_gdbarch_register_name (gdbarch, h8300_register_name); + set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT); + set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT); + set_gdbarch_extract_return_value (gdbarch, h8300h_extract_return_value); + set_gdbarch_store_return_value (gdbarch, h8300h_store_return_value); + set_gdbarch_print_insn (gdbarch, print_insn_h8300h); + break; + case bfd_mach_h8300s: + case bfd_mach_h8300sn: + h8300sxmode = 0; + h8300smode = 1; + h8300hmode = 1; + set_gdbarch_num_regs (gdbarch, 16); + set_gdbarch_num_pseudo_regs (gdbarch, 2); + set_gdbarch_ecoff_reg_to_regnum (gdbarch, h8300s_dbg_reg_to_regnum); + set_gdbarch_dwarf_reg_to_regnum (gdbarch, h8300s_dbg_reg_to_regnum); + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, h8300s_dbg_reg_to_regnum); + set_gdbarch_stab_reg_to_regnum (gdbarch, h8300s_dbg_reg_to_regnum); + set_gdbarch_register_name (gdbarch, h8300s_register_name); + set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT); + set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT); + set_gdbarch_extract_return_value (gdbarch, h8300h_extract_return_value); + set_gdbarch_store_return_value (gdbarch, h8300h_store_return_value); + set_gdbarch_print_insn (gdbarch, print_insn_h8300s); + break; + case bfd_mach_h8300sx: + case bfd_mach_h8300sxn: + h8300sxmode = 1; + h8300smode = 1; + h8300hmode = 1; + set_gdbarch_num_regs (gdbarch, 18); + set_gdbarch_num_pseudo_regs (gdbarch, 2); + set_gdbarch_ecoff_reg_to_regnum (gdbarch, h8300s_dbg_reg_to_regnum); + set_gdbarch_dwarf_reg_to_regnum (gdbarch, h8300s_dbg_reg_to_regnum); + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, h8300s_dbg_reg_to_regnum); + set_gdbarch_stab_reg_to_regnum (gdbarch, h8300s_dbg_reg_to_regnum); + set_gdbarch_register_name (gdbarch, h8300sx_register_name); + set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT); + set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT); + set_gdbarch_extract_return_value (gdbarch, h8300h_extract_return_value); + set_gdbarch_store_return_value (gdbarch, h8300h_store_return_value); + set_gdbarch_print_insn (gdbarch, print_insn_h8300s); + break; } - gdbarch = gdbarch_alloc (&info, 0); + set_gdbarch_pseudo_register_read (gdbarch, h8300_pseudo_register_read); + set_gdbarch_pseudo_register_write (gdbarch, h8300_pseudo_register_write); /* NOTE: cagney/2002-12-06: This can be deleted when this arch is ready to unwind the PC first (see frame.c:get_prev_frame()). */ @@ -1098,34 +1264,27 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) * Basic register fields and methods. */ - set_gdbarch_num_regs (gdbarch, E_NUM_REGS); - set_gdbarch_num_pseudo_regs (gdbarch, 0); set_gdbarch_sp_regnum (gdbarch, E_SP_REGNUM); set_gdbarch_deprecated_fp_regnum (gdbarch, E_FP_REGNUM); set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM); - set_gdbarch_register_name (gdbarch, h8300_register_name); - set_gdbarch_deprecated_register_size (gdbarch, BINWORD); - set_gdbarch_deprecated_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_deprecated_max_register_raw_size (gdbarch, h8300h_reg_size); - set_gdbarch_register_virtual_size (gdbarch, h8300_register_raw_size); - set_gdbarch_deprecated_max_register_virtual_size (gdbarch, h8300h_reg_size); - set_gdbarch_register_virtual_type (gdbarch, h8300_register_virtual_type); + set_gdbarch_register_type (gdbarch, h8300_register_type); set_gdbarch_print_registers_info (gdbarch, h8300_print_registers_info); set_gdbarch_print_float_info (gdbarch, h8300_print_float_info); /* * Frame Info */ - 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_skip_prologue (gdbarch, h8300_skip_prologue); + + 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_deprecated_frame_chain (gdbarch, h8300_frame_chain); - set_gdbarch_deprecated_saved_pc_after_call (gdbarch, h8300_saved_pc_after_call); + set_gdbarch_deprecated_saved_pc_after_call (gdbarch, + h8300_saved_pc_after_call); set_gdbarch_deprecated_frame_saved_pc (gdbarch, h8300_frame_saved_pc); - set_gdbarch_skip_prologue (gdbarch, h8300_skip_prologue); - set_gdbarch_frame_args_address (gdbarch, h8300_frame_args_address); - set_gdbarch_frame_locals_address (gdbarch, h8300_frame_locals_address); + set_gdbarch_deprecated_pop_frame (gdbarch, h8300_pop_frame); /* * Miscelany @@ -1139,44 +1298,32 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_function_start_offset (gdbarch, 0); /* This value is almost never non-zero... */ set_gdbarch_frame_args_skip (gdbarch, 0); - /* OK to default this value to 'unknown'. */ - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue); - /* - * Call Dummies - * - * These values and methods are used when gdb calls a target function. */ - set_gdbarch_deprecated_push_return_address (gdbarch, h8300_push_return_address); - set_gdbarch_deprecated_extract_return_value (gdbarch, h8300_extract_return_value); - set_gdbarch_deprecated_push_arguments (gdbarch, h8300_push_arguments); - set_gdbarch_deprecated_pop_frame (gdbarch, h8300_pop_frame); - set_gdbarch_deprecated_store_struct_return (gdbarch, h8300_store_struct_return); - set_gdbarch_deprecated_store_return_value (gdbarch, h8300_store_return_value); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, h8300_extract_struct_value_address); - set_gdbarch_use_struct_convention (gdbarch, h8300_use_struct_convention); - set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words); - set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0); + set_gdbarch_extract_struct_value_address (gdbarch, + h8300_extract_struct_value_address); + set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention); set_gdbarch_breakpoint_from_pc (gdbarch, h8300_breakpoint_from_pc); + set_gdbarch_push_dummy_code (gdbarch, h8300_push_dummy_code); + set_gdbarch_push_dummy_call (gdbarch, h8300_push_dummy_call); set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT); set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT); - set_gdbarch_ptr_bit (gdbarch, BINWORD * TARGET_CHAR_BIT); - set_gdbarch_addr_bit (gdbarch, BINWORD * TARGET_CHAR_BIT); + set_gdbarch_long_long_bit (gdbarch, 4 * TARGET_CHAR_BIT); + set_gdbarch_double_bit (gdbarch, 4 * TARGET_CHAR_BIT); + set_gdbarch_long_double_bit (gdbarch, 4 * TARGET_CHAR_BIT); /* set_gdbarch_stack_align (gdbarch, SOME_stack_align); */ set_gdbarch_believe_pcc_promotion (gdbarch, 1); - /* Should be using push_dummy_call. */ - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); - return gdbarch; } +extern initialize_file_ftype _initialize_h8300_tdep; /* -Wmissing-prototypes */ + void _initialize_h8300_tdep (void) { - deprecated_tm_print_insn = gdb_print_insn_h8300; register_gdbarch_init (bfd_arch_h8300, h8300_gdbarch_init); } diff --git a/gdb/hpacc-abi.c b/gdb/hpacc-abi.c index 799d4c7e9bf..0fb3adccb12 100644 --- a/gdb/hpacc-abi.c +++ b/gdb/hpacc-abi.c @@ -309,6 +309,7 @@ init_hpacc_ops (void) hpacc_abi_ops.baseclass_offset = gnuv2_baseclass_offset; } +extern initialize_file_ftype _initialize_hpacc_abi; /* -Wmissing-prototypes */ void _initialize_hpacc_abi (void) diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c index cc50e02783e..0fb7c8f879d 100644 --- a/gdb/hppa-hpux-tdep.c +++ b/gdb/hppa-hpux-tdep.c @@ -94,15 +94,22 @@ hppa_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi, } } +static void +hppa_hpux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +{ + set_gdbarch_pc_in_sigtramp (gdbarch, hppa_hpux_pc_in_sigtramp); +} static void hppa_hpux_som_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { + hppa_hpux_init_abi (info, gdbarch); } static void hppa_hpux_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { + hppa_hpux_init_abi (info, gdbarch); } void diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 0b84442f030..2a8ddc7dc31 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -129,9 +129,6 @@ static int restore_pc_queue (CORE_ADDR *); static int hppa_alignof (struct type *); -/* To support multi-threading and stepping. */ -int hppa_prepare_to_proceed (); - static int prologue_inst_adjust_sp (unsigned long); static int is_branch (unsigned long); @@ -4670,92 +4667,6 @@ unwind_command (char *exp, int from_tty) pin (Total_frame_size); } -#ifdef PREPARE_TO_PROCEED - -/* If the user has switched threads, and there is a breakpoint - at the old thread's pc location, then switch to that thread - and return TRUE, else return FALSE and don't do a thread - switch (or rather, don't seem to have done a thread switch). - - Ptrace-based gdb will always return FALSE to the thread-switch - query, and thus also to PREPARE_TO_PROCEED. - - The important thing is whether there is a BPT instruction, - not how many user breakpoints there are. So we have to worry - about things like these: - - o Non-bp stop -- NO - - o User hits bp, no switch -- NO - - o User hits bp, switches threads -- YES - - o User hits bp, deletes bp, switches threads -- NO - - o User hits bp, deletes one of two or more bps - at that PC, user switches threads -- YES - - o Plus, since we're buffering events, the user may have hit a - breakpoint, deleted the breakpoint and then gotten another - hit on that same breakpoint on another thread which - actually hit before the delete. (FIXME in breakpoint.c - so that "dead" breakpoints are ignored?) -- NO - - For these reasons, we have to violate information hiding and - call "breakpoint_here_p". If core gdb thinks there is a bpt - here, that's what counts, as core gdb is the one which is - putting the BPT instruction in and taking it out. - - Note that this implementation is potentially redundant now that - default_prepare_to_proceed() has been added. - - FIXME This may not support switching threads after Ctrl-C - correctly. The default implementation does support this. */ -int -hppa_prepare_to_proceed (void) -{ - pid_t old_thread; - pid_t current_thread; - - old_thread = hppa_switched_threads (PIDGET (inferior_ptid)); - if (old_thread != 0) - { - /* Switched over from "old_thread". Try to do - as little work as possible, 'cause mostly - we're going to switch back. */ - CORE_ADDR new_pc; - CORE_ADDR old_pc = read_pc (); - - /* Yuk, shouldn't use global to specify current - thread. But that's how gdb does it. */ - current_thread = PIDGET (inferior_ptid); - inferior_ptid = pid_to_ptid (old_thread); - - new_pc = read_pc (); - if (new_pc != old_pc /* If at same pc, no need */ - && breakpoint_here_p (new_pc)) - { - /* User hasn't deleted the BP. - Return TRUE, finishing switch to "old_thread". */ - flush_cached_frames (); - registers_changed (); -#if 0 - printf ("---> PREPARE_TO_PROCEED (was %d, now %d)!\n", - current_thread, PIDGET (inferior_ptid)); -#endif - - return 1; - } - - /* Otherwise switch back to the user-chosen thread. */ - inferior_ptid = pid_to_ptid (current_thread); - new_pc = read_pc (); /* Re-prime register cache */ - } - - return 0; -} -#endif /* PREPARE_TO_PROCEED */ - void hppa_skip_permanent_breakpoint (void) { @@ -4957,26 +4868,6 @@ hppa_cannot_store_register (int regnum) } -CORE_ADDR -hppa_frame_args_address (struct frame_info *fi) -{ - return get_frame_base (fi); -} - -CORE_ADDR -hppa_frame_locals_address (struct frame_info *fi) -{ - return get_frame_base (fi); -} - -int -hppa_frame_num_args (struct frame_info *frame) -{ - /* We can't tell how many args there are now that the C compiler delays - popping them. */ - return -1; -} - CORE_ADDR hppa_smash_text_address (CORE_ADDR addr) { @@ -4990,6 +4881,16 @@ hppa_smash_text_address (CORE_ADDR addr) return (addr &= ~0x3); } +/* Get the ith function argument for the current function. */ +CORE_ADDR +hppa_fetch_pointer_argument (struct frame_info *frame, int argi, + struct type *type) +{ + CORE_ADDR addr; + frame_read_register (frame, R0_REGNUM + 26 - argi, &addr); + return addr; +} + static struct gdbarch * hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { @@ -5032,13 +4933,13 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fp0_regnum (gdbarch, 64); set_gdbarch_pc_regnum (gdbarch, PCOQ_HEAD_REGNUM); set_gdbarch_npc_regnum (gdbarch, PCOQ_TAIL_REGNUM); - set_gdbarch_register_raw_size (gdbarch, hppa_register_raw_size); + set_gdbarch_deprecated_register_raw_size (gdbarch, hppa_register_raw_size); set_gdbarch_deprecated_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_deprecated_register_byte (gdbarch, hppa_register_byte); + set_gdbarch_deprecated_register_virtual_size (gdbarch, hppa_register_raw_size); 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_deprecated_register_virtual_type (gdbarch, hppa_register_virtual_type); set_gdbarch_deprecated_store_struct_return (gdbarch, hppa_store_struct_return); set_gdbarch_deprecated_extract_return_value (gdbarch, hppa_extract_return_value); @@ -5053,9 +4954,6 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frameless_function_invocation (gdbarch, hppa_frameless_function_invocation); set_gdbarch_deprecated_frame_saved_pc (gdbarch, hppa_frame_saved_pc); - set_gdbarch_frame_args_address (gdbarch, hppa_frame_args_address); - 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_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame); set_gdbarch_deprecated_pop_frame (gdbarch, hppa_pop_frame); @@ -5068,6 +4966,9 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, hppa_target_write_pc); set_gdbarch_deprecated_target_read_fp (gdbarch, hppa_target_read_fp); + /* Helper for function argument information. */ + set_gdbarch_fetch_pointer_argument (gdbarch, hppa_fetch_pointer_argument); + return gdbarch; } diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c index 0b8b04f9778..380a901e982 100644 --- a/gdb/hppah-nat.c +++ b/gdb/hppah-nat.c @@ -930,16 +930,6 @@ hppa_pid_or_tid_to_str (ptid_t id) return child_pid_to_str (id); } -/* This function has no meaning in a non-threaded world. Thus, we - return 0 (FALSE). See the use of "hppa_prepare_to_proceed" in - hppa-tdep.c. */ - -pid_t -hppa_switched_threads (pid_t pid) -{ - return (pid_t) 0; -} - void hppa_ensure_vforking_parent_remains_stopped (int pid) { diff --git a/gdb/hpread.c b/gdb/hpread.c index 885d4627739..3e2179aac3d 100644 --- a/gdb/hpread.c +++ b/gdb/hpread.c @@ -140,9 +140,7 @@ lbrac_mismatch_complaint (int arg1) /* Forward procedure declarations */ -static void set_namestring (union dnttentry *sym, char **namep, - struct objfile *objfile); - +/* Used in somread.c. */ void hpread_symfile_init (struct objfile *); void do_pxdb (bfd *); @@ -151,6 +149,9 @@ void hpread_build_psymtabs (struct objfile *, int); void hpread_symfile_finish (struct objfile *); +static void set_namestring (union dnttentry *sym, char **namep, + struct objfile *objfile); + static union dnttentry *hpread_get_gntt (int, struct objfile *); static union dnttentry *hpread_get_lntt (int index, struct objfile *objfile); @@ -172,11 +173,11 @@ static unsigned long hpread_get_line (sltpointer, struct objfile *); static CORE_ADDR hpread_get_location (sltpointer, struct objfile *); -int hpread_has_name (enum dntt_entry_type kind); +static int hpread_has_name (enum dntt_entry_type kind); static void hpread_psymtab_to_symtab_1 (struct partial_symtab *); -void hpread_psymtab_to_symtab (struct partial_symtab *); +static void hpread_psymtab_to_symtab (struct partial_symtab *); static struct symtab *hpread_expand_symtab (struct objfile *, int, int, CORE_ADDR, int, @@ -261,7 +262,7 @@ static struct type *fixup_method = NULL; #include "gdb_string.h" /* check for the existence of a file, given its full pathname */ -int +static int file_exists (char *filename) { if (filename) @@ -321,7 +322,7 @@ set_namestring (union dnttentry *sym, char **namep, struct objfile *objfile) NOTE: uses system function and string functions directly. Return value: 1 if ok, 0 if not */ -int +static int hpread_call_pxdb (const char *file_name) { char *p; @@ -354,7 +355,7 @@ hpread_call_pxdb (const char *file_name) by PXDB, and we have thus called PXDB to do this processing and the file therefore needs to be re-loaded. Otherwise return 0. */ -int +static int hpread_pxdb_needed (bfd *sym_bfd) { asection *pinfo_section, *debug_section, *header_section; @@ -837,7 +838,7 @@ scan_procs (int *curr_pd_p, quick_procedure_entry *qPD, int max_procs, a file can result in a compiled object which does not have a module entry for it, so in such cases we create a psymtab for the file. */ -int +static int hpread_quick_traverse (struct objfile *objfile, char *gntt_bits, char *vt_bits, PXDB_header_ptr pxdb_header_p) { @@ -1542,7 +1543,7 @@ hpread_quick_traverse (struct objfile *objfile, char *gntt_bits, /* Get appropriate header, based on pxdb type. Return value: 1 if ok, 0 if not */ -int +static int hpread_get_header (struct objfile *objfile, PXDB_header_ptr pxdb_header_p) { asection *pinfo_section, *debug_section, *header_section; @@ -2294,7 +2295,7 @@ hpread_symfile_finish (struct objfile *objfile) /* Various small functions to get entries in the debug symbol sections. */ -union dnttentry * +static union dnttentry * hpread_get_lntt (int index, struct objfile *objfile) { return (union dnttentry *) @@ -2308,7 +2309,7 @@ hpread_get_gntt (int index, struct objfile *objfile) &(GNTT (objfile)[(index * sizeof (struct dntt_type_block))]); } -union sltentry * +static union sltentry * hpread_get_slt (int index, struct objfile *objfile) { return (union sltentry *) &(SLT (objfile)[index * sizeof (union sltentry)]); @@ -2588,7 +2589,7 @@ hpread_get_location (sltpointer index, struct objfile *objfile) * leave it here in case it proves useful later on. - RT). */ -int +static int hpread_has_name (enum dntt_entry_type kind) { switch (kind) @@ -2720,7 +2721,7 @@ hpread_psymtab_to_symtab_1 (struct partial_symtab *pst) /* Read in all of the symbols for a given psymtab for real. Be verbose about it if the user wants that. */ -void +static void hpread_psymtab_to_symtab (struct partial_symtab *pst) { /* Get out quick if given junk. */ @@ -5015,7 +5016,7 @@ hpread_record_lines (struct subfile *subfile, sltpointer s_idx, * Called from hpread_process_one_debug_symbol() * If "f" is not a member function, return NULL. */ -char * +static char * class_of (struct type *functype) { struct type *first_param_type; diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c index 02f5acd9a90..ed55c341596 100644 --- a/gdb/hpux-thread.c +++ b/gdb/hpux-thread.c @@ -360,8 +360,8 @@ hpux_thread_store_registers (int regno) &deprecated_registers[REGISTER_BYTE (regno)], REGISTER_RAW_SIZE (regno)); tcb_ptr->static_ctx.sp = (cma__t_hppa_regs *) - (extract_address (&deprecated_registers[REGISTER_BYTE (regno)], - REGISTER_RAW_SIZE (regno)) + 160); + (extract_unsigned_integer (&deprecated_registers[REGISTER_BYTE (regno)], + REGISTER_RAW_SIZE (regno)) + 160); } else if (regno == PC_REGNUM) write_memory (sp - 20, diff --git a/gdb/i386-cygwin-tdep.c b/gdb/i386-cygwin-tdep.c index 5911ec9b91a..443f8f7c223 100644 --- a/gdb/i386-cygwin-tdep.c +++ b/gdb/i386-cygwin-tdep.c @@ -1,56 +1,30 @@ /* Target-dependent code for Cygwin running on i386's, for GDB. + Copyright 2003 Free Software Foundation, Inc. -This file is part of GDB. + This file is part of GDB. -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 "defs.h" - -#include "gdb_string.h" -#include "gdbcore.h" -#include "i386-tdep.h" #include "osabi.h" -#include "frame.h" -#include "dummy-frame.h" - -static int -i386_cygwin_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe) -{ - /* In the context where this is used, we get the saved PC before we've - successfully unwound far enough to be sure what we've got (it may - be a signal handler caller). If we're dealing with a signal - handler caller, this will return valid, which is fine. If not, - it'll make the correct test. */ - return ((get_frame_type (thisframe) == SIGTRAMP_FRAME) || chain != 0); -} -/* Return the chain-pointer for FRAME. In the case of the i386, the - frame's nominal address is the address of a 4-byte word containing - the calling frame's address. */ -static CORE_ADDR -i386_cygwin_frame_chain (struct frame_info *frame) -{ - if (pc_in_dummy_frame (get_frame_pc (frame))) - return get_frame_base (frame); - if (get_frame_type (frame) == SIGTRAMP_FRAME - || i386_frameless_signal_p (frame)) - return get_frame_base (frame); +#include "gdb_string.h" - return read_memory_unsigned_integer (get_frame_base (frame), 4); -} +#include "i386-tdep.h" static void i386_cygwin_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) @@ -58,8 +32,6 @@ i386_cygwin_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); tdep->struct_return = reg_struct_return; - set_gdbarch_deprecated_frame_chain (gdbarch, i386_cygwin_frame_chain); - set_gdbarch_deprecated_frame_chain_valid (gdbarch, i386_cygwin_frame_chain_valid); } static enum gdb_osabi @@ -75,6 +47,9 @@ i386_cygwin_osabi_sniffer (bfd * abfd) return GDB_OSABI_UNKNOWN; } +/* Provide a prototype to silence -Wmissing-prototypes. */ +void _initialize_i386_cygwin_tdep (void); + void _initialize_i386_cygwin_tdep (void) { diff --git a/gdb/i386-interix-tdep.c b/gdb/i386-interix-tdep.c index 7713863e4d7..2fced7202cd 100644 --- a/gdb/i386-interix-tdep.c +++ b/gdb/i386-interix-tdep.c @@ -90,7 +90,7 @@ pei_adjust_objfile_offsets (struct objfile *objfile, return; } - for (i = 0; i < SECT_OFF_MAX; i++) + for (i = 0; i < objfile->num_sections; i++) { (objfile->section_offsets)->offsets[i] += symbols_offset; } diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index cf769d87edc..81be404a0f4 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -70,6 +70,9 @@ /* Defines I386_LINUX_ORIG_EAX_REGNUM. */ #include "i386-linux-tdep.h" +/* Defines ps_err_e, struct ps_prochandle. */ +#include "gdb_proc_service.h" + /* Prototypes for local functions. */ static void dummy_sse_values (void); @@ -683,6 +686,21 @@ i386_linux_dr_set (int regnum, unsigned long value) perror_with_name ("Couldn't write debug register"); } +extern ps_err_e +ps_get_thread_area(const struct ps_prochandle *ph, + lwpid_t lwpid, int idx, void **base) +{ + unsigned long int desc[3]; +#define PTRACE_GET_THREAD_AREA 25 + + if (ptrace (PTRACE_GET_THREAD_AREA, + lwpid, (void *) idx, (unsigned long) &desc) < 0) + return PS_ERR; + + *(int *)base = desc[1]; + return PS_OK; +} + void i386_linux_dr_set_control (unsigned long control) { @@ -852,7 +870,7 @@ child_resume (ptid_t ptid, int step, enum target_signal signal) /* Then check the system call number. */ if (syscall == SYS_sigreturn || syscall == SYS_rt_sigreturn) { - CORE_ADDR sp = read_register (SP_REGNUM); + CORE_ADDR sp = read_register (I386_ESP_REGNUM); CORE_ADDR addr = sp; unsigned long int eflags; diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index afff5485edc..6d284f1ea98 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -81,7 +81,7 @@ i386_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum, The instruction sequence for normal signals is pop %eax - mov $0x77,%eax + mov $0x77, %eax int $0x80 or 0x58 0xb8 0x77 0x00 0x00 0x00 0xcd 0x80. @@ -103,17 +103,17 @@ i386_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum, to the ones used by the kernel. Therefore, these trampolines are supported too. */ -#define LINUX_SIGTRAMP_INSN0 (0x58) /* pop %eax */ -#define LINUX_SIGTRAMP_OFFSET0 (0) -#define LINUX_SIGTRAMP_INSN1 (0xb8) /* mov $NNNN,%eax */ -#define LINUX_SIGTRAMP_OFFSET1 (1) -#define LINUX_SIGTRAMP_INSN2 (0xcd) /* int */ -#define LINUX_SIGTRAMP_OFFSET2 (6) +#define LINUX_SIGTRAMP_INSN0 0x58 /* pop %eax */ +#define LINUX_SIGTRAMP_OFFSET0 0 +#define LINUX_SIGTRAMP_INSN1 0xb8 /* mov $NNNN, %eax */ +#define LINUX_SIGTRAMP_OFFSET1 1 +#define LINUX_SIGTRAMP_INSN2 0xcd /* int */ +#define LINUX_SIGTRAMP_OFFSET2 6 static const unsigned char linux_sigtramp_code[] = { LINUX_SIGTRAMP_INSN0, /* pop %eax */ - LINUX_SIGTRAMP_INSN1, 0x77, 0x00, 0x00, 0x00, /* mov $0x77,%eax */ + LINUX_SIGTRAMP_INSN1, 0x77, 0x00, 0x00, 0x00, /* mov $0x77, %eax */ LINUX_SIGTRAMP_INSN2, 0x80 /* int $0x80 */ }; @@ -167,20 +167,20 @@ i386_linux_sigtramp_start (CORE_ADDR pc) /* This function does the same for RT signals. Here the instruction sequence is - mov $0xad,%eax + mov $0xad, %eax int $0x80 or 0xb8 0xad 0x00 0x00 0x00 0xcd 0x80. The effect is to call the system call rt_sigreturn. */ -#define LINUX_RT_SIGTRAMP_INSN0 (0xb8) /* mov $NNNN,%eax */ -#define LINUX_RT_SIGTRAMP_OFFSET0 (0) -#define LINUX_RT_SIGTRAMP_INSN1 (0xcd) /* int */ -#define LINUX_RT_SIGTRAMP_OFFSET1 (5) +#define LINUX_RT_SIGTRAMP_INSN0 0xb8 /* mov $NNNN, %eax */ +#define LINUX_RT_SIGTRAMP_OFFSET0 0 +#define LINUX_RT_SIGTRAMP_INSN1 0xcd /* int */ +#define LINUX_RT_SIGTRAMP_OFFSET1 5 static const unsigned char linux_rt_sigtramp_code[] = { - LINUX_RT_SIGTRAMP_INSN0, 0xad, 0x00, 0x00, 0x00, /* mov $0xad,%eax */ + LINUX_RT_SIGTRAMP_INSN0, 0xad, 0x00, 0x00, 0x00, /* mov $0xad, %eax */ LINUX_RT_SIGTRAMP_INSN1, 0x80 /* int $0x80 */ }; @@ -239,50 +239,47 @@ i386_linux_pc_in_sigtramp (CORE_ADDR pc, char *name) || strcmp ("__restore_rt", name) == 0); } -/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the - address of the associated sigcontext structure. */ +/* Offset to struct sigcontext in ucontext, from . */ +#define I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 20 + +/* Assuming NEXT_FRAME is a frame following a GNU/Linux sigtramp + routine, return the address of the associated sigcontext structure. */ static CORE_ADDR -i386_linux_sigcontext_addr (struct frame_info *frame) +i386_linux_sigcontext_addr (struct frame_info *next_frame) { CORE_ADDR pc; + CORE_ADDR sp; + char buf[4]; + + frame_unwind_register (next_frame, I386_ESP_REGNUM, buf); + sp = extract_unsigned_integer (buf, 4); - pc = i386_linux_sigtramp_start (get_frame_pc (frame)); + pc = i386_linux_sigtramp_start (frame_pc_unwind (next_frame)); if (pc) { - CORE_ADDR sp; - - if (get_next_frame (frame)) - /* If this isn't the top frame, the next frame must be for the - signal handler itself. The sigcontext structure lives on - the stack, right after the signum argument. */ - return get_frame_base (get_next_frame (frame)) + 12; - - /* This is the top frame. We'll have to find the address of the - sigcontext structure by looking at the stack pointer. Keep - in mind that the first instruction of the sigtramp code is - "pop %eax". If the PC is at this instruction, adjust the - returned value accordingly. */ - sp = read_register (SP_REGNUM); - if (pc == get_frame_pc (frame)) + /* The sigcontext structure lives on the stack, right after + the signum argument. We determine the address of the + sigcontext structure by looking at the frame's stack + pointer. Keep in mind that the first instruction of the + sigtramp code is "pop %eax". If the PC is after this + instruction, adjust the returned value accordingly. */ + if (pc == frame_pc_unwind (next_frame)) return sp + 4; return sp; } - pc = i386_linux_rt_sigtramp_start (get_frame_pc (frame)); + pc = i386_linux_rt_sigtramp_start (frame_pc_unwind (next_frame)); if (pc) { - if (get_next_frame (frame)) - /* If this isn't the top frame, the next frame must be for the - signal handler itself. The sigcontext structure is part of - the user context. A pointer to the user context is passed - as the third argument to the signal handler. */ - return read_memory_integer (get_frame_base (get_next_frame (frame)) - + 16, 4) + 20; - - /* This is the top frame. Again, use the stack pointer to find - the address of the sigcontext structure. */ - return read_memory_integer (read_register (SP_REGNUM) + 8, 4) + 20; + CORE_ADDR ucontext_addr; + + /* The sigcontext structure is part of the user context. A + pointer to the user context is passed as the third argument + to the signal handler. */ + read_memory (sp + 8, buf, 4); + ucontext_addr = extract_unsigned_integer (buf, 4) + 20; + return ucontext_addr + I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET; } error ("Couldn't recognize signal trampoline."); @@ -294,7 +291,7 @@ i386_linux_sigcontext_addr (struct frame_info *frame) static void i386_linux_write_pc (CORE_ADDR pc, ptid_t ptid) { - write_register_pid (PC_REGNUM, pc, ptid); + write_register_pid (I386_EIP_REGNUM, pc, ptid); /* We must be careful with modifying the program counter. If we just interrupted a system call, the kernel might try to restart @@ -322,7 +319,7 @@ i386_linux_write_pc (CORE_ADDR pc, ptid_t ptid) be considered too special-purpose for general consumption. */ static struct minimal_symbol * -find_minsym_and_objfile (char *name, struct objfile **objfile_p) +find_minsym_and_objfile (char *name, struct objfile **objfilep) { struct objfile *objfile; @@ -335,7 +332,7 @@ find_minsym_and_objfile (char *name, struct objfile **objfile_p) if (SYMBOL_LINKAGE_NAME (msym) && strcmp (SYMBOL_LINKAGE_NAME (msym), name) == 0) { - *objfile_p = objfile; + *objfilep = objfile; return msym; } } @@ -345,9 +342,9 @@ find_minsym_and_objfile (char *name, struct objfile **objfile_p) } static CORE_ADDR -skip_hurd_resolver (CORE_ADDR pc) +skip_gnu_resolver (CORE_ADDR pc) { - /* The HURD dynamic linker is part of the GNU C library, so many + /* The GNU dynamic linker is part of the GNU C library, so many GNU/Linux distributions use it. (All ELF versions, as far as I know.) An unresolved PLT entry points to "_dl_runtime_resolve", which calls "fixup" to patch the PLT, and then passes control to @@ -374,7 +371,7 @@ skip_hurd_resolver (CORE_ADDR pc) = lookup_minimal_symbol ("fixup", NULL, objfile); if (fixup && SYMBOL_VALUE_ADDRESS (fixup) == pc) - return (DEPRECATED_SAVED_PC_AFTER_CALL (get_current_frame ())); + return frame_pc_unwind (get_current_frame ()); } return 0; @@ -393,7 +390,7 @@ i386_linux_skip_solib_resolver (CORE_ADDR pc) CORE_ADDR result; /* Plug in functions for other kinds of resolvers here. */ - result = skip_hurd_resolver (pc); + result = skip_gnu_resolver (pc); if (result) return result; @@ -442,6 +439,27 @@ i386_linux_svr4_fetch_link_map_offsets (void) } +/* From . */ +static int i386_linux_sc_reg_offset[I386_NUM_GREGS] = +{ + 11 * 4, /* %eax */ + 10 * 4, /* %ecx */ + 9 * 4, /* %edx */ + 8 * 4, /* %ebx */ + 7 * 4, /* %esp */ + 6 * 4, /* %ebp */ + 5 * 4, /* %esi */ + 4 * 4, /* %edi */ + 14 * 4, /* %eip */ + 16 * 4, /* %eflags */ + 15 * 4, /* %cs */ + 18 * 4, /* %ss */ + 3 * 4, /* %ds */ + 2 * 4, /* %es */ + 1 * 4, /* %fs */ + 0 * 4 /* %gs */ +}; + static void i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -461,13 +479,12 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_num_regs (gdbarch, I386_SSE_NUM_REGS + 1); set_gdbarch_register_name (gdbarch, i386_linux_register_name); set_gdbarch_register_reggroup_p (gdbarch, i386_linux_register_reggroup_p); - set_gdbarch_deprecated_register_bytes (gdbarch, I386_SSE_SIZEOF_REGS + 4); tdep->jb_pc_offset = 20; /* From . */ tdep->sigcontext_addr = i386_linux_sigcontext_addr; - tdep->sc_pc_offset = 14 * 4; /* From . */ - tdep->sc_sp_offset = 7 * 4; + tdep->sc_reg_offset = i386_linux_sc_reg_offset; + tdep->sc_num_regs = I386_NUM_GREGS; /* When the i386 Linux kernel calls a signal handler, the return address points to a bit of code on the stack. This function is diff --git a/gdb/i386-nto-tdep.c b/gdb/i386-nto-tdep.c index b35dd2a13b7..f9a2887e044 100644 --- a/gdb/i386-nto-tdep.c +++ b/gdb/i386-nto-tdep.c @@ -231,14 +231,21 @@ i386nto_pc_in_sigtramp (CORE_ADDR pc, char *name) return name && strcmp ("__signalstub", name) == 0; } -#define SIGCONTEXT_OFFSET 136 +#define I386_NTO_SIGCONTEXT_OFFSET 136 + +/* Assuming NEXT_FRAME is a frame following a QNX Neutrino sigtramp + routine, return the address of the associated sigcontext structure. */ + static CORE_ADDR -i386nto_sigcontext_addr (struct frame_info *frame) +i386nto_sigcontext_addr (struct frame_info *next_frame) { - if (get_next_frame (frame)) - return get_frame_base (get_next_frame (frame)) + SIGCONTEXT_OFFSET; + char buf[4]; + CORE_ADDR sp; + + frame_unwind_register (next_frame, SP_REGNUM, buf); + sp = extract_unsigned_integer (buf, 4); - return read_register (SP_REGNUM) + SIGCONTEXT_OFFSET; + return sp + I386_NTO_SIGCONTEXT_OFFSET; } static void diff --git a/gdb/i386-sol2-tdep.c b/gdb/i386-sol2-tdep.c index a52b18850fb..78487af4658 100644 --- a/gdb/i386-sol2-tdep.c +++ b/gdb/i386-sol2-tdep.c @@ -42,12 +42,8 @@ i386_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Solaris is SVR4-based. */ i386_svr4_init_abi (info, gdbarch); - /* Signal trampolines are different from SVR4, in fact they're - rather similar to BSD. */ + /* Signal trampolines are slightly different from SVR4. */ set_gdbarch_pc_in_sigtramp (gdbarch, i386_sol2_pc_in_sigtramp); - tdep->sigcontext_addr = i386bsd_sigcontext_addr; - tdep->sc_pc_offset = 36 + 14 * 4; - tdep->sc_sp_offset = 36 + 17 * 4; } diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 0428c13dabb..3b981806dc2 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -21,25 +21,29 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" -#include "gdb_string.h" +#include "arch-utils.h" +#include "command.h" +#include "dummy-frame.h" +#include "dwarf2-frame.h" +#include "doublest.h" +#include "floatformat.h" #include "frame.h" +#include "frame-base.h" +#include "frame-unwind.h" #include "inferior.h" +#include "gdbcmd.h" #include "gdbcore.h" #include "objfiles.h" -#include "target.h" -#include "floatformat.h" +#include "osabi.h" +#include "regcache.h" +#include "reggroups.h" #include "symfile.h" #include "symtab.h" -#include "gdbcmd.h" -#include "command.h" -#include "arch-utils.h" -#include "regcache.h" -#include "doublest.h" +#include "target.h" #include "value.h" + #include "gdb_assert.h" -#include "reggroups.h" -#include "dummy-frame.h" -#include "osabi.h" +#include "gdb_string.h" #include "i386-tdep.h" #include "i387-tdep.h" @@ -122,12 +126,12 @@ i386_mxcsr_regnum_p (int regnum) const char * i386_register_name (int reg) { - if (reg >= 0 && reg < i386_num_register_names) - return i386_register_names[reg]; - if (i386_mmx_regnum_p (reg)) return i386_mmx_names[reg - MM0_REGNUM]; + if (reg >= 0 && reg < i386_num_register_names) + return i386_register_names[reg]; + return NULL; } @@ -140,7 +144,7 @@ i386_stab_reg_to_regnum (int reg) /* This implements what GCC calls the "default" register map. */ if (reg >= 0 && reg <= 7) { - /* General registers. */ + /* General-purpose registers. */ return reg; } else if (reg >= 12 && reg <= 19) @@ -173,7 +177,7 @@ i386_dwarf_reg_to_regnum (int reg) numbers the floating point registers differently. */ if (reg >= 0 && reg <= 9) { - /* General registers. */ + /* General-purpose registers. */ return reg; } else if (reg >= 11 && reg <= 18) @@ -203,412 +207,359 @@ static const char *valid_flavors[] = NULL }; static const char *disassembly_flavor = att_flavor; + -/* Stdio style buffering was used to minimize calls to ptrace, but - this buffering did not take into account that the code section - being accessed may not be an even number of buffers long (even if - the buffer is only sizeof(int) long). In cases where the code - section size happened to be a non-integral number of buffers long, - attempting to read the last buffer would fail. Simply using - target_read_memory and ignoring errors, rather than read_memory, is - not the correct solution, since legitimate access errors would then - be totally ignored. To properly handle this situation and continue - to use buffering would require that this code be able to determine - the minimum code section size granularity (not the alignment of the - section itself, since the actual failing case that pointed out this - problem had a section alignment of 4 but was not a multiple of 4 - bytes long), on a target by target basis, and then adjust it's - buffer size accordingly. This is messy, but potentially feasible. - It probably needs the bfd library's help and support. For now, the - buffer size is set to 1. (FIXME -fnf) */ - -#define CODESTREAM_BUFSIZ 1 /* Was sizeof(int), see note above. */ -static CORE_ADDR codestream_next_addr; -static CORE_ADDR codestream_addr; -static unsigned char codestream_buf[CODESTREAM_BUFSIZ]; -static int codestream_off; -static int codestream_cnt; - -#define codestream_tell() (codestream_addr + codestream_off) -#define codestream_peek() \ - (codestream_cnt == 0 ? \ - codestream_fill(1) : codestream_buf[codestream_off]) -#define codestream_get() \ - (codestream_cnt-- == 0 ? \ - codestream_fill(0) : codestream_buf[codestream_off++]) - -static unsigned char -codestream_fill (int peek_flag) -{ - codestream_addr = codestream_next_addr; - codestream_next_addr += CODESTREAM_BUFSIZ; - codestream_off = 0; - codestream_cnt = CODESTREAM_BUFSIZ; - read_memory (codestream_addr, (char *) codestream_buf, CODESTREAM_BUFSIZ); - - if (peek_flag) - return (codestream_peek ()); - else - return (codestream_get ()); -} +/* Use the program counter to determine the contents and size of a + breakpoint instruction. Return a pointer to a string of bytes that + encode a breakpoint instruction, store the length of the string in + *LEN and optionally adjust *PC to point to the correct memory + location for inserting the breakpoint. -static void -codestream_seek (CORE_ADDR place) -{ - codestream_next_addr = place / CODESTREAM_BUFSIZ; - codestream_next_addr *= CODESTREAM_BUFSIZ; - codestream_cnt = 0; - codestream_fill (1); - while (codestream_tell () != place) - codestream_get (); -} + On the i386 we have a single breakpoint that fits in a single byte + and can be inserted anywhere. -static void -codestream_read (unsigned char *buf, int count) + This function is 64-bit safe. */ + +static const unsigned char * +i386_breakpoint_from_pc (CORE_ADDR *pc, int *len) { - unsigned char *p; - int i; - p = buf; - for (i = 0; i < count; i++) - *p++ = codestream_get (); + static unsigned char break_insn[] = { 0xcc }; /* int 3 */ + + *len = sizeof (break_insn); + return break_insn; } +#ifdef I386_REGNO_TO_SYMMETRY +#error "The Sequent Symmetry is no longer supported." +#endif -/* If the next instruction is a jump, move to its target. */ +/* According to the System V ABI, the registers %ebp, %ebx, %edi, %esi + and %esp "belong" to the calling function. Therefore these + registers should be saved if they're going to be modified. */ -static void -i386_follow_jump (void) +/* The maximum number of saved registers. This should include all + registers mentioned above, and %eip. */ +#define I386_NUM_SAVED_REGS I386_NUM_GREGS + +struct i386_frame_cache { - unsigned char buf[4]; - long delta; + /* Base address. */ + CORE_ADDR base; + CORE_ADDR sp_offset; + CORE_ADDR pc; + + /* Saved registers. */ + CORE_ADDR saved_regs[I386_NUM_SAVED_REGS]; + CORE_ADDR saved_sp; + int pc_in_eax; + + /* Stack space reserved for local variables. */ + long locals; +}; + +/* Allocate and initialize a frame cache. */ + +static struct i386_frame_cache * +i386_alloc_frame_cache (void) +{ + struct i386_frame_cache *cache; + int i; + + cache = FRAME_OBSTACK_ZALLOC (struct i386_frame_cache); + + /* Base address. */ + cache->base = 0; + cache->sp_offset = -4; + cache->pc = 0; + + /* Saved registers. We initialize these to -1 since zero is a valid + offset (that's where %ebp is supposed to be stored). */ + for (i = 0; i < I386_NUM_SAVED_REGS; i++) + cache->saved_regs[i] = -1; + cache->saved_sp = 0; + cache->pc_in_eax = 0; + + /* Frameless until proven otherwise. */ + cache->locals = -1; + + return cache; +} - int data16; - CORE_ADDR pos; +/* If the instruction at PC is a jump, return the address of its + target. Otherwise, return PC. */ - pos = codestream_tell (); +static CORE_ADDR +i386_follow_jump (CORE_ADDR pc) +{ + unsigned char op; + long delta = 0; + int data16 = 0; - data16 = 0; - if (codestream_peek () == 0x66) + op = read_memory_unsigned_integer (pc, 1); + if (op == 0x66) { - codestream_get (); data16 = 1; + op = read_memory_unsigned_integer (pc + 1, 1); } - switch (codestream_get ()) + switch (op) { case 0xe9: /* Relative jump: if data16 == 0, disp32, else disp16. */ if (data16) { - codestream_read (buf, 2); - delta = extract_signed_integer (buf, 2); + delta = read_memory_integer (pc + 2, 2); /* Include the size of the jmp instruction (including the 0x66 prefix). */ - pos += delta + 4; + delta += 4; } else { - codestream_read (buf, 4); - delta = extract_signed_integer (buf, 4); + delta = read_memory_integer (pc + 1, 4); - pos += delta + 5; + /* Include the size of the jmp instruction. */ + delta += 5; } break; case 0xeb: /* Relative jump, disp8 (ignore data16). */ - codestream_read (buf, 1); - /* Sign-extend it. */ - delta = extract_signed_integer (buf, 1); + delta = read_memory_integer (pc + data16 + 1, 1); - pos += delta + 2; + delta += data16 + 2; break; } - codestream_seek (pos); -} -/* Find & return the amount a local space allocated, and advance the - codestream to the first register push (if any). + return pc + delta; +} - If the entry sequence doesn't make sense, return -1, and leave - codestream pointer at a random spot. */ +/* Check whether PC points at a prologue for a function returning a + structure or union. If so, it updates CACHE and returns the + address of the first instruction after the code sequence that + removes the "hidden" argument from the stack or CURRENT_PC, + whichever is smaller. Otherwise, return PC. */ -static long -i386_get_frame_setup (CORE_ADDR pc) +static CORE_ADDR +i386_analyze_struct_return (CORE_ADDR pc, CORE_ADDR current_pc, + struct i386_frame_cache *cache) { + /* Functions that return a structure or union start with: + + popl %eax 0x58 + xchgl %eax, (%esp) 0x87 0x04 0x24 + or xchgl %eax, 0(%esp) 0x87 0x44 0x24 0x00 + + (the System V compiler puts out the second `xchg' instruction, + and the assembler doesn't try to optimize it, so the 'sib' form + gets generated). This sequence is used to get the address of the + return buffer for a function that returns a structure. */ + static unsigned char proto1[3] = { 0x87, 0x04, 0x24 }; + static unsigned char proto2[4] = { 0x87, 0x44, 0x24, 0x00 }; + unsigned char buf[4]; unsigned char op; - codestream_seek (pc); + if (current_pc <= pc) + return pc; + + op = read_memory_unsigned_integer (pc, 1); - i386_follow_jump (); + if (op != 0x58) /* popl %eax */ + return pc; - op = codestream_get (); + read_memory (pc + 1, buf, 4); + if (memcmp (buf, proto1, 3) != 0 && memcmp (buf, proto2, 4) != 0) + return pc; - if (op == 0x58) /* popl %eax */ + if (current_pc == pc) { - /* This function must start with - - popl %eax 0x58 - xchgl %eax, (%esp) 0x87 0x04 0x24 - or xchgl %eax, 0(%esp) 0x87 0x44 0x24 0x00 - - (the System V compiler puts out the second `xchg' - instruction, and the assembler doesn't try to optimize it, so - the 'sib' form gets generated). This sequence is used to get - the address of the return buffer for a function that returns - a structure. */ - int pos; - unsigned char buf[4]; - static unsigned char proto1[3] = { 0x87, 0x04, 0x24 }; - static unsigned char proto2[4] = { 0x87, 0x44, 0x24, 0x00 }; - - pos = codestream_tell (); - codestream_read (buf, 4); - if (memcmp (buf, proto1, 3) == 0) - pos += 3; - else if (memcmp (buf, proto2, 4) == 0) - pos += 4; - - codestream_seek (pos); - op = codestream_get (); /* Update next opcode. */ + cache->sp_offset += 4; + return current_pc; } - if (op == 0x68 || op == 0x6a) + if (current_pc == pc + 1) { - /* This function may start with + cache->pc_in_eax = 1; + return current_pc; + } + + if (buf[1] == proto1[1]) + return pc + 4; + else + return pc + 5; +} + +static CORE_ADDR +i386_skip_probe (CORE_ADDR pc) +{ + /* A function may start with - pushl constant - call _probe - addl $4, %esp + pushl constant + call _probe + addl $4, %esp - followed by + followed by + + pushl %ebp - pushl %ebp + etc. */ + unsigned char buf[8]; + unsigned char op; + + op = read_memory_unsigned_integer (pc, 1); - etc. */ - int pos; - unsigned char buf[8]; + if (op == 0x68 || op == 0x6a) + { + int delta; - /* Skip past the `pushl' instruction; it has either a one-byte - or a four-byte operand, depending on the opcode. */ - pos = codestream_tell (); + /* Skip past the `pushl' instruction; it has either a one-byte or a + four-byte operand, depending on the opcode. */ if (op == 0x68) - pos += 4; + delta = 5; else - pos += 1; - codestream_seek (pos); + delta = 2; - /* Read the following 8 bytes, which should be "call _probe" (6 - bytes) followed by "addl $4,%esp" (2 bytes). */ - codestream_read (buf, sizeof (buf)); + /* Read the following 8 bytes, which should be `call _probe' (6 + bytes) followed by `addl $4,%esp' (2 bytes). */ + read_memory (pc + delta, buf, sizeof (buf)); if (buf[0] == 0xe8 && buf[6] == 0xc4 && buf[7] == 0x4) - pos += sizeof (buf); - codestream_seek (pos); - op = codestream_get (); /* Update next opcode. */ + pc += delta + sizeof (buf); } + return pc; +} + +/* Check whether PC points at a code that sets up a new stack frame. + If so, it updates CACHE and returns the address of the first + instruction after the sequence that sets removes the "hidden" + argument from the stack or CURRENT_PC, whichever is smaller. + Otherwise, return PC. */ + +static CORE_ADDR +i386_analyze_frame_setup (CORE_ADDR pc, CORE_ADDR current_pc, + struct i386_frame_cache *cache) +{ + unsigned char op; + + if (current_pc <= pc) + return current_pc; + + op = read_memory_unsigned_integer (pc, 1); + if (op == 0x55) /* pushl %ebp */ { - /* Check for "movl %esp, %ebp" -- can be written in two ways. */ - switch (codestream_get ()) + /* Take into account that we've executed the `pushl %ebp' that + starts this instruction sequence. */ + cache->saved_regs[I386_EBP_REGNUM] = 0; + cache->sp_offset += 4; + + /* If that's all, return now. */ + if (current_pc <= pc + 1) + return current_pc; + + /* Check for `movl %esp, %ebp' -- can be written in two ways. */ + op = read_memory_unsigned_integer (pc + 1, 1); + switch (op) { case 0x8b: - if (codestream_get () != 0xec) - return -1; + if (read_memory_unsigned_integer (pc + 2, 1) != 0xec) + return pc + 1; break; case 0x89: - if (codestream_get () != 0xe5) - return -1; + if (read_memory_unsigned_integer (pc + 2, 1) != 0xe5) + return pc + 1; break; default: - return -1; + return pc + 1; } + + /* OK, we actually have a frame. We just don't know how large it is + yet. Set its size to zero. We'll adjust it if necessary. */ + cache->locals = 0; + + /* If that's all, return now. */ + if (current_pc <= pc + 3) + return current_pc; + /* Check for stack adjustment - subl $XXX, %esp + subl $XXX, %esp NOTE: You can't subtract a 16 bit immediate from a 32 bit reg, so we don't have to worry about a data16 prefix. */ - op = codestream_peek (); + op = read_memory_unsigned_integer (pc + 3, 1); if (op == 0x83) { /* `subl' with 8 bit immediate. */ - codestream_get (); - if (codestream_get () != 0xec) + if (read_memory_unsigned_integer (pc + 4, 1) != 0xec) /* Some instruction starting with 0x83 other than `subl'. */ - { - codestream_seek (codestream_tell () - 2); - return 0; - } - /* `subl' with signed byte immediate (though it wouldn't - make sense to be negative). */ - return (codestream_get ()); + return pc + 3; + + /* `subl' with signed byte immediate (though it wouldn't make + sense to be negative). */ + cache->locals = read_memory_integer (pc + 5, 1); + return pc + 6; } else if (op == 0x81) { - char buf[4]; /* Maybe it is `subl' with a 32 bit immedediate. */ - codestream_get (); - if (codestream_get () != 0xec) + if (read_memory_unsigned_integer (pc + 4, 1) != 0xec) /* Some instruction starting with 0x81 other than `subl'. */ - { - codestream_seek (codestream_tell () - 2); - return 0; - } + return pc + 3; + /* It is `subl' with a 32 bit immediate. */ - codestream_read ((unsigned char *) buf, 4); - return extract_signed_integer (buf, 4); + cache->locals = read_memory_integer (pc + 5, 4); + return pc + 9; } else { - return 0; + /* Some instruction other than `subl'. */ + return pc + 3; } } - else if (op == 0xc8) + else if (op == 0xc8) /* enter $XXX */ { - char buf[2]; - /* `enter' with 16 bit unsigned immediate. */ - codestream_read ((unsigned char *) buf, 2); - codestream_get (); /* Flush final byte of enter instruction. */ - return extract_unsigned_integer (buf, 2); + cache->locals = read_memory_unsigned_integer (pc + 1, 2); + return pc + 4; } - return (-1); -} - -/* Signal trampolines don't have a meaningful frame. The frame - pointer value we use is actually the frame pointer of the calling - frame -- that is, the frame which was in progress when the signal - trampoline was entered. GDB mostly treats this frame pointer value - as a magic cookie. We detect the case of a signal trampoline by - testing for get_frame_type() == SIGTRAMP_FRAME, which is set based - on PC_IN_SIGTRAMP. - - When a signal trampoline is invoked from a frameless function, we - essentially have two frameless functions in a row. In this case, - we use the same magic cookie for three frames in a row. We detect - this case by seeing whether the next frame is a SIGTRAMP_FRAME, - and, if it does, checking whether the current frame is actually - frameless. In this case, we need to get the PC by looking at the - SP register value stored in the signal context. - - This should work in most cases except in horrible situations where - a signal occurs just as we enter a function but before the frame - has been set up. Incidentally, that's just what happens when we - call a function from GDB with a signal pending (there's a test in - the testsuite that makes this happen). Therefore we pretend that - we have a frameless function if we're stopped at the start of a - function. */ - -/* Return non-zero if we're dealing with a frameless signal, that is, - a signal trampoline invoked from a frameless function. */ - -int -i386_frameless_signal_p (struct frame_info *frame) -{ - return (get_next_frame (frame) - && get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME - && (frameless_look_for_prologue (frame) - || get_frame_pc (frame) == get_frame_func (frame))); -} - -/* Return the chain-pointer for FRAME. In the case of the i386, the - frame's nominal address is the address of a 4-byte word containing - the calling frame's address. */ - -static CORE_ADDR -i386_frame_chain (struct frame_info *frame) -{ - if (pc_in_dummy_frame (get_frame_pc (frame))) - return get_frame_base (frame); - - if (get_frame_type (frame) == SIGTRAMP_FRAME - || i386_frameless_signal_p (frame)) - return get_frame_base (frame); - - if (! inside_entry_file (get_frame_pc (frame))) - return read_memory_unsigned_integer (get_frame_base (frame), 4); - - return 0; -} - -/* Determine whether the function invocation represented by FRAME does - not have a from on the stack associated with it. If it does not, - return non-zero, otherwise return zero. */ - -static int -i386_frameless_function_invocation (struct frame_info *frame) -{ - if (get_frame_type (frame) == SIGTRAMP_FRAME) - return 0; - - return frameless_look_for_prologue (frame); -} - -/* Assuming FRAME is for a sigtramp routine, return the saved program - counter. */ - -static CORE_ADDR -i386_sigtramp_saved_pc (struct frame_info *frame) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - CORE_ADDR addr; - - addr = tdep->sigcontext_addr (frame); - return read_memory_unsigned_integer (addr + tdep->sc_pc_offset, 4); -} -/* Assuming FRAME is for a sigtramp routine, return the saved stack - pointer. */ - -static CORE_ADDR -i386_sigtramp_saved_sp (struct frame_info *frame) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - CORE_ADDR addr; - - addr = tdep->sigcontext_addr (frame); - return read_memory_unsigned_integer (addr + tdep->sc_sp_offset, 4); + return pc; } -/* Return the saved program counter for FRAME. */ +/* Check whether PC points at code that saves registers on the stack. + If so, it updates CACHE and returns the address of the first + instruction after the register saves or CURRENT_PC, whichever is + smaller. Otherwise, return PC. */ static CORE_ADDR -i386_frame_saved_pc (struct frame_info *frame) +i386_analyze_register_saves (CORE_ADDR pc, CORE_ADDR current_pc, + struct i386_frame_cache *cache) { - if (pc_in_dummy_frame (get_frame_pc (frame))) + if (cache->locals >= 0) { - ULONGEST pc; + CORE_ADDR offset; + unsigned char op; + int i; - frame_unwind_unsigned_register (frame, PC_REGNUM, &pc); - return pc; - } - - if (get_frame_type (frame) == SIGTRAMP_FRAME) - return i386_sigtramp_saved_pc (frame); + offset = - 4 - cache->locals; + for (i = 0; i < 8 && pc < current_pc; i++) + { + op = read_memory_unsigned_integer (pc, 1); + if (op < 0x50 || op > 0x57) + break; - if (i386_frameless_signal_p (frame)) - { - CORE_ADDR sp = i386_sigtramp_saved_sp (get_next_frame (frame)); - return read_memory_unsigned_integer (sp, 4); + cache->saved_regs[op - 0x50] = offset; + offset -= 4; + pc++; + } } - return read_memory_unsigned_integer (get_frame_base (frame) + 4, 4); + return pc; } -/* Immediately after a function call, return the saved pc. */ - -static CORE_ADDR -i386_saved_pc_after_call (struct frame_info *frame) -{ - if (get_frame_type (frame) == SIGTRAMP_FRAME) - return i386_sigtramp_saved_pc (frame); - - return read_memory_unsigned_integer (read_register (SP_REGNUM), 4); -} +/* Do a full analysis of the prologue at PC and update CACHE + accordingly. Bail out early if CURRENT_PC is reached. Return the + address where the analysis stopped. -/* Parse the first few instructions the function to see what registers - were stored. - We handle these cases: The startup sequence can be at the start of the function, or the @@ -632,79 +583,43 @@ i386_saved_pc_after_call (struct frame_info *frame) If the setup sequence is at the end of the function, then the next instruction will be a branch back to the start. */ -static void -i386_frame_init_saved_regs (struct frame_info *fip) +static CORE_ADDR +i386_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc, + struct i386_frame_cache *cache) { - long locals = -1; - unsigned char op; - CORE_ADDR addr; - CORE_ADDR pc; - int i; - - if (get_frame_saved_regs (fip)) - return; - - frame_saved_regs_zalloc (fip); - - pc = get_frame_func (fip); - if (pc != 0) - locals = i386_get_frame_setup (pc); - - if (locals >= 0) - { - addr = get_frame_base (fip) - 4 - locals; - for (i = 0; i < 8; i++) - { - op = codestream_get (); - if (op < 0x50 || op > 0x57) - break; -#ifdef I386_REGNO_TO_SYMMETRY - /* Dynix uses different internal numbering. Ick. */ - get_frame_saved_regs (fip)[I386_REGNO_TO_SYMMETRY (op - 0x50)] = addr; -#else - get_frame_saved_regs (fip)[op - 0x50] = addr; -#endif - addr -= 4; - } - } - - get_frame_saved_regs (fip)[PC_REGNUM] = get_frame_base (fip) + 4; - get_frame_saved_regs (fip)[DEPRECATED_FP_REGNUM] = get_frame_base (fip); + pc = i386_follow_jump (pc); + pc = i386_analyze_struct_return (pc, current_pc, cache); + pc = i386_skip_probe (pc); + pc = i386_analyze_frame_setup (pc, current_pc, cache); + return i386_analyze_register_saves (pc, current_pc, cache); } /* Return PC of first real instruction. */ static CORE_ADDR -i386_skip_prologue (CORE_ADDR pc) +i386_skip_prologue (CORE_ADDR start_pc) { - unsigned char op; - int i; static unsigned char pic_pat[6] = - { 0xe8, 0, 0, 0, 0, /* call 0x0 */ - 0x5b, /* popl %ebx */ + { + 0xe8, 0, 0, 0, 0, /* call 0x0 */ + 0x5b, /* popl %ebx */ }; - CORE_ADDR pos; - - if (i386_get_frame_setup (pc) < 0) - return (pc); + struct i386_frame_cache cache; + CORE_ADDR pc; + unsigned char op; + int i; - /* Found valid frame setup -- codestream now points to start of push - instructions for saving registers. */ + cache.locals = -1; + pc = i386_analyze_prologue (start_pc, 0xffffffff, &cache); + if (cache.locals < 0) + return start_pc; - /* Skip over register saves. */ - for (i = 0; i < 8; i++) - { - op = codestream_peek (); - /* Break if not `pushl' instrunction. */ - if (op < 0x50 || op > 0x57) - break; - codestream_get (); - } + /* Found valid frame setup. */ /* The native cc on SVR4 in -K PIC mode inserts the following code to get the address of the global offset table (GOT) into register - %ebx - + %ebx: + call 0x0 popl %ebx movl %ebx,x(%ebp) (optional) @@ -714,110 +629,350 @@ i386_skip_prologue (CORE_ADDR pc) function), so we have to skip it to get to the first real instruction at the start of the function. */ - pos = codestream_tell (); for (i = 0; i < 6; i++) { - op = codestream_get (); + op = read_memory_unsigned_integer (pc + i, 1); if (pic_pat[i] != op) break; } if (i == 6) { - unsigned char buf[4]; - long delta = 6; + int delta = 6; + + op = read_memory_unsigned_integer (pc + delta, 1); - op = codestream_get (); if (op == 0x89) /* movl %ebx, x(%ebp) */ { - op = codestream_get (); + op = read_memory_unsigned_integer (pc + delta + 1, 1); + if (op == 0x5d) /* One byte offset from %ebp. */ - { - delta += 3; - codestream_read (buf, 1); - } + delta += 3; else if (op == 0x9d) /* Four byte offset from %ebp. */ - { - delta += 6; - codestream_read (buf, 4); - } + delta += 6; else /* Unexpected instruction. */ - delta = -1; - op = codestream_get (); + delta = 0; + + op = read_memory_unsigned_integer (pc + delta, 1); } + /* addl y,%ebx */ - if (delta > 0 && op == 0x81 && codestream_get () == 0xc3) + if (delta > 0 && op == 0x81 + && read_memory_unsigned_integer (pc + delta + 1, 1) == 0xc3); { - pos += delta + 6; + pc += delta + 6; } } - codestream_seek (pos); - i386_follow_jump (); - - return (codestream_tell ()); + return i386_follow_jump (pc); } -/* Use the program counter to determine the contents and size of a - breakpoint instruction. Return a pointer to a string of bytes that - encode a breakpoint instruction, store the length of the string in - *LEN and optionally adjust *PC to point to the correct memory - location for inserting the breakpoint. +/* This function is 64-bit safe. */ - On the i386 we have a single breakpoint that fits in a single byte - and can be inserted anywhere. */ - -static const unsigned char * -i386_breakpoint_from_pc (CORE_ADDR *pc, int *len) +static CORE_ADDR +i386_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) { - static unsigned char break_insn[] = { 0xcc }; /* int 3 */ - - *len = sizeof (break_insn); - return break_insn; + char buf[8]; + + frame_unwind_register (next_frame, PC_REGNUM, buf); + return extract_typed_address (buf, builtin_type_void_func_ptr); } + -/* Push the return address (pointing to the call dummy) onto the stack - and return the new value for the stack pointer. */ +/* Normal frames. */ -static CORE_ADDR -i386_push_return_address (CORE_ADDR pc, CORE_ADDR sp) +static struct i386_frame_cache * +i386_frame_cache (struct frame_info *next_frame, void **this_cache) { + struct i386_frame_cache *cache; char buf[4]; + int i; + + if (*this_cache) + return *this_cache; + + cache = i386_alloc_frame_cache (); + *this_cache = cache; + + /* In principle, for normal frames, %ebp holds the frame pointer, + which holds the base address for the current stack frame. + However, for functions that don't need it, the frame pointer is + optional. For these "frameless" functions the frame pointer is + actually the frame pointer of the calling frame. Signal + trampolines are just a special case of a "frameless" function. + They (usually) share their frame pointer with the frame that was + in progress when the signal occurred. */ + + frame_unwind_register (next_frame, I386_EBP_REGNUM, buf); + cache->base = extract_unsigned_integer (buf, 4); + if (cache->base == 0) + return cache; + + /* For normal frames, %eip is stored at 4(%ebp). */ + cache->saved_regs[I386_EIP_REGNUM] = 4; + + cache->pc = frame_func_unwind (next_frame); + if (cache->pc != 0) + i386_analyze_prologue (cache->pc, frame_pc_unwind (next_frame), cache); + + if (cache->locals < 0) + { + /* We didn't find a valid frame, which means that CACHE->base + currently holds the frame pointer for our calling frame. If + we're at the start of a function, or somewhere half-way its + prologue, the function's frame probably hasn't been fully + setup yet. Try to reconstruct the base address for the stack + frame by looking at the stack pointer. For truly "frameless" + functions this might work too. */ + + frame_unwind_register (next_frame, I386_ESP_REGNUM, buf); + cache->base = extract_unsigned_integer (buf, 4) + cache->sp_offset; + } + + /* Now that we have the base address for the stack frame we can + calculate the value of %esp in the calling frame. */ + cache->saved_sp = cache->base + 8; + + /* Adjust all the saved registers such that they contain addresses + instead of offsets. */ + for (i = 0; i < I386_NUM_SAVED_REGS; i++) + if (cache->saved_regs[i] != -1) + cache->saved_regs[i] += cache->base; - store_unsigned_integer (buf, 4, CALL_DUMMY_ADDRESS ()); - write_memory (sp - 4, buf, 4); - return sp - 4; + return cache; } static void -i386_do_pop_frame (struct frame_info *frame) +i386_frame_this_id (struct frame_info *next_frame, void **this_cache, + struct frame_id *this_id) { - CORE_ADDR fp; - int regnum; - char regbuf[I386_MAX_REGISTER_SIZE]; + struct i386_frame_cache *cache = i386_frame_cache (next_frame, this_cache); + + /* This marks the outermost frame. */ + if (cache->base == 0) + return; + + /* See the end of i386_push_dummy_call. */ + (*this_id) = frame_id_build (cache->base + 8, cache->pc); +} + +static void +i386_frame_prev_register (struct frame_info *next_frame, void **this_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep) +{ + struct i386_frame_cache *cache = i386_frame_cache (next_frame, this_cache); + + gdb_assert (regnum >= 0); + + /* The System V ABI says that: + + "The flags register contains the system flags, such as the + direction flag and the carry flag. The direction flag must be + set to the forward (that is, zero) direction before entry and + upon exit from a function. Other user flags have no specified + role in the standard calling sequence and are not preserved." + + To guarantee the "upon exit" part of that statement we fake a + saved flags register that has its direction flag cleared. - fp = get_frame_base (frame); - i386_frame_init_saved_regs (frame); + Note that GCC doesn't seem to rely on the fact that the direction + flag is cleared after a function return; it always explicitly + clears the flag before operations where it matters. - for (regnum = 0; regnum < NUM_REGS; regnum++) + FIXME: kettenis/20030316: I'm not quite sure whether this is the + right thing to do. The way we fake the flags register here makes + it impossible to change it. */ + + if (regnum == I386_EFLAGS_REGNUM) { - CORE_ADDR addr; - addr = get_frame_saved_regs (frame)[regnum]; - if (addr) + *optimizedp = 0; + *lvalp = not_lval; + *addrp = 0; + *realnump = -1; + if (valuep) { - read_memory (addr, regbuf, REGISTER_RAW_SIZE (regnum)); - deprecated_write_register_gen (regnum, regbuf); + ULONGEST val; + + /* Clear the direction flag. */ + frame_unwind_unsigned_register (next_frame, PS_REGNUM, &val); + val &= ~(1 << 10); + store_unsigned_integer (valuep, 4, val); } + + return; + } + + if (regnum == I386_EIP_REGNUM && cache->pc_in_eax) + { + frame_register_unwind (next_frame, I386_EAX_REGNUM, + optimizedp, lvalp, addrp, realnump, valuep); + return; } - write_register (DEPRECATED_FP_REGNUM, read_memory_integer (fp, 4)); - write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); - write_register (SP_REGNUM, fp + 8); - flush_cached_frames (); + + if (regnum == I386_ESP_REGNUM && cache->saved_sp) + { + *optimizedp = 0; + *lvalp = not_lval; + *addrp = 0; + *realnump = -1; + if (valuep) + { + /* Store the value. */ + store_unsigned_integer (valuep, 4, cache->saved_sp); + } + return; + } + + if (regnum < I386_NUM_SAVED_REGS && cache->saved_regs[regnum] != -1) + { + *optimizedp = 0; + *lvalp = lval_memory; + *addrp = cache->saved_regs[regnum]; + *realnump = -1; + if (valuep) + { + /* Read the value in from memory. */ + read_memory (*addrp, valuep, + register_size (current_gdbarch, regnum)); + } + return; + } + + frame_register_unwind (next_frame, regnum, + optimizedp, lvalp, addrp, realnump, valuep); +} + +static const struct frame_unwind i386_frame_unwind = +{ + NORMAL_FRAME, + i386_frame_this_id, + i386_frame_prev_register +}; + +static const struct frame_unwind * +i386_frame_p (CORE_ADDR pc) +{ + return &i386_frame_unwind; +} + + +/* Signal trampolines. */ + +static struct i386_frame_cache * +i386_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache) +{ + struct i386_frame_cache *cache; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + CORE_ADDR addr; + char buf[4]; + + if (*this_cache) + return *this_cache; + + cache = i386_alloc_frame_cache (); + + frame_unwind_register (next_frame, I386_ESP_REGNUM, buf); + cache->base = extract_unsigned_integer (buf, 4) - 4; + + addr = tdep->sigcontext_addr (next_frame); + if (tdep->sc_reg_offset) + { + int i; + + gdb_assert (tdep->sc_num_regs <= I386_NUM_SAVED_REGS); + + for (i = 0; i < tdep->sc_num_regs; i++) + if (tdep->sc_reg_offset[i] != -1) + cache->saved_regs[i] = addr + tdep->sc_reg_offset[i]; + } + else + { + cache->saved_regs[I386_EIP_REGNUM] = addr + tdep->sc_pc_offset; + cache->saved_regs[I386_ESP_REGNUM] = addr + tdep->sc_sp_offset; + } + + *this_cache = cache; + return cache; +} + +static void +i386_sigtramp_frame_this_id (struct frame_info *next_frame, void **this_cache, + struct frame_id *this_id) +{ + struct i386_frame_cache *cache = + i386_sigtramp_frame_cache (next_frame, this_cache); + + /* See the end of i386_push_dummy_call. */ + (*this_id) = frame_id_build (cache->base + 8, frame_pc_unwind (next_frame)); } static void -i386_pop_frame (void) +i386_sigtramp_frame_prev_register (struct frame_info *next_frame, + void **this_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep) { - generic_pop_current_frame (i386_do_pop_frame); + /* Make sure we've initialized the cache. */ + i386_sigtramp_frame_cache (next_frame, this_cache); + + i386_frame_prev_register (next_frame, this_cache, regnum, + optimizedp, lvalp, addrp, realnump, valuep); +} + +static const struct frame_unwind i386_sigtramp_frame_unwind = +{ + SIGTRAMP_FRAME, + i386_sigtramp_frame_this_id, + i386_sigtramp_frame_prev_register +}; + +static const struct frame_unwind * +i386_sigtramp_frame_p (CORE_ADDR pc) +{ + char *name; + + /* We shouldn't even bother to try if the OSABI didn't register + a sigcontext_addr handler. */ + if (!gdbarch_tdep (current_gdbarch)->sigcontext_addr) + return NULL; + + find_pc_partial_function (pc, &name, NULL, NULL); + if (PC_IN_SIGTRAMP (pc, name)) + return &i386_sigtramp_frame_unwind; + + return NULL; +} + + +static CORE_ADDR +i386_frame_base_address (struct frame_info *next_frame, void **this_cache) +{ + struct i386_frame_cache *cache = i386_frame_cache (next_frame, this_cache); + + return cache->base; +} + +static const struct frame_base i386_frame_base = +{ + &i386_frame_unwind, + i386_frame_base_address, + i386_frame_base_address, + i386_frame_base_address +}; + +static struct frame_id +i386_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) +{ + char buf[4]; + CORE_ADDR fp; + + frame_unwind_register (next_frame, I386_EBP_REGNUM, buf); + fp = extract_unsigned_integer (buf, 4); + + /* See the end of i386_push_dummy_call. */ + return frame_id_build (fp + 8, frame_pc_unwind (next_frame)); } @@ -825,7 +980,9 @@ i386_pop_frame (void) stack. We expect the first arg to be a pointer to the jmp_buf structure from which we extract the address that we will land at. This address is copied into PC. This routine returns non-zero on - success. */ + success. + + This function is 64-bit safe. */ static int i386_get_longjmp_target (CORE_ADDR *pc) @@ -854,28 +1011,67 @@ i386_get_longjmp_target (CORE_ADDR *pc) static CORE_ADDR -i386_push_arguments (int nargs, struct value **args, CORE_ADDR sp, - int struct_return, CORE_ADDR struct_addr) +i386_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, + struct regcache *regcache, CORE_ADDR bp_addr, int nargs, + struct value **args, CORE_ADDR sp, int struct_return, + CORE_ADDR struct_addr) { - sp = legacy_push_arguments (nargs, args, sp, struct_return, struct_addr); - - if (struct_return) + char buf[4]; + int i; + + /* Push arguments in reverse order. */ + for (i = nargs - 1; i >= 0; i--) { - char buf[4]; + int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (args[i])); + + /* The System V ABI says that: + + "An argument's size is increased, if necessary, to make it a + multiple of [32-bit] words. This may require tail padding, + depending on the size of the argument." + This makes sure the stack says word-aligned. */ + sp -= (len + 3) & ~3; + write_memory (sp, VALUE_CONTENTS_ALL (args[i]), len); + } + + /* Push value address. */ + if (struct_return) + { sp -= 4; store_unsigned_integer (buf, 4, struct_addr); write_memory (sp, buf, 4); } - return sp; + /* Store return address. */ + sp -= 4; + store_unsigned_integer (buf, 4, bp_addr); + write_memory (sp, buf, 4); + + /* Finally, update the stack pointer... */ + store_unsigned_integer (buf, 4, sp); + regcache_cooked_write (regcache, I386_ESP_REGNUM, buf); + + /* ...and fake a frame pointer. */ + regcache_cooked_write (regcache, I386_EBP_REGNUM, buf); + + /* MarkK wrote: This "+ 8" is all over the place: + (i386_frame_this_id, i386_sigtramp_frame_this_id, + i386_unwind_dummy_id). It's there, since all frame unwinders for + a given target have to agree (within a certain margin) on the + defenition of the stack address of a frame. Otherwise + frame_id_inner() won't work correctly. Since DWARF2/GCC uses the + stack address *before* the function call as a frame's CFA. On + the i386, when %ebp is used as a frame pointer, the offset + between the contents %ebp and the CFA as defined by GCC. */ + return sp + 8; } /* These registers are used for returning integers (and on some targets also for returning `struct' and `union' values when their size and alignment match an integer type). */ -#define LOW_RETURN_REGNUM 0 /* %eax */ -#define HIGH_RETURN_REGNUM 2 /* %edx */ +#define LOW_RETURN_REGNUM I386_EAX_REGNUM /* %eax */ +#define HIGH_RETURN_REGNUM I386_EDX_REGNUM /* %edx */ /* Extract from an array REGBUF containing the (raw) register state, a function return value of TYPE, and copy that, in virtual format, @@ -909,7 +1105,7 @@ i386_extract_return_value (struct type *type, struct regcache *regcache, its contents to the desired type. This is probably not exactly how it would happen on the target itself, but it is the best we can do. */ - regcache_raw_read (regcache, FP0_REGNUM, buf); + regcache_raw_read (regcache, I386_ST0_REGNUM, buf); convert_typed_floating (buf, builtin_type_i387_ext, valbuf, type); } else @@ -971,7 +1167,7 @@ i386_store_return_value (struct type *type, struct regcache *regcache, not exactly how it would happen on the target itself, but it is the best we can do. */ convert_typed_floating (valbuf, type, buf, builtin_type_i387_ext); - regcache_raw_write (regcache, FP0_REGNUM, buf); + regcache_raw_write (regcache, I386_ST0_REGNUM, buf); /* Set the top of the floating-point register stack to 7. The actual value doesn't really matter, but 7 is what a normal @@ -1012,10 +1208,10 @@ i386_store_return_value (struct type *type, struct regcache *regcache, static CORE_ADDR i386_extract_struct_value_address (struct regcache *regcache) { - ULONGEST addr; + char buf[4]; - regcache_raw_read_unsigned (regcache, LOW_RETURN_REGNUM, &addr); - return addr; + regcache_cooked_read (regcache, I386_EAX_REGNUM, buf); + return extract_unsigned_integer (buf, 4); } @@ -1057,7 +1253,8 @@ i386_use_struct_convention (int gcc_p, struct type *type) static struct type * i386_register_type (struct gdbarch *gdbarch, int regnum) { - if (regnum == PC_REGNUM || regnum == DEPRECATED_FP_REGNUM || regnum == SP_REGNUM) + if (regnum == I386_EIP_REGNUM + || regnum == I386_EBP_REGNUM || regnum == I386_ESP_REGNUM) return lookup_pointer_type (builtin_type_void); if (i386_fp_regnum_p (regnum)) @@ -1073,7 +1270,7 @@ i386_register_type (struct gdbarch *gdbarch, int regnum) } /* Map a cooked register onto a raw register or memory. For the i386, - the MMX registers need to be mapped onto floating-point registers. */ + the MMX registers need to be mapped onto floating point registers. */ static int i386_mmx_regnum_to_fp_regnum (struct regcache *regcache, int regnum) @@ -1127,65 +1324,143 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, else regcache_raw_write (regcache, regnum, buf); } + + +/* These registers don't have pervasive standard uses. Move them to + i386-tdep.h if necessary. */ + +#define I386_EBX_REGNUM 3 /* %ebx */ +#define I386_ECX_REGNUM 1 /* %ecx */ +#define I386_ESI_REGNUM 6 /* %esi */ +#define I386_EDI_REGNUM 7 /* %edi */ + +/* Return the register number of the register allocated by GCC after + REGNUM, or -1 if there is no such register. */ + +static int +i386_next_regnum (int regnum) +{ + /* GCC allocates the registers in the order: + + %eax, %edx, %ecx, %ebx, %esi, %edi, %ebp, %esp, ... + + Since storing a variable in %esp doesn't make any sense we return + -1 for %ebp and for %esp itself. */ + static int next_regnum[] = + { + I386_EDX_REGNUM, /* Slot for %eax. */ + I386_EBX_REGNUM, /* Slot for %ecx. */ + I386_ECX_REGNUM, /* Slot for %edx. */ + I386_ESI_REGNUM, /* Slot for %ebx. */ + -1, -1, /* Slots for %esp and %ebp. */ + I386_EDI_REGNUM, /* Slot for %esi. */ + I386_EBP_REGNUM /* Slot for %edi. */ + }; + + if (regnum >= 0 && regnum < sizeof (next_regnum) / sizeof (next_regnum[0])) + return next_regnum[regnum]; + + return -1; +} -/* Return true iff register REGNUM's virtual format is different from - its raw format. Note that this definition assumes that the host - supports IEEE 32-bit floats, since it doesn't say that SSE - registers need conversion. Even if we can't find a counterexample, - this is still sloppy. */ +/* Return nonzero if a value of type TYPE stored in register REGNUM + needs any special handling. */ static int -i386_register_convertible (int regnum) +i386_convert_register_p (int regnum, struct type *type) { + int len = TYPE_LENGTH (type); + + /* Values may be spread across multiple registers. Most debugging + formats aren't expressive enough to specify the locations, so + some heuristics is involved. Right now we only handle types that + have a length that is a multiple of the word size, since GCC + doesn't seem to put any other types into registers. */ + if (len > 4 && len % 4 == 0) + { + int last_regnum = regnum; + + while (len > 4) + { + last_regnum = i386_next_regnum (last_regnum); + len -= 4; + } + + if (last_regnum != -1) + return 1; + } + return i386_fp_regnum_p (regnum); } -/* Convert data from raw format for register REGNUM in buffer FROM to - virtual format with type TYPE in buffer TO. */ +/* Read a value of type TYPE from register REGNUM in frame FRAME, and + return its contents in TO. */ static void -i386_register_convert_to_virtual (int regnum, struct type *type, - char *from, char *to) +i386_register_to_value (struct frame_info *frame, int regnum, + struct type *type, void *to) { - gdb_assert (i386_fp_regnum_p (regnum)); + int len = TYPE_LENGTH (type); + char *buf = to; + + /* FIXME: kettenis/20030609: What should we do if REGNUM isn't + available in FRAME (i.e. if it wasn't saved)? */ - /* We only support floating-point values. */ - if (TYPE_CODE (type) != TYPE_CODE_FLT) + if (i386_fp_regnum_p (regnum)) { - warning ("Cannot convert floating-point register value " - "to non-floating-point type."); - memset (to, 0, TYPE_LENGTH (type)); + i387_register_to_value (frame, regnum, type, to); return; } - /* Convert to TYPE. This should be a no-op if TYPE is equivalent to - the extended floating-point format used by the FPU. */ - convert_typed_floating (from, builtin_type_i387_ext, to, type); + /* Read a value spread accross multiple registers. */ + + gdb_assert (len > 4 && len % 4 == 0); + + while (len > 0) + { + gdb_assert (regnum != -1); + gdb_assert (register_size (current_gdbarch, regnum) == 4); + + frame_read_register (frame, regnum, buf); + regnum = i386_next_regnum (regnum); + len -= 4; + buf += 4; + } } -/* Convert data from virtual format with type TYPE in buffer FROM to - raw format for register REGNUM in buffer TO. */ +/* Write the contents FROM of a value of type TYPE into register + REGNUM in frame FRAME. */ static void -i386_register_convert_to_raw (struct type *type, int regnum, - char *from, char *to) +i386_value_to_register (struct frame_info *frame, int regnum, + struct type *type, const void *from) { - gdb_assert (i386_fp_regnum_p (regnum)); + int len = TYPE_LENGTH (type); + const char *buf = from; - /* We only support floating-point values. */ - if (TYPE_CODE (type) != TYPE_CODE_FLT) + if (i386_fp_regnum_p (regnum)) { - warning ("Cannot convert non-floating-point type " - "to floating-point register value."); - memset (to, 0, TYPE_LENGTH (type)); + i387_value_to_register (frame, regnum, type, from); return; } - /* Convert from TYPE. This should be a no-op if TYPE is equivalent - to the extended floating-point format used by the FPU. */ - convert_typed_floating (from, type, to, builtin_type_i387_ext); + /* Write a value spread accross multiple registers. */ + + gdb_assert (len > 4 && len % 4 == 0); + + while (len > 0) + { + gdb_assert (regnum != -1); + gdb_assert (register_size (current_gdbarch, regnum) == 4); + + put_frame_register (frame, regnum, buf); + regnum = i386_next_regnum (regnum); + len -= 4; + buf += 4; + } } - + + #ifdef STATIC_TRANSFORM_NAME /* SunPRO encodes the static variables. This is not related to C++ @@ -1274,36 +1549,27 @@ i386_print_insn (bfd_vma pc, disassemble_info *info) static int i386_svr4_pc_in_sigtramp (CORE_ADDR pc, char *name) { + /* UnixWare uses _sigacthandler. The origin of the other symbols is + currently unknown. */ return (name && (strcmp ("_sigreturn", name) == 0 || strcmp ("_sigacthandler", name) == 0 || strcmp ("sigvechandler", name) == 0)); } -/* Get address of the pushed ucontext (sigcontext) on the stack for - all three variants of SVR4 sigtramps. */ +/* Assuming NEXT_FRAME is for a frame following a SVR4 sigtramp + routine, return the address of the associated sigcontext (ucontext) + structure. */ static CORE_ADDR -i386_svr4_sigcontext_addr (struct frame_info *frame) +i386_svr4_sigcontext_addr (struct frame_info *next_frame) { - int sigcontext_offset = -1; - char *name = NULL; - - find_pc_partial_function (get_frame_pc (frame), &name, NULL, NULL); - if (name) - { - if (strcmp (name, "_sigreturn") == 0) - sigcontext_offset = 132; - else if (strcmp (name, "_sigacthandler") == 0) - sigcontext_offset = 80; - else if (strcmp (name, "sigvechandler") == 0) - sigcontext_offset = 120; - } + char buf[4]; + CORE_ADDR sp; - gdb_assert (sigcontext_offset != -1); + frame_unwind_register (next_frame, I386_ESP_REGNUM, buf); + sp = extract_unsigned_integer (buf, 4); - if (get_next_frame (frame)) - return get_frame_base (get_next_frame (frame)) + sigcontext_offset; - return read_register (SP_REGNUM) + sigcontext_offset; + return read_memory_unsigned_integer (sp + 8, 4); } @@ -1342,8 +1608,8 @@ i386_svr4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_pc_in_sigtramp (gdbarch, i386_svr4_pc_in_sigtramp); tdep->sigcontext_addr = i386_svr4_sigcontext_addr; - tdep->sc_pc_offset = 14 * 4; - tdep->sc_sp_offset = 7 * 4; + tdep->sc_pc_offset = 36 + 14 * 4; + tdep->sc_sp_offset = 36 + 17 * 4; tdep->jb_pc_offset = 20; } @@ -1407,6 +1673,7 @@ i386_register_reggroup_p (struct gdbarch *gdbarch, int regnum, int fp_regnum_p = (i386_fp_regnum_p (regnum) || i386_fpc_regnum_p (regnum)); int mmx_regnum_p = (i386_mmx_regnum_p (regnum)); + if (group == i386_mmx_reggroup) return mmx_regnum_p; if (group == i386_sse_reggroup) @@ -1417,8 +1684,20 @@ i386_register_reggroup_p (struct gdbarch *gdbarch, int regnum, return fp_regnum_p; if (group == general_reggroup) return (!fp_regnum_p && !mmx_regnum_p && !sse_regnum_p); + return default_register_reggroup_p (gdbarch, regnum, group); } + + +/* Get the ith function argument for the current function. */ +static CORE_ADDR +i386_fetch_pointer_argument (struct frame_info *frame, int argi, + struct type *type) +{ + CORE_ADDR stack; + frame_read_register (frame, SP_REGNUM, &stack); + return read_memory_unsigned_integer (stack + (4 * (argi + 1)), 4); +} static struct gdbarch * @@ -1436,10 +1715,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = XMALLOC (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); - /* NOTE: cagney/2002-12-06: This can be deleted when this arch is - ready to unwind the PC first (see frame.c:get_prev_frame()). */ - set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); - /* The i386 default settings don't include the SSE registers. FIXME: kettenis/20020614: They do include the FPU registers for now, which probably is not quite right. */ @@ -1450,6 +1725,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->sigtramp_start = 0; tdep->sigtramp_end = 0; tdep->sigcontext_addr = NULL; + tdep->sc_reg_offset = NULL; tdep->sc_pc_offset = -1; tdep->sc_sp_offset = -1; @@ -1464,15 +1740,17 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) alignment. */ set_gdbarch_long_double_bit (gdbarch, 96); - /* NOTE: tm-i386aix.h, tm-i386bsd.h, tm-i386os9k.h, tm-ptx.h, - tm-symmetry.h currently override this. Sigh. */ + /* The default ABI includes general-purpose registers and + floating-point registers. */ set_gdbarch_num_regs (gdbarch, I386_NUM_GREGS + I386_NUM_FREGS); + set_gdbarch_register_name (gdbarch, i386_register_name); + set_gdbarch_register_type (gdbarch, i386_register_type); - set_gdbarch_sp_regnum (gdbarch, 4); /* %esp */ - set_gdbarch_deprecated_fp_regnum (gdbarch, 5); /* %ebp */ - set_gdbarch_pc_regnum (gdbarch, 8); /* %eip */ - set_gdbarch_ps_regnum (gdbarch, 9); /* %eflags */ - set_gdbarch_fp0_regnum (gdbarch, 16); /* %st(0) */ + /* Register numbers of various important registers. */ + set_gdbarch_sp_regnum (gdbarch, I386_ESP_REGNUM); /* %esp */ + set_gdbarch_pc_regnum (gdbarch, I386_EIP_REGNUM); /* %eip */ + set_gdbarch_ps_regnum (gdbarch, I386_EFLAGS_REGNUM); /* %eflags */ + set_gdbarch_fp0_regnum (gdbarch, I386_ST0_REGNUM); /* %st(0) */ /* Use the "default" register numbering scheme for stabs and COFF. */ set_gdbarch_stab_reg_to_regnum (gdbarch, i386_stab_reg_to_regnum); @@ -1485,39 +1763,23 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* We don't define ECOFF_REG_TO_REGNUM, since ECOFF doesn't seem to be in use on any of the supported i386 targets. */ - set_gdbarch_register_name (gdbarch, i386_register_name); - set_gdbarch_deprecated_register_size (gdbarch, 4); - set_gdbarch_deprecated_register_bytes (gdbarch, I386_SIZEOF_GREGS + I386_SIZEOF_FREGS); - set_gdbarch_register_type (gdbarch, i386_register_type); - set_gdbarch_print_float_info (gdbarch, i387_print_float_info); set_gdbarch_get_longjmp_target (gdbarch, i386_get_longjmp_target); /* Call dummy code. */ - set_gdbarch_deprecated_call_dummy_words (gdbarch, NULL); - set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0); - - set_gdbarch_register_convertible (gdbarch, i386_register_convertible); - set_gdbarch_register_convert_to_virtual (gdbarch, - i386_register_convert_to_virtual); - set_gdbarch_register_convert_to_raw (gdbarch, i386_register_convert_to_raw); + set_gdbarch_push_dummy_call (gdbarch, i386_push_dummy_call); - /* "An argument's size is increased, if necessary, to make it a - multiple of [32-bit] words. This may require tail padding, - depending on the size of the argument" -- from the x86 ABI. */ - set_gdbarch_parm_boundary (gdbarch, 32); + set_gdbarch_convert_register_p (gdbarch, i386_convert_register_p); + set_gdbarch_register_to_value (gdbarch, i386_register_to_value); + set_gdbarch_value_to_register (gdbarch, i386_value_to_register); set_gdbarch_extract_return_value (gdbarch, i386_extract_return_value); - set_gdbarch_deprecated_push_arguments (gdbarch, i386_push_arguments); - set_gdbarch_deprecated_push_return_address (gdbarch, i386_push_return_address); - set_gdbarch_deprecated_pop_frame (gdbarch, i386_pop_frame); set_gdbarch_store_return_value (gdbarch, i386_store_return_value); set_gdbarch_extract_struct_value_address (gdbarch, i386_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, i386_use_struct_convention); - set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, i386_frame_init_saved_regs); set_gdbarch_skip_prologue (gdbarch, i386_skip_prologue); /* Stack grows downward. */ @@ -1527,18 +1789,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_decr_pc_after_break (gdbarch, 1); set_gdbarch_function_start_offset (gdbarch, 0); - /* The following redefines make backtracing through sigtramp work. - They manufacture a fake sigtramp frame and obtain the saved pc in - sigtramp from the sigcontext structure which is pushed by the - kernel on the user stack, along with a pointer to it. */ - set_gdbarch_frame_args_skip (gdbarch, 8); - set_gdbarch_frameless_function_invocation (gdbarch, - i386_frameless_function_invocation); - set_gdbarch_deprecated_frame_chain (gdbarch, i386_frame_chain); - set_gdbarch_deprecated_frame_saved_pc (gdbarch, i386_frame_saved_pc); - set_gdbarch_deprecated_saved_pc_after_call (gdbarch, i386_saved_pc_after_call); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_pc_in_sigtramp (gdbarch, i386_pc_in_sigtramp); /* Wire in the MMX registers. */ @@ -1548,16 +1799,29 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_print_insn (gdbarch, i386_print_insn); + set_gdbarch_unwind_dummy_id (gdbarch, i386_unwind_dummy_id); + + set_gdbarch_unwind_pc (gdbarch, i386_unwind_pc); + /* Add the i386 register groups. */ i386_add_reggroups (gdbarch); set_gdbarch_register_reggroup_p (gdbarch, i386_register_reggroup_p); - /* Should be using push_dummy_call. */ - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + /* Helper for function argument information. */ + set_gdbarch_fetch_pointer_argument (gdbarch, i386_fetch_pointer_argument); + + /* Hook in the DWARF CFI frame unwinder. */ + frame_unwind_append_predicate (gdbarch, dwarf2_frame_p); + set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info); + + frame_base_set_default (gdbarch, &i386_frame_base); /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); + frame_unwind_append_predicate (gdbarch, i386_sigtramp_frame_p); + frame_unwind_append_predicate (gdbarch, i386_frame_p); + return gdbarch; } diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h index 1b569d924dd..38eac2004e8 100644 --- a/gdb/i386-tdep.h +++ b/gdb/i386-tdep.h @@ -71,7 +71,12 @@ struct gdbarch_tdep /* Get address of sigcontext for sigtramp. */ CORE_ADDR (*sigcontext_addr) (struct frame_info *); - /* Offset of saved PC and SP in `struct sigcontext'. */ + /* Offset of registers in `struct sigcontext'. */ + int *sc_reg_offset; + int sc_num_regs; + + /* Offset of saved PC and SP in `struct sigcontext'. Usage of these + is deprecated, please use `sc_reg_offset' instead. */ int sc_pc_offset; int sc_sp_offset; }; @@ -136,8 +141,16 @@ extern int i386_mxcsr_regnum_p (int regnum); #define FCOFF_REGNUM FIOFF_REGNUM #define FDS_REGNUM FOSEG_REGNUM #define FDOFF_REGNUM FOOFF_REGNUM -#define IS_FP_REGNUM(n) i386_fp_regnum_p (n) -#define IS_SSE_REGNUM(n) i386_sse_regnum_p (n) + +/* Register numbers of various important registers. */ + +#define I386_EAX_REGNUM 0 /* %eax */ +#define I386_EDX_REGNUM 2 /* %edx */ +#define I386_ESP_REGNUM 4 /* %esp */ +#define I386_EBP_REGNUM 5 /* %ebp */ +#define I386_EIP_REGNUM 8 /* %eip */ +#define I386_EFLAGS_REGNUM 9 /* %eflags */ +#define I386_ST0_REGNUM 16 /* %st(0) */ #define I386_NUM_GREGS 16 #define I386_NUM_FREGS 16 @@ -146,16 +159,6 @@ extern int i386_mxcsr_regnum_p (int regnum); #define I386_SSE_NUM_REGS (I386_NUM_GREGS + I386_NUM_FREGS \ + I386_NUM_XREGS) -/* Sizes of individual register sets. These cover the entire register - file, so summing up the sizes of those portions actually present - yields DEPRECATED_REGISTER_BYTES. */ -#define I386_SIZEOF_GREGS (I386_NUM_GREGS * 4) -#define I386_SIZEOF_FREGS (8 * 10 + 8 * 4) -#define I386_SIZEOF_XREGS (8 * 16 + 4) - -#define I386_SSE_SIZEOF_REGS (I386_SIZEOF_GREGS + I386_SIZEOF_FREGS \ - + I386_SIZEOF_XREGS) - /* Size of the largest register. */ #define I386_MAX_REGISTER_SIZE 16 @@ -178,7 +181,6 @@ extern void i386_svr4_init_abi (struct gdbarch_info, struct gdbarch *); /* Functions exported from i386bsd-tdep.c. */ -extern CORE_ADDR i386bsd_sigcontext_addr (struct frame_info *frame); extern void i386bsd_init_abi (struct gdbarch_info, struct gdbarch *); #endif /* i386-tdep.h */ diff --git a/gdb/i386bsd-nat.c b/gdb/i386bsd-nat.c index ec38e135717..60524de148e 100644 --- a/gdb/i386bsd-nat.c +++ b/gdb/i386bsd-nat.c @@ -386,8 +386,7 @@ kernel_u_size (void) void _initialize_i386bsd_nat (void) { - int sc_pc_offset; - int sc_sp_offset; + int offset; /* To support the recognition of signal handlers, i386bsd-tdep.c hardcodes some constants. Inclusion of this file means that we @@ -396,51 +395,69 @@ _initialize_i386bsd_nat (void) information. */ #if defined (__FreeBSD_version) && __FreeBSD_version >= 400011 - extern int i386fbsd4_sc_pc_offset; - extern int i386fbsd4_sc_sp_offset; -#define SC_PC_OFFSET i386fbsd4_sc_pc_offset -#define SC_SP_OFFSET i386fbsd4_sc_sp_offset + extern int i386fbsd4_sc_reg_offset[]; +#define SC_REG_OFFSET i386fbsd4_sc_reg_offset +#elif defined (__FreeBSD_version) && __FreeBSD_version >= 300005 + extern int i386fbsd_sc_reg_offset[]; +#define SC_REG_OFFSET i386fbsd_sc_reg_offset #elif defined (NetBSD) || defined (__NetBSD_Version__) - extern int i386nbsd_sc_pc_offset; - extern int i386nbsd_sc_sp_offset; -#define SC_PC_OFFSET i386nbsd_sc_pc_offset -#define SC_SP_OFFSET i386nbsd_sc_sp_offset + extern int i386nbsd_sc_reg_offset[]; +#define SC_REG_OFFSET i386nbsd_sc_reg_offset #elif defined (OpenBSD) - extern int i386obsd_sc_pc_offset; - extern int i386obsd_sc_sp_offset; -#define SC_PC_OFFSET i386obsd_sc_pc_offset -#define SC_SP_OFFSET i386obsd_sc_sp_offset + extern int i386obsd_sc_reg_offset[]; +#define SC_REG_OFFSET i386obsd_sc_reg_offset #else - extern int i386bsd_sc_pc_offset; - extern int i386bsd_sc_sp_offset; -#define SC_PC_OFFSET i386bsd_sc_pc_offset -#define SC_SP_OFFSET i386bsd_sc_sp_offset + extern int i386bsd_sc_reg_offset[]; +#define SC_PC_OFFSET i386bsd_sc_reg_offset #endif + /* We only check the program counter, stack pointer and frame + pointer since these members of `struct sigcontext' are essential + for providing backtraces. More checks could be added, but would + involve adding configure checks for the appropriate structure + members, since older BSD's don't provide all of them. */ + +#define SC_PC_OFFSET SC_REG_OFFSET[I386_EIP_REGNUM] +#define SC_SP_OFFSET SC_REG_OFFSET[I386_ESP_REGNUM] +#define SC_FP_OFFSET SC_REG_OFFSET[I386_EBP_REGNUM] + /* Override the default value for the offset of the program counter in the sigcontext structure. */ - sc_pc_offset = offsetof (struct sigcontext, sc_pc); + offset = offsetof (struct sigcontext, sc_pc); - if (SC_PC_OFFSET != sc_pc_offset) + if (SC_PC_OFFSET != offset) { warning ("\ offsetof (struct sigcontext, sc_pc) yields %d instead of %d.\n\ -Please report this to .", - sc_pc_offset, SC_PC_OFFSET); +Please report this to .", + offset, SC_PC_OFFSET); } - SC_PC_OFFSET = sc_pc_offset; + SC_PC_OFFSET = offset; /* Likewise for the stack pointer. */ - sc_sp_offset = offsetof (struct sigcontext, sc_sp); + offset = offsetof (struct sigcontext, sc_sp); - if (SC_SP_OFFSET != sc_sp_offset) + if (SC_SP_OFFSET != offset) { warning ("\ offsetof (struct sigcontext, sc_sp) yields %d instead of %d.\n\ Please report this to .", - sc_sp_offset, SC_SP_OFFSET); + offset, SC_SP_OFFSET); + } + + SC_SP_OFFSET = offset; + + /* And the frame pointer. */ + offset = offsetof (struct sigcontext, sc_fp); + + if (SC_FP_OFFSET != offset) + { + warning ("\ +offsetof (struct sigcontext, sc_fp) yields %d instead of %d.\n\ +Please report this to .", + offset, SC_FP_OFFSET); } - SC_SP_OFFSET = sc_sp_offset; + SC_FP_OFFSET = offset; } diff --git a/gdb/i386bsd-tdep.c b/gdb/i386bsd-tdep.c index c0c544de52d..94d68600fee 100644 --- a/gdb/i386bsd-tdep.c +++ b/gdb/i386bsd-tdep.c @@ -41,26 +41,19 @@ i386bsd_pc_in_sigtramp (CORE_ADDR pc, char *name) return (pc >= tdep->sigtramp_start && pc < tdep->sigtramp_end); } -/* Assuming FRAME is for a BSD sigtramp routine, return the address of - the associated sigcontext structure. +/* Assuming NEXT_FRAME is for a frame following a BSD sigtramp + routine, return the address of the associated sigcontext structure. */ - Note: This function is used for Solaris 2 too, so don't make it - static. */ - -CORE_ADDR -i386bsd_sigcontext_addr (struct frame_info *frame) +static CORE_ADDR +i386bsd_sigcontext_addr (struct frame_info *next_frame) { - struct frame_info *next_frame = get_next_frame (frame); + char buf[4]; + CORE_ADDR sp; - 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 (get_frame_base (next_frame) + 16, 4); + frame_unwind_register (next_frame, I386_ESP_REGNUM, buf); + sp = extract_unsigned_integer (buf, 4); - /* This is the top frame. We'll have to find the address of the - sigcontext structure by looking at the stack pointer. */ - return read_memory_unsigned_integer (read_register (SP_REGNUM) + 8, 4); + return read_memory_unsigned_integer (sp + 8, 4); } /* Return the start address of the sigtramp routine. */ @@ -93,8 +86,25 @@ i386bsd_aout_in_solib_call_trampoline (CORE_ADDR pc, char *name) /* Traditional BSD (4.3 BSD, still used for BSDI and 386BSD). */ /* From . */ -int i386bsd_sc_pc_offset = 20; -int i386bsd_sc_sp_offset = 8; +int i386bsd_sc_reg_offset[I386_NUM_GREGS] = +{ + -1, /* %eax */ + -1, /* %ecx */ + -1, /* %edx */ + -1, /* %ebx */ + 8 + 0 * 4, /* %esp */ + 8 + 1 * 4, /* %ebp */ + -1, /* %esi */ + -1, /* %edi */ + 8 + 3 * 4, /* %eip */ + 8 + 4 * 4, /* %eflags */ + -1, /* %cs */ + -1, /* %ss */ + -1, /* %ds */ + -1, /* %es */ + -1, /* %fs */ + -1 /* %gs */ +}; void i386bsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) @@ -116,8 +126,8 @@ i386bsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tdep->sigtramp_start = 0xfdbfdfc0; tdep->sigtramp_end = 0xfdbfe000; tdep->sigcontext_addr = i386bsd_sigcontext_addr; - tdep->sc_pc_offset = i386bsd_sc_pc_offset; - tdep->sc_sp_offset = i386bsd_sc_sp_offset; + tdep->sc_reg_offset = i386bsd_sc_reg_offset; + tdep->sc_num_regs = I386_NUM_GREGS; } /* FreeBSD 3.0-RELEASE or later. */ @@ -125,6 +135,27 @@ i386bsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) CORE_ADDR i386fbsd_sigtramp_start = 0xbfbfdf20; CORE_ADDR i386fbsd_sigtramp_end = 0xbfbfdff0; +/* From . */ +int i386fbsd_sc_reg_offset[I386_NUM_GREGS] = +{ + 8 + 14 * 4, /* %eax */ + 8 + 13 * 4, /* %ecx */ + 8 + 12 * 4, /* %edx */ + 8 + 11 * 4, /* %ebx */ + 8 + 0 * 4, /* %esp */ + 8 + 1 * 4, /* %ebp */ + 8 + 10 * 4, /* %esi */ + 8 + 9 * 4, /* %edi */ + 8 + 3 * 4, /* %eip */ + 8 + 4 * 4, /* %eflags */ + 8 + 7 * 4, /* %cs */ + 8 + 8 * 4, /* %ss */ + 8 + 6 * 4, /* %ds */ + 8 + 5 * 4, /* %es */ + 8 + 15 * 4, /* %fs */ + 8 + 16 * 4 /* %gs */ +}; + static void i386fbsdaout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -139,6 +170,10 @@ i386fbsdaout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* FreeBSD uses a different memory layout. */ tdep->sigtramp_start = i386fbsd_sigtramp_start; tdep->sigtramp_end = i386fbsd_sigtramp_end; + + /* FreeBSD has a more complete `struct sigcontext'. */ + tdep->sc_reg_offset = i386fbsd_sc_reg_offset; + tdep->sc_num_regs = I386_NUM_GREGS; } static void @@ -158,8 +193,25 @@ i386fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* FreeBSD 4.0-RELEASE or later. */ /* From . */ -int i386fbsd4_sc_pc_offset = 76; -int i386fbsd4_sc_sp_offset = 88; +int i386fbsd4_sc_reg_offset[I386_NUM_GREGS] = +{ + 20 + 11 * 4, /* %eax */ + 20 + 10 * 4, /* %ecx */ + 20 + 9 * 4, /* %edx */ + 20 + 8 * 4, /* %ebx */ + 20 + 17 * 4, /* %esp */ + 20 + 6 * 4, /* %ebp */ + 20 + 5 * 4, /* %esi */ + 20 + 4 * 4, /* %edi */ + 20 + 14 * 4, /* %eip */ + 20 + 16 * 4, /* %eflags */ + 20 + 15 * 4, /* %cs */ + 20 + 18 * 4, /* %ss */ + 20 + 3 * 4, /* %ds */ + 20 + 2 * 4, /* %es */ + 20 + 1 * 4, /* %fs */ + 20 + 0 * 4 /* %gs */ +}; static void i386fbsd4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) @@ -171,8 +223,8 @@ i386fbsd4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) i386fbsd_init_abi (info, gdbarch); /* FreeBSD 4.0 introduced a new `struct sigcontext'. */ - tdep->sc_pc_offset = i386fbsd4_sc_pc_offset; - tdep->sc_sp_offset = i386fbsd4_sc_sp_offset; + tdep->sc_reg_offset = i386fbsd4_sc_reg_offset; + tdep->sc_num_regs = I386_NUM_GREGS; } diff --git a/gdb/i386nbsd-tdep.c b/gdb/i386nbsd-tdep.c index 64b3dc0984e..601530bce25 100644 --- a/gdb/i386nbsd-tdep.c +++ b/gdb/i386nbsd-tdep.c @@ -239,8 +239,25 @@ i386nbsd_pc_in_sigtramp (CORE_ADDR pc, char *name) } /* From . */ -int i386nbsd_sc_pc_offset = 44; -int i386nbsd_sc_sp_offset = 56; +int i386nbsd_sc_reg_offset[I386_NUM_GREGS] = +{ + 10 * 4, /* %eax */ + 9 * 4, /* %ecx */ + 8 * 4, /* %edx */ + 7 * 4, /* %ebx */ + 14 * 4, /* %esp */ + 6 * 4, /* %ebp */ + 5 * 4, /* %esi */ + 4 * 4, /* %edi */ + 11 * 4, /* %eip */ + 13 * 4, /* %eflags */ + 12 * 4, /* %cs */ + 15 * 4, /* %ss */ + 3 * 4, /* %ds */ + 2 * 4, /* %es */ + 1 * 4, /* %fs */ + 0 * 4 /* %gs */ +}; static void i386nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) @@ -263,8 +280,8 @@ i386nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* NetBSD has a `struct sigcontext' that's different from the origional 4.3 BSD. */ - tdep->sc_pc_offset = i386nbsd_sc_pc_offset; - tdep->sc_sp_offset = i386nbsd_sc_sp_offset; + tdep->sc_reg_offset = i386nbsd_sc_reg_offset; + tdep->sc_num_regs = I386_NUM_GREGS; } /* NetBSD ELF. */ diff --git a/gdb/i386obsd-tdep.c b/gdb/i386obsd-tdep.c index be0c674493b..7db076d3a3e 100644 --- a/gdb/i386obsd-tdep.c +++ b/gdb/i386obsd-tdep.c @@ -83,8 +83,25 @@ CORE_ADDR i386obsd_sigtramp_start = 0xbfbfdf20; CORE_ADDR i386obsd_sigtramp_end = 0xbfbfdff0; /* From . */ -int i386obsd_sc_pc_offset = 44; -int i386obsd_sc_sp_offset = 56; +int i386obsd_sc_reg_offset[I386_NUM_GREGS] = +{ + 10 * 4, /* %eax */ + 9 * 4, /* %ecx */ + 8 * 4, /* %edx */ + 7 * 4, /* %ebx */ + 14 * 4, /* %esp */ + 6 * 4, /* %ebp */ + 5 * 4, /* %esi */ + 4 * 4, /* %edi */ + 11 * 4, /* %eip */ + 13 * 4, /* %eflags */ + 12 * 4, /* %cs */ + 15 * 4, /* %ss */ + 3 * 4, /* %ds */ + 2 * 4, /* %es */ + 1 * 4, /* %fs */ + 0 * 4 /* %gs */ +}; static void i386obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) @@ -103,8 +120,8 @@ i386obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* OpenBSD has a `struct sigcontext' that's different from the origional 4.3 BSD. */ - tdep->sc_pc_offset = i386obsd_sc_pc_offset; - tdep->sc_sp_offset = i386obsd_sc_sp_offset; + tdep->sc_reg_offset = i386obsd_sc_reg_offset; + tdep->sc_num_regs = I386_NUM_GREGS; } void diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c index c6a2d5dac84..f7800af6415 100644 --- a/gdb/i387-tdep.c +++ b/gdb/i387-tdep.c @@ -21,128 +21,26 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include "doublest.h" +#include "floatformat.h" #include "frame.h" +#include "gdbcore.h" #include "inferior.h" #include "language.h" -#include "value.h" -#include "gdbcore.h" -#include "floatformat.h" #include "regcache.h" +#include "value.h" + #include "gdb_assert.h" #include "gdb_string.h" -#include "doublest.h" #include "i386-tdep.h" +#include "i387-tdep.h" - -/* FIXME: The functions on this page are used by the old `info float' - implementations that a few of the i386 targets provide. These - functions should be removed if all of these have been converted to - use the generic implementation based on the new register file - layout. */ - -static void print_387_control_bits (unsigned int control); -static void print_387_status_bits (unsigned int status); - -static void -print_387_control_bits (unsigned int control) -{ - switch ((control >> 8) & 3) - { - case 0: - puts_unfiltered (" 24 bit; "); - break; - case 1: - puts_unfiltered (" (bad); "); - break; - case 2: - puts_unfiltered (" 53 bit; "); - break; - case 3: - puts_unfiltered (" 64 bit; "); - break; - } - switch ((control >> 10) & 3) - { - case 0: - puts_unfiltered ("NEAR; "); - break; - case 1: - puts_unfiltered ("DOWN; "); - break; - case 2: - puts_unfiltered ("UP; "); - break; - case 3: - puts_unfiltered ("CHOP; "); - break; - } - if (control & 0x3f) - { - puts_unfiltered ("mask"); - if (control & 0x0001) - puts_unfiltered (" INVAL"); - if (control & 0x0002) - puts_unfiltered (" DENOR"); - if (control & 0x0004) - puts_unfiltered (" DIVZ"); - if (control & 0x0008) - puts_unfiltered (" OVERF"); - if (control & 0x0010) - puts_unfiltered (" UNDER"); - if (control & 0x0020) - puts_unfiltered (" LOS"); - puts_unfiltered (";"); - } - - if (control & 0xe080) - warning ("\nreserved bits on: %s", - local_hex_string (control & 0xe080)); -} - -void -print_387_control_word (unsigned int control) -{ - printf_filtered ("control %s:", local_hex_string(control & 0xffff)); - print_387_control_bits (control); - puts_unfiltered ("\n"); -} - -static void -print_387_status_bits (unsigned int status) -{ - printf_unfiltered (" flags %d%d%d%d; ", - (status & 0x4000) != 0, - (status & 0x0400) != 0, - (status & 0x0200) != 0, - (status & 0x0100) != 0); - printf_unfiltered ("top %d; ", (status >> 11) & 7); - if (status & 0xff) - { - puts_unfiltered ("excep"); - if (status & 0x0001) puts_unfiltered (" INVAL"); - if (status & 0x0002) puts_unfiltered (" DENOR"); - if (status & 0x0004) puts_unfiltered (" DIVZ"); - if (status & 0x0008) puts_unfiltered (" OVERF"); - if (status & 0x0010) puts_unfiltered (" UNDER"); - if (status & 0x0020) puts_unfiltered (" LOS"); - if (status & 0x0040) puts_unfiltered (" STACK"); - } -} - -void -print_387_status_word (unsigned int status) -{ - printf_filtered ("status %s:", local_hex_string (status & 0xffff)); - print_387_status_bits (status); - puts_unfiltered ("\n"); -} - - /* Implement the `info float' layout based on the register definitions in `tm-i386.h'. */ /* Print the floating point number specified by RAW. */ + static void print_i387_value (char *raw, struct ui_file *file) { @@ -166,6 +64,7 @@ print_i387_value (char *raw, struct ui_file *file) } /* Print the classification for the register contents RAW. */ + static void print_i387_ext (unsigned char *raw, struct ui_file *file) { @@ -217,6 +116,7 @@ print_i387_ext (unsigned char *raw, struct ui_file *file) } /* Print the status word STATUS. */ + static void print_i387_status_word (unsigned int status, struct ui_file *file) { @@ -246,6 +146,7 @@ print_i387_status_word (unsigned int status, struct ui_file *file) } /* Print the control word CONTROL. */ + static void print_i387_control_word (unsigned int control, struct ui_file *file) { @@ -386,12 +287,60 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, fprintf_filtered (file, "Opcode: %s\n", local_hex_string_custom (fop ? (fop | 0xd800) : 0, "04")); } + + +/* Read a value of type TYPE from register REGNUM in frame FRAME, and + return its contents in TO. */ + +void +i387_register_to_value (struct frame_info *frame, int regnum, + struct type *type, void *to) +{ + char from[I386_MAX_REGISTER_SIZE]; + + gdb_assert (i386_fp_regnum_p (regnum)); + + /* We only support floating-point values. */ + if (TYPE_CODE (type) != TYPE_CODE_FLT) + { + warning ("Cannot convert floating-point register value " + "to non-floating-point type."); + return; + } + + /* Convert to TYPE. This should be a no-op if TYPE is equivalent to + the extended floating-point format used by the FPU. */ + frame_read_register (frame, regnum, from); + convert_typed_floating (from, builtin_type_i387_ext, to, type); +} + +/* Write the contents FROM of a value of type TYPE into register + REGNUM in frame FRAME. */ + +void +i387_value_to_register (struct frame_info *frame, int regnum, + struct type *type, const void *from) +{ + char to[I386_MAX_REGISTER_SIZE]; + + gdb_assert (i386_fp_regnum_p (regnum)); + + /* We only support floating-point values. */ + if (TYPE_CODE (type) != TYPE_CODE_FLT) + { + warning ("Cannot convert non-floating-point type " + "to floating-point register value."); + return; + } + + /* Convert from TYPE. This should be a no-op if TYPE is equivalent + to the extended floating-point format used by the FPU. */ + convert_typed_floating (from, type, to, builtin_type_i387_ext); + put_frame_register (frame, regnum, to); +} + -/* FIXME: kettenis/2000-05-21: Right now more than a few i386 targets - define their own routines to manage the floating-point registers in - GDB's register array. Most (if not all) of these targets use the - format used by the "fsave" instruction in their communication with - the OS. They should all be converted to use the routines below. */ +/* Handle FSAVE and FXSAVE formats. */ /* At fsave_offset[REGNUM] you'll find the offset to the location in the data structure used by the "fsave" instruction where GDB diff --git a/gdb/i387-tdep.h b/gdb/i387-tdep.h index 707931016b2..df5c77bdaec 100644 --- a/gdb/i387-tdep.h +++ b/gdb/i387-tdep.h @@ -24,6 +24,7 @@ struct gdbarch; struct ui_file; struct frame_info; +struct type; /* Print out the i387 floating point state. */ @@ -32,6 +33,18 @@ extern void i387_print_float_info (struct gdbarch *gdbarch, struct frame_info *frame, const char *args); +/* Read a value of type TYPE from register REGNUM in frame FRAME, and + return its contents in TO. */ + +extern void i387_register_to_value (struct frame_info *frame, int regnum, + struct type *type, void *to); + +/* Write the contents FROM of a value of type TYPE into register + REGNUM in frame FRAME. */ + +extern void i387_value_to_register (struct frame_info *frame, int regnum, + struct type *type, const void *from); + /* Fill register REGNUM in GDB's register array with the appropriate value from *FSAVE. This function masks off any of the reserved bits in *FSAVE. */ diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index a898f5211ab..0bc4dea0182 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -28,7 +28,7 @@ #include "regcache.h" #include "doublest.h" #include "value.h" - +#include "gdb_assert.h" #include "objfiles.h" #include "elf/common.h" /* for DT_PLTGOT value */ #include "elf-bfd.h" @@ -86,10 +86,6 @@ extern CORE_ADDR ia64_aix_sigcontext_register_address (CORE_ADDR, int); static gdbarch_init_ftype ia64_gdbarch_init; static gdbarch_register_name_ftype ia64_register_name; -static gdbarch_register_raw_size_ftype ia64_register_raw_size; -static gdbarch_register_virtual_size_ftype ia64_register_virtual_size; -static gdbarch_register_virtual_type_ftype ia64_register_virtual_type; -static gdbarch_register_byte_ftype ia64_register_byte; static gdbarch_breakpoint_from_pc_ftype ia64_breakpoint_from_pc; static gdbarch_skip_prologue_ftype ia64_skip_prologue; static gdbarch_deprecated_extract_return_value_ftype ia64_extract_return_value; @@ -239,13 +235,13 @@ ia64_register_name (int reg) return ia64_register_names[reg]; } -int +static int ia64_register_raw_size (int reg) { return (IA64_FR0_REGNUM <= reg && reg <= IA64_FR127_REGNUM) ? 16 : 8; } -int +static int ia64_register_virtual_size (int reg) { return (IA64_FR0_REGNUM <= reg && reg <= IA64_FR127_REGNUM) ? 16 : 8; @@ -253,7 +249,7 @@ ia64_register_virtual_size (int reg) /* Return true iff register N's virtual format is different from its raw format. */ -int +static int ia64_register_convertible (int nr) { return (IA64_FR0_REGNUM <= nr && nr <= IA64_FR127_REGNUM); @@ -265,7 +261,7 @@ const struct floatformat floatformat_ia64_ext = floatformat_intbit_yes }; -void +static void ia64_register_convert_to_virtual (int regnum, struct type *type, char *from, char *to) { @@ -279,9 +275,9 @@ ia64_register_convert_to_virtual (int regnum, struct type *type, error("ia64_register_convert_to_virtual called with non floating point register number"); } -void +static void ia64_register_convert_to_raw (struct type *type, int regnum, - char *from, char *to) + const char *from, char *to) { if (regnum >= IA64_FR0_REGNUM && regnum <= IA64_FR127_REGNUM) { @@ -301,7 +297,7 @@ ia64_register_virtual_type (int reg) return builtin_type_long; } -int +static int ia64_register_byte (int reg) { return (8 * reg) + @@ -623,7 +619,19 @@ ia64_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) return breakpoint; } -CORE_ADDR +static CORE_ADDR +ia64_read_fp (void) +{ + /* We won't necessarily have a frame pointer and even if we do, it + winds up being extraordinarly messy when attempting to find the + frame chain. So for the purposes of creating frames (which is + all deprecated_read_fp() is used for), simply use the stack + pointer value instead. */ + gdb_assert (SP_REGNUM >= 0); + return read_register (SP_REGNUM); +} + +static CORE_ADDR ia64_read_pc (ptid_t ptid) { CORE_ADDR psr_value = read_register_pid (IA64_PSR_REGNUM, ptid); @@ -633,7 +641,7 @@ ia64_read_pc (ptid_t ptid) return pc_value | (slot_num * SLOT_MULTIPLIER); } -void +static void ia64_write_pc (CORE_ADDR new_pc, ptid_t ptid) { int slot_num = (int) (new_pc & 0xf) / SLOT_MULTIPLIER; @@ -691,7 +699,7 @@ rse_address_add(CORE_ADDR addr, int nslots) represent the frame chain as the end of the previous frame instead of the beginning. */ -CORE_ADDR +static CORE_ADDR ia64_frame_chain (struct frame_info *frame) { if ((get_frame_type (frame) == SIGTRAMP_FRAME)) @@ -711,7 +719,7 @@ ia64_frame_chain (struct frame_info *frame) } } -CORE_ADDR +static CORE_ADDR ia64_frame_saved_pc (struct frame_info *frame) { if ((get_frame_type (frame) == SIGTRAMP_FRAME)) @@ -1222,7 +1230,7 @@ ia64_skip_prologue (CORE_ADDR pc) return examine_prologue (pc, pc+1024, 0); } -void +static void ia64_frame_init_saved_regs (struct frame_info *frame) { if (get_frame_saved_regs (frame)) @@ -1276,7 +1284,7 @@ ia64_frame_init_saved_regs (struct frame_info *frame) } } -void +static void ia64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, @@ -1508,7 +1516,7 @@ ia64_extract_struct_value_address (char *regbuf) return struct_return_address; } -void +static void ia64_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) { /* FIXME: See above. */ @@ -1529,7 +1537,7 @@ ia64_saved_pc_after_call (struct frame_info *frame) return read_register (IA64_BR0_REGNUM); } -CORE_ADDR +static CORE_ADDR ia64_frame_args_address (struct frame_info *frame) { /* frame->frame points at the SP for this frame; But we want the start @@ -1537,7 +1545,7 @@ ia64_frame_args_address (struct frame_info *frame) return ia64_frame_chain (frame); } -CORE_ADDR +static CORE_ADDR ia64_frame_locals_address (struct frame_info *frame) { /* frame->frame points at the SP for this frame; But we want the start @@ -1545,7 +1553,7 @@ ia64_frame_locals_address (struct frame_info *frame) return ia64_frame_chain (frame); } -void +static void ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame) { CORE_ADDR bsp, cfm; @@ -1747,7 +1755,7 @@ generic_elf_find_global_pointer (CORE_ADDR faddr) status = target_read_memory (addr + 8, buf, sizeof (buf)); if (status != 0) break; - global_pointer = extract_address (buf, sizeof (buf)); + global_pointer = extract_unsigned_integer (buf, sizeof (buf)); /* The payoff... */ return global_pointer; @@ -1844,7 +1852,7 @@ find_func_descr (CORE_ADDR faddr, CORE_ADDR *fdaptr) return fdesc; } -CORE_ADDR +static CORE_ADDR ia64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { @@ -1929,7 +1937,7 @@ ia64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, char val_buf[8]; store_unsigned_integer (val_buf, 8, - find_func_descr (extract_address (VALUE_CONTENTS (arg), 8), + find_func_descr (extract_unsigned_integer (VALUE_CONTENTS (arg), 8), &funcdescaddr)); if (slotnum < rseslots) write_memory (rse_address_add (bsp, slotnum), val_buf, 8); @@ -1994,14 +2002,15 @@ ia64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* Sync gdb's idea of what the registers are with the target. */ target_store_registers (-1); - /* FIXME: This doesn't belong here! Instead, SAVE_DUMMY_FRAME_TOS needs - to be defined to call generic_save_dummy_frame_tos(). But at the - time of this writing, SAVE_DUMMY_FRAME_TOS wasn't gdbarch'd, so - I chose to put this call here instead of using the old mechanisms. - Once SAVE_DUMMY_FRAME_TOS is gdbarch'd, all we need to do is add the - line + /* FIXME: This doesn't belong here! Instead, + DEPRECATED_SAVE_DUMMY_FRAME_TOS needs to be defined to call + generic_save_dummy_frame_tos(). But at the time of this writing, + DEPRECATED_SAVE_DUMMY_FRAME_TOS wasn't gdbarch'd, so I chose to + put this call here instead of using the old mechanisms. Once + DEPRECATED_SAVE_DUMMY_FRAME_TOS is gdbarch'd, all we need to do + is add the line - set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); + set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); to ia64_gdbarch_init() and remove the line below. */ generic_save_dummy_frame_tos (sp); @@ -2009,7 +2018,7 @@ ia64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, return sp; } -CORE_ADDR +static CORE_ADDR ia64_push_return_address (CORE_ADDR pc, CORE_ADDR sp) { CORE_ADDR global_pointer = FIND_GLOBAL_POINTER (pc); @@ -2021,7 +2030,7 @@ ia64_push_return_address (CORE_ADDR pc, CORE_ADDR sp) return sp; } -void +static void ia64_store_return_value (struct type *type, char *valbuf) { if (TYPE_CODE (type) == TYPE_CODE_FLT) @@ -2035,7 +2044,7 @@ ia64_store_return_value (struct type *type, char *valbuf) valbuf, TYPE_LENGTH (type)); } -void +static void ia64_pop_frame (void) { generic_pop_current_frame (ia64_pop_frame_regular); @@ -2231,7 +2240,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_long_long_bit (gdbarch, 64); set_gdbarch_float_bit (gdbarch, 32); set_gdbarch_double_bit (gdbarch, 64); - set_gdbarch_long_double_bit (gdbarch, 64); + set_gdbarch_long_double_bit (gdbarch, 128); set_gdbarch_ptr_bit (gdbarch, 64); set_gdbarch_num_regs (gdbarch, ia64_num_regs); @@ -2243,16 +2252,15 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_name (gdbarch, ia64_register_name); set_gdbarch_deprecated_register_size (gdbarch, 8); set_gdbarch_deprecated_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_deprecated_register_byte (gdbarch, ia64_register_byte); + set_gdbarch_deprecated_register_raw_size (gdbarch, ia64_register_raw_size); set_gdbarch_deprecated_max_register_raw_size (gdbarch, 16); - set_gdbarch_register_virtual_size (gdbarch, ia64_register_virtual_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, ia64_register_virtual_size); set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 16); - set_gdbarch_register_virtual_type (gdbarch, ia64_register_virtual_type); + set_gdbarch_deprecated_register_virtual_type (gdbarch, ia64_register_virtual_type); set_gdbarch_skip_prologue (gdbarch, ia64_skip_prologue); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_frameless_function_invocation (gdbarch, ia64_frameless_function_invocation); set_gdbarch_deprecated_saved_pc_after_call (gdbarch, ia64_saved_pc_after_call); @@ -2263,9 +2271,9 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, ia64_frame_init_saved_regs); set_gdbarch_deprecated_get_saved_register (gdbarch, ia64_get_saved_register); - set_gdbarch_register_convertible (gdbarch, ia64_register_convertible); - set_gdbarch_register_convert_to_virtual (gdbarch, ia64_register_convert_to_virtual); - set_gdbarch_register_convert_to_raw (gdbarch, ia64_register_convert_to_raw); + set_gdbarch_deprecated_register_convertible (gdbarch, ia64_register_convertible); + set_gdbarch_deprecated_register_convert_to_virtual (gdbarch, ia64_register_convert_to_virtual); + set_gdbarch_deprecated_register_convert_to_raw (gdbarch, ia64_register_convert_to_raw); set_gdbarch_use_struct_convention (gdbarch, ia64_use_struct_convention); set_gdbarch_deprecated_extract_return_value (gdbarch, ia64_extract_return_value); @@ -2288,21 +2296,20 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_call_dummy_words (gdbarch, ia64_call_dummy_words); set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (ia64_call_dummy_words)); 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); + set_gdbarch_deprecated_frame_args_address (gdbarch, ia64_frame_args_address); + set_gdbarch_deprecated_frame_locals_address (gdbarch, ia64_frame_locals_address); /* We won't necessarily have a frame pointer and even if we do, it winds up being extraordinarly messy when attempting to find the frame chain. So for the purposes of creating frames (which is all deprecated_read_fp() is used for), simply use the stack pointer value instead. */ - set_gdbarch_deprecated_target_read_fp (gdbarch, generic_target_read_sp); + set_gdbarch_deprecated_target_read_fp (gdbarch, ia64_read_fp); /* Settings that should be unnecessary. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); - set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); set_gdbarch_decr_pc_after_break (gdbarch, 0); set_gdbarch_function_start_offset (gdbarch, 0); @@ -2314,6 +2321,8 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return gdbarch; } +extern initialize_file_ftype _initialize_ia64_tdep; /* -Wmissing-prototypes */ + void _initialize_ia64_tdep (void) { diff --git a/gdb/infcall.c b/gdb/infcall.c index 5f80e896bbc..123fba067cf 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -34,6 +34,7 @@ #include "gdbcmd.h" #include "command.h" #include "gdb_string.h" +#include "infcall.h" /* NOTE: cagney/2003-04-16: What's the future of this code? @@ -422,11 +423,11 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) 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. + parameter to generic_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 @@ -473,15 +474,14 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) || (INNER_THAN (2, 1) && sp >= old_sp)); } else - /* FIXME: cagney/2002-09-18: Hey, you loose! Who knows how - badly aligned the SP is! Further, per comment above, if the - generic dummy frame ends up empty (because nothing is pushed) - GDB won't be able to correctly perform back traces. If a - target is having trouble with backtraces, first thing to do - is add FRAME_ALIGN() to its architecture vector. After that, - try adding SAVE_DUMMY_FRAME_TOS() and modifying - DEPRECATED_FRAME_CHAIN so that when the next outer frame is a - generic dummy, it returns the current frame's base. */ + /* FIXME: cagney/2002-09-18: Hey, you loose! + + Who knows how badly aligned the SP is! Further, per comment + above, if the generic dummy frame ends up empty (because + nothing is pushed) GDB won't be able to correctly perform + back traces. If a target is having trouble with backtraces, + first thing to do is add FRAME_ALIGN() to the architecture + vector. If that fails, try unwind_dummy_id(). */ sp = old_sp; } @@ -530,6 +530,17 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) } break; case AT_ENTRY_POINT: + if (DEPRECATED_FIX_CALL_DUMMY_P ()) + { + /* Sigh. Some targets use DEPRECATED_FIX_CALL_DUMMY to + shove extra stuff onto the stack or into registers. That + code should be in PUSH_DUMMY_CALL, however, in the mean + time ... */ + /* If the target is manipulating DUMMY1, it looses big time. */ + void *dummy1 = NULL; + DEPRECATED_FIX_CALL_DUMMY (dummy1, sp, funaddr, nargs, args, + value_type, using_gcc); + } real_pc = funaddr; dummy_addr = CALL_DUMMY_ADDRESS (); /* A call dummy always consists of just a single breakpoint, so @@ -736,7 +747,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name); /* When there is no push_dummy_call method, should this code simply error out. That would the implementation of this method for all ABIs (which is probably a good thing). */ - sp = gdbarch_push_dummy_call (current_gdbarch, current_regcache, + sp = gdbarch_push_dummy_call (current_gdbarch, funaddr, current_regcache, bp_addr, nargs, args, sp, struct_return, struct_addr); else if (DEPRECATED_PUSH_ARGUMENTS_P ()) @@ -798,20 +809,29 @@ You must use a pointer to function type variable. Command ignored.", arg_name); if (struct_return && DEPRECATED_STORE_STRUCT_RETURN_P ()) DEPRECATED_STORE_STRUCT_RETURN (struct_addr, sp); - /* Write the stack pointer. This is here because the statements above - might fool with it. On SPARC, this write also stores the register - window into the right place in the new stack frame, which otherwise - wouldn't happen. (See store_inferior_registers in sparc-nat.c.) */ - /* NOTE: cagney/2003-03-23: Disable this code when there is a - push_dummy_call() method. Since that method will have already - stored the stack pointer (as part of creating the fake call - frame), and none of the code following that code adjusts the - stack-pointer value, the below call is entirely redundant. */ + /* Write the stack pointer. This is here because the statements + above might fool with it. On SPARC, this write also stores the + register window into the right place in the new stack frame, + which otherwise wouldn't happen (see store_inferior_registers in + sparc-nat.c). */ + /* NOTE: cagney/2003-03-23: Since the architecture method + push_dummy_call() should have already stored the stack pointer + (as part of creating the fake call frame), and none of the code + following that call adjusts the stack-pointer value, the below + call is entirely redundant. */ if (DEPRECATED_DUMMY_WRITE_SP_P ()) DEPRECATED_DUMMY_WRITE_SP (sp); - if (SAVE_DUMMY_FRAME_TOS_P ()) - SAVE_DUMMY_FRAME_TOS (sp); + if (gdbarch_unwind_dummy_id_p (current_gdbarch)) + { + /* Sanity. The exact same SP value is returned by + PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by + unwind_dummy_id to form the frame ID's stack address. */ + gdb_assert (DEPRECATED_USE_GENERIC_DUMMY_FRAMES); + generic_save_dummy_frame_tos (sp); + } + else if (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ()) + DEPRECATED_SAVE_DUMMY_FRAME_TOS (sp); /* Now proceed, having reached the desired place. */ clear_proceed_status (); @@ -830,17 +850,29 @@ You must use a pointer to function type variable. Command ignored.", arg_name); set_momentary_breakpoint. We need to give the breakpoint a frame ID so that the breakpoint code can correctly re-identify the dummy breakpoint. */ - /* The assumption here is that push_dummy_call() returned the - stack part of the frame ID. Unfortunatly, many older - architectures were, via a convoluted mess, relying on the - poorly defined and greatly overloaded DEPRECATED_TARGET_READ_FP - or DEPRECATED_FP_REGNUM to supply the value. */ - if (DEPRECATED_TARGET_READ_FP_P ()) - frame = frame_id_build (DEPRECATED_TARGET_READ_FP (), sal.pc); - else if (DEPRECATED_FP_REGNUM >= 0) - frame = frame_id_build (read_register (DEPRECATED_FP_REGNUM), sal.pc); + if (gdbarch_unwind_dummy_id_p (current_gdbarch)) + { + /* Sanity. The exact same SP value is returned by + PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by + unwind_dummy_id to form the frame ID's stack address. */ + gdb_assert (DEPRECATED_USE_GENERIC_DUMMY_FRAMES); + frame = frame_id_build (sp, sal.pc); + } else - frame = frame_id_build (sp, sal.pc); + { + /* The assumption here is that push_dummy_call() returned the + stack part of the frame ID. Unfortunatly, many older + architectures were, via a convoluted mess, relying on the + poorly defined and greatly overloaded + DEPRECATED_TARGET_READ_FP or DEPRECATED_FP_REGNUM to supply + the value. */ + if (DEPRECATED_TARGET_READ_FP_P ()) + frame = frame_id_build (DEPRECATED_TARGET_READ_FP (), sal.pc); + else if (DEPRECATED_FP_REGNUM >= 0) + frame = frame_id_build (read_register (DEPRECATED_FP_REGNUM), sal.pc); + else + frame = frame_id_build (sp, sal.pc); + } bpt = set_momentary_breakpoint (sal, frame, bp_call_dummy); bpt->disposition = disp_del; } diff --git a/gdb/infcmd.c b/gdb/infcmd.c index de6c319608d..911e865cf4e 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -81,6 +81,8 @@ static void float_info (char *, int); static void detach_command (char *, int); +static void disconnect_command (char *, int); + static void unset_environment_command (char *, int); static void set_environment_command (char *, int); @@ -1551,9 +1553,9 @@ default_print_registers_info (struct gdbarch *gdbarch, The function frame_register_read() should have returned the pre-cooked register so no conversion is necessary. */ /* Convert raw data to virtual format if necessary. */ - if (REGISTER_CONVERTIBLE (i)) + if (DEPRECATED_REGISTER_CONVERTIBLE (i)) { - REGISTER_CONVERT_TO_VIRTUAL (i, register_type (current_gdbarch, i), + DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (i, register_type (current_gdbarch, i), raw_buffer, virtual_buffer); } else @@ -1876,6 +1878,26 @@ detach_command (char *args, int from_tty) detach_hook (); } +/* Disconnect from the current target without resuming it (leaving it + waiting for a debugger). + + We'd better not have left any breakpoints in the program or the + next debugger will get confused. Currently only supported for some + remote targets, since the normal attach mechanisms don't work on + stopped processes on some native platforms (e.g. GNU/Linux). */ + +static void +disconnect_command (char *args, int from_tty) +{ + dont_repeat (); /* Not for the faint of heart */ + target_disconnect (args, from_tty); +#if defined(SOLIB_RESTART) + SOLIB_RESTART (); +#endif + if (detach_hook) + detach_hook (); +} + /* Stop the execution of the target while running in async mode, in the backgound. */ void @@ -2014,6 +2036,11 @@ to specify the program, and to load its symbol table."); If a process, it is no longer traced, and it continues its execution. If\n\ you were debugging a file, the file is closed and gdb no longer accesses it."); + add_com ("disconnect", class_run, disconnect_command, + "Disconnect from a target.\n\ +The target will wait for another debugger to connect. Not available for\n\ +all targets."); + add_com ("signal", class_run, signal_command, "Continue program giving it signal specified by the argument.\n\ An argument of \"0\" means continue program without giving it a signal."); diff --git a/gdb/inferior.h b/gdb/inferior.h index 1de3b25e39b..ed49d2315d9 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -168,8 +168,6 @@ extern CORE_ADDR read_pc (void); extern CORE_ADDR read_pc_pid (ptid_t); -extern CORE_ADDR generic_target_read_pc (ptid_t); - extern void write_pc (CORE_ADDR); extern void write_pc_pid (CORE_ADDR, ptid_t); @@ -178,9 +176,7 @@ extern void generic_target_write_pc (CORE_ADDR, ptid_t); extern CORE_ADDR read_sp (void); -extern CORE_ADDR generic_target_read_sp (void); - -extern void generic_target_write_sp (CORE_ADDR); +extern void deprecated_write_sp (CORE_ADDR); extern CORE_ADDR deprecated_read_fp (void); diff --git a/gdb/infrun.c b/gdb/infrun.c index df179682109..b2e371eebb0 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -79,6 +79,8 @@ static int currently_stepping (struct execution_control_state *ecs); static void xdb_handle_command (char *args, int from_tty); +static int prepare_to_proceed (void); + void _initialize_infrun (void); int inferior_ignoring_startup_exec_events = 0; @@ -667,6 +669,55 @@ clear_proceed_status (void) bpstat_clear (&stop_bpstat); } +/* This should be suitable for any targets that support threads. */ + +static int +prepare_to_proceed (void) +{ + ptid_t wait_ptid; + struct target_waitstatus wait_status; + + /* Get the last target status returned by target_wait(). */ + get_last_target_status (&wait_ptid, &wait_status); + + /* Make sure we were stopped either at a breakpoint, or because + of a Ctrl-C. */ + if (wait_status.kind != TARGET_WAITKIND_STOPPED + || (wait_status.value.sig != TARGET_SIGNAL_TRAP && + wait_status.value.sig != TARGET_SIGNAL_INT)) + { + return 0; + } + + if (!ptid_equal (wait_ptid, minus_one_ptid) + && !ptid_equal (inferior_ptid, wait_ptid)) + { + /* Switched over from WAIT_PID. */ + CORE_ADDR wait_pc = read_pc_pid (wait_ptid); + + if (wait_pc != read_pc ()) + { + /* Switch back to WAIT_PID thread. */ + inferior_ptid = wait_ptid; + + /* FIXME: This stuff came from switch_to_thread() in + thread.c (which should probably be a public function). */ + flush_cached_frames (); + registers_changed (); + stop_pc = wait_pc; + select_frame (get_current_frame ()); + } + + /* We return 1 to indicate that there is a breakpoint here, + so we need to step over it before continuing to avoid + hitting it straight away. */ + if (breakpoint_here_p (wait_pc)) + return 1; + } + + return 0; + +} /* Record the pc of the program the last time it stopped. This is just used internally by wait_for_inferior, but need to be preserved @@ -722,7 +773,6 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) write_pc (addr); } -#ifdef PREPARE_TO_PROCEED /* In a multi-threaded task we may select another thread and then continue or step. @@ -731,15 +781,11 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) any execution (i.e. it will report a breakpoint hit incorrectly). So we must step over it first. - PREPARE_TO_PROCEED checks the current thread against the thread + prepare_to_proceed checks the current thread against the thread that reported the most recent event. If a step-over is required it returns TRUE and sets the current thread to the old thread. */ - if (PREPARE_TO_PROCEED (1) && breakpoint_here_p (read_pc ())) - { - oneproc = 1; - } - -#endif /* PREPARE_TO_PROCEED */ + if (prepare_to_proceed () && breakpoint_here_p (read_pc ())) + oneproc = 1; #ifdef HP_OS_BUG if (trap_expected_after_continue) diff --git a/gdb/infttrace.c b/gdb/infttrace.c index f86ab025ef6..e0238e8bc55 100644 --- a/gdb/infttrace.c +++ b/gdb/infttrace.c @@ -142,12 +142,6 @@ static startup_semaphore_t startup_semaphore; static int vforking_child_pid = 0; static int vfork_in_flight = 0; -/* To support PREPARE_TO_PROCEED (hppa_prepare_to_proceed). - */ -static pid_t old_gdb_pid = 0; -static pid_t reported_pid = 0; -static int reported_bpt = 0; - /* 1 if ok as results of a ttrace or ttrace_wait call, 0 otherwise. */ #define TT_OK( _status, _errno ) \ @@ -2912,12 +2906,6 @@ ptrace_wait (ptid_t ptid, int *status) */ return_pid = map_to_gdb_tid (real_tid); - /* Remember this for later use in "hppa_prepare_to_proceed". - */ - old_gdb_pid = PIDGET (inferior_ptid); - reported_pid = return_pid; - reported_bpt = ((tsp.tts_event & TTEVT_SIGNAL) && (5 == tsp.tts_u.tts_signal.tts_signo)); - if (real_tid == 0 || return_pid == 0) { warning ("Internal error: process-wait failed."); @@ -5536,64 +5524,6 @@ hppa_pid_or_tid_to_str (ptid_t ptid) } -/* If the current pid is not the pid this module reported - * from "ptrace_wait" with the most recent event, then the - * user has switched threads. - * - * If the last reported event was a breakpoint, then return - * the old thread id, else return 0. - */ -pid_t -hppa_switched_threads (pid_t gdb_pid) -{ - if (gdb_pid == old_gdb_pid) - { - /* - * Core gdb is working with the same pid that it - * was before we reported the last event. This - * is ok: e.g. we reported hitting a thread-specific - * breakpoint, but we were reporting the wrong - * thread, so the core just ignored the event. - * - * No thread switch has happened. - */ - return (pid_t) 0; - } - else if (gdb_pid == reported_pid) - { - /* - * Core gdb is working with the pid we reported, so - * any continue or step will be able to figure out - * that it needs to step over any hit breakpoints - * without our (i.e. PREPARE_TO_PROCEED's) help. - */ - return (pid_t) 0; - } - else if (!reported_bpt) - { - /* - * The core switched, but we didn't just report a - * breakpoint, so there's no just-hit breakpoint - * instruction at "reported_pid"'s PC, and thus there - * is no need to step over it. - */ - return (pid_t) 0; - } - else - { - /* There's been a real switch, and we reported - * a hit breakpoint. Let "hppa_prepare_to_proceed" - * know, so it can see whether the breakpoint is - * still active. - */ - return reported_pid; - } - - /* Keep compiler happy with an obvious return at the end. - */ - return (pid_t) 0; -} - void hppa_ensure_vforking_parent_remains_stopped (int pid) { diff --git a/gdb/interps.c b/gdb/interps.c index 748b5b64901..6df1d4bf17f 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -290,7 +290,7 @@ interp_quiet_p (struct interp *interp) return current_interpreter->quiet_p; } -int +static int interp_set_quiet (struct interp *interp, int quiet) { int old_val = interp->quiet_p; @@ -357,7 +357,7 @@ initialize_interps (void) /* Don't know if anything needs to be done here... */ } -void +static void interpreter_exec_cmd (char *args, int from_tty) { struct interp *old_interp, *interp_to_use; diff --git a/gdb/interps.h b/gdb/interps.h index 3954e553671..74008d6c21a 100644 --- a/gdb/interps.h +++ b/gdb/interps.h @@ -63,7 +63,7 @@ extern int current_interp_named_p (const char *name); extern int current_interp_display_prompt_p (void); extern void current_interp_command_loop (void); -extern void clear_interpreter_hooks (); +extern void clear_interpreter_hooks (void); /* well-known interpreters */ #define INTERP_CONSOLE "console" diff --git a/gdb/irix4-nat.c b/gdb/irix4-nat.c index 76354954443..90229bbe014 100644 --- a/gdb/irix4-nat.c +++ b/gdb/irix4-nat.c @@ -156,7 +156,7 @@ get_longjmp_target (CORE_ADDR *pc) TARGET_PTR_BIT / TARGET_CHAR_BIT)) return 0; - *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); + *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); return 1; } diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index 6128a04a450..bb90da51f88 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -174,7 +174,7 @@ get_longjmp_target (CORE_ADDR *pc) TARGET_PTR_BIT / TARGET_CHAR_BIT)) return 0; - *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); + *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); return 1; } diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index 99f7484f433..36589fb6323 100644 --- a/gdb/jv-exp.y +++ b/gdb/jv-exp.y @@ -1228,9 +1228,7 @@ java_type_from_name (name) Otherwise, return 0. */ static int -push_variable (name) - struct stoken name; - +push_variable (struct stoken name) { char *tmp = copy_name (name); int is_a_field_of_this = 0; @@ -1302,9 +1300,7 @@ push_fieldnames (name) Handle a qualified name, where DOT_INDEX is the index of the first '.' */ static void -push_qualified_expression_name (name, dot_index) - struct stoken name; - int dot_index; +push_qualified_expression_name (struct stoken name, int dot_index) { struct stoken token; char *tmp; diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index 144b3a74aea..82ebadcb3cd 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -36,6 +36,7 @@ #include "dictionary.h" #include "block.h" #include "demangle.h" +#include "dictionary.h" #include struct type *java_int_type; @@ -111,7 +112,8 @@ get_java_class_symtab (void) to delete this comment. */ class_symtab->free_code = free_nothing; bv = (struct blockvector *) - obstack_alloc (&objfile->symbol_obstack, sizeof (struct blockvector)); + obstack_alloc (&objfile->symbol_obstack, + sizeof (struct blockvector) + sizeof (struct block *)); BLOCKVECTOR_NBLOCKS (bv) = 1; BLOCKVECTOR (class_symtab) = bv; @@ -260,7 +262,7 @@ type_from_class (struct value *clas) char *nptr; CORE_ADDR addr; struct block *bl; - int i; + struct dict_iterator iter; int is_array = 0; type = check_typedef (VALUE_TYPE (clas)); @@ -275,9 +277,8 @@ type_from_class (struct value *clas) #if 0 get_java_class_symtab (); bl = BLOCKVECTOR_BLOCK (BLOCKVECTOR (class_symtab), GLOBAL_BLOCK); - for (i = BLOCK_NSYMS (bl); --i >= 0;) + ALL_BLOCK_SYMBOLS (block, iter, sym) { - struct symbol *sym = BLOCK_SYM (bl, i); if (SYMBOL_VALUE_ADDRESS (sym) == addr) return SYMBOL_TYPE (sym); } diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index 78309c4d8ed..656e33bcbb3 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -110,14 +110,22 @@ java_value_print (struct value *val, struct ui_file *stream, int format, { read_memory (address, buf, sizeof (buf)); address += TARGET_PTR_BIT / HOST_CHAR_BIT; - element = extract_address (buf, sizeof (buf)); + /* FIXME: cagney/2003-05-24: Bogus or what. It + pulls a host sized pointer out of the target and + then extracts that as an address (while assuming + that the address is unsigned)! */ + element = extract_unsigned_integer (buf, sizeof (buf)); } for (reps = 1; i + reps < length; reps++) { read_memory (address, buf, sizeof (buf)); address += TARGET_PTR_BIT / HOST_CHAR_BIT; - next_element = extract_address (buf, sizeof (buf)); + /* FIXME: cagney/2003-05-24: Bogus or what. It + pulls a host sized pointer out of the target and + then extracts that as an address (while assuming + that the address is unsigned)! */ + next_element = extract_unsigned_integer (buf, sizeof (buf)); if (next_element != element) break; } @@ -468,7 +476,8 @@ java_val_print (struct type *type, char *valaddr, int embedded_offset, /* Print the unmangled name if desired. */ /* Print vtable entry - we only get here if we ARE using -fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */ - print_address_demangle (extract_address (valaddr, TYPE_LENGTH (type)), + /* Extract an address, assume that it is unsigned. */ + print_address_demangle (extract_unsigned_integer (valaddr, TYPE_LENGTH (type)), stream, demangle); break; } diff --git a/gdb/lin-lwp.c b/gdb/lin-lwp.c index c36394e87f3..a82adb7ea2a 100644 --- a/gdb/lin-lwp.c +++ b/gdb/lin-lwp.c @@ -24,6 +24,10 @@ #include "gdb_string.h" #include #include +#ifdef HAVE_TKILL_SYSCALL +#include +#include +#endif #include #include "gdb_wait.h" @@ -36,6 +40,8 @@ static int debug_lin_lwp; extern char *strsignal (int sig); +#include "linux-nat.h" + /* On GNU/Linux there are no real LWP's. The closest thing to LWP's are processes sharing the same VM space. A multi-threaded process is basically a group of such processes. However, such a grouping @@ -69,43 +75,6 @@ extern char *strsignal (int sig); threads will run out of processes, even if the threads exit, because the "zombies" stay around. */ -/* Structure describing a LWP. */ -struct lwp_info -{ - /* The process id of the LWP. This is a combination of the LWP id - and overall process id. */ - ptid_t ptid; - - /* Non-zero if this LWP is cloned. In this context "cloned" means - that the LWP is reporting to its parent using a signal other than - SIGCHLD. */ - int cloned; - - /* Non-zero if we sent this LWP a SIGSTOP (but the LWP didn't report - it back yet). */ - int signalled; - - /* Non-zero if this LWP is stopped. */ - int stopped; - - /* Non-zero if this LWP will be/has been resumed. Note that an LWP - can be marked both as stopped and resumed at the same time. This - happens if we try to resume an LWP that has a wait status - pending. We shouldn't let the LWP run until that wait status has - been processed, but we should not report that wait status if GDB - didn't try to let the LWP run. */ - int resumed; - - /* If non-zero, a pending wait status. */ - int status; - - /* Non-zero if we were stepping this LWP. */ - int step; - - /* Next LWP in list. */ - struct lwp_info *next; -}; - /* List of known LWPs. */ static struct lwp_info *lwp_list; @@ -156,6 +125,7 @@ static sigset_t blocked_mask; /* Prototypes for local functions. */ static int stop_wait_callback (struct lwp_info *lp, void *data); +static int lin_lwp_thread_alive (ptid_t ptid); /* Convert wait status STATUS to a string. Used for printing debug messages only. */ @@ -293,46 +263,6 @@ iterate_over_lwps (int (*callback) (struct lwp_info *, void *), void *data) } -/* Implementation of the PREPARE_TO_PROCEED hook for the GNU/Linux LWP - layer. - - Note that this implementation is potentially redundant now that - default_prepare_to_proceed() has been added. - - FIXME This may not support switching threads after Ctrl-C - correctly. The default implementation does support this. */ - -int -lin_lwp_prepare_to_proceed (void) -{ - if (!ptid_equal (trap_ptid, null_ptid) - && !ptid_equal (inferior_ptid, trap_ptid)) - { - /* Switched over from TRAP_PID. */ - CORE_ADDR stop_pc = read_pc (); - CORE_ADDR trap_pc; - - /* Avoid switching where it wouldn't do any good, i.e. if both - threads are at the same breakpoint. */ - trap_pc = read_pc_pid (trap_ptid); - if (trap_pc != stop_pc && breakpoint_here_p (trap_pc)) - { - /* User hasn't deleted the breakpoint. Return non-zero, and - switch back to TRAP_PID. */ - inferior_ptid = trap_ptid; - - /* FIXME: Is this stuff really necessary? */ - flush_cached_frames (); - registers_changed (); - - return 1; - } - } - - return 0; -} - - #if 0 static void lin_lwp_open (char *args, int from_tty) @@ -627,6 +557,32 @@ lin_lwp_resume (ptid_t ptid, int step, enum target_signal signo) } +/* Issue kill to specified lwp. */ + +static int tkill_failed; + +static int +kill_lwp (int lwpid, int signo) +{ + errno = 0; + +/* Use tkill, if possible, in case we are using nptl threads. If tkill + fails, then we are not using nptl threads and we should be using kill. */ + +#ifdef HAVE_TKILL_SYSCALL + if (!tkill_failed) + { + int ret = syscall (__NR_tkill, lwpid, signo); + if (errno != ENOSYS) + return ret; + errno = 0; + tkill_failed = 1; + } +#endif + + return kill (lwpid, signo); +} + /* Send a SIGSTOP to LP. */ static int @@ -642,8 +598,15 @@ stop_callback (struct lwp_info *lp, void *data) "SC: kill %s ****\n", target_pid_to_str (lp->ptid)); } - ret = kill (GET_LWP (lp->ptid), SIGSTOP); - gdb_assert (ret == 0); + errno = 0; + ret = kill_lwp (GET_LWP (lp->ptid), SIGSTOP); + if (debug_lin_lwp) + { + fprintf_unfiltered (gdb_stdlog, + "SC: lwp kill %d %s\n", + ret, + errno ? safe_strerror (errno) : "ERRNO-OK"); + } lp->signalled = 1; gdb_assert (lp->status == 0); @@ -667,11 +630,23 @@ stop_wait_callback (struct lwp_info *lp, void *data) gdb_assert (lp->status == 0); - pid = waitpid (GET_LWP (lp->ptid), &status, lp->cloned ? __WCLONE : 0); + pid = waitpid (GET_LWP (lp->ptid), &status, 0); if (pid == -1 && errno == ECHILD) - /* OK, the proccess has disappeared. We'll catch the actual - exit event in lin_lwp_wait. */ - return 0; + { + pid = waitpid (GET_LWP (lp->ptid), &status, __WCLONE); + if (pid == -1 && errno == ECHILD) + { + /* The thread has previously exited. We need to delete it now + because in the case of nptl threads, there won't be an + exit event unless it is the main thread. */ + if (debug_lin_lwp) + fprintf_unfiltered (gdb_stdlog, + "SWC: %s exited.\n", + target_pid_to_str (lp->ptid)); + delete_lwp (lp->ptid); + return 0; + } + } gdb_assert (pid == GET_LWP (lp->ptid)); @@ -683,6 +658,7 @@ stop_wait_callback (struct lwp_info *lp, void *data) status_to_str (status)); } + /* Check if the thread has exited. */ if (WIFEXITED (status) || WIFSIGNALED (status)) { gdb_assert (num_lwps > 1); @@ -697,7 +673,31 @@ stop_wait_callback (struct lwp_info *lp, void *data) target_pid_to_str (lp->ptid)); } if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, "SWC: %s exited.\n", + fprintf_unfiltered (gdb_stdlog, + "SWC: %s exited.\n", + target_pid_to_str (lp->ptid)); + + delete_lwp (lp->ptid); + return 0; + } + + /* Check if the current LWP has previously exited. For nptl threads, + there is no exit signal issued for LWPs that are not the + main thread so we should check whenever the thread is stopped. */ + if (!lin_lwp_thread_alive (lp->ptid)) + { + if (in_thread_list (lp->ptid)) + { + /* Core GDB cannot deal with us deleting the current + thread. */ + if (!ptid_equal (lp->ptid, inferior_ptid)) + delete_thread (lp->ptid); + printf_unfiltered ("[%s exited]\n", + target_pid_to_str (lp->ptid)); + } + if (debug_lin_lwp) + fprintf_unfiltered (gdb_stdlog, + "SWC: %s already exited.\n", target_pid_to_str (lp->ptid)); delete_lwp (lp->ptid); @@ -756,7 +756,14 @@ stop_wait_callback (struct lwp_info *lp, void *data) /* If there's another event, throw it back into the queue. */ if (lp->status) { - kill (GET_LWP (lp->ptid), WSTOPSIG (lp->status)); + if (debug_lin_lwp) + { + fprintf_unfiltered (gdb_stdlog, + "SWC: kill %s, %s\n", + target_pid_to_str (lp->ptid), + status_to_str ((int) status)); + } + kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (lp->status)); } /* Save the sigtrap event. */ lp->status = status; @@ -800,7 +807,7 @@ stop_wait_callback (struct lwp_info *lp, void *data) target_pid_to_str (lp->ptid), status_to_str ((int) status)); } - kill (GET_LWP (lp->ptid), WSTOPSIG (status)); + kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (status)); } return 0; } @@ -1027,6 +1034,23 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus) save_errno = EINTR; } + /* Check for stop events reported by a process we didn't already + know about - in this case, anything other than inferior_ptid. + + If we're expecting to receive stopped processes after fork, + vfork, and clone events, then we'll just add the new one to + our list and go back to waiting for the event to be reported + - the stopped process might be returned from waitpid before + or after the event is. If we want to handle debugging of + CLONE_PTRACE processes we need to do more here, i.e. switch + to multi-threaded mode. */ + if (pid != -1 && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP + && pid != GET_PID (inferior_ptid)) + { + pid = -1; + save_errno = EINTR; + } + clear_sigio_trap (); clear_sigint_trap (); } @@ -1049,6 +1073,25 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus) #endif +/* Stop an active thread, verify it still exists, then resume it. */ + +static int +stop_and_resume_callback (struct lwp_info *lp, void *data) +{ + struct lwp_info *ptr; + + if (!lp->stopped && !lp->signalled) + { + stop_callback (lp, NULL); + stop_wait_callback (lp, NULL); + /* Resume if the lwp still exists. */ + for (ptr = lwp_list; ptr; ptr = ptr->next) + if (lp == ptr) + resume_callback (lp, NULL); + } + return 0; +} + static ptid_t lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) { @@ -1171,6 +1214,22 @@ retry: lp = find_lwp_pid (pid_to_ptid (lwpid)); + /* Check for stop events reported by a process we didn't + already know about - anything not already in our LWP + list. + + If we're expecting to receive stopped processes after + fork, vfork, and clone events, then we'll just add the + new one to our list and go back to waiting for the event + to be reported - the stopped process might be returned + from waitpid before or after the event is. */ + if (WIFSTOPPED (status) && !lp) + { + linux_record_stopped_pid (lwpid); + status = 0; + continue; + } + /* Make sure we don't report an event for the exit of an LWP not in our list, i.e. not part of the current process. This can happen if we detach from a program we original forked and then it @@ -1181,6 +1240,13 @@ retry: continue; } + /* NOTE drow/2003-06-17: This code seems to be meant for debugging + CLONE_PTRACE processes which do not use the thread library - + otherwise we wouldn't find the new LWP this way. That doesn't + currently work, and the following code is currently unreachable + due to the two blocks above. If it's fixed some day, this code + should be broken out into a function so that we can also pick up + LWPs from the new interface. */ if (!lp) { lp = add_lwp (BUILD_LWP (lwpid, GET_PID (inferior_ptid))); @@ -1206,10 +1272,61 @@ retry: } } - /* Make sure we don't report a TARGET_WAITKIND_EXITED or - TARGET_WAITKIND_SIGNALLED event if there are still LWP's - left in the process. */ + /* Check if the thread has exited. */ if ((WIFEXITED (status) || WIFSIGNALED (status)) && num_lwps > 1) + { + if (in_thread_list (lp->ptid)) + { + /* Core GDB cannot deal with us deleting the current + thread. */ + if (!ptid_equal (lp->ptid, inferior_ptid)) + delete_thread (lp->ptid); + printf_unfiltered ("[%s exited]\n", + target_pid_to_str (lp->ptid)); + } + + /* If this is the main thread, we must stop all threads and + verify if they are still alive. This is because in the nptl + thread model, there is no signal issued for exiting LWPs + other than the main thread. We only get the main thread + exit signal once all child threads have already exited. + If we stop all the threads and use the stop_wait_callback + to check if they have exited we can determine whether this + signal should be ignored or whether it means the end of the + debugged application, regardless of which threading model + is being used. */ + if (GET_PID (lp->ptid) == GET_LWP (lp->ptid)) + { + lp->stopped = 1; + iterate_over_lwps (stop_and_resume_callback, NULL); + } + + if (debug_lin_lwp) + fprintf_unfiltered (gdb_stdlog, + "LLW: %s exited.\n", + target_pid_to_str (lp->ptid)); + + delete_lwp (lp->ptid); + + /* If there is at least one more LWP, then the exit signal + was not the end of the debugged application and should be + ignored. */ + if (num_lwps > 0) + { + /* Make sure there is at least one thread running. */ + gdb_assert (iterate_over_lwps (running_callback, NULL)); + + /* Discard the event. */ + status = 0; + continue; + } + } + + /* Check if the current LWP has previously exited. In the nptl + thread model, LWPs other than the main thread do not issue + signals when they exit so we must check whenever the thread + has stopped. A similar check is made in stop_wait_callback(). */ + if (num_lwps > 1 && !lin_lwp_thread_alive (lp->ptid)) { if (in_thread_list (lp->ptid)) { diff --git a/gdb/linespec.c b/gdb/linespec.c index 1d00d79dc84..0fb4d2eef8f 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -35,6 +35,7 @@ #include "block.h" #include "objc-lang.h" #include "cp-support.h" +#include "linespec.h" /* Prototypes for local functions. */ @@ -328,8 +329,6 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, is_objc_method, paren_pointer, file_symtab); } - - /* Now, the helper functions. */ /* NOTE: carlton/2002-11-04: Some of these have non-obvious side diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c index a9512964dab..e4ea747008b 100644 --- a/gdb/linux-proc.c +++ b/gdb/linux-proc.c @@ -35,6 +35,8 @@ #include "cli/cli-decode.h" /* for add_info */ #include "gdb_string.h" +#include "linux-nat.h" + #ifndef O_LARGEFILE #define O_LARGEFILE 0 #endif @@ -171,13 +173,13 @@ linux_do_thread_registers (bfd *obfd, ptid_t ptid, #ifdef FILL_FPXREGSET gdb_fpxregset_t fpxregs; #endif - unsigned long merged_pid = ptid_get_tid (ptid) << 16 | ptid_get_pid (ptid); + unsigned long lwp = ptid_get_lwp (ptid); fill_gregset (&gregs, -1); note_data = (char *) elfcore_write_prstatus (obfd, note_data, note_size, - merged_pid, + lwp, stop_signal, &gregs); fill_fpregset (&fpregs, -1); @@ -210,7 +212,7 @@ struct linux_corefile_thread_data */ static int -linux_corefile_thread_callback (struct thread_info *ti, void *data) +linux_corefile_thread_callback (struct lwp_info *ti, void *data) { struct linux_corefile_thread_data *args = data; ptid_t saved_ptid = inferior_ptid; @@ -268,7 +270,7 @@ linux_make_note_section (bfd *obfd, int *note_size) thread_args.note_data = note_data; thread_args.note_size = note_size; thread_args.num_notes = 0; - iterate_over_threads (linux_corefile_thread_callback, &thread_args); + iterate_over_lwps (linux_corefile_thread_callback, &thread_args); if (thread_args.num_notes == 0) { /* iterate_over_threads didn't come up with any threads; diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 5d6e51e756b..f0f4ea59666 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -419,12 +419,6 @@ m68hc11_frame_args_address (struct frame_info *frame) return addr; } -static CORE_ADDR -m68hc11_frame_locals_address (struct frame_info *frame) -{ - return get_frame_base (frame); -} - /* Discard from the stack the innermost frame, restoring all saved registers. */ @@ -1057,7 +1051,7 @@ m68hc11_push_arguments (int nargs, /* Return a location where we can set a breakpoint that will be hit when an inferior function call returns. */ -CORE_ADDR +static CORE_ADDR m68hc11_call_dummy_address (void) { return entry_point_address (); @@ -1171,8 +1165,8 @@ m68hc11_return_value_on_stack (struct type *type) static CORE_ADDR m68hc11_extract_struct_value_address (char *regbuf) { - return extract_address (®buf[HARD_D_REGNUM * 2], - REGISTER_RAW_SIZE (HARD_D_REGNUM)); + return extract_unsigned_integer (®buf[HARD_D_REGNUM * 2], + REGISTER_RAW_SIZE (HARD_D_REGNUM)); } /* Function: push_return_address (pc) @@ -1358,6 +1352,9 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_ptr_bit (gdbarch, 16); set_gdbarch_long_long_bit (gdbarch, 64); + /* Characters are unsigned. */ + set_gdbarch_char_signed (gdbarch, 0); + /* Set register info. */ set_gdbarch_fp0_regnum (gdbarch, -1); set_gdbarch_deprecated_max_register_raw_size (gdbarch, 2); @@ -1365,17 +1362,15 @@ m68hc11_gdbarch_init (struct gdbarch_info info, 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); set_gdbarch_write_pc (gdbarch, generic_target_write_pc); - set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); set_gdbarch_sp_regnum (gdbarch, HARD_SP_REGNUM); set_gdbarch_deprecated_fp_regnum (gdbarch, SOFT_FP_REGNUM); set_gdbarch_register_name (gdbarch, m68hc11_register_name); set_gdbarch_deprecated_register_size (gdbarch, 2); set_gdbarch_deprecated_register_bytes (gdbarch, M68HC11_ALL_REGS * 2); - set_gdbarch_register_virtual_type (gdbarch, m68hc11_register_virtual_type); + set_gdbarch_deprecated_register_virtual_type (gdbarch, m68hc11_register_virtual_type); set_gdbarch_pseudo_register_read (gdbarch, m68hc11_pseudo_register_read); set_gdbarch_pseudo_register_write (gdbarch, m68hc11_pseudo_register_write); @@ -1391,15 +1386,11 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_deprecated_store_struct_return (gdbarch, m68hc11_store_struct_return); set_gdbarch_deprecated_store_return_value (gdbarch, m68hc11_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m68hc11_extract_struct_value_address); - set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not); - set_gdbarch_deprecated_frame_chain (gdbarch, m68hc11_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, m68hc11_frame_saved_pc); - set_gdbarch_frame_args_address (gdbarch, m68hc11_frame_args_address); - set_gdbarch_frame_locals_address (gdbarch, m68hc11_frame_locals_address); + set_gdbarch_deprecated_frame_args_address (gdbarch, m68hc11_frame_args_address); set_gdbarch_deprecated_saved_pc_after_call (gdbarch, m68hc11_saved_pc_after_call); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register); @@ -1431,6 +1422,8 @@ m68hc11_gdbarch_init (struct gdbarch_info info, return gdbarch; } +extern initialize_file_ftype _initialize_m68hc11_tdep; /* -Wmissing-prototypes */ + void _initialize_m68hc11_tdep (void) { diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index 087d0bb2633..c8158c4261c 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -77,13 +77,13 @@ #endif -void m68k_frame_init_saved_regs (struct frame_info *frame_info); +static void m68k_frame_init_saved_regs (struct frame_info *frame_info); /* gdbarch_breakpoint_from_pc is set to m68k_local_breakpoint_from_pc so m68k_remote_breakpoint_from_pc is currently not used. */ -const static unsigned char * +static const unsigned char * m68k_remote_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) { static unsigned char break_insn[] = {0x4e, (0x40 | REMOTE_BPT_VECTOR)}; @@ -91,7 +91,7 @@ m68k_remote_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) return break_insn; } -const static unsigned char * +static const unsigned char * m68k_local_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) { static unsigned char break_insn[] = {0x4e, (0x40 | BPT_VECTOR)}; @@ -110,13 +110,11 @@ m68k_register_bytes_ok (long numbytes) /* Number of bytes of storage in the actual machine representation for register regnum. On the 68000, all regs are 4 bytes except the floating point regs which are 12 bytes. */ -/* Note that the unsigned cast here forces the result of the - subtraction to very high positive values if regnum < FP0_REGNUM */ static int m68k_register_raw_size (int regnum) { - return (((unsigned) (regnum) - FP0_REGNUM) < 8 ? 12 : 4); + return (regnum >= FP0_REGNUM && regnum < FP0_REGNUM + 8 ? 12 : 4); } /* Number of bytes of storage in the program's representation @@ -126,7 +124,7 @@ m68k_register_raw_size (int regnum) static int m68k_register_virtual_size (int regnum) { - return (((unsigned) (regnum) - FP0_REGNUM) < 8 ? 12 : 4); + return (regnum >= FP0_REGNUM && regnum < FP0_REGNUM + 8 ? 12 : 4); } /* Return the GDB type object for the "standard" data type of data in @@ -178,14 +176,6 @@ m68k_register_name (int regnum) return register_names[regnum]; } -/* Stack must be kept short aligned when doing function calls. */ - -static CORE_ADDR -m68k_stack_align (CORE_ADDR addr) -{ - return ((addr + 1) & ~1); -} - /* Index within `registers' of the first byte of the space for register regnum. */ @@ -296,28 +286,6 @@ m68k_frame_saved_pc (struct frame_info *frame) } -/* The only reason this is here is the tm-altos.h reference below. It - was moved back here from tm-m68k.h. FIXME? */ - -extern CORE_ADDR -altos_skip_prologue (CORE_ADDR pc) -{ - register int op = read_memory_unsigned_integer (pc, 2); - if (op == P_LINKW_FP) - pc += 4; /* Skip link #word */ - else if (op == P_LINKL_FP) - pc += 6; /* Skip link #long */ - /* Not sure why branches are here. */ - /* From tm-altos.h */ - else if (op == 0060000) - pc += 4; /* Skip bra #word */ - else if (op == 00600377) - pc += 6; /* skip bra #long */ - else if ((op & 0177400) == 0060000) - pc += 2; /* skip bra #char */ - return pc; -} - int delta68_in_sigtramp (CORE_ADDR pc, char *name) { @@ -353,31 +321,6 @@ delta68_frame_saved_pc (struct frame_info *frame_info) + 4, 4); } -/* Return number of args passed to a frame. - Can return -1, meaning no way to tell. */ - -int -isi_frame_num_args (struct frame_info *fi) -{ - int val; - CORE_ADDR pc = DEPRECATED_FRAME_SAVED_PC (fi); - int insn = read_memory_unsigned_integer (pc, 2); - val = 0; - if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ - val = read_memory_integer (pc + 2, 2); - else if ((insn & 0170777) == 0050217 /* addql #N, sp */ - || (insn & 0170777) == 0050117) /* addqw */ - { - val = (insn >> 9) & 7; - if (val == 0) - val = 8; - } - else if (insn == 0157774) /* addal #WW, sp */ - val = read_memory_integer (pc + 2, 4); - val >>= 2; - return val; -} - int delta68_frame_num_args (struct frame_info *fi) { @@ -400,33 +343,11 @@ delta68_frame_num_args (struct frame_info *fi) return val; } -int -news_frame_num_args (struct frame_info *fi) -{ - int val; - CORE_ADDR pc = DEPRECATED_FRAME_SAVED_PC (fi); - int insn = read_memory_unsigned_integer (pc, 2); - val = 0; - if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ - val = read_memory_integer (pc + 2, 2); - else if ((insn & 0170777) == 0050217 /* addql #N, sp */ - || (insn & 0170777) == 0050117) /* addqw */ - { - val = (insn >> 9) & 7; - if (val == 0) - val = 8; - } - else if (insn == 0157774) /* addal #WW, sp */ - val = read_memory_integer (pc + 2, 4); - val >>= 2; - return val; -} - /* Insert the specified number of args and function address into a call sequence of the above form stored at DUMMYNAME. We use the BFD routines to store a big-endian value of known size. */ -void +static void m68k_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p) { @@ -438,7 +359,7 @@ m68k_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, /* Push an empty stack frame, to record the current PC, etc. */ -void +static void m68k_push_dummy_frame (void) { register CORE_ADDR sp = read_register (SP_REGNUM); @@ -468,7 +389,7 @@ m68k_push_dummy_frame (void) /* Discard from the stack the innermost frame, restoring all saved registers. */ -void +static void m68k_pop_frame (void) { register struct frame_info *frame = get_current_frame (); @@ -539,7 +460,7 @@ m68k_pop_frame (void) */ -CORE_ADDR +static CORE_ADDR m68k_skip_prologue (CORE_ADDR ip) { register CORE_ADDR limit; @@ -580,7 +501,7 @@ m68k_skip_prologue (CORE_ADDR ip) ways in the stack frame. sp is even more special: the address we return for it IS the sp for the next frame. */ -void +static void m68k_frame_init_saved_regs (struct frame_info *frame_info) { register int regnum; @@ -905,17 +826,19 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) we extract the pc (JB_PC) that we will land at. The pc is copied into PC. This routine returns true on success. */ -/* NOTE: cagney/2000-11-08: For this function to be fully multi-arched - the macro's JB_PC and JB_ELEMENT_SIZE would need to be moved into - the ``struct gdbarch_tdep'' object and then set on a target ISA/ABI - dependant basis. */ - int m68k_get_longjmp_target (CORE_ADDR *pc) { -#if defined (JB_PC) && defined (JB_ELEMENT_SIZE) char *buf; CORE_ADDR sp, jb_addr; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + + if (tdep->jb_pc < 0) + { + internal_error (__FILE__, __LINE__, + "m68k_get_longjmp_target: not implemented"); + return 0; + } buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT); sp = read_register (SP_REGNUM); @@ -924,20 +847,14 @@ m68k_get_longjmp_target (CORE_ADDR *pc) buf, TARGET_PTR_BIT / TARGET_CHAR_BIT)) return 0; - jb_addr = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); + jb_addr = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); - if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf, + if (target_read_memory (jb_addr + tdep->jb_pc * tdep->jb_elt_size, buf, TARGET_PTR_BIT / TARGET_CHAR_BIT)) return 0; - *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); - + *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); return 1; -#else - internal_error (__FILE__, __LINE__, - "m68k_get_longjmp_target: not implemented"); - return 0; -#endif } /* Immediately after a function call, return the saved pc before the frame @@ -945,7 +862,7 @@ m68k_get_longjmp_target (CORE_ADDR *pc) system call, and if so, we know that Sun pushes the call # on the stack prior to doing the trap. */ -CORE_ADDR +static CORE_ADDR m68k_saved_pc_after_call (struct frame_info *frame) { #ifdef SYSCALL_TRAP @@ -979,11 +896,8 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (arches != NULL) return (arches->gdbarch); -#if 0 - tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep)); -#endif - - gdbarch = gdbarch_alloc (&info, 0); + tdep = xmalloc (sizeof (struct gdbarch_tdep)); + gdbarch = gdbarch_alloc (&info, tdep); /* NOTE: cagney/2002-12-06: This can be deleted when this arch is ready to unwind the PC first (see frame.c:get_prev_frame()). */ @@ -1000,8 +914,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Stack grows down. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); - set_gdbarch_stack_align (gdbarch, m68k_stack_align); - set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1); + set_gdbarch_parm_boundary (gdbarch, 32); set_gdbarch_believe_pcc_promotion (gdbarch, 1); set_gdbarch_decr_pc_after_break (gdbarch, 2); @@ -1016,18 +929,16 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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'. */ - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_frame_args_skip (gdbarch, 8); - set_gdbarch_register_raw_size (gdbarch, m68k_register_raw_size); - set_gdbarch_register_virtual_size (gdbarch, m68k_register_virtual_size); + set_gdbarch_deprecated_register_raw_size (gdbarch, m68k_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, m68k_register_virtual_size); 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_deprecated_register_virtual_type (gdbarch, m68k_register_virtual_type); set_gdbarch_register_name (gdbarch, m68k_register_name); set_gdbarch_deprecated_register_size (gdbarch, 4); - set_gdbarch_register_byte (gdbarch, m68k_register_byte); + set_gdbarch_deprecated_register_byte (gdbarch, m68k_register_byte); set_gdbarch_num_regs (gdbarch, 29); set_gdbarch_register_bytes_ok (gdbarch, m68k_register_bytes_ok); set_gdbarch_deprecated_register_bytes (gdbarch, (16 * 4 + 8 + 8 * 12 + 3 * 4)); @@ -1051,11 +962,27 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_pop_frame (gdbarch, m68k_pop_frame); /* Should be using push_dummy_call. */ - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); + + /* Disassembler. */ + set_gdbarch_print_insn (gdbarch, print_insn_m68k); + +#if defined JB_PC && defined JB_ELEMENT_SIZE + tdep->jb_pc = JB_PC; + tdep->jb_elt_size = JB_ELEMENT_SIZE; +#else + tdep->jb_pc = -1; +#endif /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); + /* Now we have tuned the configuration, set a few final things, + based on what the OS ABI has told us. */ + + if (tdep->jb_pc >= 0) + set_gdbarch_get_longjmp_target (gdbarch, m68k_get_longjmp_target); + return gdbarch; } @@ -1063,12 +990,16 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) static void m68k_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) { + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + if (tdep == NULL) + return; } +extern initialize_file_ftype _initialize_m68k_tdep; /* -Wmissing-prototypes */ + void _initialize_m68k_tdep (void) { gdbarch_register (bfd_arch_m68k, m68k_gdbarch_init, m68k_dump_tdep); - deprecated_tm_print_insn = print_insn_m68k; } diff --git a/gdb/m68k-tdep.h b/gdb/m68k-tdep.h index 8da568e6e27..7c499a73ca9 100644 --- a/gdb/m68k-tdep.h +++ b/gdb/m68k-tdep.h @@ -1,5 +1,5 @@ /* Common target dependent code for the Motorola 68000 series. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -44,4 +44,14 @@ enum M68K_FPI_REGNUM = 28 }; +/* Target-dependent structure in gdbarch. */ +struct gdbarch_tdep +{ + /* Offset to PC value in the jump buffer. If this is negative, + longjmp support will be disabled. */ + int jb_pc; + /* The size of each entry in the jump buffer. */ + size_t jb_elt_size; +}; + #endif /* M68K_TDEP_H */ diff --git a/gdb/m68klinux-tdep.c b/gdb/m68klinux-tdep.c index 8b9193d2cc3..1fa9f749650 100644 --- a/gdb/m68klinux-tdep.c +++ b/gdb/m68klinux-tdep.c @@ -27,8 +27,16 @@ #include "gdb_string.h" #include "gdbtypes.h" #include "osabi.h" +#include "regcache.h" +#include "objfiles.h" +#include "symtab.h" #include "m68k-tdep.h" +/* Offsets (in target ints) into jmp_buf. */ + +#define M68K_LINUX_JB_ELEMENT_SIZE 4 +#define M68K_LINUX_JB_PC 7 + /* Check whether insn1 and insn2 are parts of a signal trampoline. */ #define IS_SIGTRAMP(insn1, insn2) \ @@ -47,8 +55,8 @@ of m68k_linux_frame_saved_pc we also distinguish between non-RT and RT signal trampolines. */ -int -m68k_linux_in_sigtramp (CORE_ADDR pc) +static int +m68k_linux_pc_in_sigtramp (CORE_ADDR pc, char *name) { CORE_ADDR sp; char buf[12]; @@ -110,7 +118,7 @@ m68k_linux_sigtramp_saved_pc (struct frame_info *frame) /* Don't cause a memory_error when accessing sigcontext in case the stack layout has changed or the stack is corrupt. */ - if (m68k_linux_in_sigtramp (get_frame_pc (frame)) == 2) + if (m68k_linux_pc_in_sigtramp (get_frame_pc (frame), 0) == 2) target_read_memory (sigcontext_addr + UCONTEXT_PC_OFFSET, buf, ptrbytes); else target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, ptrbytes); @@ -141,9 +149,9 @@ m68k_linux_extract_return_value (struct type *type, char *regbuf, char *valbuf) { if (TYPE_CODE (type) == TYPE_CODE_FLT) { - REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, type, - regbuf + REGISTER_BYTE (FP0_REGNUM), - valbuf); + DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, type, + regbuf + REGISTER_BYTE (FP0_REGNUM), + valbuf); } else if (TYPE_CODE (type) == TYPE_CODE_PTR) memcpy (valbuf, regbuf + REGISTER_BYTE (M68K_A0_REGNUM), @@ -163,7 +171,7 @@ m68k_linux_store_return_value (struct type *type, char *valbuf) if (TYPE_CODE (type) == TYPE_CODE_FLT) { char raw_buffer[REGISTER_RAW_SIZE (FP0_REGNUM)]; - REGISTER_CONVERT_TO_RAW (type, FP0_REGNUM, valbuf, raw_buffer); + DEPRECATED_REGISTER_CONVERT_TO_RAW (type, FP0_REGNUM, valbuf, raw_buffer); deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), raw_buffer, TYPE_LENGTH (type)); } @@ -189,6 +197,11 @@ m68k_linux_extract_struct_value_address (char *regbuf) static void m68k_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + tdep->jb_pc = M68K_LINUX_JB_PC; + tdep->jb_elt_size = M68K_LINUX_JB_ELEMENT_SIZE; + set_gdbarch_deprecated_frame_saved_pc (gdbarch, m68k_linux_frame_saved_pc); set_gdbarch_deprecated_extract_return_value (gdbarch, @@ -197,6 +210,12 @@ m68k_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) m68k_linux_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m68k_linux_extract_struct_value_address); + + set_gdbarch_pc_in_sigtramp (gdbarch, m68k_linux_pc_in_sigtramp); + + /* Shared library handling. */ + set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section); + set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); } void diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c index 02f44fce4cd..7c2ebbea749 100644 --- a/gdb/macrocmd.c +++ b/gdb/macrocmd.c @@ -222,6 +222,8 @@ macro_list_command (char *exp, int from_tty) /* Initializing the `macrocmd' module. */ +extern initialize_file_ftype _initialize_macrocmd; /* -Wmissing-prototypes */ + void _initialize_macrocmd (void) { diff --git a/gdb/macrotab.c b/gdb/macrotab.c index 1432847a8e6..4f0761d7dec 100644 --- a/gdb/macrotab.c +++ b/gdb/macrotab.c @@ -123,7 +123,7 @@ macro_bcache_str (struct macro_table *t, const char *s) /* Free a possibly bcached object OBJ. That is, if the macro table T has a bcache, it's an error; otherwise, xfree OBJ. */ -void +static void macro_bcache_free (struct macro_table *t, void *obj) { gdb_assert (! t->bcache); diff --git a/gdb/main.c b/gdb/main.c index fd25750b94e..5a06017ac88 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -73,10 +73,10 @@ struct ui_file *gdb_stdout; struct ui_file *gdb_stderr; struct ui_file *gdb_stdlog; struct ui_file *gdb_stdtarg; - -/* Used to initialize error() - defined in utils.c */ - -extern void error_init (void); +struct ui_file *gdb_stdin; +/* target IO streams */ +struct ui_file *gdb_stdtargin; +struct ui_file *gdb_stdtargerr; /* Whether to enable writing into executable and core files */ extern int write_files; @@ -168,6 +168,10 @@ captured_main (void *data) /* This needs to happen before the first use of malloc. */ init_malloc (NULL); +#ifdef HAVE_SBRK + lim_at_start = (char *) sbrk (0); +#endif + #if defined (ALIGN_STACK_ON_STARTUP) i = (int) &count & 0x3; if (i != 0) @@ -193,6 +197,9 @@ captured_main (void *data) gdb_stderr = stdio_fileopen (stderr); gdb_stdlog = gdb_stderr; /* for moment */ gdb_stdtarg = gdb_stderr; /* for moment */ + gdb_stdin = stdio_fileopen (stdin); + gdb_stdtargerr = gdb_stderr; /* for moment */ + gdb_stdtargin = gdb_stdin; /* for moment */ /* initialize error() */ error_init (); diff --git a/gdb/maint.c b/gdb/maint.c index aa342390765..b55cb67b4e3 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -407,7 +407,7 @@ maintenance_print_statistics (char *args, int from_tty) print_symbol_bcache_statistics (); } -void +static void maintenance_print_architecture (char *args, int from_tty) { if (args == NULL) diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index ea97ec297e4..3c4e7e7d97c 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -30,51 +30,10 @@ #include "gdb_string.h" #include "disasm.h" -/* Functions declared and used only in this file */ - -static CORE_ADDR mcore_analyze_prologue (struct frame_info *fi, CORE_ADDR pc, int skip_prologue); - -static struct frame_info *analyze_dummy_frame (CORE_ADDR pc, CORE_ADDR frame); - +static CORE_ADDR mcore_analyze_prologue (struct frame_info *fi, CORE_ADDR pc, + int skip_prologue); static int get_insn (CORE_ADDR pc); -/* Functions exported from this file */ - -int mcore_use_struct_convention (int gcc_p, struct type *type); - -void _initialize_mcore (void); - -void mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi); - -CORE_ADDR mcore_frame_saved_pc (struct frame_info *fi); - -CORE_ADDR mcore_find_callers_reg (struct frame_info *fi, int regnum); - -CORE_ADDR mcore_frame_args_address (struct frame_info *fi); - -CORE_ADDR mcore_frame_locals_address (struct frame_info *fi); - -CORE_ADDR mcore_push_return_address (CORE_ADDR pc, CORE_ADDR sp); - -CORE_ADDR mcore_push_arguments (int nargs, struct value ** args, CORE_ADDR sp, - int struct_return, CORE_ADDR struct_addr); - -void mcore_pop_frame (); - -CORE_ADDR mcore_skip_prologue (CORE_ADDR pc); - -CORE_ADDR mcore_frame_chain (struct frame_info *fi); - -const unsigned char *mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size); - -int mcore_use_struct_convention (int gcc_p, struct type *type); - -void mcore_store_return_value (struct type *type, char *valbuf); - -CORE_ADDR mcore_extract_struct_value_address (char *regbuf); - -void mcore_extract_return_value (struct type *type, char *regbuf, char *valbuf); - #ifdef MCORE_DEBUG int mcore_debug = 0; #endif @@ -243,7 +202,7 @@ mcore_register_name (int regnum) instructions are 16 bits, this is all we need, regardless of address. bpkt = 0x0000 */ -const unsigned char * +static const unsigned char * mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size) { static char breakpoint[] = @@ -647,7 +606,7 @@ mcore_analyze_prologue (struct frame_info *fi, CORE_ADDR pc, int skip_prologue) then DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC will be called for the new frame. */ -CORE_ADDR +static CORE_ADDR mcore_frame_chain (struct frame_info * fi) { struct frame_info *dummy; @@ -705,7 +664,7 @@ mcore_frame_chain (struct frame_info * fi) /* Skip the prologue of the function at PC. */ -CORE_ADDR +static CORE_ADDR mcore_skip_prologue (CORE_ADDR pc) { CORE_ADDR func_addr, func_end; @@ -725,13 +684,13 @@ mcore_skip_prologue (CORE_ADDR pc) } /* Return the address at which function arguments are offset. */ -CORE_ADDR +static CORE_ADDR mcore_frame_args_address (struct frame_info * fi) { return get_frame_base (fi) - get_frame_extra_info (fi)->framesize; } -CORE_ADDR +static CORE_ADDR mcore_frame_locals_address (struct frame_info * fi) { return get_frame_base (fi) - get_frame_extra_info (fi)->framesize; @@ -739,7 +698,7 @@ mcore_frame_locals_address (struct frame_info * fi) /* Return the frame pointer in use at address PC. */ -void +static void mcore_virtual_frame_pointer (CORE_ADDR pc, int *reg, LONGEST *offset) { struct frame_info *dummy = analyze_dummy_frame (pc, 0); @@ -757,7 +716,7 @@ mcore_virtual_frame_pointer (CORE_ADDR pc, int *reg, LONGEST *offset) /* Find the value of register REGNUM in frame FI. */ -CORE_ADDR +static CORE_ADDR mcore_find_callers_reg (struct frame_info *fi, int regnum) { for (; fi != NULL; fi = get_next_frame (fi)) @@ -776,7 +735,7 @@ mcore_find_callers_reg (struct frame_info *fi, int regnum) /* Find the saved pc in frame FI. */ -CORE_ADDR +static CORE_ADDR mcore_frame_saved_pc (struct frame_info * fi) { @@ -793,7 +752,7 @@ mcore_frame_saved_pc (struct frame_info * fi) /* This routine gets called when either the user uses the "return" command, or the call dummy breakpoint gets hit. */ -void +static void mcore_pop_frame (void) { int rn; @@ -843,7 +802,7 @@ mcore_pop_frame (void) FIRST_ARGREG, since the MCORE treats struct returns (of less than eight bytes) as hidden first arguments. */ -CORE_ADDR +static CORE_ADDR mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { @@ -953,7 +912,7 @@ mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp, opted to use generic call dummies, so we simply store the CALL_DUMMY_ADDRESS into the PR register (r15). */ -CORE_ADDR +static CORE_ADDR mcore_push_return_address (CORE_ADDR pc, CORE_ADDR sp) { write_register (PR_REGNUM, CALL_DUMMY_ADDRESS ()); @@ -979,7 +938,7 @@ mcore_push_return_address (CORE_ADDR pc, CORE_ADDR sp) EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc and TYPE is the type (which is known to be struct, union or array). */ -int +static int mcore_use_struct_convention (int gcc_p, struct type *type) { return (TYPE_LENGTH (type) > 8); @@ -989,17 +948,17 @@ mcore_use_struct_convention (int gcc_p, struct type *type) this buffer was passed as a hidden first argument, so just return that address. */ -CORE_ADDR +static CORE_ADDR mcore_extract_struct_value_address (char *regbuf) { - return extract_address (regbuf + REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE); + return extract_unsigned_integer (regbuf + REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE); } /* Given a function which returns a value of type TYPE, extract the the function's return value and place the result into VALBUF. REGBUF is the register contents of the target. */ -void +static void mcore_extract_return_value (struct type *type, char *regbuf, char *valbuf) { /* Copy the return value (starting) in RETVAL_REGNUM to VALBUF. */ @@ -1019,7 +978,7 @@ mcore_extract_return_value (struct type *type, char *regbuf, char *valbuf) significant word) and r3 (least significant word, left justified). Note that this includes structures of less than eight bytes, too. */ -void +static void mcore_store_return_value (struct type *type, char *valbuf) { int value_size; @@ -1045,7 +1004,7 @@ mcore_store_return_value (struct type *type, char *valbuf) This includes allocating space for saved registers and analyzing the prologue of this frame. */ -void +static void mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi) { if (fi && get_next_frame (fi)) @@ -1106,10 +1065,10 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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); - set_gdbarch_register_raw_size (gdbarch, mcore_register_size); - set_gdbarch_register_byte (gdbarch, mcore_register_byte); + set_gdbarch_deprecated_register_virtual_type (gdbarch, mcore_register_virtual_type); + set_gdbarch_deprecated_register_virtual_size (gdbarch, mcore_register_size); + set_gdbarch_deprecated_register_raw_size (gdbarch, mcore_register_size); + set_gdbarch_deprecated_register_byte (gdbarch, mcore_register_byte); set_gdbarch_deprecated_register_bytes (gdbarch, MCORE_REG_SIZE * MCORE_NUM_REGS); set_gdbarch_num_regs (gdbarch, MCORE_NUM_REGS); set_gdbarch_pc_regnum (gdbarch, 64); @@ -1120,7 +1079,7 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words); set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0); - set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); + set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); set_gdbarch_deprecated_saved_pc_after_call (gdbarch, mcore_saved_pc_after_call); set_gdbarch_function_start_offset (gdbarch, 0); set_gdbarch_decr_pc_after_break (gdbarch, 0); @@ -1142,9 +1101,8 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) mcore_extract_struct_value_address); set_gdbarch_skip_prologue (gdbarch, mcore_skip_prologue); set_gdbarch_frame_args_skip (gdbarch, 0); - set_gdbarch_frame_args_address (gdbarch, mcore_frame_args_address); - set_gdbarch_frame_locals_address (gdbarch, mcore_frame_locals_address); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); + set_gdbarch_deprecated_frame_args_address (gdbarch, mcore_frame_args_address); + set_gdbarch_deprecated_frame_locals_address (gdbarch, mcore_frame_locals_address); set_gdbarch_deprecated_pop_frame (gdbarch, mcore_pop_frame); set_gdbarch_virtual_frame_pointer (gdbarch, mcore_virtual_frame_pointer); @@ -1159,7 +1117,7 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_reg_struct_has_addr (gdbarch, mcore_reg_struct_has_addr); /* Should be using push_dummy_call. */ - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); return gdbarch; } @@ -1170,6 +1128,8 @@ mcore_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) } +extern initialize_file_ftype _initialize_mcore_tdep; /* -Wmissing-prototypes */ + void _initialize_mcore_tdep (void) { diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 04eefb5f3cb..bc96b24a121 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -285,7 +285,9 @@ static struct symbol *new_symbol (char *); static struct type *new_type (char *); -static struct block *new_block (int function); +enum block_type { FUNCTION_BLOCK, NON_FUNCTION_BLOCK }; + +static struct block *new_block (enum block_type); static struct symtab *new_symtab (char *, int, struct objfile *); @@ -832,7 +834,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, TYPE_FLAGS (SYMBOL_TYPE (s)) |= TYPE_FLAG_PROTOTYPED; /* Create and enter a new lexical context */ - b = new_block (1); + b = new_block (FUNCTION_BLOCK); SYMBOL_BLOCK_VALUE (s) = b; BLOCK_FUNCTION (b) = s; BLOCK_START (b) = BLOCK_END (b) = sh->value; @@ -1167,7 +1169,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, } top_stack->blocktype = stBlock; - b = new_block (0); + b = new_block (NON_FUNCTION_BLOCK); BLOCK_START (b) = sh->value + top_stack->procadr; BLOCK_SUPERBLOCK (b) = top_stack->cur_block; top_stack->cur_block = b; @@ -1236,12 +1238,12 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, TYPE_FIELDS (ftype) = (struct field *) TYPE_ALLOC (ftype, nparams * sizeof (struct field)); - for (sym = dict_iterator_first (BLOCK_DICT (b), &iter), - iparams = 0; - iparams < nparams; - sym = dict_iterator_next (&iter)) + iparams = 0; + ALL_BLOCK_SYMBOLS (b, iter, sym) { - gdb_assert (sym != NULL); + if (iparams == nparams) + break; + switch (SYMBOL_CLASS (sym)) { case LOC_ARG: @@ -4059,8 +4061,6 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename) int maxlines; EXTR *ext_ptr; - /* How many symbols will we need */ - /* FIXME, this does not count enum values. */ if (fh == 0) { maxlines = 0; @@ -4467,9 +4467,6 @@ mylookup_symbol (char *name, register struct block *block, static void add_symbol (struct symbol *s, struct block *b) { - struct block *newb; - struct parse_stack *stackp; - dict_add_symbol (BLOCK_DICT (b), s); } @@ -4592,8 +4589,8 @@ sort_blocks (struct symtab *s) /* Constructor/restructor/destructor procedures */ -/* Allocate a new symtab for NAME. Needs an estimate of how many symbols - and linenumbers MAXLINES we'll put in it */ +/* Allocate a new symtab for NAME. Needs an estimate of how many + linenumbers MAXLINES we'll put in it */ static struct symtab * new_symtab (char *name, int maxlines, struct objfile *objfile) @@ -4606,11 +4603,12 @@ new_symtab (char *name, int maxlines, struct objfile *objfile) /* All symtabs must have at least two blocks */ BLOCKVECTOR (s) = new_bvect (2); - global_block = new_block (0); - static_block = new_block (0); - BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK) = global_block; - BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK) = static_block; - BLOCK_SUPERBLOCK (static_block) = global_block; + BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK) + = new_block (NON_FUNCTION_BLOCK); + BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK) + = new_block (NON_FUNCTION_BLOCK); + BLOCK_SUPERBLOCK (BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK)) = + BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK); /* FIXME: carlton/2002-09-24: But how do the blocks get freed? Oy. */ @@ -4700,11 +4698,11 @@ new_bvect (int nblocks) hashed. */ static struct block * -new_block (int function) +new_block (enum block_type type) { struct block *retval = xzalloc (sizeof (struct block)); - if (function) + if (type == FUNCTION_BLOCK) BLOCK_DICT (retval) = dict_create_linear_expandable (); else BLOCK_DICT (retval) = dict_create_hashed_expandable (); @@ -4846,7 +4844,7 @@ fixup_sigtramp (void) TYPE_TARGET_TYPE (SYMBOL_TYPE (s)) = mdebug_type_void; /* Need a block to allocate MIPS_EFI_SYMBOL_NAME in */ - b = new_block (0); + b = new_block (NON_FUNCTION_BLOCK); SYMBOL_BLOCK_VALUE (s) = b; BLOCK_START (b) = sigtramp_address; BLOCK_END (b) = sigtramp_end; @@ -4888,8 +4886,6 @@ fixup_sigtramp (void) } dict_add_symbol (BLOCK_DICT (b), s); - add_block (b, st); - sort_blocks (st); } #endif /* TM_MIPS_H */ diff --git a/gdb/memattr.c b/gdb/memattr.c index 05ad413cc0a..4ab5dbf1009 100644 --- a/gdb/memattr.c +++ b/gdb/memattr.c @@ -514,6 +514,8 @@ mem_delete_command (char *args, int from_tty) dont_repeat (); } +extern initialize_file_ftype _initialize_mem; /* -Wmissing-prototype */ + void _initialize_mem (void) { diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 4451cb89575..2902629a43e 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,27 @@ +2003-06-17 Daniel Jacobowitz + + * mi-cmds.c (mi_cmds): Add "-target-disconnect". + +2003-06-11 David Carlton + + * mi-cmd-stack.c: Include dictionary.h. + (list_args_or_locals): Update use of ALL_BLOCK_SYMBOLS. + +2003-06-11 Andrew Cagney + + * mi-main.c (get_register): Replace REGISTER_CONVERTIBLE with + DEPRECATED_REGISTER_CONVERTIBLE. + +2003-06-08 Andrew Cagney + + * mi-parse.c (_initialize_mi_parse): Delete function. + * mi-main.c: Include "mi-main.h". + * mi-interp.c (_initialize_mi_interp): Add declaration. + * mi-cmd-stack.c: Include "stack.h". + (select_frame_command_wrapper): Delete extern declaration. + (mi_cmd_stack_select_frame): Replace select_frame_command_wrapper + with select_frame_command. + 2003-05-16 Andrew Cagney * mi-main.c (mi_setup_architecture_data): diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index b968d845893..6330cda473c 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -27,13 +27,9 @@ #include "ui-out.h" #include "symtab.h" #include "block.h" +#include "stack.h" #include "dictionary.h" -/* FIXME: these should go in some .h file but stack.c doesn't have a - corresponding .h file. These wrappers will be obsolete anyway, once - we pull the plug on the sanitization. */ -extern void select_frame_command_wrapper (char *, int); - static void list_args_or_locals (int locals, int values, struct frame_info *fi); /* Print a list of the stack frames. Args can be none, in which case @@ -219,6 +215,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi) struct block *block; struct symbol *sym; struct dict_iterator iter; + int nsyms; struct cleanup *cleanup_list; static struct ui_stream *stb = NULL; @@ -312,8 +309,8 @@ mi_cmd_stack_select_frame (char *command, char **argv, int argc) /* with no args, don't change frame */ if (argc == 0) - select_frame_command_wrapper (0, 1 /* not used */ ); + select_frame_command (0, 1 /* not used */ ); else - select_frame_command_wrapper (argv[0], 1 /* not used */ ); + select_frame_command (argv[0], 1 /* not used */ ); return MI_CMD_DONE; } diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c index 9ec174fd854..91824022278 100644 --- a/gdb/mi/mi-cmds.c +++ b/gdb/mi/mi-cmds.c @@ -127,6 +127,7 @@ struct mi_cmd mi_cmds[] = {"target-attach", 0, 0}, {"target-compare-sections", 0, 0}, {"target-detach", "detach", 0}, + {"target-disconnect", "disconnect", 0}, {"target-download", 0, mi_cmd_target_download}, {"target-exec-status", 0, 0}, {"target-list-available-targets", 0, 0}, diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index 87ed17f16c9..696ae06e24c 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -393,6 +393,8 @@ mi_input (char *buf) return gdb_readline (NULL); } +extern initialize_file_ftype _initialize_mi_interp; /* -Wmissing-prototypes */ + void _initialize_mi_interp (void) { diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 0e9cb248a10..5e55913fb94 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -41,6 +41,7 @@ #include "regcache.h" #include "gdb.h" #include "frame.h" +#include "mi-main.h" #include #include @@ -535,9 +536,9 @@ get_register (int regnum, int format) /* Convert raw data to virtual format if necessary. */ - if (REGISTER_CONVERTIBLE (regnum)) + if (DEPRECATED_REGISTER_CONVERTIBLE (regnum)) { - REGISTER_CONVERT_TO_VIRTUAL (regnum, + DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, register_type (current_gdbarch, regnum), raw_buffer, virtual_buffer); } diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c index caefd5936a5..ebfddc7ff29 100644 --- a/gdb/mi/mi-parse.c +++ b/gdb/mi/mi-parse.c @@ -231,8 +231,3 @@ mi_parse (char *cmd) parse->op = MI_COMMAND; return parse; } - -void -_initialize_mi_parse (void) -{ -} diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index b8072f1aba7..78503d1c650 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -80,7 +80,7 @@ mips_linux_get_longjmp_target (CORE_ADDR *pc) buf, TARGET_PTR_BIT / TARGET_CHAR_BIT)) return 0; - *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); + *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); return 1; } @@ -367,7 +367,7 @@ mips64_linux_get_longjmp_target (CORE_ADDR *pc) buf, TARGET_PTR_BIT / TARGET_CHAR_BIT)) return 0; - *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); + *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); return 1; } diff --git a/gdb/mips-nat.c b/gdb/mips-nat.c index e370534f38c..fbd18c0b43f 100644 --- a/gdb/mips-nat.c +++ b/gdb/mips-nat.c @@ -150,7 +150,7 @@ get_longjmp_target (CORE_ADDR *pc) TARGET_PTR_BIT / TARGET_CHAR_BIT)) return 0; - *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); + *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); return 1; } diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 23a5911f1c6..f39179d3a0f 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -42,11 +42,14 @@ #include "osabi.h" #include "mips-tdep.h" #include "block.h" - +#include "reggroups.h" #include "opcode/mips.h" #include "elf/mips.h" #include "elf-bfd.h" #include "symcat.h" +#include "sim-regno.h" + +static void set_reg_offset (CORE_ADDR *saved_regs, int regnum, CORE_ADDR off); /* A useful bit in the CP0 status register (PS_REGNUM). */ /* This bit is set if we are emulating 32-bit FPRs on a 64-bit chip. */ @@ -150,6 +153,27 @@ static const char *mips_saved_regsize_string = size_auto; #define MIPS_SAVED_REGSIZE (mips_saved_regsize()) +/* MIPS16 function addresses are odd (bit 0 is set). Here are some + functions to test, set, or clear bit 0 of addresses. */ + +static CORE_ADDR +is_mips16_addr (CORE_ADDR addr) +{ + return ((addr) & 1); +} + +static CORE_ADDR +make_mips16_addr (CORE_ADDR addr) +{ + return ((addr) | 1); +} + +static CORE_ADDR +unmake_mips16_addr (CORE_ADDR addr) +{ + return ((addr) & ~1); +} + /* Return the contents of register REGNUM as a signed integer. */ static LONGEST @@ -247,6 +271,7 @@ mips_xfer_register (struct regcache *regcache, int reg_num, int length, { bfd_byte reg[MAX_REGISTER_SIZE]; int reg_offset = 0; + gdb_assert (reg_num >= NUM_REGS); /* Need to transfer the left or right part of the register, based on the targets byte order. */ switch (endian) @@ -275,9 +300,9 @@ mips_xfer_register (struct regcache *regcache, int reg_num, int length, fprintf_unfiltered (gdb_stdlog, "%02x", out[buf_offset + i]); } if (in != NULL) - regcache_raw_read_part (regcache, reg_num, reg_offset, length, in + buf_offset); + regcache_cooked_read_part (regcache, reg_num, reg_offset, length, in + buf_offset); if (out != NULL) - regcache_raw_write_part (regcache, reg_num, reg_offset, length, out + buf_offset); + regcache_cooked_write_part (regcache, reg_num, reg_offset, length, out + buf_offset); if (mips_debug && in != NULL) { int i; @@ -350,8 +375,6 @@ mips_stack_argsize (void) int gdb_print_insn_mips (bfd_vma, disassemble_info *); -static void mips_print_register (int, int); - static mips_extra_func_info_t heuristic_proc_desc (CORE_ADDR, CORE_ADDR, struct frame_info *, int); @@ -372,9 +395,6 @@ static mips_extra_func_info_t find_proc_desc (CORE_ADDR pc, static CORE_ADDR after_prologue (CORE_ADDR pc, mips_extra_func_info_t proc_desc); -static void mips_read_fp_register_single (int regno, char *rare_buffer); -static void mips_read_fp_register_double (int regno, char *rare_buffer); - static struct type *mips_float_register_type (void); static struct type *mips_double_register_type (void); @@ -422,21 +442,27 @@ mips_register_name (int regno) enum mips_abi abi = mips_abi (current_gdbarch); + /* Map [NUM_REGS .. 2*NUM_REGS) onto the raw registers, but then + don't make the raw register names visible. */ + int rawnum = regno % NUM_REGS; + if (regno < NUM_REGS) + return ""; + /* The MIPS integer registers are always mapped from 0 to 31. The names of the registers (which reflects the conventions regarding register use) vary depending on the ABI. */ - if (0 <= regno && regno < 32) + if (0 <= rawnum && rawnum < 32) { if (abi == MIPS_ABI_N32 || abi == MIPS_ABI_N64) - return mips_n32_n64_gpr_names[regno]; + return mips_n32_n64_gpr_names[rawnum]; else - return mips_gpr_names[regno]; + return mips_gpr_names[rawnum]; } - else if (32 <= regno && regno < NUM_REGS) - return mips_processor_reg_names[regno - 32]; + else if (32 <= rawnum && rawnum < NUM_REGS) + return mips_processor_reg_names[rawnum - 32]; else internal_error (__FILE__, __LINE__, - "mips_register_name: bad register number %d", regno); + "mips_register_name: bad register number %d", rawnum); } /* *INDENT-OFF* */ @@ -506,8 +532,63 @@ struct { }; /* *INDENT-ON* */ +/* Return the groups that a MIPS register can be categorised into. */ +static int +mips_register_reggroup_p (struct gdbarch *gdbarch, int regnum, + struct reggroup *reggroup) +{ + int vector_p; + int float_p; + int raw_p; + int rawnum = regnum % NUM_REGS; + int pseudo = regnum / NUM_REGS; + if (reggroup == all_reggroup) + return pseudo; + vector_p = TYPE_VECTOR (register_type (gdbarch, regnum)); + float_p = TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_FLT; + /* FIXME: cagney/2003-04-13: Can't yet use gdbarch_num_regs + (gdbarch), as not all architectures are multi-arch. */ + raw_p = rawnum < NUM_REGS; + if (REGISTER_NAME (regnum) == NULL + || REGISTER_NAME (regnum)[0] == '\0') + return 0; + if (reggroup == float_reggroup) + return float_p && pseudo; + if (reggroup == vector_reggroup) + return vector_p && pseudo; + if (reggroup == general_reggroup) + return (!vector_p && !float_p) && pseudo; + /* Save the pseudo registers. Need to make certain that any code + extracting register values from a saved register cache also uses + pseudo registers. */ + if (reggroup == save_reggroup) + return raw_p && pseudo; + /* Restore the same pseudo register. */ + if (reggroup == restore_reggroup) + return raw_p && pseudo; + return 0; +} + +/* Map the symbol table registers which live in the range [1 * + NUM_REGS .. 2 * NUM_REGS) back onto the corresponding raw + registers. */ + +static void +mips_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, + int cookednum, void *buf) +{ + gdb_assert (cookednum >= NUM_REGS && cookednum < 2 * NUM_REGS); + return regcache_raw_read (regcache, cookednum % NUM_REGS, buf); +} +static void +mips_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, + int cookednum, const void *buf) +{ + gdb_assert (cookednum >= NUM_REGS && cookednum < 2 * NUM_REGS); + return regcache_raw_write (regcache, cookednum % NUM_REGS, buf); +} /* Table to translate MIPS16 register field to actual register number. */ static int mips16_to_32_reg[8] = @@ -557,22 +638,73 @@ mips_print_extra_frame_info (struct frame_info *fi) /* Number of bytes of storage in the actual machine representation for register N. NOTE: This indirectly defines the register size - transfered by the GDB protocol. */ + transfered by the GDB protocol. */ static int mips64_transfers_32bit_regs_p = 0; static int -mips_register_raw_size (int reg_nr) +mips_register_raw_size (int regnum) { - if (mips64_transfers_32bit_regs_p) - return REGISTER_VIRTUAL_SIZE (reg_nr); - else if (reg_nr >= FP0_REGNUM && reg_nr < FP0_REGNUM + 32 - && FP_REGISTER_DOUBLE) - /* For MIPS_ABI_N32 (for example) we need 8 byte floating point - registers. */ - return 8; + gdb_assert (regnum >= 0); + if (regnum < NUM_REGS) + { + /* For compatibility with old code, implemnt the broken register raw + size map for the raw registers. + + NOTE: cagney/2003-06-15: This is so bogus. The register's + raw size is changing according to the ABI + (FP_REGISTER_DOUBLE). Also, GDB's protocol is defined by a + combination of REGISTER_RAW_SIZE and REGISTER_BYTE. */ + if (mips64_transfers_32bit_regs_p) + return REGISTER_VIRTUAL_SIZE (regnum); + else if (regnum >= FP0_REGNUM && regnum < FP0_REGNUM + 32 + && FP_REGISTER_DOUBLE) + /* For MIPS_ABI_N32 (for example) we need 8 byte floating point + registers. */ + return 8; + else + return MIPS_REGSIZE; + } + else if (regnum < 2 * NUM_REGS) + { + /* For the moment map [NUM_REGS .. 2*NUM_REGS) onto the same raw + registers, but always return the virtual size. */ + int rawnum = regnum % NUM_REGS; + return TYPE_LENGTH (MIPS_REGISTER_TYPE (rawnum)); + } else - return MIPS_REGSIZE; + internal_error (__FILE__, __LINE__, "Register %d out of range", regnum); +} + +/* Register offset in a buffer for each register. + + FIXME: cagney/2003-06-15: This is so bogus. Instead REGISTER_TYPE + should strictly return the layout of the buffer. Unfortunatly + remote.c and the MIPS have come to rely on a custom layout that + doesn't 1:1 map onto the register type. */ + +static int +mips_register_byte (int regnum) +{ + gdb_assert (regnum >= 0); + if (regnum < NUM_REGS) + /* Pick up the relevant per-tm file register byte method. */ + return MIPS_REGISTER_BYTE (regnum); + else if (regnum < 2 * NUM_REGS) + { + int reg; + int byte; + /* Start with the end of the raw register buffer - assum that + MIPS_REGISTER_BYTE (NUM_REGS) returns that end. */ + byte = MIPS_REGISTER_BYTE (NUM_REGS); + /* Add space for all the proceeding registers based on their + real size. */ + for (reg = NUM_REGS; reg < regnum; reg++) + byte += TYPE_LENGTH (MIPS_REGISTER_TYPE ((reg % NUM_REGS))); + return byte; + } + else + internal_error (__FILE__, __LINE__, "Register %d out of range", regnum); } /* Convert between RAW and VIRTUAL registers. The RAW register size @@ -603,7 +735,7 @@ mips_register_convert_to_virtual (int n, struct type *virtual_type, static void mips_register_convert_to_raw (struct type *virtual_type, int n, - char *virt_buf, char *raw_buf) + const char *virt_buf, char *raw_buf) { memset (raw_buf, 0, REGISTER_RAW_SIZE (n)); if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) @@ -616,52 +748,46 @@ mips_register_convert_to_raw (struct type *virtual_type, int n, TYPE_LENGTH (virtual_type)); } -void -mips_register_convert_to_type (int regnum, struct type *type, char *buffer) +static int +mips_convert_register_p (int regnum, struct type *type) { - if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG - && REGISTER_RAW_SIZE (regnum) == 4 - && (regnum) >= FP0_REGNUM && (regnum) < FP0_REGNUM + 32 - && TYPE_CODE(type) == TYPE_CODE_FLT - && TYPE_LENGTH(type) == 8) - { - char temp[4]; - memcpy (temp, ((char *)(buffer))+4, 4); - memcpy (((char *)(buffer))+4, (buffer), 4); - memcpy (((char *)(buffer)), temp, 4); - } + return (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG + && REGISTER_RAW_SIZE (regnum) == 4 + && (regnum) >= FP0_REGNUM && (regnum) < FP0_REGNUM + 32 + && TYPE_CODE(type) == TYPE_CODE_FLT + && TYPE_LENGTH(type) == 8); } -void -mips_register_convert_from_type (int regnum, struct type *type, char *buffer) +static void +mips_register_to_value (struct frame_info *frame, int regnum, + struct type *type, void *to) { -if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG - && REGISTER_RAW_SIZE (regnum) == 4 - && (regnum) >= FP0_REGNUM && (regnum) < FP0_REGNUM + 32 - && TYPE_CODE(type) == TYPE_CODE_FLT - && TYPE_LENGTH(type) == 8) - { - char temp[4]; - memcpy (temp, ((char *)(buffer))+4, 4); - memcpy (((char *)(buffer))+4, (buffer), 4); - memcpy (((char *)(buffer)), temp, 4); - } + frame_read_register (frame, regnum + 0, (char *) to + 4); + frame_read_register (frame, regnum + 1, (char *) to + 0); } -/* Return the GDB type object for the "standard" data type - of data in register REG. - - Note: kevinb/2002-08-01: The definition below should faithfully - reproduce the behavior of each of the REGISTER_VIRTUAL_TYPE - definitions found in config/mips/tm-*.h. I'm concerned about the - ``FCRCS_REGNUM <= reg && reg <= LAST_EMBED_REGNUM'' clause though. - In some cases DEPRECATED_FP_REGNUM is in this range, and I doubt - that this code is correct for the 64-bit case. */ +static void +mips_value_to_register (struct frame_info *frame, int regnum, + struct type *type, const void *from) +{ + put_frame_register (frame, regnum + 0, (const char *) from + 4); + put_frame_register (frame, regnum + 1, (const char *) from + 0); +} + +/* Return the GDB type object for the "standard" data type of data in + register REG. */ static struct type * -mips_register_virtual_type (int reg) -{ - if (FP0_REGNUM <= reg && reg < FP0_REGNUM + 32) +mips_register_type (struct gdbarch *gdbarch, int regnum) +{ + /* For moment, map [NUM_REGS .. 2*NUM_REGS) onto the same raw + registers. Even return the same type. */ + int rawnum = regnum % NUM_REGS; + gdb_assert (rawnum >= 0 && rawnum < NUM_REGS); +#ifdef MIPS_REGISTER_TYPE + return MIPS_REGISTER_TYPE (rawnum); +#else + if (FP0_REGNUM <= rawnum && rawnum < FP0_REGNUM + 32) { /* Floating point registers... */ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) @@ -669,9 +795,9 @@ mips_register_virtual_type (int reg) else return builtin_type_ieee_double_little; } - else if (reg == PS_REGNUM /* CR */) + else if (rawnum == PS_REGNUM /* CR */) return builtin_type_uint32; - else if (FCRCS_REGNUM <= reg && reg <= LAST_EMBED_REGNUM) + else if (FCRCS_REGNUM <= rawnum && rawnum <= LAST_EMBED_REGNUM) return builtin_type_uint32; else { @@ -682,6 +808,7 @@ mips_register_virtual_type (int reg) else return builtin_type_uint32; } +#endif } /* TARGET_READ_SP -- Remove useless bits from the stack pointer. */ @@ -750,12 +877,6 @@ mips_n32n64_use_struct_convention (int gcc_p, struct type *type) return (TYPE_LENGTH (type) > 2 * MIPS_SAVED_REGSIZE); } -static int -mips_o32_use_struct_convention (int gcc_p, struct type *type) -{ - return 1; /* Structures are returned by ref in extra arg0. */ -} - /* Should call_function pass struct by reference? For each architecture, structs are passed either by value or by reference, depending on their size. */ @@ -792,7 +913,7 @@ pc_is_mips16 (bfd_vma memaddr) struct minimal_symbol *sym; /* If bit 0 of the address is set, assume this is a MIPS16 address. */ - if (IS_MIPS16_ADDR (memaddr)) + if (is_mips16_addr (memaddr)) return 1; /* A flag indicating that this is a MIPS16 function is stored by elfread.c in @@ -925,7 +1046,7 @@ mips_fetch_instruction (CORE_ADDR addr) if (pc_is_mips16 (addr)) { instlen = MIPS16_INSTLEN; - addr = UNMAKE_MIPS16_ADDR (addr); + addr = unmake_mips16_addr (addr); } else instlen = MIPS_INSTLEN; @@ -1428,38 +1549,37 @@ mips_next_pc (CORE_ADDR pc) return mips32_next_pc (pc); } -/* Guaranteed to set fci->saved_regs to some values (it never leaves it - NULL). - - Note: kevinb/2002-08-09: The only caller of this function is (and - should remain) mips_frame_init_saved_regs(). In fact, - aside from calling mips_find_saved_regs(), mips_frame_init_saved_regs() - does nothing more than set frame->saved_regs[SP_REGNUM]. These two - functions should really be combined and now that there is only one - caller, it should be straightforward. (Watch out for multiple returns - though.) */ +/* Set up the 'saved_regs' array. This is a data structure containing + the addresses on the stack where each register has been saved, for + each stack frame. Registers that have not been saved will have + zero here. The stack pointer register is special: rather than the + address where the stack register has been saved, + saved_regs[SP_REGNUM] will have the actual value of the previous + frame's stack register. */ static void mips_find_saved_regs (struct frame_info *fci) { int ireg; - CORE_ADDR reg_position; /* r0 bit means kernel trap */ int kernel_trap; /* What registers have been saved? Bitmasks. */ unsigned long gen_mask, float_mask; mips_extra_func_info_t proc_desc; t_inst inst; + CORE_ADDR *saved_regs; - frame_saved_regs_zalloc (fci); + if (get_frame_saved_regs (fci) != NULL) + return; + saved_regs = frame_saved_regs_zalloc (fci); /* If it is the frame for sigtramp, the saved registers are located - in a sigcontext structure somewhere on the stack. - If the stack layout for sigtramp changes we might have to change these - constants and the companion fixup_sigtramp in mdebugread.c */ + in a sigcontext structure somewhere on the stack. If the stack + layout for sigtramp changes we might have to change these + constants and the companion fixup_sigtramp in mdebugread.c */ #ifndef SIGFRAME_BASE -/* To satisfy alignment restrictions, sigcontext is located 4 bytes - above the sigtramp frame. */ + /* To satisfy alignment restrictions, sigcontext is located 4 bytes + above the sigtramp frame. */ #define SIGFRAME_BASE MIPS_REGSIZE /* FIXME! Are these correct?? */ #define SIGFRAME_PC_OFF (SIGFRAME_BASE + 2 * MIPS_REGSIZE) @@ -1468,61 +1588,65 @@ mips_find_saved_regs (struct frame_info *fci) (SIGFRAME_REGSAVE_OFF + MIPS_NUMREGS * MIPS_REGSIZE + 3 * MIPS_REGSIZE) #endif #ifndef SIGFRAME_REG_SIZE -/* FIXME! Is this correct?? */ + /* FIXME! Is this correct?? */ #define SIGFRAME_REG_SIZE MIPS_REGSIZE #endif if ((get_frame_type (fci) == SIGTRAMP_FRAME)) { for (ireg = 0; ireg < MIPS_NUMREGS; ireg++) { - reg_position = get_frame_base (fci) + SIGFRAME_REGSAVE_OFF - + ireg * SIGFRAME_REG_SIZE; - get_frame_saved_regs (fci)[ireg] = reg_position; + CORE_ADDR reg_position = (get_frame_base (fci) + SIGFRAME_REGSAVE_OFF + + ireg * SIGFRAME_REG_SIZE); + set_reg_offset (saved_regs, ireg, reg_position); } for (ireg = 0; ireg < MIPS_NUMREGS; ireg++) { - reg_position = get_frame_base (fci) + SIGFRAME_FPREGSAVE_OFF - + ireg * SIGFRAME_REG_SIZE; - get_frame_saved_regs (fci)[FP0_REGNUM + ireg] = reg_position; + CORE_ADDR reg_position = (get_frame_base (fci) + + SIGFRAME_FPREGSAVE_OFF + + ireg * SIGFRAME_REG_SIZE); + set_reg_offset (saved_regs, FP0_REGNUM + ireg, reg_position); } - get_frame_saved_regs (fci)[PC_REGNUM] = get_frame_base (fci) + SIGFRAME_PC_OFF; + + set_reg_offset (saved_regs, PC_REGNUM, get_frame_base (fci) + SIGFRAME_PC_OFF); + /* SP_REGNUM, contains the value and not the address. */ + set_reg_offset (saved_regs, SP_REGNUM, get_frame_base (fci)); return; } proc_desc = get_frame_extra_info (fci)->proc_desc; if (proc_desc == NULL) - /* I'm not sure how/whether this can happen. Normally when we can't - find a proc_desc, we "synthesize" one using heuristic_proc_desc - and set the saved_regs right away. */ + /* I'm not sure how/whether this can happen. Normally when we + can't find a proc_desc, we "synthesize" one using + heuristic_proc_desc and set the saved_regs right away. */ return; kernel_trap = PROC_REG_MASK (proc_desc) & 1; gen_mask = kernel_trap ? 0xFFFFFFFF : PROC_REG_MASK (proc_desc); float_mask = kernel_trap ? 0xFFFFFFFF : PROC_FREG_MASK (proc_desc); - if ( /* In any frame other than the innermost or a frame interrupted by - a signal, we assume that all registers have been saved. - This assumes that all register saves in a function happen before - the first function call. */ + if (/* In any frame other than the innermost or a frame interrupted + by a signal, we assume that all registers have been saved. + This assumes that all register saves in a function happen + before the first function call. */ (get_next_frame (fci) == NULL || (get_frame_type (get_next_frame (fci)) == SIGTRAMP_FRAME)) - /* In a dummy frame we know exactly where things are saved. */ + /* In a dummy frame we know exactly where things are saved. */ && !PROC_DESC_IS_DUMMY (proc_desc) - /* Don't bother unless we are inside a function prologue. Outside the - prologue, we know where everything is. */ + /* Don't bother unless we are inside a function prologue. + Outside the prologue, we know where everything is. */ && in_prologue (get_frame_pc (fci), PROC_LOW_ADDR (proc_desc)) - /* Not sure exactly what kernel_trap means, but if it means - the kernel saves the registers without a prologue doing it, - we better not examine the prologue to see whether registers - have been saved yet. */ + /* Not sure exactly what kernel_trap means, but if it means the + kernel saves the registers without a prologue doing it, we + better not examine the prologue to see whether registers + have been saved yet. */ && !kernel_trap) { - /* We need to figure out whether the registers that the proc_desc - claims are saved have been saved yet. */ + /* We need to figure out whether the registers that the + proc_desc claims are saved have been saved yet. */ CORE_ADDR addr; @@ -1535,8 +1659,8 @@ mips_find_saved_regs (struct frame_info *fci) addr = PROC_LOW_ADDR (proc_desc); instlen = pc_is_mips16 (addr) ? MIPS16_INSTLEN : MIPS_INSTLEN; - /* Scan through this function's instructions preceding the current - PC, and look for those that save registers. */ + /* Scan through this function's instructions preceding the + current PC, and look for those that save registers. */ while (addr < get_frame_pc (fci)) { inst = mips_fetch_instruction (addr); @@ -1550,125 +1674,122 @@ mips_find_saved_regs (struct frame_info *fci) float_mask = float_save_found; } - /* Fill in the offsets for the registers which gen_mask says - were saved. */ - reg_position = get_frame_base (fci) + PROC_REG_OFFSET (proc_desc); - for (ireg = MIPS_NUMREGS - 1; gen_mask; --ireg, gen_mask <<= 1) - if (gen_mask & 0x80000000) - { - get_frame_saved_regs (fci)[ireg] = reg_position; - reg_position -= MIPS_SAVED_REGSIZE; - } + /* Fill in the offsets for the registers which gen_mask says were + saved. */ + { + CORE_ADDR reg_position = (get_frame_base (fci) + + PROC_REG_OFFSET (proc_desc)); + for (ireg = MIPS_NUMREGS - 1; gen_mask; --ireg, gen_mask <<= 1) + if (gen_mask & 0x80000000) + { + set_reg_offset (saved_regs, ireg, reg_position); + reg_position -= MIPS_SAVED_REGSIZE; + } + } - /* The MIPS16 entry instruction saves $s0 and $s1 in the reverse order - of that normally used by gcc. Therefore, we have to fetch the first - instruction of the function, and if it's an entry instruction that - saves $s0 or $s1, correct their saved addresses. */ + /* The MIPS16 entry instruction saves $s0 and $s1 in the reverse + order of that normally used by gcc. Therefore, we have to fetch + the first instruction of the function, and if it's an entry + instruction that saves $s0 or $s1, correct their saved addresses. */ if (pc_is_mips16 (PROC_LOW_ADDR (proc_desc))) { inst = mips_fetch_instruction (PROC_LOW_ADDR (proc_desc)); - if ((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700) /* entry */ + if ((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700) + /* entry */ { int reg; int sreg_count = (inst >> 6) & 3; /* Check if the ra register was pushed on the stack. */ - reg_position = get_frame_base (fci) + PROC_REG_OFFSET (proc_desc); + CORE_ADDR reg_position = (get_frame_base (fci) + + PROC_REG_OFFSET (proc_desc)); if (inst & 0x20) reg_position -= MIPS_SAVED_REGSIZE; - /* Check if the s0 and s1 registers were pushed on the stack. */ + /* Check if the s0 and s1 registers were pushed on the + stack. */ for (reg = 16; reg < sreg_count + 16; reg++) { - get_frame_saved_regs (fci)[reg] = reg_position; + set_reg_offset (saved_regs, reg, reg_position); reg_position -= MIPS_SAVED_REGSIZE; } } } - /* Fill in the offsets for the registers which float_mask says - were saved. */ - reg_position = get_frame_base (fci) + PROC_FREG_OFFSET (proc_desc); - - /* Apparently, the freg_offset gives the offset to the first 64 bit - saved. - - When the ABI specifies 64 bit saved registers, the FREG_OFFSET - designates the first saved 64 bit register. - - When the ABI specifies 32 bit saved registers, the ``64 bit saved - DOUBLE'' consists of two adjacent 32 bit registers, Hence - FREG_OFFSET, designates the address of the lower register of the - register pair. Adjust the offset so that it designates the upper - register of the pair -- i.e., the address of the first saved 32 - bit register. */ - - if (MIPS_SAVED_REGSIZE == 4) - reg_position += MIPS_SAVED_REGSIZE; - - /* Fill in the offsets for the float registers which float_mask says - were saved. */ - for (ireg = MIPS_NUMREGS - 1; float_mask; --ireg, float_mask <<= 1) - if (float_mask & 0x80000000) - { - get_frame_saved_regs (fci)[FP0_REGNUM + ireg] = reg_position; - reg_position -= MIPS_SAVED_REGSIZE; - } + /* Fill in the offsets for the registers which float_mask says were + saved. */ + { + CORE_ADDR reg_position = (get_frame_base (fci) + + PROC_FREG_OFFSET (proc_desc)); - get_frame_saved_regs (fci)[PC_REGNUM] = get_frame_saved_regs (fci)[RA_REGNUM]; -} + /* Fill in the offsets for the float registers which float_mask + says were saved. */ + for (ireg = MIPS_NUMREGS - 1; float_mask; --ireg, float_mask <<= 1) + if (float_mask & 0x80000000) + { + if (MIPS_SAVED_REGSIZE == 4 && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + { + /* On a big endian 32 bit ABI, floating point registers + are paired to form doubles such that the most + significant part is in $f[N+1] and the least + significant in $f[N] vis: $f[N+1] ||| $f[N]. The + registers are also spilled as a pair and stored as a + double. + + When little-endian the least significant part is + stored first leading to the memory order $f[N] and + then $f[N+1]. + + Unfortunatly, when big-endian the most significant + part of the double is stored first, and the least + significant is stored second. This leads to the + registers being ordered in memory as firt $f[N+1] and + then $f[N]. + + For the big-endian case make certain that the + addresses point at the correct (swapped) locations + $f[N] and $f[N+1] pair (keep in mind that + reg_position is decremented each time through the + loop). */ + if ((ireg & 1)) + set_reg_offset (saved_regs, FP0_REGNUM + ireg, + reg_position - MIPS_SAVED_REGSIZE); + else + set_reg_offset (saved_regs, FP0_REGNUM + ireg, + reg_position + MIPS_SAVED_REGSIZE); + } + else + set_reg_offset (saved_regs, FP0_REGNUM + ireg, reg_position); + reg_position -= MIPS_SAVED_REGSIZE; + } -/* Set up the 'saved_regs' array. This is a data structure containing - the addresses on the stack where each register has been saved, for - each stack frame. Registers that have not been saved will have - zero here. The stack pointer register is special: rather than the - address where the stack register has been saved, saved_regs[SP_REGNUM] - will have the actual value of the previous frame's stack register. */ + set_reg_offset (saved_regs, PC_REGNUM, saved_regs[RA_REGNUM]); + } -static void -mips_frame_init_saved_regs (struct frame_info *frame) -{ - if (get_frame_saved_regs (frame) == NULL) - { - mips_find_saved_regs (frame); - } - get_frame_saved_regs (frame)[SP_REGNUM] = get_frame_base (frame); + /* SP_REGNUM, contains the value and not the address. */ + set_reg_offset (saved_regs, SP_REGNUM, get_frame_base (fci)); } static CORE_ADDR read_next_frame_reg (struct frame_info *fi, int regno) { - int optimized; - CORE_ADDR addr; - int realnum; - enum lval_type lval; - char raw_buffer[MAX_REGISTER_SIZE]; - + /* Always a pseudo. */ + gdb_assert (regno >= NUM_REGS); if (fi == NULL) { - regcache_cooked_read (current_regcache, regno, raw_buffer); + LONGEST val; + regcache_cooked_read_signed (current_regcache, regno, &val); + return val; } + else if ((regno % NUM_REGS) == SP_REGNUM) + /* The SP_REGNUM is special, its value is stored in saved_regs. + In fact, it is so special that it can even only be fetched + using a raw register number! Once this code as been converted + to frame-unwind the problem goes away. */ + return frame_unwind_register_signed (fi, regno % NUM_REGS); else - { - 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 (regno < 32) - { - /* Only MIPS_SAVED_REGSIZE bytes of GP registers are - saved. */ - return read_memory_integer (addr, MIPS_SAVED_REGSIZE); - } - } - } + return frame_unwind_register_signed (fi, regno); - return extract_signed_integer (raw_buffer, REGISTER_VIRTUAL_SIZE (regno)); } /* mips_addr_bits_remove - remove useless address bits */ @@ -1758,23 +1879,29 @@ static CORE_ADDR mips_frame_saved_pc (struct frame_info *frame) { CORE_ADDR saved_pc; - mips_extra_func_info_t proc_desc = get_frame_extra_info (frame)->proc_desc; - /* We have to get the saved pc from the sigcontext - if it is a signal handler frame. */ - int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME) ? PC_REGNUM - : (proc_desc ? PROC_PC_REG (proc_desc) : RA_REGNUM); if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), 0, 0)) { LONGEST tmp; - frame_unwind_signed_register (frame, PC_REGNUM, &tmp); + /* Always unwind the cooked PC register value. */ + frame_unwind_signed_register (frame, NUM_REGS + PC_REGNUM, &tmp); saved_pc = tmp; } - else if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc)) - saved_pc = read_memory_integer (get_frame_base (frame) - MIPS_SAVED_REGSIZE, MIPS_SAVED_REGSIZE); else - saved_pc = read_next_frame_reg (frame, pcreg); - + { + mips_extra_func_info_t proc_desc + = get_frame_extra_info (frame)->proc_desc; + if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc)) + saved_pc = read_memory_integer (get_frame_base (frame) - MIPS_SAVED_REGSIZE, MIPS_SAVED_REGSIZE); + else + { + /* We have to get the saved pc from the sigcontext if it is + a signal handler frame. */ + int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME ? PC_REGNUM + : proc_desc ? PROC_PC_REG (proc_desc) : RA_REGNUM); + saved_pc = read_next_frame_reg (frame, NUM_REGS + pcreg); + } + } return ADDR_BITS_REMOVE (saved_pc); } @@ -1787,16 +1914,25 @@ static struct mips_extra_func_info temp_proc_desc; frames. */ static CORE_ADDR *temp_saved_regs; -/* Set a register's saved stack address in temp_saved_regs. If an address - has already been set for this register, do nothing; this way we will - only recognize the first save of a given register in a function prologue. - This is a helper function for mips{16,32}_heuristic_proc_desc. */ +/* Set a register's saved stack address in temp_saved_regs. If an + address has already been set for this register, do nothing; this + way we will only recognize the first save of a given register in a + function prologue. + + For simplicity, save the address in both [0 .. NUM_REGS) and + [NUM_REGS .. 2*NUM_REGS). Strictly speaking, only the second range + is used as it is only second range (the ABI instead of ISA + registers) that comes into play when finding saved registers in a + frame. */ static void -set_reg_offset (int regno, CORE_ADDR offset) +set_reg_offset (CORE_ADDR *saved_regs, int regno, CORE_ADDR offset) { - if (temp_saved_regs[regno] == 0) - temp_saved_regs[regno] = offset; + if (saved_regs[regno] == 0) + { + saved_regs[regno + 0 * NUM_REGS] = offset; + saved_regs[regno + 1 * NUM_REGS] = offset; + } } @@ -1992,26 +2128,26 @@ mips16_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, offset = mips16_get_imm (prev_inst, inst, 8, 4, 0); reg = mips16_to_32_reg[(inst & 0x700) >> 8]; PROC_REG_MASK (&temp_proc_desc) |= (1 << reg); - set_reg_offset (reg, sp + offset); + set_reg_offset (temp_saved_regs, reg, sp + offset); } else if ((inst & 0xff00) == 0xf900) /* sd reg,n($sp) */ { offset = mips16_get_imm (prev_inst, inst, 5, 8, 0); reg = mips16_to_32_reg[(inst & 0xe0) >> 5]; PROC_REG_MASK (&temp_proc_desc) |= (1 << reg); - set_reg_offset (reg, sp + offset); + set_reg_offset (temp_saved_regs, reg, sp + offset); } else if ((inst & 0xff00) == 0x6200) /* sw $ra,n($sp) */ { offset = mips16_get_imm (prev_inst, inst, 8, 4, 0); PROC_REG_MASK (&temp_proc_desc) |= (1 << RA_REGNUM); - set_reg_offset (RA_REGNUM, sp + offset); + set_reg_offset (temp_saved_regs, RA_REGNUM, sp + offset); } else if ((inst & 0xff00) == 0xfa00) /* sd $ra,n($sp) */ { offset = mips16_get_imm (prev_inst, inst, 8, 8, 0); PROC_REG_MASK (&temp_proc_desc) |= (1 << RA_REGNUM); - set_reg_offset (RA_REGNUM, sp + offset); + set_reg_offset (temp_saved_regs, RA_REGNUM, sp + offset); } else if (inst == 0x673d) /* move $s1, $sp */ { @@ -2030,14 +2166,14 @@ mips16_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, offset = mips16_get_imm (prev_inst, inst, 5, 4, 0); reg = mips16_to_32_reg[(inst & 0xe0) >> 5]; PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (reg, frame_addr + offset); + set_reg_offset (temp_saved_regs, reg, frame_addr + offset); } else if ((inst & 0xFF00) == 0x7900) /* sd reg,offset($s1) */ { offset = mips16_get_imm (prev_inst, inst, 5, 8, 0); reg = mips16_to_32_reg[(inst & 0xe0) >> 5]; PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (reg, frame_addr + offset); + set_reg_offset (temp_saved_regs, reg, frame_addr + offset); } else if ((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700) /* entry */ entry_inst = inst; /* save for later processing */ @@ -2067,7 +2203,7 @@ mips16_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, for (reg = 4, offset = 0; reg < areg_count + 4; reg++) { PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (reg, sp + offset); + set_reg_offset (temp_saved_regs, reg, sp + offset); offset += MIPS_SAVED_REGSIZE; } @@ -2076,7 +2212,7 @@ mips16_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, if (entry_inst & 0x20) { PROC_REG_MASK (&temp_proc_desc) |= 1 << RA_REGNUM; - set_reg_offset (RA_REGNUM, sp + offset); + set_reg_offset (temp_saved_regs, RA_REGNUM, sp + offset); offset -= MIPS_SAVED_REGSIZE; } @@ -2084,7 +2220,7 @@ mips16_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, for (reg = 16; reg < sreg_count + 16; reg++) { PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (reg, sp + offset); + set_reg_offset (temp_saved_regs, reg, sp + offset); offset -= MIPS_SAVED_REGSIZE; } } @@ -2129,7 +2265,7 @@ restart: else if ((high_word & 0xFFE0) == 0xafa0) /* sw reg,offset($sp) */ { PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (reg, sp + low_word); + set_reg_offset (temp_saved_regs, reg, sp + low_word); } else if ((high_word & 0xFFE0) == 0xffa0) /* sd reg,offset($sp) */ { @@ -2137,7 +2273,7 @@ restart: but the register size used is only 32 bits. Make the address for the saved register point to the lower 32 bits. */ PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (reg, sp + low_word + 8 - MIPS_REGSIZE); + set_reg_offset (temp_saved_regs, reg, sp + low_word + 8 - MIPS_REGSIZE); } else if (high_word == 0x27be) /* addiu $30,$sp,size */ { @@ -2148,7 +2284,7 @@ restart: { unsigned alloca_adjust; PROC_FRAME_REG (&temp_proc_desc) = 30; - frame_addr = read_next_frame_reg (next_frame, 30); + frame_addr = read_next_frame_reg (next_frame, NUM_REGS + 30); alloca_adjust = (unsigned) (frame_addr - (sp + low_word)); if (alloca_adjust > 0) { @@ -2171,7 +2307,7 @@ restart: { unsigned alloca_adjust; PROC_FRAME_REG (&temp_proc_desc) = 30; - frame_addr = read_next_frame_reg (next_frame, 30); + frame_addr = read_next_frame_reg (next_frame, NUM_REGS + 30); alloca_adjust = (unsigned) (frame_addr - sp); if (alloca_adjust > 0) { @@ -2187,7 +2323,7 @@ restart: else if ((high_word & 0xFFE0) == 0xafc0) /* sw reg,offset($30) */ { PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (reg, frame_addr + low_word); + set_reg_offset (temp_saved_regs, reg, frame_addr + low_word); } } } @@ -2199,7 +2335,7 @@ heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, CORE_ADDR sp; if (cur_frame) - sp = read_next_frame_reg (next_frame, SP_REGNUM); + sp = read_next_frame_reg (next_frame, NUM_REGS + SP_REGNUM); else sp = 0; @@ -2472,7 +2608,7 @@ static CORE_ADDR get_frame_pointer (struct frame_info *frame, mips_extra_func_info_t proc_desc) { - return (read_next_frame_reg (frame, PROC_FRAME_REG (proc_desc)) + return (read_next_frame_reg (frame, NUM_REGS + PROC_FRAME_REG (proc_desc)) + PROC_FRAME_OFFSET (proc_desc) - PROC_FRAME_ADJUST (proc_desc)); } @@ -2558,7 +2694,7 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci) interrupted by a signal at it's very start. */ if (get_frame_pc (fci) == PROC_LOW_ADDR (proc_desc) && !PROC_DESC_IS_DUMMY (proc_desc)) - deprecated_update_frame_base_hack (fci, read_next_frame_reg (get_next_frame (fci), SP_REGNUM)); + deprecated_update_frame_base_hack (fci, read_next_frame_reg (get_next_frame (fci), NUM_REGS + SP_REGNUM)); else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fci), 0, 0)) /* Do not ``fix'' fci->frame. It will have the value of the generic dummy frame's top-of-stack (since the draft @@ -2586,15 +2722,18 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci) if (!PC_IN_SIGTRAMP (get_frame_pc (fci), name)) { frame_saved_regs_zalloc (fci); - memcpy (get_frame_saved_regs (fci), temp_saved_regs, SIZEOF_FRAME_SAVED_REGS); - get_frame_saved_regs (fci)[PC_REGNUM] - = get_frame_saved_regs (fci)[RA_REGNUM]; - /* Set value of previous frame's stack pointer. Remember that - saved_regs[SP_REGNUM] is special in that it contains the - value of the stack pointer register. The other saved_regs - values are addresses (in the inferior) at which a given - register's value may be found. */ - get_frame_saved_regs (fci)[SP_REGNUM] = get_frame_base (fci); + /* Set value of previous frame's stack pointer. + Remember that saved_regs[SP_REGNUM] is special in + that it contains the value of the stack pointer + register. The other saved_regs values are addresses + (in the inferior) at which a given register's value + may be found. */ + set_reg_offset (temp_saved_regs, SP_REGNUM, + get_frame_base (fci)); + set_reg_offset (temp_saved_regs, PC_REGNUM, + temp_saved_regs[RA_REGNUM]); + memcpy (get_frame_saved_regs (fci), temp_saved_regs, + SIZEOF_FRAME_SAVED_REGS); } } @@ -2697,11 +2836,10 @@ mips_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) } static CORE_ADDR -mips_eabi_push_arguments (int nargs, - struct value **args, - CORE_ADDR sp, - int struct_return, - CORE_ADDR struct_addr) +mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, + struct regcache *regcache, CORE_ADDR bp_addr, int nargs, + struct value **args, CORE_ADDR sp, int struct_return, + CORE_ADDR struct_addr) { int argreg; int float_argreg; @@ -2709,6 +2847,14 @@ mips_eabi_push_arguments (int nargs, int len = 0; int stack_offset = 0; + /* For shared libraries, "t9" needs to point at the function + address. */ + regcache_cooked_write_signed (regcache, T9_REGNUM, func_addr); + + /* Set the return address register to point to the entry point of + the program, where a breakpoint lies in wait. */ + regcache_cooked_write_signed (regcache, RA_REGNUM, bp_addr); + /* First ensure that the stack and structure return address (if any) are properly aligned. The stack has to be at least 64-bit aligned even on 32-bit machines, because doubles must be 64-bit @@ -2728,7 +2874,7 @@ mips_eabi_push_arguments (int nargs, if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_eabi_push_arguments: sp=0x%s allocated %d\n", + "mips_eabi_push_dummy_call: sp=0x%s allocated %d\n", paddr_nz (sp), ROUND_UP (len, 16)); /* Initialize the integer and float register pointers. */ @@ -2740,7 +2886,7 @@ mips_eabi_push_arguments (int nargs, { if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_eabi_push_arguments: struct_return reg=%d 0x%s\n", + "mips_eabi_push_dummy_call: struct_return reg=%d 0x%s\n", argreg, paddr_nz (struct_addr)); write_register (argreg++, struct_addr); } @@ -2759,7 +2905,7 @@ mips_eabi_push_arguments (int nargs, if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_eabi_push_arguments: %d len=%d type=%d", + "mips_eabi_push_dummy_call: %d len=%d type=%d", argnum + 1, len, (int) typecode); /* The EABI passes structures that do not fit in a register by @@ -2943,18 +3089,19 @@ mips_eabi_push_arguments (int nargs, fprintf_unfiltered (gdb_stdlog, "\n"); } + regcache_cooked_write_signed (regcache, SP_REGNUM, sp); + /* Return adjusted stack pointer. */ return sp; } -/* N32/N64 version of push_arguments. */ +/* N32/N64 version of push_dummy_call. */ static CORE_ADDR -mips_n32n64_push_arguments (int nargs, - struct value **args, - CORE_ADDR sp, - int struct_return, - CORE_ADDR struct_addr) +mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, + struct regcache *regcache, CORE_ADDR bp_addr, int nargs, + struct value **args, CORE_ADDR sp, int struct_return, + CORE_ADDR struct_addr) { int argreg; int float_argreg; @@ -2962,6 +3109,14 @@ mips_n32n64_push_arguments (int nargs, int len = 0; int stack_offset = 0; + /* For shared libraries, "t9" needs to point at the function + address. */ + regcache_cooked_write_signed (regcache, T9_REGNUM, func_addr); + + /* Set the return address register to point to the entry point of + the program, where a breakpoint lies in wait. */ + regcache_cooked_write_signed (regcache, RA_REGNUM, bp_addr); + /* First ensure that the stack and structure return address (if any) are properly aligned. The stack has to be at least 64-bit aligned even on 32-bit machines, because doubles must be 64-bit @@ -2979,7 +3134,7 @@ mips_n32n64_push_arguments (int nargs, if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_n32n64_push_arguments: sp=0x%s allocated %d\n", + "mips_n32n64_push_dummy_call: sp=0x%s allocated %d\n", paddr_nz (sp), ROUND_UP (len, 16)); /* Initialize the integer and float register pointers. */ @@ -2991,7 +3146,7 @@ mips_n32n64_push_arguments (int nargs, { if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_n32n64_push_arguments: struct_return reg=%d 0x%s\n", + "mips_n32n64_push_dummy_call: struct_return reg=%d 0x%s\n", argreg, paddr_nz (struct_addr)); write_register (argreg++, struct_addr); } @@ -3010,7 +3165,7 @@ mips_n32n64_push_arguments (int nargs, if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_n32n64_push_arguments: %d len=%d type=%d", + "mips_n32n64_push_dummy_call: %d len=%d type=%d", argnum + 1, len, (int) typecode); val = (char *) VALUE_CONTENTS (arg); @@ -3165,18 +3320,19 @@ mips_n32n64_push_arguments (int nargs, fprintf_unfiltered (gdb_stdlog, "\n"); } + regcache_cooked_write_signed (regcache, SP_REGNUM, sp); + /* Return adjusted stack pointer. */ return sp; } -/* O32 version of push_arguments. */ +/* O32 version of push_dummy_call. */ static CORE_ADDR -mips_o32_push_arguments (int nargs, - struct value **args, - CORE_ADDR sp, - int struct_return, - CORE_ADDR struct_addr) +mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, + struct regcache *regcache, CORE_ADDR bp_addr, int nargs, + struct value **args, CORE_ADDR sp, int struct_return, + CORE_ADDR struct_addr) { int argreg; int float_argreg; @@ -3184,6 +3340,14 @@ mips_o32_push_arguments (int nargs, int len = 0; int stack_offset = 0; + /* For shared libraries, "t9" needs to point at the function + address. */ + regcache_cooked_write_signed (regcache, T9_REGNUM, func_addr); + + /* Set the return address register to point to the entry point of + the program, where a breakpoint lies in wait. */ + regcache_cooked_write_signed (regcache, RA_REGNUM, bp_addr); + /* First ensure that the stack and structure return address (if any) are properly aligned. The stack has to be at least 64-bit aligned even on 32-bit machines, because doubles must be 64-bit @@ -3201,7 +3365,7 @@ mips_o32_push_arguments (int nargs, if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o32_push_arguments: sp=0x%s allocated %d\n", + "mips_o32_push_dummy_call: sp=0x%s allocated %d\n", paddr_nz (sp), ROUND_UP (len, 16)); /* Initialize the integer and float register pointers. */ @@ -3213,7 +3377,7 @@ mips_o32_push_arguments (int nargs, { if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o32_push_arguments: struct_return reg=%d 0x%s\n", + "mips_o32_push_dummy_call: struct_return reg=%d 0x%s\n", argreg, paddr_nz (struct_addr)); write_register (argreg++, struct_addr); stack_offset += MIPS_STACK_ARGSIZE; @@ -3233,7 +3397,7 @@ mips_o32_push_arguments (int nargs, if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o32_push_arguments: %d len=%d type=%d", + "mips_o32_push_dummy_call: %d len=%d type=%d", argnum + 1, len, (int) typecode); val = (char *) VALUE_CONTENTS (arg); @@ -3464,18 +3628,19 @@ mips_o32_push_arguments (int nargs, fprintf_unfiltered (gdb_stdlog, "\n"); } + regcache_cooked_write_signed (regcache, SP_REGNUM, sp); + /* Return adjusted stack pointer. */ return sp; } -/* O64 version of push_arguments. */ +/* O64 version of push_dummy_call. */ static CORE_ADDR -mips_o64_push_arguments (int nargs, - struct value **args, - CORE_ADDR sp, - int struct_return, - CORE_ADDR struct_addr) +mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, + struct regcache *regcache, CORE_ADDR bp_addr, int nargs, + struct value **args, CORE_ADDR sp, int struct_return, + CORE_ADDR struct_addr) { int argreg; int float_argreg; @@ -3483,6 +3648,14 @@ mips_o64_push_arguments (int nargs, int len = 0; int stack_offset = 0; + /* For shared libraries, "t9" needs to point at the function + address. */ + regcache_cooked_write_signed (regcache, T9_REGNUM, func_addr); + + /* Set the return address register to point to the entry point of + the program, where a breakpoint lies in wait. */ + regcache_cooked_write_signed (regcache, RA_REGNUM, bp_addr); + /* First ensure that the stack and structure return address (if any) are properly aligned. The stack has to be at least 64-bit aligned even on 32-bit machines, because doubles must be 64-bit @@ -3500,7 +3673,7 @@ mips_o64_push_arguments (int nargs, if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o64_push_arguments: sp=0x%s allocated %d\n", + "mips_o64_push_dummy_call: sp=0x%s allocated %d\n", paddr_nz (sp), ROUND_UP (len, 16)); /* Initialize the integer and float register pointers. */ @@ -3512,7 +3685,7 @@ mips_o64_push_arguments (int nargs, { if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o64_push_arguments: struct_return reg=%d 0x%s\n", + "mips_o64_push_dummy_call: struct_return reg=%d 0x%s\n", argreg, paddr_nz (struct_addr)); write_register (argreg++, struct_addr); stack_offset += MIPS_STACK_ARGSIZE; @@ -3532,7 +3705,7 @@ mips_o64_push_arguments (int nargs, if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o64_push_arguments: %d len=%d type=%d", + "mips_o64_push_dummy_call: %d len=%d type=%d", argnum + 1, len, (int) typecode); val = (char *) VALUE_CONTENTS (arg); @@ -3763,16 +3936,9 @@ mips_o64_push_arguments (int nargs, fprintf_unfiltered (gdb_stdlog, "\n"); } - /* Return adjusted stack pointer. */ - return sp; -} + regcache_cooked_write_signed (regcache, SP_REGNUM, sp); -static CORE_ADDR -mips_push_return_address (CORE_ADDR pc, CORE_ADDR sp) -{ - /* Set the return address register to point to the entry - point of the program, where a breakpoint lies in wait. */ - write_register (RA_REGNUM, CALL_DUMMY_ADDRESS ()); + /* Return adjusted stack pointer. */ return sp; } @@ -3793,8 +3959,7 @@ mips_pop_frame (void) proc_desc = get_frame_extra_info (frame)->proc_desc; write_register (PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (frame)); - if (get_frame_saved_regs (frame) == NULL) - DEPRECATED_FRAME_INIT_SAVED_REGS (frame); + mips_find_saved_regs (frame); for (regnum = 0; regnum < NUM_REGS; regnum++) if (regnum != SP_REGNUM && regnum != PC_REGNUM && get_frame_saved_regs (frame)[regnum]) @@ -3850,13 +4015,6 @@ mips_pop_frame (void) } } -static void -mips_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, - struct value **args, struct type *type, int gcc_p) -{ - write_register(T9_REGNUM, fun); -} - /* Floating point register management. Background: MIPS1 & 2 fp registers are 32 bits wide. To support @@ -3909,12 +4067,13 @@ mips_double_register_type (void) into rare_buffer. */ static void -mips_read_fp_register_single (int regno, char *rare_buffer) +mips_read_fp_register_single (struct frame_info *frame, int regno, + char *rare_buffer) { int raw_size = REGISTER_RAW_SIZE (regno); char *raw_buffer = alloca (raw_size); - if (!frame_register_read (deprecated_selected_frame, regno, raw_buffer)) + if (!frame_register_read (frame, regno, raw_buffer)) error ("can't read register %d (%s)", regno, REGISTER_NAME (regno)); if (raw_size == 8) { @@ -3940,7 +4099,8 @@ mips_read_fp_register_single (int regno, char *rare_buffer) register. */ static void -mips_read_fp_register_double (int regno, char *rare_buffer) +mips_read_fp_register_double (struct frame_info *frame, int regno, + char *rare_buffer) { int raw_size = REGISTER_RAW_SIZE (regno); @@ -3948,7 +4108,7 @@ mips_read_fp_register_double (int regno, char *rare_buffer) { /* We have a 64-bit value for this register, and we should use all 64 bits. */ - if (!frame_register_read (deprecated_selected_frame, regno, rare_buffer)) + if (!frame_register_read (frame, regno, rare_buffer)) error ("can't read register %d (%s)", regno, REGISTER_NAME (regno)); } else @@ -3962,19 +4122,20 @@ mips_read_fp_register_double (int regno, char *rare_buffer) each register. */ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) { - mips_read_fp_register_single (regno, rare_buffer + 4); - mips_read_fp_register_single (regno + 1, rare_buffer); + mips_read_fp_register_single (frame, regno, rare_buffer + 4); + mips_read_fp_register_single (frame, regno + 1, rare_buffer); } else { - mips_read_fp_register_single (regno, rare_buffer); - mips_read_fp_register_single (regno + 1, rare_buffer + 4); + mips_read_fp_register_single (frame, regno, rare_buffer); + mips_read_fp_register_single (frame, regno + 1, rare_buffer + 4); } } } static void -mips_print_fp_register (int regnum) +mips_print_fp_register (struct ui_file *file, struct frame_info *frame, + int regnum) { /* do values for FP (float) regs */ char *raw_buffer; double doub, flt1, flt2; /* doubles extracted from raw hex data */ @@ -3982,114 +4143,115 @@ mips_print_fp_register (int regnum) raw_buffer = (char *) alloca (2 * REGISTER_RAW_SIZE (FP0_REGNUM)); - printf_filtered ("%s:", REGISTER_NAME (regnum)); - printf_filtered ("%*s", 4 - (int) strlen (REGISTER_NAME (regnum)), ""); + fprintf_filtered (file, "%s:", REGISTER_NAME (regnum)); + fprintf_filtered (file, "%*s", 4 - (int) strlen (REGISTER_NAME (regnum)), + ""); if (REGISTER_RAW_SIZE (regnum) == 4 || mips2_fp_compat ()) { /* 4-byte registers: Print hex and floating. Also print even numbered registers as doubles. */ - mips_read_fp_register_single (regnum, raw_buffer); + mips_read_fp_register_single (frame, regnum, raw_buffer); flt1 = unpack_double (mips_float_register_type (), raw_buffer, &inv1); - print_scalar_formatted (raw_buffer, builtin_type_uint32, 'x', 'w', - gdb_stdout); + print_scalar_formatted (raw_buffer, builtin_type_uint32, 'x', 'w', file); - printf_filtered (" flt: "); + fprintf_filtered (file, " flt: "); if (inv1) - printf_filtered (" "); + fprintf_filtered (file, " "); else - printf_filtered ("%-17.9g", flt1); + fprintf_filtered (file, "%-17.9g", flt1); if (regnum % 2 == 0) { - mips_read_fp_register_double (regnum, raw_buffer); + mips_read_fp_register_double (frame, regnum, raw_buffer); doub = unpack_double (mips_double_register_type (), raw_buffer, &inv2); - printf_filtered (" dbl: "); + fprintf_filtered (file, " dbl: "); if (inv2) - printf_filtered (""); + fprintf_filtered (file, ""); else - printf_filtered ("%-24.17g", doub); + fprintf_filtered (file, "%-24.17g", doub); } } else { /* Eight byte registers: print each one as hex, float and double. */ - mips_read_fp_register_single (regnum, raw_buffer); + mips_read_fp_register_single (frame, regnum, raw_buffer); flt1 = unpack_double (mips_float_register_type (), raw_buffer, &inv1); - mips_read_fp_register_double (regnum, raw_buffer); + mips_read_fp_register_double (frame, regnum, raw_buffer); doub = unpack_double (mips_double_register_type (), raw_buffer, &inv2); - print_scalar_formatted (raw_buffer, builtin_type_uint64, 'x', 'g', - gdb_stdout); + print_scalar_formatted (raw_buffer, builtin_type_uint64, 'x', 'g', file); - printf_filtered (" flt: "); + fprintf_filtered (file, " flt: "); if (inv1) - printf_filtered (""); + fprintf_filtered (file, ""); else - printf_filtered ("%-17.9g", flt1); + fprintf_filtered (file, "%-17.9g", flt1); - printf_filtered (" dbl: "); + fprintf_filtered (file, " dbl: "); if (inv2) - printf_filtered (""); + fprintf_filtered (file, ""); else - printf_filtered ("%-24.17g", doub); + fprintf_filtered (file, "%-24.17g", doub); } } static void -mips_print_register (int regnum, int all) +mips_print_register (struct ui_file *file, struct frame_info *frame, + int regnum, int all) { + struct gdbarch *gdbarch = get_frame_arch (frame); char raw_buffer[MAX_REGISTER_SIZE]; int offset; - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT) + if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) == TYPE_CODE_FLT) { - mips_print_fp_register (regnum); + mips_print_fp_register (file, frame, regnum); return; } /* Get the data in raw format. */ - if (!frame_register_read (deprecated_selected_frame, regnum, raw_buffer)) + if (!frame_register_read (frame, regnum, raw_buffer)) { - printf_filtered ("%s: [Invalid]", REGISTER_NAME (regnum)); + fprintf_filtered (file, "%s: [Invalid]", REGISTER_NAME (regnum)); return; } - fputs_filtered (REGISTER_NAME (regnum), gdb_stdout); + fputs_filtered (REGISTER_NAME (regnum), file); /* The problem with printing numeric register names (r26, etc.) is that the user can't use them on input. Probably the best solution is to fix it so that either the numeric or the funky (a2, etc.) names are accepted on input. */ if (regnum < MIPS_NUMREGS) - printf_filtered ("(r%d): ", regnum); + fprintf_filtered (file, "(r%d): ", regnum); else - printf_filtered (": "); + fprintf_filtered (file, ": "); if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) offset = REGISTER_RAW_SIZE (regnum) - REGISTER_VIRTUAL_SIZE (regnum); else offset = 0; - print_scalar_formatted (raw_buffer + offset, - REGISTER_VIRTUAL_TYPE (regnum), - 'x', 0, gdb_stdout); + print_scalar_formatted (raw_buffer + offset, gdbarch_register_type (gdbarch, regnum), + 'x', 0, file); } /* Replacement for generic do_registers_info. Print regs in pretty columns. */ static int -do_fp_register_row (int regnum) +print_fp_register_row (struct ui_file *file, struct frame_info *frame, + int regnum) { - printf_filtered (" "); - mips_print_fp_register (regnum); - printf_filtered ("\n"); + fprintf_filtered (file, " "); + mips_print_fp_register (file, frame, regnum); + fprintf_filtered (file, "\n"); return regnum + 1; } @@ -4097,41 +4259,47 @@ do_fp_register_row (int regnum) /* Print a row's worth of GP (int) registers, with name labels above */ static int -do_gp_register_row (int regnum) +print_gp_register_row (struct ui_file *file, struct frame_info *frame, + int start_regnum) { + struct gdbarch *gdbarch = get_frame_arch (frame); /* do values for GP (int) regs */ char raw_buffer[MAX_REGISTER_SIZE]; int ncols = (MIPS_REGSIZE == 8 ? 4 : 8); /* display cols per row */ int col, byte; - int start_regnum = regnum; - int numregs = NUM_REGS; - + int regnum; /* For GP registers, we print a separate row of names above the vals */ - printf_filtered (" "); - for (col = 0; col < ncols && regnum < numregs; regnum++) + fprintf_filtered (file, " "); + for (col = 0, regnum = start_regnum; + col < ncols && regnum < NUM_REGS + NUM_PSEUDO_REGS; + regnum++) { if (*REGISTER_NAME (regnum) == '\0') continue; /* unused register */ - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT) + if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) == TYPE_CODE_FLT) break; /* end the row: reached FP register */ - printf_filtered (MIPS_REGSIZE == 8 ? "%17s" : "%9s", - REGISTER_NAME (regnum)); + fprintf_filtered (file, MIPS_REGSIZE == 8 ? "%17s" : "%9s", + REGISTER_NAME (regnum)); col++; } - printf_filtered (start_regnum < MIPS_NUMREGS ? "\n R%-4d" : "\n ", - start_regnum); /* print the R0 to R31 names */ + /* print the R0 to R31 names */ + fprintf_filtered (file, + (start_regnum % NUM_REGS) < MIPS_NUMREGS + ? "\n R%-4d" : "\n ", + start_regnum); - regnum = start_regnum; /* go back to start of row */ /* now print the values in hex, 4 or 8 to the row */ - for (col = 0; col < ncols && regnum < numregs; regnum++) + for (col = 0, regnum = start_regnum; + col < ncols && regnum < NUM_REGS + NUM_PSEUDO_REGS; + regnum++) { if (*REGISTER_NAME (regnum) == '\0') continue; /* unused register */ - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT) + if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) == TYPE_CODE_FLT) break; /* end row: reached FP register */ /* OK: get the data in raw format. */ - if (!frame_register_read (deprecated_selected_frame, regnum, raw_buffer)) + if (!frame_register_read (frame, regnum, raw_buffer)) error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum)); /* pad small registers */ for (byte = 0; byte < (MIPS_REGSIZE - REGISTER_VIRTUAL_SIZE (regnum)); byte++) @@ -4141,17 +4309,17 @@ do_gp_register_row (int regnum) for (byte = REGISTER_RAW_SIZE (regnum) - REGISTER_VIRTUAL_SIZE (regnum); byte < REGISTER_RAW_SIZE (regnum); byte++) - printf_filtered ("%02x", (unsigned char) raw_buffer[byte]); + fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[byte]); else for (byte = REGISTER_VIRTUAL_SIZE (regnum) - 1; byte >= 0; byte--) - printf_filtered ("%02x", (unsigned char) raw_buffer[byte]); - printf_filtered (" "); + fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[byte]); + fprintf_filtered (file, " "); col++; } if (col > 0) /* ie. if we actually printed anything... */ - printf_filtered ("\n"); + fprintf_filtered (file, "\n"); return regnum; } @@ -4159,29 +4327,33 @@ do_gp_register_row (int regnum) /* MIPS_DO_REGISTERS_INFO(): called by "info register" command */ static void -mips_do_registers_info (int regnum, int fpregs) +mips_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, + struct frame_info *frame, int regnum, int all) { if (regnum != -1) /* do one specified register */ { + gdb_assert (regnum >= NUM_REGS); if (*(REGISTER_NAME (regnum)) == '\0') error ("Not a valid register for the current processor type"); - mips_print_register (regnum, 0); - printf_filtered ("\n"); + mips_print_register (file, frame, regnum, 0); + fprintf_filtered (file, "\n"); } else /* do all (or most) registers */ { - regnum = 0; - while (regnum < NUM_REGS) + regnum = NUM_REGS; + while (regnum < NUM_REGS + NUM_PSEUDO_REGS) { - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT) - if (fpregs) /* true for "INFO ALL-REGISTERS" command */ - regnum = do_fp_register_row (regnum); /* FP regs */ - else - regnum += MIPS_NUMREGS; /* skip floating point regs */ + if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) == TYPE_CODE_FLT) + { + if (all) /* true for "INFO ALL-REGISTERS" command */ + regnum = print_fp_register_row (file, frame, regnum); + else + regnum += MIPS_NUMREGS; /* skip floating point regs */ + } else - regnum = do_gp_register_row (regnum); /* GP (int) regs */ + regnum = print_gp_register_row (file, frame, regnum); } } } @@ -4660,30 +4832,30 @@ mips_o32_xfer_return_value (struct type *type, least significant part of FP0. */ if (mips_debug) fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n"); - mips_xfer_register (regcache, FP0_REGNUM, TYPE_LENGTH (type), + mips_xfer_register (regcache, NUM_REGS + FP0_REGNUM, TYPE_LENGTH (type), TARGET_BYTE_ORDER, in, out, 0); } else if (TYPE_CODE (type) == TYPE_CODE_FLT && TYPE_LENGTH (type) == 8 && tdep->mips_fpu_type != MIPS_FPU_NONE) { - /* A double-precision floating-point value. It fits in the - least significant part of FP0/FP1 but with byte ordering - based on the target (???). */ + /* A double-precision floating-point value. The most + significant part goes in FP1, and the least significant in + FP0. */ if (mips_debug) - fprintf_unfiltered (gdb_stderr, "Return float in $fp0/$fp1\n"); + fprintf_unfiltered (gdb_stderr, "Return float in $fp1/$fp0\n"); switch (TARGET_BYTE_ORDER) { case BFD_ENDIAN_LITTLE: - mips_xfer_register (regcache, FP0_REGNUM + 0, 4, + mips_xfer_register (regcache, NUM_REGS + FP0_REGNUM + 0, 4, TARGET_BYTE_ORDER, in, out, 0); - mips_xfer_register (regcache, FP0_REGNUM + 1, 4, + mips_xfer_register (regcache, NUM_REGS + FP0_REGNUM + 1, 4, TARGET_BYTE_ORDER, in, out, 4); break; case BFD_ENDIAN_BIG: - mips_xfer_register (regcache, FP0_REGNUM + 1, 4, + mips_xfer_register (regcache, NUM_REGS + FP0_REGNUM + 1, 4, TARGET_BYTE_ORDER, in, out, 0); - mips_xfer_register (regcache, FP0_REGNUM + 0, 4, + mips_xfer_register (regcache, NUM_REGS + FP0_REGNUM + 0, 4, TARGET_BYTE_ORDER, in, out, 4); break; default: @@ -4718,7 +4890,8 @@ mips_o32_xfer_return_value (struct type *type, / TARGET_CHAR_BIT); if (mips_debug) fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", offset); - mips_xfer_register (regcache, regnum, TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)), + mips_xfer_register (regcache, NUM_REGS + regnum, + TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)), TARGET_BYTE_ORDER, in, out, offset); } } @@ -4742,8 +4915,8 @@ mips_o32_xfer_return_value (struct type *type, if (mips_debug) fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n", offset, xfer, regnum); - mips_xfer_register (regcache, regnum, xfer, BFD_ENDIAN_UNKNOWN, - in, out, offset); + mips_xfer_register (regcache, NUM_REGS + regnum, xfer, + BFD_ENDIAN_UNKNOWN, in, out, offset); } } #endif @@ -4765,8 +4938,8 @@ mips_o32_xfer_return_value (struct type *type, if (mips_debug) fprintf_unfiltered (gdb_stderr, "Return scalar+%d:%d in $%d\n", offset, xfer, regnum); - mips_xfer_register (regcache, regnum, xfer, TARGET_BYTE_ORDER, - in, out, offset); + mips_xfer_register (regcache, NUM_REGS + regnum, xfer, + TARGET_BYTE_ORDER, in, out, offset); } } } @@ -4800,7 +4973,7 @@ mips_n32n64_xfer_return_value (struct type *type, of FP0. */ if (mips_debug) fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n"); - mips_xfer_register (regcache, FP0_REGNUM, TYPE_LENGTH (type), + mips_xfer_register (regcache, NUM_REGS + FP0_REGNUM, TYPE_LENGTH (type), TARGET_BYTE_ORDER, in, out, 0); } else if (TYPE_CODE (type) == TYPE_CODE_STRUCT @@ -4830,7 +5003,8 @@ mips_n32n64_xfer_return_value (struct type *type, / TARGET_CHAR_BIT); if (mips_debug) fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", offset); - mips_xfer_register (regcache, regnum, TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)), + mips_xfer_register (regcache, NUM_REGS + regnum, + TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)), TARGET_BYTE_ORDER, in, out, offset); } } @@ -4852,8 +5026,8 @@ mips_n32n64_xfer_return_value (struct type *type, if (mips_debug) fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n", offset, xfer, regnum); - mips_xfer_register (regcache, regnum, xfer, BFD_ENDIAN_UNKNOWN, - in, out, offset); + mips_xfer_register (regcache, NUM_REGS + regnum, xfer, + BFD_ENDIAN_UNKNOWN, in, out, offset); } } else @@ -4873,8 +5047,8 @@ mips_n32n64_xfer_return_value (struct type *type, if (mips_debug) fprintf_unfiltered (gdb_stderr, "Return scalar+%d:%d in $%d\n", offset, xfer, regnum); - mips_xfer_register (regcache, regnum, xfer, TARGET_BYTE_ORDER, - in, out, offset); + mips_xfer_register (regcache, NUM_REGS + regnum, xfer, + TARGET_BYTE_ORDER, in, out, offset); } } } @@ -4893,12 +5067,6 @@ mips_n32n64_store_return_value (struct type *type, char *valbuf) mips_n32n64_xfer_return_value (type, current_regcache, NULL, valbuf); } -static void -mips_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) -{ - /* Nothing to do -- push_arguments does all the work. */ -} - static CORE_ADDR mips_extract_struct_value_address (struct regcache *regcache) { @@ -5096,18 +5264,26 @@ gdb_print_insn_mips (bfd_vma memaddr, disassemble_info *info) the search would fail because the symbol table says the function starts at an odd address, i.e. 1 byte past the given address. */ memaddr = ADDR_BITS_REMOVE (memaddr); - proc_desc = non_heuristic_proc_desc (MAKE_MIPS16_ADDR (memaddr), NULL); + proc_desc = non_heuristic_proc_desc (make_mips16_addr (memaddr), NULL); /* Make an attempt to determine if this is a 16-bit function. If the procedure descriptor exists and the address therein is odd, it's definitely a 16-bit function. Otherwise, we have to just guess that if the address passed in is odd, it's 16-bits. */ + /* FIXME: cagney/2003-06-26: Is this even necessary? The + disassembler needs to be able to locally determine the ISA, and + not rely on GDB. Otherwize the stand-alone 'objdump -d' will not + work. */ if (proc_desc) - info->mach = pc_is_mips16 (PROC_LOW_ADDR (proc_desc)) ? - bfd_mach_mips16 : TM_PRINT_INSN_MACH; + { + if (pc_is_mips16 (PROC_LOW_ADDR (proc_desc))) + info->mach = bfd_mach_mips16; + } else - info->mach = pc_is_mips16 (memaddr) ? - bfd_mach_mips16 : TM_PRINT_INSN_MACH; + { + if (pc_is_mips16 (memaddr)) + info->mach = bfd_mach_mips16; + } /* Round down the instruction address to the appropriate boundary. */ memaddr &= (info->mach == bfd_mach_mips16 ? ~1 : ~3); @@ -5134,7 +5310,7 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) if (pc_is_mips16 (*pcptr)) { static unsigned char mips16_big_breakpoint[] = {0xe8, 0xa5}; - *pcptr = UNMAKE_MIPS16_ADDR (*pcptr); + *pcptr = unmake_mips16_addr (*pcptr); *lenptr = sizeof (mips16_big_breakpoint); return mips16_big_breakpoint; } @@ -5164,7 +5340,7 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) if (pc_is_mips16 (*pcptr)) { static unsigned char mips16_little_breakpoint[] = {0xa5, 0xe8}; - *pcptr = UNMAKE_MIPS16_ADDR (*pcptr); + *pcptr = unmake_mips16_addr (*pcptr); *lenptr = sizeof (mips16_little_breakpoint); return mips16_little_breakpoint; } @@ -5401,9 +5577,10 @@ mips_get_saved_register (char *raw_buffer, CORE_ADDR addrx; enum lval_type lvalx; int optimizedx; + int realnumx; - if (!target_has_registers) - error ("No registers."); + /* Always a pseudo. */ + gdb_assert (regnum >= NUM_REGS); /* Make certain that all needed parameters are present. */ if (addrp == NULL) @@ -5412,26 +5589,20 @@ mips_get_saved_register (char *raw_buffer, lvalp = &lvalx; if (optimizedp == NULL) optimizedp = &optimizedx; - 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 - implicitly describe their size and hence could be used without - the below munging. */ - if ((*lvalp) == lval_memory) - { - if (raw_buffer != NULL) - { - if (regnum < 32) - { - /* Only MIPS_SAVED_REGSIZE bytes of GP registers are - saved. */ - LONGEST val = read_memory_integer ((*addrp), MIPS_SAVED_REGSIZE); - store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), val); - } - } - } + + if ((regnum % NUM_REGS) == SP_REGNUM) + /* The SP_REGNUM is special, its value is stored in saved_regs. + In fact, it is so special that it can even only be fetched + using a raw register number! Once this code as been converted + to frame-unwind the problem goes away. */ + frame_register_unwind (deprecated_get_next_frame_hack (frame), + regnum % NUM_REGS, optimizedp, lvalp, addrp, + &realnumx, raw_buffer); + else + /* Get it from the next frame. */ + frame_register_unwind (deprecated_get_next_frame_hack (frame), + regnum, optimizedp, lvalp, addrp, + &realnumx, raw_buffer); } /* Immediately after a function call, return the saved pc. @@ -5446,48 +5617,64 @@ mips_saved_pc_after_call (struct frame_info *frame) } -/* Convert a dbx stab register number (from `r' declaration) to a gdb - REGNUM */ +/* Convert a dbx stab register number (from `r' declaration) to a GDB + [1 * NUM_REGS .. 2 * NUM_REGS) REGNUM. */ static int mips_stab_reg_to_regnum (int num) { + int regnum; if (num >= 0 && num < 32) - return num; + regnum = num; else if (num >= 38 && num < 70) - return num + FP0_REGNUM - 38; + regnum = num + FP0_REGNUM - 38; else if (num == 70) - return HI_REGNUM; + regnum = HI_REGNUM; else if (num == 71) - return LO_REGNUM; + regnum = LO_REGNUM; else - { - /* This will hopefully (eventually) provoke a warning. Should - we be calling complaint() here? */ - return NUM_REGS + NUM_PSEUDO_REGS; - } + /* This will hopefully (eventually) provoke a warning. Should + we be calling complaint() here? */ + return NUM_REGS + NUM_PSEUDO_REGS; + return NUM_REGS + regnum; } -/* Convert a dwarf, dwarf2, or ecoff register number to a gdb REGNUM */ +/* Convert a dwarf, dwarf2, or ecoff register number to a GDB [1 * + NUM_REGS .. 2 * NUM_REGS) REGNUM. */ static int mips_dwarf_dwarf2_ecoff_reg_to_regnum (int num) { + int regnum; if (num >= 0 && num < 32) - return num; + regnum = num; else if (num >= 32 && num < 64) - return num + FP0_REGNUM - 32; + regnum = num + FP0_REGNUM - 32; else if (num == 64) - return HI_REGNUM; + regnum = HI_REGNUM; else if (num == 65) - return LO_REGNUM; + regnum = LO_REGNUM; else - { - /* This will hopefully (eventually) provoke a warning. Should - we be calling complaint() here? */ - return NUM_REGS + NUM_PSEUDO_REGS; - } + /* This will hopefully (eventually) provoke a warning. Should we + be calling complaint() here? */ + return NUM_REGS + NUM_PSEUDO_REGS; + return NUM_REGS + regnum; +} + +static int +mips_register_sim_regno (int regnum) +{ + /* Only makes sense to supply raw registers. */ + gdb_assert (regnum >= 0 && regnum < NUM_REGS); + /* FIXME: cagney/2002-05-13: Need to look at the pseudo register to + decide if it is valid. Should instead define a standard sim/gdb + register numbering scheme. */ + if (REGISTER_NAME (NUM_REGS + regnum) != NULL + && REGISTER_NAME (NUM_REGS + regnum)[0] != '\0') + return regnum; + else + return LEGACY_SIM_REGNO_IGNORE; } @@ -5550,12 +5737,11 @@ static struct gdbarch * mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { - static LONGEST mips_call_dummy_words[] = - {0}; struct gdbarch *gdbarch; struct gdbarch_tdep *tdep; int elf_flags; enum mips_abi mips_abi, found_abi, wanted_abi; + int num_regs; /* Reset the disassembly info, in case it was set to something non-default. */ @@ -5708,24 +5894,29 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_float_bit (gdbarch, 32); 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_deprecated_max_register_raw_size (gdbarch, 8); - set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8); + set_gdbarch_deprecated_register_raw_size (gdbarch, mips_register_raw_size); + set_gdbarch_deprecated_register_byte (gdbarch, mips_register_byte); + set_gdbarch_register_reggroup_p (gdbarch, mips_register_reggroup_p); + set_gdbarch_pseudo_register_read (gdbarch, mips_pseudo_register_read); + set_gdbarch_pseudo_register_write (gdbarch, mips_pseudo_register_write); tdep->found_abi = found_abi; tdep->mips_abi = mips_abi; set_gdbarch_elf_make_msymbol_special (gdbarch, mips_elf_make_msymbol_special); + if (info.osabi == GDB_OSABI_IRIX) - set_gdbarch_num_regs (gdbarch, 71); + num_regs = 71; else - set_gdbarch_num_regs (gdbarch, 90); + num_regs = 90; + set_gdbarch_num_regs (gdbarch, num_regs); + set_gdbarch_num_pseudo_regs (gdbarch, num_regs); switch (mips_abi) { case MIPS_ABI_O32: - set_gdbarch_deprecated_push_arguments (gdbarch, mips_o32_push_arguments); + set_gdbarch_push_dummy_call (gdbarch, mips_o32_push_dummy_call); set_gdbarch_deprecated_store_return_value (gdbarch, mips_o32_store_return_value); set_gdbarch_extract_return_value (gdbarch, mips_o32_extract_return_value); tdep->mips_default_saved_regsize = 4; @@ -5741,10 +5932,10 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_reg_struct_has_addr (gdbarch, mips_o32_reg_struct_has_addr); set_gdbarch_use_struct_convention (gdbarch, - mips_o32_use_struct_convention); + always_use_struct_convention); break; case MIPS_ABI_O64: - set_gdbarch_deprecated_push_arguments (gdbarch, mips_o64_push_arguments); + set_gdbarch_push_dummy_call (gdbarch, mips_o64_push_dummy_call); set_gdbarch_deprecated_store_return_value (gdbarch, mips_o64_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, mips_o64_extract_return_value); tdep->mips_default_saved_regsize = 8; @@ -5759,11 +5950,10 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_long_long_bit (gdbarch, 64); set_gdbarch_reg_struct_has_addr (gdbarch, mips_o32_reg_struct_has_addr); - set_gdbarch_use_struct_convention (gdbarch, - mips_o32_use_struct_convention); + set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention); break; case MIPS_ABI_EABI32: - set_gdbarch_deprecated_push_arguments (gdbarch, mips_eabi_push_arguments); + set_gdbarch_push_dummy_call (gdbarch, mips_eabi_push_dummy_call); set_gdbarch_deprecated_store_return_value (gdbarch, mips_eabi_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, mips_eabi_extract_return_value); tdep->mips_default_saved_regsize = 4; @@ -5782,7 +5972,7 @@ mips_gdbarch_init (struct gdbarch_info info, mips_eabi_use_struct_convention); break; case MIPS_ABI_EABI64: - set_gdbarch_deprecated_push_arguments (gdbarch, mips_eabi_push_arguments); + set_gdbarch_push_dummy_call (gdbarch, mips_eabi_push_dummy_call); set_gdbarch_deprecated_store_return_value (gdbarch, mips_eabi_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, mips_eabi_extract_return_value); tdep->mips_default_saved_regsize = 8; @@ -5801,7 +5991,7 @@ mips_gdbarch_init (struct gdbarch_info info, mips_eabi_use_struct_convention); break; case MIPS_ABI_N32: - set_gdbarch_deprecated_push_arguments (gdbarch, mips_n32n64_push_arguments); + set_gdbarch_push_dummy_call (gdbarch, mips_n32n64_push_dummy_call); set_gdbarch_deprecated_store_return_value (gdbarch, mips_n32n64_store_return_value); set_gdbarch_extract_return_value (gdbarch, mips_n32n64_extract_return_value); tdep->mips_default_saved_regsize = 8; @@ -5820,7 +6010,7 @@ mips_gdbarch_init (struct gdbarch_info info, mips_n32n64_reg_struct_has_addr); break; case MIPS_ABI_N64: - set_gdbarch_deprecated_push_arguments (gdbarch, mips_n32n64_push_arguments); + set_gdbarch_push_dummy_call (gdbarch, mips_n32n64_push_dummy_call); set_gdbarch_deprecated_store_return_value (gdbarch, mips_n32n64_store_return_value); set_gdbarch_extract_return_value (gdbarch, mips_n32n64_extract_return_value); tdep->mips_default_saved_regsize = 8; @@ -5898,7 +6088,6 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_write_pc (gdbarch, generic_target_write_pc); set_gdbarch_deprecated_target_read_fp (gdbarch, mips_read_sp); /* Draft FRAME base. */ set_gdbarch_read_sp (gdbarch, mips_read_sp); - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); /* Add/remove bits from an address. The MIPS needs be careful to ensure that all 32 bit addresses are sign extended to 64 bits. */ @@ -5914,33 +6103,26 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_ecoff_reg_to_regnum (gdbarch, mips_dwarf_dwarf2_ecoff_reg_to_regnum); set_gdbarch_dwarf_reg_to_regnum (gdbarch, mips_dwarf_dwarf2_ecoff_reg_to_regnum); set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mips_dwarf_dwarf2_ecoff_reg_to_regnum); + set_gdbarch_register_sim_regno (gdbarch, mips_register_sim_regno); /* Initialize a frame */ - set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, mips_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, mips_find_saved_regs); set_gdbarch_deprecated_init_extra_frame_info (gdbarch, mips_init_extra_frame_info); /* MIPS version of CALL_DUMMY */ set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address); - set_gdbarch_deprecated_push_return_address (gdbarch, mips_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, mips_pop_frame); - set_gdbarch_deprecated_fix_call_dummy (gdbarch, mips_fix_call_dummy); - set_gdbarch_deprecated_call_dummy_words (gdbarch, mips_call_dummy_words); - set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (mips_call_dummy_words)); - set_gdbarch_deprecated_push_return_address (gdbarch, mips_push_return_address); set_gdbarch_frame_align (gdbarch, mips_frame_align); - set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); - set_gdbarch_register_convertible (gdbarch, mips_register_convertible); - set_gdbarch_register_convert_to_virtual (gdbarch, - mips_register_convert_to_virtual); - set_gdbarch_register_convert_to_raw (gdbarch, - mips_register_convert_to_raw); + set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); + set_gdbarch_deprecated_register_convertible (gdbarch, mips_register_convertible); + set_gdbarch_deprecated_register_convert_to_virtual (gdbarch, mips_register_convert_to_virtual); + set_gdbarch_deprecated_register_convert_to_raw (gdbarch, mips_register_convert_to_raw); set_gdbarch_deprecated_frame_chain (gdbarch, mips_frame_chain); set_gdbarch_frameless_function_invocation (gdbarch, generic_frameless_function_invocation_not); set_gdbarch_deprecated_frame_saved_pc (gdbarch, mips_frame_saved_pc); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_frame_args_skip (gdbarch, 0); set_gdbarch_deprecated_get_saved_register (gdbarch, mips_get_saved_register); @@ -5958,18 +6140,14 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_function_start_offset (gdbarch, 0); - /* There are MIPS targets which do not yet use this since they still - define REGISTER_VIRTUAL_TYPE. */ - set_gdbarch_register_virtual_type (gdbarch, mips_register_virtual_type); - set_gdbarch_register_virtual_size (gdbarch, generic_register_size); + set_gdbarch_register_type (gdbarch, mips_register_type); - set_gdbarch_deprecated_do_registers_info (gdbarch, mips_do_registers_info); + set_gdbarch_print_registers_info (gdbarch, mips_print_registers_info); set_gdbarch_pc_in_sigtramp (gdbarch, mips_pc_in_sigtramp); /* Hook in OS ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); - set_gdbarch_deprecated_store_struct_return (gdbarch, mips_store_struct_return); set_gdbarch_extract_struct_value_address (gdbarch, mips_extract_struct_value_address); @@ -6162,8 +6340,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "mips_dump_tdep: IN_SOLIB_RETURN_TRAMPOLINE # %s\n", XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (PC, NAME))); - fprintf_unfiltered (file, - "mips_dump_tdep: IS_MIPS16_ADDR = FIXME!\n"); fprintf_unfiltered (file, "mips_dump_tdep: LAST_EMBED_REGNUM = %d\n", LAST_EMBED_REGNUM); @@ -6185,8 +6361,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) "mips_dump_tdep: MACHINE_CPROC_SP_OFFSET = %d\n", MACHINE_CPROC_SP_OFFSET); #endif - fprintf_unfiltered (file, - "mips_dump_tdep: MAKE_MIPS16_ADDR = FIXME!\n"); fprintf_unfiltered (file, "mips_dump_tdep: MIPS16_INSTLEN = %d\n", MIPS16_INSTLEN); @@ -6249,12 +6423,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "mips_dump_tdep: RA_REGNUM = %d\n", RA_REGNUM); - fprintf_unfiltered (file, - "mips_dump_tdep: REGISTER_CONVERT_FROM_TYPE # %s\n", - XSTRING (REGISTER_CONVERT_FROM_TYPE (REGNUM, VALTYPE, RAW_BUFFER))); - fprintf_unfiltered (file, - "mips_dump_tdep: REGISTER_CONVERT_TO_TYPE # %s\n", - XSTRING (REGISTER_CONVERT_TO_TYPE (REGNUM, VALTYPE, RAW_BUFFER))); fprintf_unfiltered (file, "mips_dump_tdep: REGISTER_NAMES = delete?\n"); fprintf_unfiltered (file, @@ -6333,11 +6501,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "mips_dump_tdep: TARGET_HAS_HARDWARE_WATCHPOINTS # %s\n", XSTRING (TARGET_HAS_HARDWARE_WATCHPOINTS)); - fprintf_unfiltered (file, - "mips_dump_tdep: TARGET_MIPS = used?\n"); - fprintf_unfiltered (file, - "mips_dump_tdep: TM_PRINT_INSN_MACH # %s\n", - XSTRING (TM_PRINT_INSN_MACH)); #ifdef TRACE_CLEAR fprintf_unfiltered (file, "mips_dump_tdep: TRACE_CLEAR # %s\n", @@ -6358,8 +6521,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) "mips_dump_tdep: TRACE_SET # %s\n", XSTRING (TRACE_SET (X,STATE))); #endif - fprintf_unfiltered (file, - "mips_dump_tdep: UNMAKE_MIPS16_ADDR = function?\n"); #ifdef UNUSED_REGNUM fprintf_unfiltered (file, "mips_dump_tdep: UNUSED_REGNUM = %d\n", @@ -6384,6 +6545,8 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) _PROC_MAGIC_); } +extern initialize_file_ftype _initialize_mips_tdep; /* -Wmissing-prototypes */ + void _initialize_mips_tdep (void) { diff --git a/gdb/mips-tdep.h b/gdb/mips-tdep.h index 8e19bcdf266..5d3aa85692d 100644 --- a/gdb/mips-tdep.h +++ b/gdb/mips-tdep.h @@ -40,4 +40,7 @@ enum mips_abi /* Return the MIPS ABI associated with GDBARCH. */ enum mips_abi mips_abi (struct gdbarch *gdbarch); +/* For wince :-(. */ +extern CORE_ADDR mips_next_pc (CORE_ADDR pc); + #endif /* MIPS_TDEP_H */ diff --git a/gdb/mipsnbsd-tdep.c b/gdb/mipsnbsd-tdep.c index 7776d465ad1..62ec8f3bb64 100644 --- a/gdb/mipsnbsd-tdep.c +++ b/gdb/mipsnbsd-tdep.c @@ -1,5 +1,5 @@ /* Target-dependent code for MIPS systems running NetBSD. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. This file is part of GDB. @@ -105,7 +105,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, mipsnbsd_supply_reg (regs, -1); /* Floating point registers. */ - mipsnbsd_supply_fpreg (regs, -1); + mipsnbsd_supply_fpreg (fpregs, -1); } static void @@ -250,7 +250,7 @@ mipsnbsd_get_longjmp_target (CORE_ADDR *pc) NBSD_MIPS_JB_ELEMENT_SIZE)) return 0; - *pc = extract_address (buf, NBSD_MIPS_JB_ELEMENT_SIZE); + *pc = extract_unsigned_integer (buf, NBSD_MIPS_JB_ELEMENT_SIZE); return 1; } diff --git a/gdb/mipsv4-nat.c b/gdb/mipsv4-nat.c index 65ffa0dc629..d29bc995d9a 100644 --- a/gdb/mipsv4-nat.c +++ b/gdb/mipsv4-nat.c @@ -154,7 +154,7 @@ get_longjmp_target (CORE_ADDR *pc) TARGET_PTR_BIT / TARGET_CHAR_BIT)) return 0; - *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); + *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); return 1; } diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index c7bc58c35fa..3519495f5f9 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -31,6 +31,7 @@ #include "symfile.h" #include "regcache.h" #include "arch-utils.h" +#include "gdb_assert.h" #define D0_REGNUM 0 #define D2_REGNUM 2 @@ -131,8 +132,8 @@ mn10300_extract_return_value (struct type *type, char *regbuf, char *valbuf) static CORE_ADDR mn10300_extract_struct_value_address (char *regbuf) { - return extract_address (regbuf + REGISTER_BYTE (4), - REGISTER_RAW_SIZE (4)); + return extract_unsigned_integer (regbuf + REGISTER_BYTE (4), + REGISTER_RAW_SIZE (4)); } static void @@ -1091,6 +1092,14 @@ mn10300_do_registers_info (int regnum, int fpregs) } } +static CORE_ADDR +mn10300_read_fp (void) +{ + /* That's right, we're using the stack pointer as our frame pointer. */ + gdb_assert (SP_REGNUM >= 0); + return read_register (SP_REGNUM); +} + /* Dump out the mn10300 speciic architecture information. */ static void @@ -1149,11 +1158,11 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_deprecated_register_size (gdbarch, 4); set_gdbarch_deprecated_register_bytes (gdbarch, num_regs * gdbarch_deprecated_register_size (gdbarch)); 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_deprecated_register_raw_size (gdbarch, mn10300_register_raw_size); + set_gdbarch_deprecated_register_byte (gdbarch, mn10300_register_byte); 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_deprecated_register_virtual_size (gdbarch, mn10300_register_virtual_size); + set_gdbarch_deprecated_register_virtual_type (gdbarch, mn10300_register_virtual_type); set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mn10300_dwarf2_reg_to_regnum); set_gdbarch_deprecated_do_registers_info (gdbarch, mn10300_do_registers_info); set_gdbarch_sp_regnum (gdbarch, 8); @@ -1182,9 +1191,8 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_deprecated_pop_frame (gdbarch, mn10300_pop_frame); set_gdbarch_skip_prologue (gdbarch, mn10300_skip_prologue); set_gdbarch_frame_args_skip (gdbarch, 0); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); /* That's right, we're using the stack pointer as our frame pointer. */ - set_gdbarch_deprecated_target_read_fp (gdbarch, generic_target_read_sp); + set_gdbarch_deprecated_target_read_fp (gdbarch, mn10300_read_fp); /* Calling functions in the inferior from GDB. */ set_gdbarch_deprecated_call_dummy_words (gdbarch, mn10300_call_dummy_words); @@ -1193,13 +1201,13 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_deprecated_push_arguments (gdbarch, mn10300_push_arguments); set_gdbarch_reg_struct_has_addr (gdbarch, mn10300_reg_struct_has_addr); set_gdbarch_deprecated_push_return_address (gdbarch, mn10300_push_return_address); - set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); + set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); set_gdbarch_use_struct_convention (gdbarch, mn10300_use_struct_convention); tdep->am33_mode = am33_mode; /* Should be using push_dummy_call. */ - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); return gdbarch; } diff --git a/gdb/monitor.c b/gdb/monitor.c index eabbbd938cc..ee2280d968c 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -1054,12 +1054,11 @@ monitor_wait_cleanup (void *old_timeout) -void +static void monitor_wait_filter (char *buf, int bufmax, int *ext_resp_len, - struct target_waitstatus *status -) + struct target_waitstatus *status) { int resp_len; do @@ -2335,6 +2334,8 @@ init_monitor_ops (struct target_ops *ops) /* Define additional commands that are usually only used by monitors. */ +extern initialize_file_ftype _initialize_remote_monitors; /* -Wmissing-prototypes */ + void _initialize_remote_monitors (void) { diff --git a/gdb/nlm/configure b/gdb/nlm/configure index 3918fee794c..ca1146a14b4 100755 --- a/gdb/nlm/configure +++ b/gdb/nlm/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12.2 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -28,6 +28,7 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= +sitefile= srcdir= target=NONE verbose= @@ -142,6 +143,7 @@ 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 @@ -312,6 +314,11 @@ 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=*) @@ -333,7 +340,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12.2" + echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) @@ -477,12 +484,16 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -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" +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 fi +else + CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -569,7 +580,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:573: checking host system type" >&5 +echo "configure:584: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -590,7 +601,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:594: checking target system type" >&5 +echo "configure:605: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -608,7 +619,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:612: checking build system type" >&5 +echo "configure:623: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -662,7 +673,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," # 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:666: checking for a BSD compatible install" >&5 +echo "configure:677: 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 @@ -710,6 +721,8 @@ echo "$ac_t""$INSTALL" 1>&6 # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' @@ -719,7 +732,7 @@ case "${target_cpu}" in alpha) gdb_target_cpu=alpha ;; c[12]) gdb_target_cpu=convex ;; hppa*) gdb_target_cpu=pa ;; -i[3456]86) gdb_target_cpu=i386 ;; +i[34567]86) gdb_target_cpu=i386 ;; m68*) gdb_target_cpu=m68k ;; np1) gdb_target_cpu=gould ;; pn) gdb_target_cpu=gould ;; @@ -773,7 +786,7 @@ EOF # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - case `(ac_space=' '; set) 2>&1 | grep ac_space` in + case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). @@ -852,7 +865,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12.2" + echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -876,6 +889,7 @@ s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g @@ -910,6 +924,7 @@ s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@target_makefile_frag_path@%$target_makefile_frag_path%g /@target_makefile_frag@/r $target_makefile_frag diff --git a/gdb/nlm/configure.in b/gdb/nlm/configure.in index 845b486e524..ba415aa31e1 100644 --- a/gdb/nlm/configure.in +++ b/gdb/nlm/configure.in @@ -15,7 +15,7 @@ case "${target_cpu}" in alpha) gdb_target_cpu=alpha ;; c[12]) gdb_target_cpu=convex ;; hppa*) gdb_target_cpu=pa ;; -i[3456]86) gdb_target_cpu=i386 ;; +i[34567]86) gdb_target_cpu=i386 ;; m68*) gdb_target_cpu=m68k ;; np1) gdb_target_cpu=gould ;; pn) gdb_target_cpu=gould ;; diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c index 46c175c4b02..7bad91dc3b0 100644 --- a/gdb/ns32k-tdep.c +++ b/gdb/ns32k-tdep.c @@ -327,7 +327,7 @@ ns32k_sigtramp_saved_pc (struct frame_info *frame) /* Get sigcontext address, it is the third parameter on the stack. */ if (get_next_frame (frame)) sigcontext_addr = read_memory_typed_address - (FRAME_ARGS_ADDRESS (get_next_frame (frame)) + FRAME_ARGS_SKIP + sigcontext_offs, + (DEPRECATED_FRAME_ARGS_ADDRESS (get_next_frame (frame)) + FRAME_ARGS_SKIP + sigcontext_offs, builtin_type_void_data_ptr); else sigcontext_addr = read_memory_typed_address @@ -357,12 +357,6 @@ ns32k_frame_args_address (struct frame_info *frame) return (read_register (SP_REGNUM) - 4); } -static CORE_ADDR -ns32k_frame_locals_address (struct frame_info *frame) -{ - return (get_frame_base (frame)); -} - /* Code to initialize the addresses of the saved registers of frame described by FRAME_INFO. This includes special registers such as pc and fp saved in special ways in the stack frame. sp is even more special: the address we @@ -503,7 +497,7 @@ ns32k_store_return_value (struct type *valtype, char *valbuf) static CORE_ADDR ns32k_extract_struct_value_address (char *regbuf) { - return (extract_address (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0))); + return (extract_unsigned_integer (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0))); } void @@ -513,7 +507,7 @@ ns32k_gdbarch_init_32082 (struct gdbarch *gdbarch) set_gdbarch_register_name (gdbarch, ns32k_register_name_32082); set_gdbarch_deprecated_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32082); - set_gdbarch_register_byte (gdbarch, ns32k_register_byte_32082); + set_gdbarch_deprecated_register_byte (gdbarch, ns32k_register_byte_32082); } void @@ -523,7 +517,7 @@ ns32k_gdbarch_init_32382 (struct gdbarch *gdbarch) set_gdbarch_register_name (gdbarch, ns32k_register_name_32382); set_gdbarch_deprecated_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32382); - set_gdbarch_register_byte (gdbarch, ns32k_register_byte_32382); + set_gdbarch_deprecated_register_byte (gdbarch, ns32k_register_byte_32382); } /* Initialize the current architecture based on INFO. If possible, re-use an @@ -557,12 +551,12 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, NS32K_PS_REGNUM); set_gdbarch_deprecated_register_size (gdbarch, NS32K_REGISTER_SIZE); - set_gdbarch_register_raw_size (gdbarch, ns32k_register_raw_size); + set_gdbarch_deprecated_register_raw_size (gdbarch, ns32k_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_deprecated_register_virtual_size (gdbarch, ns32k_register_virtual_size); set_gdbarch_deprecated_max_register_virtual_size (gdbarch, NS32K_MAX_REGISTER_VIRTUAL_SIZE); - set_gdbarch_register_virtual_type (gdbarch, ns32k_register_virtual_type); + set_gdbarch_deprecated_register_virtual_type (gdbarch, ns32k_register_virtual_type); /* Frame and stack info */ set_gdbarch_skip_prologue (gdbarch, umax_skip_prologue); @@ -575,8 +569,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_frame_chain (gdbarch, ns32k_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, ns32k_frame_saved_pc); - set_gdbarch_frame_args_address (gdbarch, ns32k_frame_args_address); - set_gdbarch_frame_locals_address (gdbarch, ns32k_frame_locals_address); + set_gdbarch_deprecated_frame_args_address (gdbarch, ns32k_frame_args_address); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, ns32k_frame_init_saved_regs); @@ -611,7 +604,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_function_start_offset (gdbarch, 0); /* Should be using push_dummy_call. */ - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); /* Hook in OS ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); @@ -619,6 +612,8 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return (gdbarch); } +extern initialize_file_ftype _initialize_ns32k_tdep; /* -Wmissing-prototypes */ + void _initialize_ns32k_tdep (void) { diff --git a/gdb/ns32knbsd-tdep.c b/gdb/ns32knbsd-tdep.c index 33b99d98094..b241851665f 100644 --- a/gdb/ns32knbsd-tdep.c +++ b/gdb/ns32knbsd-tdep.c @@ -61,6 +61,8 @@ ns32knbsd_aout_osabi_sniffer (bfd *abfd) return GDB_OSABI_UNKNOWN; } +extern initialize_file_ftype _initialize_ns32knbsd_tdep; /* -Wmissing-prototypes */ + void _initialize_ns32knbsd_tdep (void) { diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c index 94f156e571b..056b93f5b1a 100644 --- a/gdb/nto-tdep.c +++ b/gdb/nto-tdep.c @@ -72,7 +72,7 @@ nto_map_arch_to_cputype (const char *arch) { if (!strcmp (arch, "i386") || !strcmp (arch, "x86")) return CPUTYPE_X86; - if (!strcmp (arch, "rs6000") || !strcmp (arch, "ppc")) + if (!strcmp (arch, "rs6000") || !strcmp (arch, "powerpc")) return CPUTYPE_PPC; if (!strcmp (arch, "mips")) return CPUTYPE_MIPS; @@ -97,7 +97,8 @@ nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname) arch = "x86"; endian = ""; } - else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") == 0) + else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") == 0 + || strcmp (TARGET_ARCHITECTURE->arch_name, "powerpc") == 0) { arch = "ppc"; endian = "be"; @@ -130,7 +131,8 @@ nto_init_solib_absolute_prefix (void) arch = "x86"; endian = ""; } - else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") == 0) + else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") == 0 + || strcmp (TARGET_ARCHITECTURE->arch_name, "powerpc") == 0) { arch = "ppc"; endian = "be"; @@ -269,7 +271,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, CORE_ADDR reg_addr) { nto_regset_t regset; - + /* See corelow.c:get_core_registers for values of WHICH. */ if (which == 0) { @@ -305,11 +307,11 @@ void _initialize_nto_tdep (void) { add_setshow_cmd ("nto-debug", class_maintenance, var_zinteger, - &nto_internal_debugging, "Set QNX NTO internal debugging.\n\ + &nto_internal_debugging, "Set QNX NTO internal debugging.\n\ When non-zero, nto specific debug info is\n\ displayed. Different information is displayed\n\ -for different positive values.", "Show QNX NTO internal debugging.\n", - NULL, NULL, &setdebuglist, &showdebuglist); +for different positive values.", "Show QNX NTO internal debugging.\n", + NULL, NULL, &setdebuglist, &showdebuglist); /* We use SIG45 for pulses, or something, so nostop, noprint and pass them. */ diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y index cd6fe636334..9931f4dedce 100644 --- a/gdb/objc-exp.y +++ b/gdb/objc-exp.y @@ -1779,7 +1779,6 @@ yylex () CORE_ADDR Class = lookup_objc_class(tmp); if (Class) { - extern struct symbol *lookup_struct_typedef(); yylval.class.class = Class; if ((sym = lookup_struct_typedef (tmp, expression_context_block, diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 77fec6a1f65..5f2822c4fe0 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -44,6 +44,7 @@ #include "block.h" #include "infcall.h" #include "valprint.h" +#include "gdb_assert.h" #include @@ -75,38 +76,6 @@ struct objc_method { CORE_ADDR imp; }; -/* Complaints about ObjC classes, selectors, etc. */ - -#if (!defined __GNUC__ || __GNUC__ < 2 || __GNUC_MINOR__ < (defined __cplusplus ? 6 : 4)) -#define __CHECK_FUNCTION ((__const char *) 0) -#else -#define __CHECK_FUNCTION __PRETTY_FUNCTION__ -#endif - -#define CHECK(expression) \ - ((void) ((expression) ? 0 : gdb_check (#expression, __FILE__, __LINE__, \ - __CHECK_FUNCTION))) - -#define CHECK_FATAL(expression) \ - ((void) ((expression) ? 0 : gdb_check_fatal (#expression, __FILE__, \ - __LINE__, __CHECK_FUNCTION))) - -static void -gdb_check (const char *str, const char *file, - unsigned int line, const char *func) -{ - error ("assertion failure on line %u of \"%s\" in function \"%s\": %s\n", - line, file, func, str); -} - -static void -gdb_check_fatal (const char *str, const char *file, - unsigned int line, const char *func) -{ - internal_error (file, line, - "assertion failure in function \"%s\": %s\n", func, str); -} - /* Lookup a structure type named "struct NAME", visible in lexical block BLOCK. If NOERR is nonzero, return zero if NAME is not suitably defined. */ @@ -658,7 +627,7 @@ static const struct op_print objc_op_print_tab[] = {"sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0}, {"++", UNOP_PREINCREMENT, PREC_PREFIX, 0}, {"--", UNOP_PREDECREMENT, PREC_PREFIX, 0}, - {NULL, 0, 0, 0} + {NULL, OP_NULL, PREC_NULL, 0} }; struct type ** const (objc_builtin_types[]) = @@ -806,7 +775,8 @@ end_msglist(void) * Used for qsorting lists of objc methods (either by class or selector). */ -int specialcmp(char *a, char *b) +static int +specialcmp (char *a, char *b) { while (*a && *a != ' ' && *a != ']' && *b && *b != ' ' && *b != ']') { @@ -1153,7 +1123,7 @@ parse_selector (char *method, char **selector) char *nselector = NULL; - CHECK (selector != NULL); + gdb_assert (selector != NULL); s1 = method; @@ -1212,10 +1182,10 @@ parse_method (char *method, char *type, char **class, char *ncategory = NULL; char *nselector = NULL; - CHECK (type != NULL); - CHECK (class != NULL); - CHECK (category != NULL); - CHECK (selector != NULL); + gdb_assert (type != NULL); + gdb_assert (class != NULL); + gdb_assert (category != NULL); + gdb_assert (selector != NULL); s1 = method; @@ -1325,8 +1295,8 @@ find_methods (struct symtab *symtab, char type, static char *tmp = NULL; static unsigned int tmplen = 0; - CHECK (nsym != NULL); - CHECK (ndebug != NULL); + gdb_assert (nsym != NULL); + gdb_assert (ndebug != NULL); if (symtab) block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK); @@ -1438,8 +1408,8 @@ char *find_imps (struct symtab *symtab, struct block *block, char *buf = NULL; char *tmp = NULL; - CHECK (nsym != NULL); - CHECK (ndebug != NULL); + gdb_assert (nsym != NULL); + gdb_assert (ndebug != NULL); if (nsym != NULL) *nsym = 0; @@ -1451,6 +1421,7 @@ char *find_imps (struct symtab *symtab, struct block *block, tmp = parse_method (buf, &type, &class, &category, &selector); if (tmp == NULL) { + struct symbol *sym = NULL; struct minimal_symbol *msym = NULL; @@ -1551,7 +1522,7 @@ char *find_imps (struct symtab *symtab, struct block *block, return method + (tmp - buf); } -void +static void print_object_command (char *args, int from_tty) { struct value *object, *function, *description; @@ -1639,7 +1610,7 @@ static struct objc_methcall methcalls[] = { * case the functions have moved for some reason. */ -void +static void find_objc_msgsend (void) { unsigned int i; @@ -1686,7 +1657,7 @@ struct objc_submethod_helper_data { CORE_ADDR *new_pc; }; -int +static int find_objc_msgcall_submethod_helper (void * arg) { struct objc_submethod_helper_data *s = @@ -1698,7 +1669,7 @@ find_objc_msgcall_submethod_helper (void * arg) return 0; } -int +static int find_objc_msgcall_submethod (int (*f) (CORE_ADDR, CORE_ADDR *), CORE_ADDR pc, CORE_ADDR *new_pc) @@ -1742,6 +1713,8 @@ find_objc_msgcall (CORE_ADDR pc, CORE_ADDR *new_pc) return 0; } +extern initialize_file_ftype _initialize_objc_language; /* -Wmissing-prototypes */ + void _initialize_objc_language (void) { @@ -1755,60 +1728,6 @@ _initialize_objc_language (void) add_com_alias ("po", "print-object", class_vars, 1); } -#if 1 -/* Disable these functions until we put them in the gdbarch vector. */ -static unsigned long FETCH_ARGUMENT (int i) -{ - internal_error (__FILE__, __LINE__, "FETCH_ARGUMENT not implemented"); - return 0; -} -static CORE_ADDR CONVERT_FUNCPTR (CORE_ADDR pc) -{ - internal_error (__FILE__, __LINE__, "CONVERT_FUNCPTR not implemented"); - return pc; -} -#else -#if defined (__powerpc__) || defined (__ppc__) -static unsigned long FETCH_ARGUMENT (int i) -{ - return read_register (3 + i); -} -#elif defined (__i386__) -static unsigned long FETCH_ARGUMENT (int i) -{ - CORE_ADDR stack = read_register (SP_REGNUM); - return read_memory_unsigned_integer (stack + (4 * (i + 1)), 4); -} -#elif defined (__sparc__) -static unsigned long FETCH_ARGUMENT (int i) -{ - return read_register (O0_REGNUM + i); -} -#elif defined (__hppa__) || defined (__hppa) -static unsigned long FETCH_ARGUMENT (int i) -{ - return read_register (R0_REGNUM + 26 - i); -} -#else -#error unknown architecture -#endif - -#if defined (__hppa__) || defined (__hppa) -static CORE_ADDR CONVERT_FUNCPTR (CORE_ADDR pc) -{ - if (pc & 0x2) - pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, 4); - - return pc; -} -#else -static CORE_ADDR CONVERT_FUNCPTR (CORE_ADDR pc) -{ - return pc; -} -#endif -#endif - static void read_objc_method (CORE_ADDR addr, struct objc_method *method) { @@ -1827,7 +1746,7 @@ static void read_objc_methlist_method (CORE_ADDR addr, unsigned long num, struct objc_method *method) { - CHECK_FATAL (num < read_objc_methlist_nmethods (addr)); + gdb_assert (num < read_objc_methlist_nmethods (addr)); read_objc_method (addr + 8 + (12 * num), method); } @@ -1859,7 +1778,7 @@ read_objc_class (CORE_ADDR addr, struct objc_class *class) class->protocols = read_memory_unsigned_integer (addr + 36, 4); } -CORE_ADDR +static CORE_ADDR find_implementation_from_class (CORE_ADDR class, CORE_ADDR sel) { CORE_ADDR subclass = class; @@ -1897,7 +1816,9 @@ find_implementation_from_class (CORE_ADDR class, CORE_ADDR sel) #endif if (meth_str.name == sel) - return CONVERT_FUNCPTR (meth_str.imp); + /* FIXME: hppa arch was doing a pointer dereference + here. There needs to be a better way to do that. */ + return meth_str.imp; } mlistnum++; } @@ -1907,7 +1828,7 @@ find_implementation_from_class (CORE_ADDR class, CORE_ADDR sel) return 0; } -CORE_ADDR +static CORE_ADDR find_implementation (CORE_ADDR object, CORE_ADDR sel) { struct objc_object ostr; @@ -1921,6 +1842,9 @@ find_implementation (CORE_ADDR object, CORE_ADDR sel) return find_implementation_from_class (ostr.isa, sel); } +#define OBJC_FETCH_POINTER_ARGUMENT(argi) \ + FETCH_POINTER_ARGUMENT (get_current_frame (), argi, builtin_type_void_func_ptr) + static int resolve_msgsend (CORE_ADDR pc, CORE_ADDR *new_pc) { @@ -1928,8 +1852,8 @@ resolve_msgsend (CORE_ADDR pc, CORE_ADDR *new_pc) CORE_ADDR sel; CORE_ADDR res; - object = FETCH_ARGUMENT (0); - sel = FETCH_ARGUMENT (1); + object = OBJC_FETCH_POINTER_ARGUMENT (0); + sel = OBJC_FETCH_POINTER_ARGUMENT (1); res = find_implementation (object, sel); if (new_pc != 0) @@ -1946,8 +1870,8 @@ resolve_msgsend_stret (CORE_ADDR pc, CORE_ADDR *new_pc) CORE_ADDR sel; CORE_ADDR res; - object = FETCH_ARGUMENT (1); - sel = FETCH_ARGUMENT (2); + object = OBJC_FETCH_POINTER_ARGUMENT (1); + sel = OBJC_FETCH_POINTER_ARGUMENT (2); res = find_implementation (object, sel); if (new_pc != 0) @@ -1966,8 +1890,8 @@ resolve_msgsend_super (CORE_ADDR pc, CORE_ADDR *new_pc) CORE_ADDR sel; CORE_ADDR res; - super = FETCH_ARGUMENT (0); - sel = FETCH_ARGUMENT (1); + super = OBJC_FETCH_POINTER_ARGUMENT (0); + sel = OBJC_FETCH_POINTER_ARGUMENT (1); read_objc_super (super, &sstr); if (sstr.class == 0) @@ -1990,8 +1914,8 @@ resolve_msgsend_super_stret (CORE_ADDR pc, CORE_ADDR *new_pc) CORE_ADDR sel; CORE_ADDR res; - super = FETCH_ARGUMENT (1); - sel = FETCH_ARGUMENT (2); + super = OBJC_FETCH_POINTER_ARGUMENT (1); + sel = OBJC_FETCH_POINTER_ARGUMENT (2); read_objc_super (super, &sstr); if (sstr.class == 0) diff --git a/gdb/objc-lang.h b/gdb/objc-lang.h index 0c49bac6382..c88a0f7a5fa 100644 --- a/gdb/objc-lang.h +++ b/gdb/objc-lang.h @@ -62,4 +62,7 @@ extern void start_msglist (void); extern void add_msglist (struct stoken *str, int addcolon); extern int end_msglist (void); +struct symbol *lookup_struct_typedef (char *name, struct block *block, + int noerr); + #endif diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 2c525f61f99..39f5623749d 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -614,7 +614,8 @@ void objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) { struct section_offsets *delta = - (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS); + ((struct section_offsets *) + alloca (SIZEOF_N_SECTION_OFFSETS (objfile->num_sections))); { int i; diff --git a/gdb/ocd.c b/gdb/ocd.c index 4dfda5d6d4b..3c8d5d2936d 100644 --- a/gdb/ocd.c +++ b/gdb/ocd.c @@ -1365,6 +1365,8 @@ bdm_read_register_command (char *args, int from_tty) } +extern initialize_file_ftype _initialize_remote_ocd; /* -Wmissing-prototypes */ + void _initialize_remote_ocd (void) { diff --git a/gdb/osabi.c b/gdb/osabi.c index 22414062705..252129ba7f2 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -384,6 +384,14 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, void *obj) *os_ident_ptr = GDB_OSABI_SOLARIS; break; + case GNU_ABI_TAG_FREEBSD: + *os_ident_ptr = GDB_OSABI_FREEBSD_ELF; + break; + + case GNU_ABI_TAG_NETBSD: + *os_ident_ptr = GDB_OSABI_NETBSD_ELF; + break; + default: internal_error (__FILE__, __LINE__, @@ -531,7 +539,7 @@ set_osabi (char *args, int from_tty, struct cmd_list_element *c) internal_error (__FILE__, __LINE__, "Updating OS ABI failed."); } -void +static void show_osabi (char *args, int from_tty) { if (user_osabi_state == osabi_auto) @@ -546,6 +554,8 @@ show_osabi (char *args, int from_tty) gdbarch_osabi_name (GDB_OSABI_DEFAULT)); } +extern initialize_file_ftype _initialize_gdb_osabi; /* -Wmissing-prototype */ + void _initialize_gdb_osabi (void) { diff --git a/gdb/p-exp.y b/gdb/p-exp.y index abb4433171f..9ce3eb6d7d1 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -158,8 +158,8 @@ parse_number (char *, int, int, YYSTYPE *); static struct type *current_type; -static void push_current_type (); -static void pop_current_type (); +static void push_current_type (void); +static void pop_current_type (void); static int search_field; %} @@ -995,7 +995,8 @@ struct type_push static struct type_push *tp_top = NULL; -static void push_current_type () +static void +push_current_type (void) { struct type_push *tpnew; tpnew = (struct type_push *) malloc (sizeof (struct type_push)); @@ -1005,7 +1006,8 @@ static void push_current_type () tp_top = tpnew; } -static void pop_current_type () +static void +pop_current_type (void) { struct type_push *tp = tp_top; if (tp) diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 9cfa4d781c6..a4bbaded9a1 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -141,7 +141,8 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset, /* Print the unmangled name if desired. */ /* Print vtable entry - we only get here if we ARE using -fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */ - print_address_demangle (extract_address (valaddr + embedded_offset, TYPE_LENGTH (type)), + /* Extract the address, assume that it is unsigned. */ + print_address_demangle (extract_unsigned_integer (valaddr + embedded_offset, TYPE_LENGTH (type)), stream, demangle); break; } @@ -271,9 +272,11 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset, if (addressprint) { fprintf_filtered (stream, "@"); + /* Extract the address, assume that it is unsigned. */ print_address_numeric - (extract_address (valaddr + embedded_offset, - TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream); + (extract_unsigned_integer (valaddr + embedded_offset, + TARGET_PTR_BIT / HOST_CHAR_BIT), + 1, stream); if (deref_ref) fputs_filtered (": ", stream); } @@ -311,10 +314,11 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset, /* Print the unmangled name if desired. */ /* Print vtable entry - we only get here if NOT using -fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */ - print_address_demangle (extract_address ( - valaddr + embedded_offset + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8, - TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))), - stream, demangle); + /* Extract the address, assume that it is unsigned. */ + print_address_demangle + (extract_unsigned_integer (valaddr + embedded_offset + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8, + TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))), + stream, demangle); } else { @@ -1093,6 +1097,7 @@ pascal_object_print_class_member (char *valaddr, struct type *domain, fprintf_filtered (stream, "%ld", (long int) (val >> 3)); } +extern initialize_file_ftype _initialize_pascal_valprint; /* -Wmissing-prototypes */ void _initialize_pascal_valprint (void) diff --git a/gdb/pa64solib.c b/gdb/pa64solib.c index 43910dad46f..b67532d3759 100644 --- a/gdb/pa64solib.c +++ b/gdb/pa64solib.c @@ -222,9 +222,9 @@ pa64_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty, bfd *tmp_bfd; asection *sec; obj_private_data_t *obj_private; - struct section_addr_info section_addrs; + struct section_addr_info *section_addrs; + struct cleanup *my_cleanups; - memset (§ion_addrs, 0, sizeof (section_addrs)); /* We need the BFD so that we can look at its sections. We open up the file temporarily, then close it when we are done. */ tmp_bfd = bfd_openr (name, gnutarget); @@ -262,15 +262,18 @@ pa64_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty, text_addr += sec->filepos; } + section_addrs = alloc_section_addr_info (bfd_count_sections (tmp_bfd)); + my_cleanups = make_cleanup (xfree, section_addrs); + /* We are done with the temporary bfd. Get rid of it and make sure nobody else can us it. */ bfd_close (tmp_bfd); tmp_bfd = NULL; /* Now let the generic code load up symbols for this library. */ - section_addrs.other[0].addr = text_addr; - section_addrs.other[0].name = ".text"; - so->objfile = symbol_file_add (name, from_tty, §ion_addrs, 0, OBJF_SHARED); + section_addrs->other[0].addr = text_addr; + section_addrs->other[0].name = ".text"; + so->objfile = symbol_file_add (name, from_tty, section_addrs, 0, OBJF_SHARED); so->abfd = so->objfile->obfd; /* Mark this as a shared library and save private data. */ @@ -289,6 +292,7 @@ pa64_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty, obj_private = (obj_private_data_t *) so->objfile->obj_private; obj_private->so_info = so; obj_private->dp = so->pa64_solib_desc.linkage_ptr; + do_cleanups (my_cleanups); } /* Load debugging information for a shared library. TARGET may be diff --git a/gdb/ppc-bdm.c b/gdb/ppc-bdm.c index 9e7133e10ac..f1898187cf6 100644 --- a/gdb/ppc-bdm.c +++ b/gdb/ppc-bdm.c @@ -346,6 +346,8 @@ a wiggler, specify wiggler and then the port it is connected to\n\ bdm_ppc_ops.to_magic = OPS_MAGIC; } /* init_bdm_ppc_ops */ +extern initialize_file_ftype _initialize_bdm_ppc; /* -Wmissing-prototypes */ + void _initialize_bdm_ppc (void) { diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 20c8adda44a..d0bff2ef7bd 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -127,32 +127,37 @@ ppc_register_u_addr (int regno) { int u_addr = -1; struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + int wordsize = tdep->wordsize; /* General purpose registers occupy 1 slot each in the buffer */ if (regno >= tdep->ppc_gp0_regnum && regno <= tdep->ppc_gplast_regnum ) - u_addr = ((PT_R0 + regno) * 4); + u_addr = ((PT_R0 + regno) * wordsize); - /* Floating point regs: 2 slots each */ + /* Floating point regs: eight bytes each in both 32- and 64-bit + ptrace interfaces. Thus, two slots each in 32-bit interface, one + slot each in 64-bit interface. */ if (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM) - u_addr = ((PT_FPR0 + (regno - FP0_REGNUM) * 2) * 4); + u_addr = (PT_FPR0 * wordsize) + ((regno - FP0_REGNUM) * 8); /* UISA special purpose registers: 1 slot each */ if (regno == PC_REGNUM) - u_addr = PT_NIP * 4; + u_addr = PT_NIP * wordsize; if (regno == tdep->ppc_lr_regnum) - u_addr = PT_LNK * 4; + u_addr = PT_LNK * wordsize; if (regno == tdep->ppc_cr_regnum) - u_addr = PT_CCR * 4; + u_addr = PT_CCR * wordsize; if (regno == tdep->ppc_xer_regnum) - u_addr = PT_XER * 4; + u_addr = PT_XER * wordsize; if (regno == tdep->ppc_ctr_regnum) - u_addr = PT_CTR * 4; + u_addr = PT_CTR * wordsize; +#ifdef PT_MQ if (regno == tdep->ppc_mq_regnum) - u_addr = PT_MQ * 4; + u_addr = PT_MQ * wordsize; +#endif if (regno == tdep->ppc_ps_regnum) - u_addr = PT_MSR * 4; + u_addr = PT_MSR * wordsize; if (regno == tdep->ppc_fpscr_regnum) - u_addr = PT_FPSCR * 4; + u_addr = PT_FPSCR * wordsize; return u_addr; } @@ -426,7 +431,7 @@ store_altivec_registers (int tid) int ret; gdb_vrregset_t regs; - ret = ptrace (PTRACE_GETVRREGS, tid, 0, (int) ®s); + ret = ptrace (PTRACE_GETVRREGS, tid, 0, ®s); if (ret < 0) { if (errno == EIO) @@ -439,7 +444,7 @@ store_altivec_registers (int tid) fill_vrregset (®s); - if (ptrace (PTRACE_SETVRREGS, tid, 0, (int) ®s) < 0) + if (ptrace (PTRACE_SETVRREGS, tid, 0, ®s) < 0) perror_with_name ("Couldn't write AltiVec registers"); } @@ -503,9 +508,11 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno) regcache_collect (tdep->ppc_xer_regnum, regp + PT_XER); if ((regno == -1) || regno == tdep->ppc_ctr_regnum) regcache_collect (tdep->ppc_ctr_regnum, regp + PT_CTR); +#ifdef PT_MQ if (((regno == -1) || regno == tdep->ppc_mq_regnum) && (tdep->ppc_mq_regnum != -1)) regcache_collect (tdep->ppc_mq_regnum, regp + PT_MQ); +#endif if ((regno == -1) || regno == tdep->ppc_ps_regnum) regcache_collect (tdep->ppc_ps_regnum, regp + PT_MSR); } diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index 9284751fd0c..05b051045bf 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -229,7 +229,7 @@ ppc_linux_at_sigtramp_return_path (CORE_ADDR pc) && insn_is_sigreturn (extract_unsigned_integer (buf, 4)))); } -CORE_ADDR +static CORE_ADDR ppc_linux_skip_trampoline_code (CORE_ADDR pc) { char buf[4]; @@ -295,7 +295,7 @@ ppc_linux_skip_trampoline_code (CORE_ADDR pc) /* Get address of the relocation entry (Elf32_Rela) */ if (target_read_memory (plt_table + reloc_index, buf, 4) != 0) return 0; - reloc = extract_address (buf, 4); + reloc = extract_unsigned_integer (buf, 4); sect = find_pc_section (reloc); if (!sect) @@ -632,6 +632,315 @@ ppc_linux_svr4_fetch_link_map_offsets (void) return lmp; } + +/* Macros for matching instructions. Note that, since all the + operands are masked off before they're or-ed into the instruction, + you can use -1 to make masks. */ + +#define insn_d(opcd, rts, ra, d) \ + ((((opcd) & 0x3f) << 26) \ + | (((rts) & 0x1f) << 21) \ + | (((ra) & 0x1f) << 16) \ + | ((d) & 0xffff)) + +#define insn_ds(opcd, rts, ra, d, xo) \ + ((((opcd) & 0x3f) << 26) \ + | (((rts) & 0x1f) << 21) \ + | (((ra) & 0x1f) << 16) \ + | ((d) & 0xfffc) \ + | ((xo) & 0x3)) + +#define insn_xfx(opcd, rts, spr, xo) \ + ((((opcd) & 0x3f) << 26) \ + | (((rts) & 0x1f) << 21) \ + | (((spr) & 0x1f) << 16) \ + | (((spr) & 0x3e0) << 6) \ + | (((xo) & 0x3ff) << 1)) + +/* Read a PPC instruction from memory. PPC instructions are always + big-endian, no matter what endianness the program is running in, so + we can't use read_memory_integer or one of its friends here. */ +static unsigned int +read_insn (CORE_ADDR pc) +{ + unsigned char buf[4]; + + read_memory (pc, buf, 4); + return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; +} + + +/* An instruction to match. */ +struct insn_pattern +{ + unsigned int mask; /* mask the insn with this... */ + unsigned int data; /* ...and see if it matches this. */ + int optional; /* If non-zero, this insn may be absent. */ +}; + +/* Return non-zero if the instructions at PC match the series + described in PATTERN, or zero otherwise. PATTERN is an array of + 'struct insn_pattern' objects, terminated by an entry whose mask is + zero. + + When the match is successful, fill INSN[i] with what PATTERN[i] + matched. If PATTERN[i] is optional, and the instruction wasn't + present, set INSN[i] to 0 (which is not a valid PPC instruction). + INSN should have as many elements as PATTERN. Note that, if + PATTERN contains optional instructions which aren't present in + memory, then INSN will have holes, so INSN[i] isn't necessarily the + i'th instruction in memory. */ +static int +insns_match_pattern (CORE_ADDR pc, + struct insn_pattern *pattern, + unsigned int *insn) +{ + int i; + + for (i = 0; pattern[i].mask; i++) + { + insn[i] = read_insn (pc); + if ((insn[i] & pattern[i].mask) == pattern[i].data) + pc += 4; + else if (pattern[i].optional) + insn[i] = 0; + else + return 0; + } + + return 1; +} + + +/* Return the 'd' field of the d-form instruction INSN, properly + sign-extended. */ +static CORE_ADDR +insn_d_field (unsigned int insn) +{ + return ((((CORE_ADDR) insn & 0xffff) ^ 0x8000) - 0x8000); +} + + +/* Return the 'ds' field of the ds-form instruction INSN, with the two + zero bits concatenated at the right, and properly + sign-extended. */ +static CORE_ADDR +insn_ds_field (unsigned int insn) +{ + return ((((CORE_ADDR) insn & 0xfffc) ^ 0x8000) - 0x8000); +} + + +/* If DESC is the address of a 64-bit PowerPC GNU/Linux function + descriptor, return the descriptor's entry point. */ +static CORE_ADDR +ppc64_desc_entry_point (CORE_ADDR desc) +{ + /* The first word of the descriptor is the entry point. */ + return (CORE_ADDR) read_memory_unsigned_integer (desc, 8); +} + + +/* Pattern for the standard linkage function. These are built by + build_plt_stub in elf64-ppc.c, whose GLINK argument is always + zero. */ +static struct insn_pattern ppc64_standard_linkage[] = + { + /* addis r12, r2, */ + { insn_d (-1, -1, -1, 0), insn_d (15, 12, 2, 0), 0 }, + + /* std r2, 40(r1) */ + { -1, insn_ds (62, 2, 1, 40, 0), 0 }, + + /* ld r11, (r12) */ + { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 12, 0, 0), 0 }, + + /* addis r12, r12, 1 */ + { insn_d (-1, -1, -1, -1), insn_d (15, 12, 2, 1), 1 }, + + /* ld r2, (r12) */ + { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 2, 12, 0, 0), 0 }, + + /* addis r12, r12, 1 */ + { insn_d (-1, -1, -1, -1), insn_d (15, 12, 2, 1), 1 }, + + /* mtctr r11 */ + { insn_xfx (-1, -1, -1, -1), insn_xfx (31, 11, 9, 467), + 0 }, + + /* ld r11, (r12) */ + { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 12, 0, 0), 0 }, + + /* bctr */ + { -1, 0x4e800420, 0 }, + + { 0, 0, 0 } + }; +#define PPC64_STANDARD_LINKAGE_LEN \ + (sizeof (ppc64_standard_linkage) / sizeof (ppc64_standard_linkage[0])) + + +/* Recognize a 64-bit PowerPC GNU/Linux linkage function --- what GDB + calls a "solib trampoline". */ +static int +ppc64_in_solib_call_trampoline (CORE_ADDR pc, char *name) +{ + /* Detecting solib call trampolines on PPC64 GNU/Linux is a pain. + + It's not specifically solib call trampolines that are the issue. + Any call from one function to another function that uses a + different TOC requires a trampoline, to save the caller's TOC + pointer and then load the callee's TOC. An executable or shared + library may have more than one TOC, so even intra-object calls + may require a trampoline. Since executable and shared libraries + will all have their own distinct TOCs, every inter-object call is + also an inter-TOC call, and requires a trampoline --- so "solib + call trampolines" are just a special case. + + The 64-bit PowerPC GNU/Linux ABI calls these call trampolines + "linkage functions". Since they need to be near the functions + that call them, they all appear in .text, not in any special + section. The .plt section just contains an array of function + descriptors, from which the linkage functions load the callee's + entry point, TOC value, and environment pointer. So + in_plt_section is useless. The linkage functions don't have any + special linker symbols to name them, either. + + The only way I can see to recognize them is to actually look at + their code. They're generated by ppc_build_one_stub and some + other functions in bfd/elf64-ppc.c, so that should show us all + the instruction sequences we need to recognize. */ + unsigned int insn[PPC64_STANDARD_LINKAGE_LEN]; + + return insns_match_pattern (pc, ppc64_standard_linkage, insn); +} + + +/* When the dynamic linker is doing lazy symbol resolution, the first + call to a function in another object will go like this: + + - The user's function calls the linkage function: + + 100007c4: 4b ff fc d5 bl 10000498 + 100007c8: e8 41 00 28 ld r2,40(r1) + + - The linkage function loads the entry point (and other stuff) from + the function descriptor in the PLT, and jumps to it: + + 10000498: 3d 82 00 00 addis r12,r2,0 + 1000049c: f8 41 00 28 std r2,40(r1) + 100004a0: e9 6c 80 98 ld r11,-32616(r12) + 100004a4: e8 4c 80 a0 ld r2,-32608(r12) + 100004a8: 7d 69 03 a6 mtctr r11 + 100004ac: e9 6c 80 a8 ld r11,-32600(r12) + 100004b0: 4e 80 04 20 bctr + + - But since this is the first time that PLT entry has been used, it + sends control to its glink entry. That loads the number of the + PLT entry and jumps to the common glink0 code: + + 10000c98: 38 00 00 00 li r0,0 + 10000c9c: 4b ff ff dc b 10000c78 + + - The common glink0 code then transfers control to the dynamic + linker's fixup code: + + 10000c78: e8 41 00 28 ld r2,40(r1) + 10000c7c: 3d 82 00 00 addis r12,r2,0 + 10000c80: e9 6c 80 80 ld r11,-32640(r12) + 10000c84: e8 4c 80 88 ld r2,-32632(r12) + 10000c88: 7d 69 03 a6 mtctr r11 + 10000c8c: e9 6c 80 90 ld r11,-32624(r12) + 10000c90: 4e 80 04 20 bctr + + Eventually, this code will figure out how to skip all of this, + including the dynamic linker. At the moment, we just get through + the linkage function. */ + +/* If the current thread is about to execute a series of instructions + at PC matching the ppc64_standard_linkage pattern, and INSN is the result + from that pattern match, return the code address to which the + standard linkage function will send them. (This doesn't deal with + dynamic linker lazy symbol resolution stubs.) */ +static CORE_ADDR +ppc64_standard_linkage_target (CORE_ADDR pc, unsigned int *insn) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + + /* The address of the function descriptor this linkage function + references. */ + CORE_ADDR desc + = ((CORE_ADDR) read_register (tdep->ppc_gp0_regnum + 2) + + (insn_d_field (insn[0]) << 16) + + insn_ds_field (insn[2])); + + /* The first word of the descriptor is the entry point. Return that. */ + return ppc64_desc_entry_point (desc); +} + + +/* Given that we've begun executing a call trampoline at PC, return + the entry point of the function the trampoline will go to. */ +static CORE_ADDR +ppc64_skip_trampoline_code (CORE_ADDR pc) +{ + unsigned int ppc64_standard_linkage_insn[PPC64_STANDARD_LINKAGE_LEN]; + + if (insns_match_pattern (pc, ppc64_standard_linkage, + ppc64_standard_linkage_insn)) + return ppc64_standard_linkage_target (pc, ppc64_standard_linkage_insn); + else + return 0; +} + + +/* Support for CONVERT_FROM_FUNC_PTR_ADDR(ADDR) on PPC64 GNU/Linux. + + Usually a function pointer's representation is simply the address + of the function. On GNU/Linux on the 64-bit PowerPC however, a + function pointer is represented by a pointer to a TOC entry. This + TOC entry contains three words, the first word is the address of + the function, the second word is the TOC pointer (r2), and the + third word is the static chain value. Throughout GDB it is + currently assumed that a function pointer contains the address of + the function, which is not easy to fix. In addition, the + conversion of a function address to a function pointer would + require allocation of a TOC entry in the inferior's memory space, + with all its drawbacks. To be able to call C++ virtual methods in + the inferior (which are called via function pointers), + find_function_addr uses this function to get the function address + from a function pointer. */ + +/* Return real function address if ADDR (a function pointer) is in the data + space and is therefore a special function pointer. */ + +static CORE_ADDR +ppc64_linux_convert_from_func_ptr_addr (CORE_ADDR addr) +{ + struct obj_section *s; + + s = find_pc_section (addr); + if (s && s->the_bfd_section->flags & SEC_CODE) + return addr; + + /* ADDR is in the data space, so it's a pointer to a descriptor, not + the entry point. */ + return ppc64_desc_entry_point (addr); +} + + +/* On 64-bit PowerPC GNU/Linux, the ELF header's e_entry field is the + address of a function descriptor for the entry point function, not + the actual entry point itself. So to find the actual address at + which execution should begin, we need to fetch the function's entry + point from that descriptor. */ +static CORE_ADDR +ppc64_call_dummy_address (void) +{ + return ppc64_desc_entry_point (entry_point_address ()); +} + + enum { ELF_NGREG = 48, ELF_NFPREG = 33, @@ -743,9 +1052,27 @@ ppc_linux_init_abi (struct gdbarch_info info, set_gdbarch_memory_remove_breakpoint (gdbarch, ppc_linux_memory_remove_breakpoint); + /* Shared library handling. */ + set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section); + set_gdbarch_skip_trampoline_code (gdbarch, + ppc_linux_skip_trampoline_code); set_solib_svr4_fetch_link_map_offsets (gdbarch, ppc_linux_svr4_fetch_link_map_offsets); } + + if (tdep->wordsize == 8) + { + /* Handle PPC64 GNU/Linux function pointers (which are really + function descriptors). */ + set_gdbarch_convert_from_func_ptr_addr + (gdbarch, ppc64_linux_convert_from_func_ptr_addr); + + set_gdbarch_call_dummy_address (gdbarch, ppc64_call_dummy_address); + + set_gdbarch_in_solib_call_trampoline + (gdbarch, ppc64_in_solib_call_trampoline); + set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code); + } } void diff --git a/gdb/ppcbug-rom.c b/gdb/ppcbug-rom.c index 712af06d3ff..0619964eef3 100644 --- a/gdb/ppcbug-rom.c +++ b/gdb/ppcbug-rom.c @@ -196,6 +196,8 @@ ppcbug_open1 (char *args, int from_tty) monitor_open (args, &ppcbug_cmds1, from_tty); } +extern initialize_file_ftype _initialize_ppcbug_rom; /* -Wmissing-prototypes */ + void _initialize_ppcbug_rom (void) { diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 89682344414..9d58507d335 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -141,9 +141,6 @@ static void disable_display_command (char *, int); static void printf_command (char *, int); -static void print_frame_nameless_args (struct frame_info *, long, - int, int, struct ui_file *); - static void display_info (char *, int); static void do_one_display (struct display *); @@ -1747,225 +1744,6 @@ print_variable_value (struct symbol *var, struct frame_info *frame, value_print (val, stream, 0, Val_pretty_default); } -/* Print the arguments of a stack frame, given the function FUNC - running in that frame (as a symbol), the info on the frame, - and the number of args according to the stack frame (or -1 if unknown). */ - -/* References here and elsewhere to "number of args according to the - stack frame" appear in all cases to refer to "number of ints of args - according to the stack frame". At least for VAX, i386, isi. */ - -void -print_frame_args (struct symbol *func, struct frame_info *fi, int num, - struct ui_file *stream) -{ - struct block *b = NULL; - int first = 1; - struct dict_iterator iter; - register struct symbol *sym; - struct value *val; - /* Offset of next stack argument beyond the one we have seen that is - at the highest offset. - -1 if we haven't come to a stack argument yet. */ - long highest_offset = -1; - int arg_size; - /* Number of ints of arguments that we have printed so far. */ - int args_printed = 0; - struct cleanup *old_chain, *list_chain; - struct ui_stream *stb; - - stb = ui_out_stream_new (uiout); - old_chain = make_cleanup_ui_out_stream_delete (stb); - - if (func) - { - b = SYMBOL_BLOCK_VALUE (func); - - ALL_BLOCK_SYMBOLS (b, iter, sym) - { - QUIT; - - /* Keep track of the highest stack argument offset seen, and - skip over any kinds of symbols we don't care about. */ - - switch (SYMBOL_CLASS (sym)) - { - case LOC_ARG: - case LOC_REF_ARG: - { - long current_offset = SYMBOL_VALUE (sym); - arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym)); - - /* Compute address of next argument by adding the size of - this argument and rounding to an int boundary. */ - current_offset = - ((current_offset + arg_size + sizeof (int) - 1) - & ~(sizeof (int) - 1)); - - /* If this is the highest offset seen yet, set highest_offset. */ - if (highest_offset == -1 - || (current_offset > highest_offset)) - highest_offset = current_offset; - - /* Add the number of ints we're about to print to args_printed. */ - args_printed += (arg_size + sizeof (int) - 1) / sizeof (int); - } - - /* We care about types of symbols, but don't need to keep track of - stack offsets in them. */ - case LOC_REGPARM: - 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. */ - default: - continue; - } - - /* We have to look up the symbol because arguments can have - two entries (one a parameter, one a local) and the one we - want is the local, which lookup_symbol will find for us. - This includes gcc1 (not gcc2) on the sparc when passing a - small structure and gcc2 when the argument type is float - and it is passed as a double and converted to float by - the prologue (in the latter case the type of the LOC_ARG - symbol is double and the type of the LOC_LOCAL symbol is - float). */ - /* But if the parameter name is null, don't try it. - Null parameter names occur on the RS/6000, for traceback tables. - FIXME, should we even print them? */ - - if (*DEPRECATED_SYMBOL_NAME (sym)) - { - struct symbol *nsym; - nsym = lookup_symbol - (DEPRECATED_SYMBOL_NAME (sym), - b, VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); - if (SYMBOL_CLASS (nsym) == LOC_REGISTER) - { - /* There is a LOC_ARG/LOC_REGISTER pair. This means that - it was passed on the stack and loaded into a register, - or passed in a register and stored in a stack slot. - GDB 3.x used the LOC_ARG; GDB 4.0-4.11 used the LOC_REGISTER. - - Reasons for using the LOC_ARG: - (1) because find_saved_registers may be slow for remote - debugging, - (2) because registers are often re-used and stack slots - rarely (never?) are. Therefore using the stack slot is - much less likely to print garbage. - - Reasons why we might want to use the LOC_REGISTER: - (1) So that the backtrace prints the same value as - "print foo". I see no compelling reason why this needs - to be the case; having the backtrace print the value which - was passed in, and "print foo" print the value as modified - within the called function, makes perfect sense to me. - - Additional note: It might be nice if "info args" displayed - both values. - One more note: There is a case with sparc structure passing - where we need to use the LOC_REGISTER, but this is dealt with - by creating a single LOC_REGPARM in symbol reading. */ - - /* Leave sym (the LOC_ARG) alone. */ - ; - } - else - sym = nsym; - } - - /* Print the current arg. */ - if (!first) - ui_out_text (uiout, ", "); - ui_out_wrap_hint (uiout, " "); - - annotate_arg_begin (); - - list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL); - fprintf_symbol_filtered (stb->stream, SYMBOL_PRINT_NAME (sym), - SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI); - ui_out_field_stream (uiout, "name", stb); - annotate_arg_name_end (); - ui_out_text (uiout, "="); - - /* Avoid value_print because it will deref ref parameters. We just - want to print their addresses. Print ??? for args whose address - we do not know. We pass 2 as "recurse" to val_print because our - standard indentation here is 4 spaces, and val_print indents - 2 for each recurse. */ - val = read_var_value (sym, fi); - - annotate_arg_value (val == NULL ? NULL : VALUE_TYPE (val)); - - if (val) - { - val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0, - VALUE_ADDRESS (val), - stb->stream, 0, 0, 2, Val_no_prettyprint); - ui_out_field_stream (uiout, "value", stb); - } - else - ui_out_text (uiout, "???"); - - /* Invoke ui_out_tuple_end. */ - do_cleanups (list_chain); - - annotate_arg_end (); - - first = 0; - } - } - - /* Don't print nameless args in situations where we don't know - enough about the stack to find them. */ - if (num != -1) - { - long start; - - if (highest_offset == -1) - start = FRAME_ARGS_SKIP; - else - start = highest_offset; - - print_frame_nameless_args (fi, start, num - args_printed, - first, stream); - } - do_cleanups (old_chain); -} - -/* Print nameless args on STREAM. - FI is the frameinfo for this frame, START is the offset - of the first nameless arg, and NUM is the number of nameless args to - print. FIRST is nonzero if this is the first argument (not just - the first nameless arg). */ - -static void -print_frame_nameless_args (struct frame_info *fi, long start, int num, - int first, struct ui_file *stream) -{ - int i; - CORE_ADDR argsaddr; - long arg_value; - - for (i = 0; i < num; i++) - { - QUIT; - argsaddr = get_frame_args_address (fi); - if (!argsaddr) - return; - arg_value = read_memory_integer (argsaddr + start, sizeof (int)); - if (!first) - fprintf_filtered (stream, ", "); - fprintf_filtered (stream, "%ld", arg_value); - first = 0; - start += sizeof (int); - } -} - /* ARGSUSED */ static void printf_command (char *arg, int from_tty) diff --git a/gdb/rdi-share/host.h b/gdb/rdi-share/host.h index 9944c15b714..121a823fcd9 100644 --- a/gdb/rdi-share/host.h +++ b/gdb/rdi-share/host.h @@ -214,4 +214,7 @@ extern double strtod(const char *str, char **ptr); #endif +/* Needs to be supplied by the host. */ +extern void Fail (const char *, ...); + /* end of host.h */ diff --git a/gdb/regcache.c b/gdb/regcache.c index 09b48f01054..509390f9172 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -82,7 +82,7 @@ struct regcache_descr struct type **register_type; }; -void +static void init_legacy_regcache_descr (struct gdbarch *gdbarch, struct regcache_descr *descr) { @@ -340,7 +340,7 @@ regcache_xfree (struct regcache *regcache) xfree (regcache); } -void +static void do_regcache_xfree (void *data) { regcache_xfree (data); @@ -423,8 +423,7 @@ static int do_cooked_read (void *src, int regnum, void *buf) { struct regcache *regcache = src; - if (!regcache_valid_p (regcache, regnum) - && regcache->readonly_p) + if (!regcache->register_valid_p[regnum] && regcache->readonly_p) /* Don't even think about fetching a register from a read-only cache when the register isn't yet valid. There isn't a target from which the register value can be fetched. */ @@ -1064,7 +1063,7 @@ typedef void (regcache_read_ftype) (struct regcache *regcache, int regnum, typedef void (regcache_write_ftype) (struct regcache *regcache, int regnum, const void *buf); -void +static void regcache_xfer_part (struct regcache *regcache, int regnum, int offset, int len, void *in, const void *out, regcache_read_ftype *read, regcache_write_ftype *write) @@ -1267,41 +1266,16 @@ regcache_collect (int regnum, void *buf) /* read_pc, write_pc, read_sp, deprecated_read_fp, etc. Special handling for registers PC, SP, and FP. */ -/* NOTE: cagney/2001-02-18: The functions generic_target_read_pc(), - read_pc_pid(), read_pc(), generic_target_write_pc(), - write_pc_pid(), write_pc(), generic_target_read_sp(), read_sp(), - generic_target_write_sp(), and deprecated_read_fp(), will - eventually be moved out of the reg-cache into either frame.[hc] or - to the multi-arch framework. The are not part of the raw register - cache. */ - -/* This routine is getting awfully cluttered with #if's. It's probably - time to turn this into READ_PC and define it in the tm.h file. - Ditto for write_pc. - - 1999-06-08: The following were re-written so that it assumes the - existence of a TARGET_READ_PC et.al. macro. A default generic - version of that macro is made available where needed. +/* NOTE: cagney/2001-02-18: The functions read_pc_pid(), read_pc(), + read_sp(), and deprecated_read_fp(), will eventually be replaced by + per-frame methods. Instead of relying on the global INFERIOR_PTID, + they will use the contextual information provided by the FRAME. + These functions do not belong in the register cache. */ - Since the ``TARGET_READ_PC'' et.al. macro is going to be controlled - by the multi-arch framework, it will eventually be possible to - eliminate the intermediate read_pc_pid(). The client would call - TARGET_READ_PC directly. (cagney). */ - -CORE_ADDR -generic_target_read_pc (ptid_t ptid) -{ -#ifdef PC_REGNUM - if (PC_REGNUM >= 0) - { - CORE_ADDR pc_val = ADDR_BITS_REMOVE ((CORE_ADDR) read_register_pid (PC_REGNUM, ptid)); - return pc_val; - } -#endif - internal_error (__FILE__, __LINE__, - "generic_target_read_pc"); - return 0; -} +/* NOTE: cagney/2003-06-07: The functions generic_target_write_pc(), + write_pc_pid(), write_pc(), and deprecated_read_fp(), all need to + be replaced by something that does not rely on global state. But + what? */ CORE_ADDR read_pc_pid (ptid_t ptid) @@ -1313,7 +1287,17 @@ read_pc_pid (ptid_t ptid) saved_inferior_ptid = inferior_ptid; inferior_ptid = ptid; - pc_val = TARGET_READ_PC (ptid); + if (TARGET_READ_PC_P ()) + pc_val = TARGET_READ_PC (ptid); + /* Else use per-frame method on get_current_frame. */ + else if (PC_REGNUM >= 0) + { + CORE_ADDR raw_val = read_register_pid (PC_REGNUM, ptid); + CORE_ADDR pc_val = ADDR_BITS_REMOVE (raw_val); + return pc_val; + } + else + internal_error (__FILE__, __LINE__, "read_pc_pid: Unable to find PC"); inferior_ptid = saved_inferior_ptid; return pc_val; @@ -1361,35 +1345,25 @@ write_pc (CORE_ADDR pc) /* Cope with strage ways of getting to the stack and frame pointers */ -CORE_ADDR -generic_target_read_sp (void) -{ -#ifdef SP_REGNUM - if (SP_REGNUM >= 0) - return read_register (SP_REGNUM); -#endif - internal_error (__FILE__, __LINE__, - "generic_target_read_sp"); -} - CORE_ADDR read_sp (void) { - return TARGET_READ_SP (); + if (TARGET_READ_SP_P ()) + return TARGET_READ_SP (); + else if (gdbarch_unwind_sp_p (current_gdbarch)) + return get_frame_sp (get_current_frame ()); + else if (SP_REGNUM >= 0) + /* Try SP_REGNUM last: this makes all sorts of [wrong] assumptions + about the architecture so put it at the end. */ + return read_register (SP_REGNUM); + internal_error (__FILE__, __LINE__, "read_sp: Unable to find SP"); } void -generic_target_write_sp (CORE_ADDR val) +deprecated_write_sp (CORE_ADDR val) { -#ifdef SP_REGNUM - if (SP_REGNUM >= 0) - { - write_register (SP_REGNUM, val); - return; - } -#endif - internal_error (__FILE__, __LINE__, - "generic_target_write_sp"); + gdb_assert (SP_REGNUM >= 0); + write_register (SP_REGNUM, val); } CORE_ADDR @@ -1692,6 +1666,8 @@ maintenance_print_register_groups (char *args, int from_tty) regcache_print (args, regcache_dump_groups); } +extern initialize_file_ftype _initialize_regcache; /* -Wmissing-prototype */ + void _initialize_regcache (void) { diff --git a/gdb/reggroups.c b/gdb/reggroups.c index b72140eadee..ea9a9ec921e 100644 --- a/gdb/reggroups.c +++ b/gdb/reggroups.c @@ -245,6 +245,8 @@ struct reggroup *const all_reggroup = &all_group; struct reggroup *const save_reggroup = &save_group; struct reggroup *const restore_reggroup = &restore_group; +extern initialize_file_ftype _initialize_reggroup; /* -Wmissing-prototypes */ + void _initialize_reggroup (void) { diff --git a/gdb/remote-array.c b/gdb/remote-array.c deleted file mode 100644 index ff568813856..00000000000 --- a/gdb/remote-array.c +++ /dev/null @@ -1,1424 +0,0 @@ -/* Remote debugging interface for Array Tech RAID controller.. - - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - - Contributed by Cygnus Support. Written by Rob Savoye for Cygnus. - - This module talks to a debug monitor called 'MONITOR', which - We communicate with MONITOR via either a direct serial line, or a TCP - (or possibly TELNET) stream to a terminal multiplexor, - which in turn talks to the target board. - - This file is part of GDB. - - 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. */ - -#include "defs.h" -#include "gdbcore.h" -#include "target.h" -#include -#include -#include "gdb_string.h" -#include "command.h" -#include "serial.h" -#include "monitor.h" -#include "remote-utils.h" -#include "inferior.h" -#include "version.h" -#include "regcache.h" - -extern int baud_rate; - -#define ARRAY_PROMPT ">> " - -static void debuglogs (int, char *, ...); -static void array_open (); -static void array_close (); -static void array_detach (); -static void array_attach (); -static void array_resume (ptid_t ptid, int step, enum target_signal sig); -static void array_fetch_register (); -static void array_store_register (); -static void array_fetch_registers (); -static void array_store_registers (); -static void array_prepare_to_store (); -static void array_files_info (); -static void array_kill (); -static void array_create_inferior (); -static void array_mourn_inferior (); -static void make_gdb_packet (); -static int array_xfer_memory (); -static ptid_t array_wait (ptid_t ptid, - struct target_waitstatus *status); -static int array_insert_breakpoint (); -static int array_remove_breakpoint (); -static int tohex (); -static int to_hex (); -static int from_hex (); -static int array_send_packet (); -static int array_get_packet (); -static unsigned long ascii2hexword (); -static void hexword2ascii (); - -#define LOG_FILE "monitor.log" -#if defined (LOG_FILE) -FILE *log_file; -#endif - -static int timeout = 30; -/* Having this larger than 400 causes us to be incompatible with - m68k-stub.c and i386-stub.c. Normally, no one would notice because - it only matters for writing large chunks of memory (e.g. in - downloads). Also, this needs to be more than 400 if required to - hold the registers (see below, where we round it up based on - DEPRECATED_REGISTER_BYTES). */ -#define PBUFSIZ 400 - -/* - * Descriptor for I/O to remote machine. Initialize it to NULL so that - * array_open knows that we don't have a file open when the program starts. - */ -struct serial *array_desc = NULL; - -/* - * this array of registers need to match the indexes used by GDB. The - * whole reason this exists is cause the various ROM monitors use - * different strings than GDB does, and doesn't support all the - * registers either. So, typing "info reg sp" becomes a "r30". - */ -extern char *tmp_mips_processor_type; -extern int mips_set_processor_type (); - -static struct target_ops array_ops; - -static void -init_array_ops (void) -{ - array_ops.to_shortname = "array"; - array_ops.to_longname = - "Debug using the standard GDB remote protocol for the Array Tech target.", - array_ops.to_doc = - "Debug using the standard GDB remote protocol for the Array Tech target.\n\ -Specify the serial device it is connected to (e.g. /dev/ttya)."; - array_ops.to_open = array_open; - array_ops.to_close = array_close; - array_ops.to_detach = array_detach; - array_ops.to_resume = array_resume; - array_ops.to_wait = array_wait; - array_ops.to_fetch_registers = array_fetch_registers; - array_ops.to_store_registers = array_store_registers; - array_ops.to_prepare_to_store = array_prepare_to_store; - array_ops.to_xfer_memory = array_xfer_memory; - array_ops.to_files_info = array_files_info; - array_ops.to_insert_breakpoint = array_insert_breakpoint; - array_ops.to_remove_breakpoint = array_remove_breakpoint; - array_ops.to_kill = array_kill; - array_ops.to_create_inferior = array_create_inferior; - array_ops.to_mourn_inferior = array_mourn_inferior; - array_ops.to_stratum = process_stratum; - array_ops.to_has_all_memory = 1; - array_ops.to_has_memory = 1; - array_ops.to_has_stack = 1; - array_ops.to_has_registers = 1; - array_ops.to_has_execution = 1; - array_ops.to_magic = OPS_MAGIC; -}; - -/* - * printf_monitor -- send data to monitor. Works just like printf. - */ -static void -printf_monitor (char *pattern,...) -{ - va_list args; - char buf[PBUFSIZ]; - int i; - - va_start (args, pattern); - - vsprintf (buf, pattern, args); - - debuglogs (1, "printf_monitor(), Sending: \"%s\".", buf); - - if (strlen (buf) > PBUFSIZ) - error ("printf_monitor(): string too long"); - if (serial_write (array_desc, buf, strlen (buf))) - fprintf_unfiltered (gdb_stderr, "serial_write failed: %s\n", - safe_strerror (errno)); -} -/* - * write_monitor -- send raw data to monitor. - */ -static void -write_monitor (char data[], int len) -{ - if (serial_write (array_desc, data, len)) - fprintf_unfiltered (gdb_stderr, "serial_write failed: %s\n", - safe_strerror (errno)); - - *(data + len + 1) = '\0'; - debuglogs (1, "write_monitor(), Sending: \"%s\".", data); - -} - -/* - * debuglogs -- deal with debugging info to multiple sources. This takes - * two real args, the first one is the level to be compared against - * the sr_get_debug() value, the second arg is a printf buffer and args - * to be formatted and printed. A CR is added after each string is printed. - */ -static void -debuglogs (int level, char *pattern,...) -{ - va_list args; - char *p; - unsigned char buf[PBUFSIZ]; - char newbuf[PBUFSIZ]; - int i; - - va_start (args, pattern); - - if ((level < 0) || (level > 100)) - { - error ("Bad argument passed to debuglogs(), needs debug level"); - return; - } - - vsprintf (buf, pattern, args); /* format the string */ - - /* convert some characters so it'll look right in the log */ - p = newbuf; - for (i = 0; buf[i] != '\0'; i++) - { - if (i > PBUFSIZ) - error ("Debug message too long"); - switch (buf[i]) - { - case '\n': /* newlines */ - *p++ = '\\'; - *p++ = 'n'; - continue; - case '\r': /* carriage returns */ - *p++ = '\\'; - *p++ = 'r'; - continue; - case '\033': /* escape */ - *p++ = '\\'; - *p++ = 'e'; - continue; - case '\t': /* tab */ - *p++ = '\\'; - *p++ = 't'; - continue; - case '\b': /* backspace */ - *p++ = '\\'; - *p++ = 'b'; - continue; - default: /* no change */ - *p++ = buf[i]; - } - - if (buf[i] < 26) - { /* modify control characters */ - *p++ = '^'; - *p++ = buf[i] + 'A'; - continue; - } - if (buf[i] >= 128) - { /* modify control characters */ - *p++ = '!'; - *p++ = buf[i] + 'A'; - continue; - } - } - *p = '\0'; /* terminate the string */ - - if (sr_get_debug () > level) - printf_unfiltered ("%s\n", newbuf); - -#ifdef LOG_FILE /* write to the monitor log */ - if (log_file != 0x0) - { - fputs (newbuf, log_file); - fputc ('\n', log_file); - fflush (log_file); - } -#endif -} - -/* readchar -- read a character from the remote system, doing all the fancy - * timeout stuff. - */ -static int -readchar (int timeout) -{ - int c; - - c = serial_readchar (array_desc, abs (timeout)); - - if (sr_get_debug () > 5) - { - putchar (c & 0x7f); - debuglogs (5, "readchar: timeout = %d\n", timeout); - } - -#ifdef LOG_FILE - if (isascii (c)) - putc (c & 0x7f, log_file); -#endif - - if (c >= 0) - return c & 0x7f; - - if (c == SERIAL_TIMEOUT) - { - if (timeout <= 0) - return c; /* Polls shouldn't generate timeout errors */ - error ("Timeout reading from remote system."); -#ifdef LOG_FILE - fputs ("ERROR: Timeout reading from remote system", log_file); -#endif - } - perror_with_name ("readchar"); -} - -/* - * expect -- scan input from the remote system, until STRING is found. - * If DISCARD is non-zero, then discard non-matching input, else print - * it out. Let the user break out immediately. - */ -static void -expect (char *string, int discard) -{ - char *p = string; - int c; - - - debuglogs (1, "Expecting \"%s\".", string); - - immediate_quit++; - while (1) - { - c = readchar (timeout); - if (!isascii (c)) - continue; - if (c == *p++) - { - if (*p == '\0') - { - immediate_quit--; - debuglogs (4, "Matched"); - return; - } - } - else - { - if (!discard) - { - fputc_unfiltered (c, gdb_stdout); - } - p = string; - } - } -} - -/* Keep discarding input until we see the MONITOR array_cmds->prompt. - - The convention for dealing with the expect_prompt is that you - o give your command - o *then* wait for the expect_prompt. - - Thus the last thing that a procedure does with the serial line - will be an expect_prompt(). Exception: array_resume does not - wait for the expect_prompt, because the terminal is being handed over - to the inferior. However, the next thing which happens after that - is a array_wait which does wait for the expect_prompt. - Note that this includes abnormal exit, e.g. error(). This is - necessary to prevent getting into states from which we can't - recover. */ -static void -expect_prompt (int discard) -{ - expect (ARRAY_PROMPT, discard); -} - -/* - * junk -- ignore junk characters. Returns a 1 if junk, 0 otherwise - */ -static int -junk (char ch) -{ - switch (ch) - { - case '\0': - case ' ': - case '-': - case '\t': - case '\r': - case '\n': - if (sr_get_debug () > 5) - debuglogs (5, "Ignoring \'%c\'.", ch); - return 1; - default: - if (sr_get_debug () > 5) - debuglogs (5, "Accepting \'%c\'.", ch); - return 0; - } -} - -/* - * get_hex_digit -- Get a hex digit from the remote system & return its value. - * If ignore is nonzero, ignore spaces, newline & tabs. - */ -static int -get_hex_digit (int ignore) -{ - static int ch; - while (1) - { - ch = readchar (timeout); - if (junk (ch)) - continue; - if (sr_get_debug () > 4) - { - debuglogs (4, "get_hex_digit() got a 0x%x(%c)", ch, ch); - } - else - { -#ifdef LOG_FILE /* write to the monitor log */ - if (log_file != 0x0) - { - fputs ("get_hex_digit() got a 0x", log_file); - fputc (ch, log_file); - fputc ('\n', log_file); - fflush (log_file); - } -#endif - } - - if (ch >= '0' && ch <= '9') - return ch - '0'; - else if (ch >= 'A' && ch <= 'F') - return ch - 'A' + 10; - else if (ch >= 'a' && ch <= 'f') - return ch - 'a' + 10; - else if (ch == ' ' && ignore) - ; - else - { - expect_prompt (1); - debuglogs (4, "Invalid hex digit from remote system. (0x%x)", ch); - error ("Invalid hex digit from remote system. (0x%x)", ch); - } - } -} - -/* get_hex_byte -- Get a byte from monitor and put it in *BYT. - * Accept any number leading spaces. - */ -static void -get_hex_byte (char *byt) -{ - int val; - - val = get_hex_digit (1) << 4; - debuglogs (4, "get_hex_byte() -- Read first nibble 0x%x", val); - - val |= get_hex_digit (0); - debuglogs (4, "get_hex_byte() -- Read second nibble 0x%x", val); - *byt = val; - - debuglogs (4, "get_hex_byte() -- Read a 0x%x", val); -} - -/* - * get_hex_word -- Get N 32-bit words from remote, each preceded by a space, - * and put them in registers starting at REGNO. - */ -static int -get_hex_word (void) -{ - long val, newval; - int i; - - val = 0; - - for (i = 0; i < 8; i++) - val = (val << 4) + get_hex_digit (i == 0); - - debuglogs (4, "get_hex_word() got a 0x%x.", val); - - return val; -} - -/* This is called not only when we first attach, but also when the - user types "run" after having attached. */ -static void -array_create_inferior (char *execfile, char *args, char **env) -{ - int entry_pt; - - if (args && *args) - error ("Can't pass arguments to remote MONITOR process"); - - if (execfile == 0 || exec_bfd == 0) - error ("No executable file specified"); - - entry_pt = (int) bfd_get_start_address (exec_bfd); - -/* The "process" (board) is already stopped awaiting our commands, and - the program is already downloaded. We just set its PC and go. */ - - clear_proceed_status (); - - /* Tell wait_for_inferior that we've started a new process. */ - init_wait_for_inferior (); - - /* Set up the "saved terminal modes" of the inferior - based on what modes we are starting it with. */ - target_terminal_init (); - - /* Install inferior's terminal modes. */ - target_terminal_inferior (); - - /* insert_step_breakpoint (); FIXME, do we need this? */ - - /* Let 'er rip... */ - proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0); -} - -/* - * array_open -- open a connection to a remote debugger. - * NAME is the filename used for communication. - */ -static int baudrate = 9600; -static char dev_name[100]; - -static void -array_open (char *args, char *name, int from_tty) -{ - char packet[PBUFSIZ]; - - if (args == NULL) - error ("Use `target %s DEVICE-NAME' to use a serial port, or \n\ -`target %s HOST-NAME:PORT-NUMBER' to use a network connection.", name, name); - -/* if (is_open) */ - array_close (0); - - target_preopen (from_tty); - unpush_target (&array_ops); - - tmp_mips_processor_type = "lsi33k"; /* change the default from r3051 */ - mips_set_processor_type_command ("lsi33k", 0); - - strcpy (dev_name, args); - array_desc = serial_open (dev_name); - - if (array_desc == NULL) - perror_with_name (dev_name); - - if (baud_rate != -1) - { - if (serial_setbaudrate (array_desc, baud_rate)) - { - serial_close (array_desc); - perror_with_name (name); - } - } - - serial_raw (array_desc); - -#if defined (LOG_FILE) - log_file = fopen (LOG_FILE, "w"); - if (log_file == NULL) - perror_with_name (LOG_FILE); - fprintf (log_file, "GDB %s (%s", version, host_name); - fprintf (log_file, " --target %s)\n", array_ops.to_shortname); - fprintf (log_file, "Remote target %s connected to %s\n\n", array_ops.to_shortname, dev_name); -#endif - - /* see if the target is alive. For a ROM monitor, we can just try to force the - expect_prompt to print a few times. For the GDB remote protocol, the application - being debugged is sitting at a breakpoint and waiting for GDB to initialize - the connection. We force it to give us an empty packet to see if it's alive. - */ - debuglogs (3, "Trying to ACK the target's debug stub"); - /* unless your are on the new hardware, the old board won't initialize - because the '@' doesn't flush output like it does on the new ROMS. - */ - printf_monitor ("@"); /* ask for the last signal */ - expect_prompt (1); /* See if we get a expect_prompt */ -#ifdef TEST_ARRAY /* skip packet for testing */ - make_gdb_packet (packet, "?"); /* ask for a bogus packet */ - if (array_send_packet (packet) == 0) - error ("Couldn't transmit packet\n"); - printf_monitor ("@\n"); /* force it to flush stdout */ - expect_prompt (1); /* See if we get a expect_prompt */ -#endif - push_target (&array_ops); - if (from_tty) - printf ("Remote target %s connected to %s\n", array_ops.to_shortname, dev_name); -} - -/* - * array_close -- Close out all files and local state before this - * target loses control. - */ - -static void -array_close (int quitting) -{ - serial_close (array_desc); - array_desc = NULL; - - debuglogs (1, "array_close (quitting=%d)", quitting); - -#if defined (LOG_FILE) - if (log_file) - { - if (ferror (log_file)) - printf_filtered ("Error writing log file.\n"); - if (fclose (log_file) != 0) - printf_filtered ("Error closing log file.\n"); - } -#endif -} - -/* - * array_detach -- terminate the open connection to the remote - * debugger. Use this when you want to detach and do something - * else with your gdb. - */ -static void -array_detach (int from_tty) -{ - - debuglogs (1, "array_detach ()"); - - pop_target (); /* calls array_close to do the real work */ - if (from_tty) - printf ("Ending remote %s debugging\n", target_shortname); -} - -/* - * array_attach -- attach GDB to the target. - */ -static void -array_attach (char *args, int from_tty) -{ - if (from_tty) - printf ("Starting remote %s debugging\n", target_shortname); - - debuglogs (1, "array_attach (args=%s)", args); - - printf_monitor ("go %x\n"); - /* swallow the echo. */ - expect ("go %x\n", 1); -} - -/* - * array_resume -- Tell the remote machine to resume. - */ -static void -array_resume (ptid_t ptid, int step, enum target_signal sig) -{ - debuglogs (1, "array_resume (step=%d, sig=%d)", step, sig); - - if (step) - { - printf_monitor ("s\n"); - } - else - { - printf_monitor ("go\n"); - } -} - -#define TMPBUFSIZ 5 - -/* - * array_wait -- Wait until the remote machine stops, then return, - * storing status in status just as `wait' would. - */ -static ptid_t -array_wait (ptid_t ptid, struct target_waitstatus *status) -{ - int old_timeout = timeout; - int result, i; - char c; - struct serial *tty_desc; - serial_ttystate ttystate; - - debuglogs (1, "array_wait (), printing extraneous text."); - - status->kind = TARGET_WAITKIND_EXITED; - status->value.integer = 0; - - timeout = 0; /* Don't time out -- user program is running. */ - -#if !defined(__GO32__) && !defined(__MSDOS__) && !defined(_WIN32) - tty_desc = serial_fdopen (0); - ttystate = serial_get_tty_state (tty_desc); - serial_raw (tty_desc); - - i = 0; - /* poll on the serial port and the keyboard. */ - while (1) - { - c = readchar (timeout); - if (c > 0) - { - if (c == *(ARRAY_PROMPT + i)) - { - if (++i >= strlen (ARRAY_PROMPT)) - { /* matched the prompt */ - debuglogs (4, "array_wait(), got the expect_prompt."); - break; - } - } - else - { /* not the prompt */ - i = 0; - } - fputc_unfiltered (c, gdb_stdout); - gdb_flush (gdb_stdout); - } - c = serial_readchar (tty_desc, timeout); - if (c > 0) - { - serial_write (array_desc, &c, 1); - /* do this so it looks like there's keyboard echo */ - if (c == 3) /* exit on Control-C */ - break; -#if 0 - fputc_unfiltered (c, gdb_stdout); - gdb_flush (gdb_stdout); -#endif - } - } - serial_set_tty_state (tty_desc, ttystate); -#else - expect_prompt (1); - debuglogs (4, "array_wait(), got the expect_prompt."); -#endif - - status->kind = TARGET_WAITKIND_STOPPED; - status->value.sig = TARGET_SIGNAL_TRAP; - - timeout = old_timeout; - - return inferior_ptid; -} - -/* - * array_fetch_registers -- read the remote registers into the - * block regs. - */ -static void -array_fetch_registers (int ignored) -{ - char reg[MAX_REGISTER_SIZE]; - int regno; - char *p; - char *packet = alloca (PBUFSIZ); - - debuglogs (1, "array_fetch_registers (ignored=%d)\n", ignored); - - memset (packet, 0, PBUFSIZ); - make_gdb_packet (packet, "g"); - if (array_send_packet (packet) == 0) - error ("Couldn't transmit packet\n"); - if (array_get_packet (packet) == 0) - error ("Couldn't receive packet\n"); - /* FIXME: read bytes from packet */ - debuglogs (4, "array_fetch_registers: Got a \"%s\" back\n", packet); - for (regno = 0; regno <= PC_REGNUM + 4; regno++) - { - /* supply register stores in target byte order, so swap here */ - /* FIXME: convert from ASCII hex to raw bytes */ - LONGEST i = ascii2hexword (packet + (regno * 8)); - debuglogs (5, "Adding register %d = %x\n", regno, i); - store_unsigned_integer (®, REGISTER_RAW_SIZE (regno), i); - supply_register (regno, (char *) ®); - } -} - -/* - * This is unused by targets like this one that use a - * protocol based on GDB's remote protocol. - */ -static void -array_fetch_register (int ignored) -{ - array_fetch_registers (0 /* ignored */); -} - -/* - * Get all the registers from the targets. They come back in a large array. - */ -static void -array_store_registers (int ignored) -{ - int regno; - unsigned long i; - char packet[PBUFSIZ]; - char buf[PBUFSIZ]; - char num[9]; - - debuglogs (1, "array_store_registers()"); - - memset (packet, 0, PBUFSIZ); - memset (buf, 0, PBUFSIZ); - buf[0] = 'G'; - - /* Unimplemented registers read as all bits zero. */ - /* FIXME: read bytes from packet */ - for (regno = 0; regno < 41; regno++) - { /* FIXME */ - /* supply register stores in target byte order, so swap here */ - /* FIXME: convert from ASCII hex to raw bytes */ - i = (unsigned long) read_register (regno); - hexword2ascii (num, i); - strcpy (buf + (regno * 8) + 1, num); - } - *(buf + (regno * 8) + 2) = 0; - make_gdb_packet (packet, buf); - if (array_send_packet (packet) == 0) - error ("Couldn't transmit packet\n"); - if (array_get_packet (packet) == 0) - error ("Couldn't receive packet\n"); - - registers_changed (); -} - -/* - * This is unused by targets like this one that use a - * protocol based on GDB's remote protocol. - */ -static void -array_store_register (int ignored) -{ - array_store_registers (0 /* ignored */); -} - -/* Get ready to modify the registers array. On machines which store - individual registers, this doesn't need to do anything. On machines - which store all the registers in one fell swoop, this makes sure - that registers contains all the registers from the program being - debugged. */ - -static void -array_prepare_to_store (void) -{ - /* Do nothing, since we can store individual regs */ -} - -static void -array_files_info (void) -{ - printf ("\tAttached to %s at %d baud.\n", - dev_name, baudrate); -} - -/* - * array_write_inferior_memory -- Copy LEN bytes of data from debugger - * memory at MYADDR to inferior's memory at MEMADDR. Returns length moved. - */ -static int -array_write_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -{ - unsigned long i; - int j; - char packet[PBUFSIZ]; - char buf[PBUFSIZ]; - char num[9]; - char *p; - - debuglogs (1, "array_write_inferior_memory (memaddr=0x%x, myaddr=0x%x, len=%d)", memaddr, myaddr, len); - memset (buf, '\0', PBUFSIZ); /* this also sets the string terminator */ - p = buf; - - *p++ = 'M'; /* The command to write memory */ - hexword2ascii (num, memaddr); /* convert the address */ - strcpy (p, num); /* copy the address */ - p += 8; - *p++ = ','; /* add comma delimeter */ - hexword2ascii (num, len); /* Get the length as a 4 digit number */ - *p++ = num[4]; - *p++ = num[5]; - *p++ = num[6]; - *p++ = num[7]; - *p++ = ':'; /* add the colon delimeter */ - for (j = 0; j < len; j++) - { /* copy the data in after converting it */ - *p++ = tohex ((myaddr[j] >> 4) & 0xf); - *p++ = tohex (myaddr[j] & 0xf); - } - - make_gdb_packet (packet, buf); - if (array_send_packet (packet) == 0) - error ("Couldn't transmit packet\n"); - if (array_get_packet (packet) == 0) - error ("Couldn't receive packet\n"); - - return len; -} - -/* - * array_read_inferior_memory -- read LEN bytes from inferior memory - * at MEMADDR. Put the result at debugger address MYADDR. Returns - * length moved. - */ -static int -array_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - int j; - char buf[20]; - char packet[PBUFSIZ]; - int count; /* Number of bytes read so far. */ - unsigned long startaddr; /* Starting address of this pass. */ - int len_this_pass; /* Number of bytes to read in this pass. */ - - debuglogs (1, "array_read_inferior_memory (memaddr=0x%x, myaddr=0x%x, len=%d)", memaddr, myaddr, len); - - /* Note that this code works correctly if startaddr is just less - than UINT_MAX (well, really CORE_ADDR_MAX if there was such a - thing). That is, something like - array_read_bytes (CORE_ADDR_MAX - 4, foo, 4) - works--it never adds len To memaddr and gets 0. */ - /* However, something like - array_read_bytes (CORE_ADDR_MAX - 3, foo, 4) - doesn't need to work. Detect it and give up if there's an attempt - to do that. */ - if (((memaddr - 1) + len) < memaddr) - { - errno = EIO; - return 0; - } - - for (count = 0, startaddr = memaddr; count < len; startaddr += len_this_pass) - { - /* Try to align to 16 byte boundry (why?) */ - len_this_pass = 16; - if ((startaddr % 16) != 0) - { - len_this_pass -= startaddr % 16; - } - /* Only transfer bytes we need */ - if (len_this_pass > (len - count)) - { - len_this_pass = (len - count); - } - /* Fetch the bytes */ - debuglogs (3, "read %d bytes from inferior address %x", len_this_pass, - startaddr); - sprintf (buf, "m%08lx,%04x", startaddr, len_this_pass); - make_gdb_packet (packet, buf); - if (array_send_packet (packet) == 0) - { - error ("Couldn't transmit packet\n"); - } - if (array_get_packet (packet) == 0) - { - error ("Couldn't receive packet\n"); - } - if (*packet == 0) - { - error ("Got no data in the GDB packet\n"); - } - /* Pick packet apart and xfer bytes to myaddr */ - debuglogs (4, "array_read_inferior_memory: Got a \"%s\" back\n", packet); - for (j = 0; j < len_this_pass; j++) - { - /* extract the byte values */ - myaddr[count++] = from_hex (*(packet + (j * 2))) * 16 + from_hex (*(packet + (j * 2) + 1)); - debuglogs (5, "myaddr[%d] set to %x\n", count - 1, myaddr[count - 1]); - } - } - return (count); -} - -/* Transfer LEN bytes between GDB address MYADDR and target address - MEMADDR. If WRITE is non-zero, transfer them to the target, - otherwise transfer them from the target. TARGET is unused. - - Returns the number of bytes transferred. */ - -static int -array_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, - struct mem_attrib *attrib, struct target_ops *target) -{ - if (write) - return array_write_inferior_memory (memaddr, myaddr, len); - else - return array_read_inferior_memory (memaddr, myaddr, len); -} - -static void -array_kill (char *args, int from_tty) -{ - return; /* ignore attempts to kill target system */ -} - -/* Clean up when a program exits. - The program actually lives on in the remote processor's RAM, and may be - run again without a download. Don't leave it full of breakpoint - instructions. */ - -static void -array_mourn_inferior (void) -{ - remove_breakpoints (); - generic_mourn_inferior (); /* Do all the proper things now */ -} - -#define MAX_ARRAY_BREAKPOINTS 16 - -static CORE_ADDR breakaddr[MAX_ARRAY_BREAKPOINTS] = -{0}; - -/* - * array_insert_breakpoint -- add a breakpoint - */ -static int -array_insert_breakpoint (CORE_ADDR addr, char *shadow) -{ - int i; - int bp_size = 0; - CORE_ADDR bp_addr = addr; - - debuglogs (1, "array_insert_breakpoint() addr = 0x%x", addr); - BREAKPOINT_FROM_PC (&bp_addr, &bp_size); - - for (i = 0; i <= MAX_ARRAY_BREAKPOINTS; i++) - { - if (breakaddr[i] == 0) - { - breakaddr[i] = addr; - if (sr_get_debug () > 4) - printf ("Breakpoint at %s\n", paddr_nz (addr)); - array_read_inferior_memory (bp_addr, shadow, bp_size); - printf_monitor ("b 0x%x\n", addr); - expect_prompt (1); - return 0; - } - } - - fprintf_unfiltered (gdb_stderr, "Too many breakpoints (> 16) for monitor\n"); - return 1; -} - -/* - * _remove_breakpoint -- Tell the monitor to remove a breakpoint - */ -static int -array_remove_breakpoint (CORE_ADDR addr, char *shadow) -{ - int i; - - debuglogs (1, "array_remove_breakpoint() addr = 0x%x", addr); - - for (i = 0; i < MAX_ARRAY_BREAKPOINTS; i++) - { - if (breakaddr[i] == addr) - { - breakaddr[i] = 0; - /* some monitors remove breakpoints based on the address */ - printf_monitor ("bd %x\n", i); - expect_prompt (1); - return 0; - } - } - fprintf_unfiltered (gdb_stderr, - "Can't find breakpoint associated with 0x%s\n", - paddr_nz (addr)); - return 1; -} - -static void -array_stop (void) -{ - debuglogs (1, "array_stop()"); - printf_monitor ("\003"); - expect_prompt (1); -} - -/* - * array_command -- put a command string, in args, out to MONITOR. - * Output from MONITOR is placed on the users terminal until the - * expect_prompt is seen. FIXME - */ -static void -monitor_command (char *args, int fromtty) -{ - debuglogs (1, "monitor_command (args=%s)", args); - - if (array_desc == NULL) - error ("monitor target not open."); - - if (!args) - error ("Missing command."); - - printf_monitor ("%s\n", args); - expect_prompt (0); -} - -/* - * make_gdb_packet -- make a GDB packet. The data is always ASCII. - * A debug packet whose contents are - * is encapsulated for transmission in the form: - * - * $ # CSUM1 CSUM2 - * - * must be ASCII alphanumeric and cannot include characters - * '$' or '#'. If starts with two characters followed by - * ':', then the existing stubs interpret this as a sequence number. - * - * CSUM1 and CSUM2 are ascii hex representation of an 8-bit - * checksum of , the most significant nibble is sent first. - * the hex digits 0-9,a-f are used. - * - */ -static void -make_gdb_packet (char *buf, char *data) -{ - int i; - unsigned char csum = 0; - int cnt; - char *p; - - debuglogs (3, "make_gdb_packet(%s)\n", data); - cnt = strlen (data); - if (cnt > PBUFSIZ) - error ("make_gdb_packet(): to much data\n"); - - /* start with the packet header */ - p = buf; - *p++ = '$'; - - /* calculate the checksum */ - for (i = 0; i < cnt; i++) - { - csum += data[i]; - *p++ = data[i]; - } - - /* terminate the data with a '#' */ - *p++ = '#'; - - /* add the checksum as two ascii digits */ - *p++ = tohex ((csum >> 4) & 0xf); - *p++ = tohex (csum & 0xf); - *p = 0x0; /* Null terminator on string */ -} - -/* - * array_send_packet -- send a GDB packet to the target with error handling. We - * get a '+' (ACK) back if the packet is received and the checksum - * matches. Otherwise a '-' (NAK) is returned. It returns a 1 for a - * successful transmition, or a 0 for a failure. - */ -static int -array_send_packet (char *packet) -{ - int c, retries, i; - char junk[PBUFSIZ]; - - retries = 0; - -#if 0 - /* scan the packet to make sure it only contains valid characters. - this may sound silly, but sometimes a garbled packet will hang - the target board. We scan the whole thing, then print the error - message. - */ - for (i = 0; i < strlen (packet); i++) - { - debuglogs (5, "array_send_packet(): Scanning \'%c\'\n", packet[i]); - /* legit hex numbers or command */ - if ((isxdigit (packet[i])) || (isalpha (packet[i]))) - continue; - switch (packet[i]) - { - case '+': /* ACK */ - case '-': /* NAK */ - case '#': /* end of packet */ - case '$': /* start of packet */ - continue; - default: /* bogus character */ - retries++; - debuglogs (4, "array_send_packet(): Found a non-ascii digit \'%c\' in the packet.\n", packet[i]); - } - } -#endif - - if (retries > 0) - error ("Can't send packet, found %d non-ascii characters", retries); - - /* ok, try to send the packet */ - retries = 0; - while (retries++ <= 10) - { - printf_monitor ("%s", packet); - - /* read until either a timeout occurs (-2) or '+' is read */ - while (retries <= 10) - { - c = readchar (-timeout); - debuglogs (3, "Reading a GDB protocol packet... Got a '%c'\n", c); - switch (c) - { - case '+': - debuglogs (3, "Got Ack\n"); - return 1; - case SERIAL_TIMEOUT: - debuglogs (3, "Timed out reading serial port\n"); - printf_monitor ("@"); /* resync with the monitor */ - expect_prompt (1); /* See if we get a expect_prompt */ - break; /* Retransmit buffer */ - case '-': - debuglogs (3, "Got NAK\n"); - printf_monitor ("@"); /* resync with the monitor */ - expect_prompt (1); /* See if we get a expect_prompt */ - break; - case '$': - /* it's probably an old response, or the echo of our command. - * just gobble up the packet and ignore it. - */ - debuglogs (3, "Got a junk packet\n"); - i = 0; - do - { - c = readchar (timeout); - junk[i++] = c; - } - while (c != '#'); - c = readchar (timeout); - junk[i++] = c; - c = readchar (timeout); - junk[i++] = c; - junk[i++] = '\0'; - debuglogs (3, "Reading a junk packet, got a \"%s\"\n", junk); - continue; /* Now, go look for next packet */ - default: - continue; - } - retries++; - debuglogs (3, "Retransmitting packet \"%s\"\n", packet); - break; /* Here to retransmit */ - } - } /* outer while */ - return 0; -} - -/* - * array_get_packet -- get a GDB packet from the target. Basically we read till we - * see a '#', then check the checksum. It returns a 1 if it's gotten a - * packet, or a 0 it the packet wasn't transmitted correctly. - */ -static int -array_get_packet (char *packet) -{ - int c; - int retries; - unsigned char csum; - unsigned char pktcsum; - char *bp; - - csum = 0; - bp = packet; - - memset (packet, 1, PBUFSIZ); - retries = 0; - while (retries <= 10) - { - do - { - c = readchar (timeout); - if (c == SERIAL_TIMEOUT) - { - debuglogs (3, "array_get_packet: got time out from serial port.\n"); - } - debuglogs (3, "Waiting for a '$', got a %c\n", c); - } - while (c != '$'); - - retries = 0; - while (retries <= 10) - { - c = readchar (timeout); - debuglogs (3, "array_get_packet: got a '%c'\n", c); - switch (c) - { - case SERIAL_TIMEOUT: - debuglogs (3, "Timeout in mid-packet, retrying\n"); - return 0; - case '$': - debuglogs (3, "Saw new packet start in middle of old one\n"); - return 0; /* Start a new packet, count retries */ - case '#': - *bp = '\0'; - pktcsum = from_hex (readchar (timeout)) << 4; - pktcsum |= from_hex (readchar (timeout)); - if (csum == 0) - debuglogs (3, "\nGDB packet checksum zero, must be a bogus packet\n"); - if (csum == pktcsum) - { - debuglogs (3, "\nGDB packet checksum correct, packet data is \"%s\",\n", packet); - printf_monitor ("@"); - expect_prompt (1); - return 1; - } - debuglogs (3, "Bad checksum, sentsum=0x%x, csum=0x%x\n", pktcsum, csum); - return 0; - case '*': /* Run length encoding */ - debuglogs (5, "Run length encoding in packet\n"); - csum += c; - c = readchar (timeout); - csum += c; - c = c - ' ' + 3; /* Compute repeat count */ - - if (c > 0 && c < 255 && bp + c - 1 < packet + PBUFSIZ - 1) - { - memset (bp, *(bp - 1), c); - bp += c; - continue; - } - *bp = '\0'; - printf_filtered ("Repeat count %d too large for buffer.\n", c); - return 0; - - default: - if ((!isxdigit (c)) && (!ispunct (c))) - debuglogs (4, "Got a non-ascii digit \'%c\'.\\n", c); - if (bp < packet + PBUFSIZ - 1) - { - *bp++ = c; - csum += c; - continue; - } - - *bp = '\0'; - puts_filtered ("Remote packet too long.\n"); - return 0; - } - } - } - return 0; /* exceeded retries */ -} - -/* - * ascii2hexword -- convert an ascii number represented by 8 digits to a hex value. - */ -static unsigned long -ascii2hexword (unsigned char *mem) -{ - unsigned long val; - int i; - char buf[9]; - - val = 0; - for (i = 0; i < 8; i++) - { - val <<= 4; - if (mem[i] >= 'A' && mem[i] <= 'F') - val = val + mem[i] - 'A' + 10; - if (mem[i] >= 'a' && mem[i] <= 'f') - val = val + mem[i] - 'a' + 10; - if (mem[i] >= '0' && mem[i] <= '9') - val = val + mem[i] - '0'; - buf[i] = mem[i]; - } - buf[8] = '\0'; - debuglogs (4, "ascii2hexword() got a 0x%x from %s(%x).\n", val, buf, mem); - return val; -} - -/* - * ascii2hexword -- convert a hex value to an ascii number represented by 8 - * digits. - */ -static void -hexword2ascii (unsigned char *mem, unsigned long num) -{ - int i; - unsigned char ch; - - debuglogs (4, "hexword2ascii() converting %x ", num); - for (i = 7; i >= 0; i--) - { - mem[i] = tohex ((num >> 4) & 0xf); - mem[i] = tohex (num & 0xf); - num = num >> 4; - } - mem[8] = '\0'; - debuglogs (4, "\tto a %s", mem); -} - -/* Convert hex digit A to a number. */ -static int -from_hex (int a) -{ - if (a == 0) - return 0; - - debuglogs (4, "from_hex got a 0x%x(%c)\n", a, a); - if (a >= '0' && a <= '9') - return a - '0'; - if (a >= 'a' && a <= 'f') - return a - 'a' + 10; - if (a >= 'A' && a <= 'F') - return a - 'A' + 10; - else - { - error ("Reply contains invalid hex digit 0x%x", a); - } -} - -/* Convert number NIB to a hex digit. */ -static int -tohex (int nib) -{ - if (nib < 10) - return '0' + nib; - else - return 'a' + nib - 10; -} - -/* - * _initialize_remote_monitors -- setup a few addtitional commands that - * are usually only used by monitors. - */ -void -_initialize_remote_monitors (void) -{ - /* generic monitor command */ - add_com ("monitor", class_obscure, monitor_command, - "Send a command to the debug monitor."); - -} - -/* - * _initialize_array -- do any special init stuff for the target. - */ -void -_initialize_array (void) -{ - init_array_ops (); - add_target (&array_ops); -} diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c index 643c6b6fe1b..94985fe5816 100644 --- a/gdb/remote-e7000.c +++ b/gdb/remote-e7000.c @@ -781,7 +781,7 @@ gbyte (void) return (high << 4) + low; } -void +static void fetch_regs_from_dump (int (*nextchar) (), char *want) { int regno; @@ -1873,7 +1873,7 @@ why_stop (void) /* Suck characters, if a string match, then return the strings index otherwise echo them. */ -int +static int expect_n (char **strings) { char *(ptr[10]); @@ -2165,6 +2165,8 @@ target e7000 foobar"; e7000_ops.to_magic = OPS_MAGIC; }; +extern initialize_file_ftype _initialize_remote_e7000; /* -Wmissing-prototypes */ + void _initialize_remote_e7000 (void) { diff --git a/gdb/remote-est.c b/gdb/remote-est.c index 93eddc9d123..a2c0f7ce2af 100644 --- a/gdb/remote-est.c +++ b/gdb/remote-est.c @@ -168,6 +168,8 @@ est_open (char *args, int from_tty) monitor_open (args, &est_cmds, from_tty); } +extern initialize_file_ftype _initialize_est; /* -Wmissing-prototypes */ + void _initialize_est (void) { diff --git a/gdb/remote-hms.c b/gdb/remote-hms.c index 438d6c6d6c7..cd7f4d39c49 100644 --- a/gdb/remote-hms.c +++ b/gdb/remote-hms.c @@ -140,6 +140,8 @@ hms_open (char *args, int from_tty) int write_dos_tick_delay; +extern initialize_file_ftype _initialize_remote_hms; /* -Wmissing-prototypes */ + void _initialize_remote_hms (void) { diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index e2908499fea..96f39728f54 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -536,7 +536,7 @@ fputs_readable (const char *string, struct ui_file *file) timed out. TIMEOUT specifies timeout value in seconds. */ -int +static int mips_expect_timeout (const char *string, int timeout) { const char *p = string; @@ -592,7 +592,7 @@ mips_expect_timeout (const char *string, int timeout) mips_expect_timeout if a different timeout value is needed. */ -int +static int mips_expect (const char *string) { return mips_expect_timeout (string, remote_timeout); @@ -600,7 +600,7 @@ mips_expect (const char *string) /* Read the required number of characters into the given buffer (which is assumed to be large enough). The only failure is a timeout. */ -int +static int mips_getstring (char *string, int n) { char *p = string; @@ -1721,7 +1721,7 @@ mips_resume (ptid_t ptid, int step, enum target_signal siggnal) /* Return the signal corresponding to SIG, where SIG is the number which the MIPS protocol uses for the signal. */ -enum target_signal +static enum target_signal mips_signal_from_protocol (int sig) { /* We allow a few more signals than the IDT board actually returns, on @@ -2437,7 +2437,7 @@ calculate_mask (CORE_ADDR addr, int len) /* Insert a hardware breakpoint. This works only on LSI targets, which implement ordinary breakpoints using hardware facilities. */ -int +static int remote_mips_insert_hw_breakpoint (CORE_ADDR addr, char *contents_cache) { if (strcmp (target_shortname, "lsi") == 0) @@ -2450,7 +2450,7 @@ remote_mips_insert_hw_breakpoint (CORE_ADDR addr, char *contents_cache) /* Remove a hardware breakpoint. This works only on LSI targets, which implement ordinary breakpoints using hardware facilities. */ -int +static int remote_mips_remove_hw_breakpoint (CORE_ADDR addr, char *contents_cache) { if (strcmp (target_shortname, "lsi") == 0) @@ -3477,6 +3477,8 @@ pmon_command (char *args, int from_tty) printf_filtered ("Received packet: %s\n", buf); } +extern initialize_file_ftype _initialize_remote_mips; /* -Wmissing-prototypes */ + void _initialize_remote_mips (void) { diff --git a/gdb/remote-rdi.c b/gdb/remote-rdi.c index a85fbb118b7..a868f3806c5 100644 --- a/gdb/remote-rdi.c +++ b/gdb/remote-rdi.c @@ -146,7 +146,7 @@ arm_rdi_start_remote (char *dummy) /* Helper callbacks for the "host interface" structure. RDI functions call these to forward output from the target system and so forth. */ -void +static void voiddummy (void *dummy) { fprintf_unfiltered (gdb_stdout, "void dummy\n"); @@ -1009,6 +1009,8 @@ rdilogenable_command (char *args, int from_tty) " try y or n\n", args); } +extern initialize_file_ftype _initialize_remote_rdi; /* -Wmissing-prototypes */ + void _initialize_remote_rdi (void) { @@ -1063,8 +1065,8 @@ _initialize_remote_rdi (void) /* A little dummy to make linking with the library succeed. */ -int -Fail (void) +void +Fail (const char *ignored, ...) { - return 0; + } diff --git a/gdb/remote-rdp.c b/gdb/remote-rdp.c index a9dba9ab401..6cbf73cbe8a 100644 --- a/gdb/remote-rdp.c +++ b/gdb/remote-rdp.c @@ -374,7 +374,7 @@ rdp_init (int cold, int tty) } -void +static void send_rdp (char *template,...) { char buf[200]; @@ -1403,6 +1403,8 @@ init_remote_rdp_ops (void) remote_rdp_ops.to_magic = OPS_MAGIC; } +extern initialize_file_ftype _initialize_remote_rdp; /* -Wmissing-prototypes */ + void _initialize_remote_rdp (void) { diff --git a/gdb/remote-vxsparc.c b/gdb/remote-vxsparc.c index a97c18eed99..8b554282194 100644 --- a/gdb/remote-vxsparc.c +++ b/gdb/remote-vxsparc.c @@ -101,8 +101,8 @@ vx_read_register (int regno) area in the frame. VxWorks does not do this for the active frame automatically; it greatly simplifies debugging. */ - sp = extract_address (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)], - REGISTER_RAW_SIZE (SP_REGNUM)); + sp = extract_unsigned_integer (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)], + REGISTER_RAW_SIZE (SP_REGNUM)); write_memory (sp, &deprecated_registers[REGISTER_BYTE (L0_REGNUM)], 16 * REGISTER_RAW_SIZE (L0_REGNUM)); @@ -176,8 +176,8 @@ vx_write_register (int regno) if (regno < 0 || (L0_REGNUM <= regno && regno <= I7_REGNUM)) { - sp = extract_address (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)], - REGISTER_RAW_SIZE (SP_REGNUM)); + sp = extract_unsigned_integer (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)], + REGISTER_RAW_SIZE (SP_REGNUM)); write_memory (sp, &deprecated_registers[REGISTER_BYTE (L0_REGNUM)], 16 * REGISTER_RAW_SIZE (L0_REGNUM)); } diff --git a/gdb/remote.c b/gdb/remote.c index a7249635a57..0555873834b 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -55,6 +55,8 @@ #include "gdbcore.h" /* for exec_bfd */ +#include "remote-fileio.h" + /* Prototypes for local functions */ static void cleanup_sigint_signal_handler (void *dummy); static void initialize_sigint_signal_handler (void); @@ -67,10 +69,6 @@ void async_remote_interrupt_twice (gdb_client_data); static void build_remote_gdbarch_data (void); -static int remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len); - -static int remote_read_bytes (CORE_ADDR memaddr, char *myaddr, int len); - static void remote_files_info (struct target_ops *ignore); static int remote_xfer_memory (CORE_ADDR memaddr, char *myaddr, @@ -128,7 +126,6 @@ static void remote_async_kill (void); static int tohex (int nib); static void remote_detach (char *args, int from_tty); -static void remote_async_detach (char *args, int from_tty); static void remote_interrupt (int signo); @@ -261,9 +258,10 @@ init_remote_state (struct gdbarch *gdbarch) int regnum; struct remote_state *rs = xmalloc (sizeof (struct remote_state)); - /* Start out by having the remote protocol mimic the existing - behavour - just copy in the description of the register cache. */ - rs->sizeof_g_packet = DEPRECATED_REGISTER_BYTES; /* OK */ + if (DEPRECATED_REGISTER_BYTES != 0) + rs->sizeof_g_packet = DEPRECATED_REGISTER_BYTES; + else + rs->sizeof_g_packet = 0; /* Assume a 1:1 regnum<->pnum table. */ rs->regs = xcalloc (NUM_REGS + NUM_PSEUDO_REGS, sizeof (struct packet_reg)); @@ -274,8 +272,11 @@ init_remote_state (struct gdbarch *gdbarch) r->regnum = regnum; r->offset = REGISTER_BYTE (regnum); r->in_g_packet = (regnum < NUM_REGS); - /* ...size = REGISTER_RAW_SIZE (regnum); */ /* ...name = REGISTER_NAME (regnum); */ + + /* Compute packet size by accumulating the size of all registers. */ + if (DEPRECATED_REGISTER_BYTES == 0) + rs->sizeof_g_packet += register_size (current_gdbarch, regnum); } /* Default maximum number of characters in a packet body. Many @@ -1985,8 +1986,10 @@ get_offsets (void) if (symfile_objfile == NULL) return; - offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS); - memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS); + offs = ((struct section_offsets *) + alloca (SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections))); + memcpy (offs, symfile_objfile->section_offsets, + SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections)); offs->offsets[SECT_OFF_TEXT (symfile_objfile)] = text_addr; @@ -2097,8 +2100,10 @@ remote_cisco_objfile_relocate (bfd_signed_vma text_off, bfd_signed_vma data_off, broken for xcoff, dwarf, sdb-coff, etc. But there is no simple canonical representation for this stuff. */ - offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS); - memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS); + offs = (struct section_offsets *) + alloca (SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections)); + memcpy (offs, symfile_objfile->section_offsets, + SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections)); offs->offsets[SECT_OFF_TEXT (symfile_objfile)] = text_off; offs->offsets[SECT_OFF_DATA (symfile_objfile)] = data_off; @@ -2418,15 +2423,19 @@ remote_detach (char *args, int from_tty) strcpy (buf, "D"); remote_send (buf, (rs->remote_packet_size)); + /* Unregister the file descriptor from the event loop. */ + if (target_is_async_p ()) + serial_async (remote_desc, NULL, 0); + target_mourn_inferior (); if (from_tty) puts_filtered ("Ending remote debugging.\n"); - } -/* Same as remote_detach, but with async support. */ +/* Same as remote_detach, but don't send the "D" packet; just disconnect. */ + static void -remote_async_detach (char *args, int from_tty) +remote_disconnect (char *args, int from_tty) { struct remote_state *rs = get_remote_state (); char *buf = alloca (rs->remote_packet_size); @@ -2434,10 +2443,6 @@ remote_async_detach (char *args, int from_tty) if (args) error ("Argument given to \"detach\" when remotely debugging."); - /* Tell the remote target to detach. */ - strcpy (buf, "D"); - remote_send (buf, (rs->remote_packet_size)); - /* Unregister the file descriptor from the event loop. */ if (target_is_async_p ()) serial_async (remote_desc, NULL, 0); @@ -2948,6 +2953,9 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status) case 'E': /* Error of some sort */ warning ("Remote failure reply: %s", buf); continue; + case 'F': /* File-I/O request */ + remote_fileio_request (buf); + continue; case 'T': /* Status with PC, SP, FP, ... */ { int i; @@ -3199,6 +3207,9 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status) case 'E': /* Error of some sort */ warning ("Remote failure reply: %s", buf); continue; + case 'F': /* File-I/O request */ + remote_fileio_request (buf); + continue; case 'T': /* Status with PC, SP, FP, ... */ { int i; @@ -3523,16 +3534,19 @@ remote_fetch_registers (int regnum) static void remote_prepare_to_store (void) { + struct remote_state *rs = get_remote_state (); + int i; + char buf[MAX_REGISTER_SIZE]; + /* Make sure the entire registers array is valid. */ switch (remote_protocol_P.support) { case PACKET_DISABLE: case PACKET_SUPPORT_UNKNOWN: - /* NOTE: This isn't rs->sizeof_g_packet because here, we are - forcing the register cache to read its and not the target - registers. */ - deprecated_read_register_bytes (0, (char *) NULL, - DEPRECATED_REGISTER_BYTES); /* OK */ + /* Make sure all the necessary registers are cached. */ + for (i = 0; i < NUM_REGS; i++) + if (rs->regs[i].in_g_packet) + regcache_raw_read (current_regcache, rs->regs[i].regnum, buf); break; case PACKET_ENABLE: break; @@ -3753,7 +3767,7 @@ check_binary_download (CORE_ADDR addr) Returns number of bytes transferred, or 0 (setting errno) for error. Only transfer a single packet. */ -static int +int remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len) { unsigned char *buf; @@ -3897,7 +3911,7 @@ remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len) caller and its callers caller ;-) already contains code for handling partial reads. */ -static int +int remote_read_bytes (CORE_ADDR memaddr, char *myaddr, int len) { char *buf; @@ -4628,33 +4642,33 @@ extended_remote_async_create_inferior (char *exec_file, char *args, char **env) /* On some machines, e.g. 68k, we may use a different breakpoint - instruction than other targets; in those use REMOTE_BREAKPOINT - instead of just BREAKPOINT_FROM_PC. Also, bi-endian targets may - define LITTLE_REMOTE_BREAKPOINT and BIG_REMOTE_BREAKPOINT. If none - of these are defined, we just call the standard routines that are - in mem-break.c. */ - -/* FIXME, these ought to be done in a more dynamic fashion. For instance, - the choice of breakpoint instruction affects target program design and - vice versa, and by making it user-tweakable, the special code here - goes away and we need fewer special GDB configurations. */ - -#if defined (LITTLE_REMOTE_BREAKPOINT) && defined (BIG_REMOTE_BREAKPOINT) && !defined(REMOTE_BREAKPOINT) -#define REMOTE_BREAKPOINT + instruction than other targets; in those use + DEPRECATED_REMOTE_BREAKPOINT instead of just BREAKPOINT_FROM_PC. + Also, bi-endian targets may define + DEPRECATED_LITTLE_REMOTE_BREAKPOINT and + DEPRECATED_BIG_REMOTE_BREAKPOINT. If none of these are defined, we + just call the standard routines that are in mem-break.c. */ + +/* NOTE: cagney/2003-06-08: This is silly. A remote and simulator + target should use an identical BREAKPOINT_FROM_PC. As for native, + the ARCH-OS-tdep.c code can override the default. */ + +#if defined (DEPRECATED_LITTLE_REMOTE_BREAKPOINT) && defined (DEPRECATED_BIG_REMOTE_BREAKPOINT) && !defined(DEPRECATED_REMOTE_BREAKPOINT) +#define DEPRECATED_REMOTE_BREAKPOINT #endif -#ifdef REMOTE_BREAKPOINT +#ifdef DEPRECATED_REMOTE_BREAKPOINT /* If the target isn't bi-endian, just pretend it is. */ -#if !defined (LITTLE_REMOTE_BREAKPOINT) && !defined (BIG_REMOTE_BREAKPOINT) -#define LITTLE_REMOTE_BREAKPOINT REMOTE_BREAKPOINT -#define BIG_REMOTE_BREAKPOINT REMOTE_BREAKPOINT +#if !defined (DEPRECATED_LITTLE_REMOTE_BREAKPOINT) && !defined (DEPRECATED_BIG_REMOTE_BREAKPOINT) +#define DEPRECATED_LITTLE_REMOTE_BREAKPOINT DEPRECATED_REMOTE_BREAKPOINT +#define DEPRECATED_BIG_REMOTE_BREAKPOINT DEPRECATED_REMOTE_BREAKPOINT #endif -static unsigned char big_break_insn[] = BIG_REMOTE_BREAKPOINT; -static unsigned char little_break_insn[] = LITTLE_REMOTE_BREAKPOINT; +static unsigned char big_break_insn[] = DEPRECATED_BIG_REMOTE_BREAKPOINT; +static unsigned char little_break_insn[] = DEPRECATED_LITTLE_REMOTE_BREAKPOINT; -#endif /* REMOTE_BREAKPOINT */ +#endif /* DEPRECATED_REMOTE_BREAKPOINT */ /* Insert a breakpoint on targets that don't have any better breakpoint support. We read the contents of the target location @@ -4668,7 +4682,7 @@ static int remote_insert_breakpoint (CORE_ADDR addr, char *contents_cache) { struct remote_state *rs = get_remote_state (); -#ifdef REMOTE_BREAKPOINT +#ifdef DEPRECATED_REMOTE_BREAKPOINT int val; #endif int bp_size; @@ -4705,7 +4719,7 @@ remote_insert_breakpoint (CORE_ADDR addr, char *contents_cache) } } -#ifdef REMOTE_BREAKPOINT +#ifdef DEPRECATED_REMOTE_BREAKPOINT val = target_read_memory (addr, contents_cache, sizeof big_break_insn); if (val == 0) @@ -4721,7 +4735,7 @@ remote_insert_breakpoint (CORE_ADDR addr, char *contents_cache) return val; #else return memory_insert_breakpoint (addr, contents_cache); -#endif /* REMOTE_BREAKPOINT */ +#endif /* DEPRECATED_REMOTE_BREAKPOINT */ } static int @@ -4750,11 +4764,11 @@ remote_remove_breakpoint (CORE_ADDR addr, char *contents_cache) return (buf[0] == 'E'); } -#ifdef REMOTE_BREAKPOINT +#ifdef DEPRECATED_REMOTE_BREAKPOINT return target_write_memory (addr, contents_cache, sizeof big_break_insn); #else return memory_remove_breakpoint (addr, contents_cache); -#endif /* REMOTE_BREAKPOINT */ +#endif /* DEPRECATED_REMOTE_BREAKPOINT */ } static int @@ -4849,7 +4863,7 @@ remote_remove_watchpoint (CORE_ADDR addr, int len, int type) int remote_hw_watchpoint_limit = -1; int remote_hw_breakpoint_limit = -1; -int +static int remote_check_watch_resources (int type, int cnt, int ot) { if (type == bp_hardware_breakpoint) @@ -4875,13 +4889,13 @@ remote_check_watch_resources (int type, int cnt, int ot) return -1; } -int +static int remote_stopped_by_watchpoint (void) { return remote_stopped_by_watchpoint_p; } -CORE_ADDR +static CORE_ADDR remote_stopped_data_address (void) { if (remote_stopped_by_watchpoint ()) @@ -5426,6 +5440,7 @@ Specify the serial device it is connected to\n\ remote_ops.to_open = remote_open; remote_ops.to_close = remote_close; remote_ops.to_detach = remote_detach; + remote_ops.to_disconnect = remote_disconnect; remote_ops.to_resume = remote_resume; remote_ops.to_wait = remote_wait; remote_ops.to_fetch_registers = remote_fetch_registers; @@ -5846,6 +5861,7 @@ Specify the serial device it is connected to (e.g. host:2020)."; remote_cisco_ops.to_open = remote_cisco_open; remote_cisco_ops.to_close = remote_cisco_close; remote_cisco_ops.to_detach = remote_detach; + remote_cisco_ops.to_disconnect = remote_disconnect; remote_cisco_ops.to_resume = remote_resume; remote_cisco_ops.to_wait = remote_cisco_wait; remote_cisco_ops.to_fetch_registers = remote_fetch_registers; @@ -5941,7 +5957,8 @@ init_remote_async_ops (void) Specify the serial device it is connected to (e.g. /dev/ttya)."; remote_async_ops.to_open = remote_async_open; remote_async_ops.to_close = remote_close; - remote_async_ops.to_detach = remote_async_detach; + remote_async_ops.to_detach = remote_detach; + remote_async_ops.to_disconnect = remote_disconnect; remote_async_ops.to_resume = remote_async_resume; remote_async_ops.to_wait = remote_async_wait; remote_async_ops.to_fetch_registers = remote_fetch_registers; @@ -6271,4 +6288,7 @@ Set use of remote protocol `Z' packets", set_remote_protocol_Z_packet_cmd, show_remote_protocol_Z_packet_cmd, &remote_set_cmdlist, &remote_show_cmdlist); + + /* Eventually initialize fileio. See fileio.c */ + initialize_remote_fileio (remote_set_cmdlist, remote_show_cmdlist); } diff --git a/gdb/remote.h b/gdb/remote.h index 4477148f9c8..7c0df32ad6f 100644 --- a/gdb/remote.h +++ b/gdb/remote.h @@ -54,6 +54,10 @@ extern void remote_cisco_objfile_relocate (bfd_signed_vma text_off, extern void async_remote_interrupt_twice (void *arg); +extern int remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len); + +extern int remote_read_bytes (CORE_ADDR memaddr, char *myaddr, int len); + extern void (*target_resume_hook) (void); extern void (*target_wait_loop_hook) (void); diff --git a/gdb/rom68k-rom.c b/gdb/rom68k-rom.c index 6b0926bf408..af5e02365ed 100644 --- a/gdb/rom68k-rom.c +++ b/gdb/rom68k-rom.c @@ -246,6 +246,8 @@ rom68k_open (char *args, int from_tty) monitor_open (args, &rom68k_cmds, from_tty); } +extern initialize_file_ftype _initialize_rom68k; /* -Wmissing-prototypes */ + void _initialize_rom68k (void) { diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index c5a0ea73d8f..e825529ba95 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -485,7 +485,8 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, /* Fetch trailing memory needed for alignment. */ if (addr + count * sizeof (int) > memaddr + len) - if (!read_word (addr, buf + count - 1, arch64)) + if (!read_word (addr + (count - 1) * sizeof (int), + buf + count - 1, arch64)) return 0; /* Copy supplied data into memory buffer. */ diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 977669753d1..9f3e9ea66b3 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -230,6 +230,16 @@ rs6000_saved_pc_after_call (struct frame_info *fi) return read_register (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum); } +/* Get the ith function argument for the current function. */ +static CORE_ADDR +rs6000_fetch_pointer_argument (struct frame_info *frame, int argi, + struct type *type) +{ + CORE_ADDR addr; + frame_read_register (frame, 3 + argi, &addr); + return addr; +} + /* Calculate the destination of a branch/jump. Return -1 if not a branch. */ static CORE_ADDR @@ -526,13 +536,13 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) if ((op & 0xfc1fffff) == 0x7c0802a6) { /* mflr Rx */ - lr_reg = (op & 0x03e00000) | 0x90010000; + lr_reg = (op & 0x03e00000); continue; } else if ((op & 0xfc1fffff) == 0x7c000026) { /* mfcr Rx */ - cr_reg = (op & 0x03e00000) | 0x90010000; + cr_reg = (op & 0x03e00000); continue; } @@ -558,7 +568,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) { fdata->saved_gpr = reg; if ((op & 0xfc1f0003) == 0xf8010000) - op = (op >> 1) << 1; + op &= ~3UL; fdata->gpr_offset = SIGNED_SHORT (op) + offset; } continue; @@ -590,20 +600,42 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) continue; } - else if (lr_reg != -1 && (op & 0xffff0000) == lr_reg) - { /* st Rx,NUM(r1) - where Rx == lr */ - fdata->lr_offset = SIGNED_SHORT (op) + offset; + else if (lr_reg != -1 && + /* std Rx, NUM(r1) || stdu Rx, NUM(r1) */ + (((op & 0xffff0000) == (lr_reg | 0xf8010000)) || + /* stw Rx, NUM(r1) */ + ((op & 0xffff0000) == (lr_reg | 0x90010000)) || + /* stwu Rx, NUM(r1) */ + ((op & 0xffff0000) == (lr_reg | 0x94010000)))) + { /* where Rx == lr */ + fdata->lr_offset = offset; fdata->nosavedpc = 0; lr_reg = 0; + if ((op & 0xfc000003) == 0xf8000000 || /* std */ + (op & 0xfc000000) == 0x90000000) /* stw */ + { + /* Does not update r1, so add displacement to lr_offset. */ + fdata->lr_offset += SIGNED_SHORT (op); + } continue; } - else if (cr_reg != -1 && (op & 0xffff0000) == cr_reg) - { /* st Rx,NUM(r1) - where Rx == cr */ - fdata->cr_offset = SIGNED_SHORT (op) + offset; + else if (cr_reg != -1 && + /* std Rx, NUM(r1) || stdu Rx, NUM(r1) */ + (((op & 0xffff0000) == (cr_reg | 0xf8010000)) || + /* stw Rx, NUM(r1) */ + ((op & 0xffff0000) == (cr_reg | 0x90010000)) || + /* stwu Rx, NUM(r1) */ + ((op & 0xffff0000) == (cr_reg | 0x94010000)))) + { /* where Rx == cr */ + fdata->cr_offset = offset; cr_reg = 0; + if ((op & 0xfc000003) == 0xf8000000 || + (op & 0xfc000000) == 0x90000000) + { + /* Does not update r1, so add displacement to cr_offset. */ + fdata->cr_offset += SIGNED_SHORT (op); + } continue; } @@ -647,30 +679,41 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) this branch */ continue; - /* update stack pointer */ } - else if ((op & 0xffff0000) == 0x94210000 || /* stu r1,NUM(r1) */ - (op & 0xffff0003) == 0xf8210001) /* stdu r1,NUM(r1) */ - { + /* update stack pointer */ + else if ((op & 0xfc1f0000) == 0x94010000) + { /* stu rX,NUM(r1) || stwu rX,NUM(r1) */ fdata->frameless = 0; - if ((op & 0xffff0003) == 0xf8210001) - op = (op >> 1) << 1; fdata->offset = SIGNED_SHORT (op); offset = fdata->offset; continue; - } - else if (op == 0x7c21016e) - { /* stwux 1,1,0 */ + else if ((op & 0xfc1f016a) == 0x7c01016e) + { /* stwux rX,r1,rY */ + /* no way to figure out what r1 is going to be */ fdata->frameless = 0; offset = fdata->offset; continue; - - /* Load up minimal toc pointer */ } - else if ((op >> 22) == 0x20f + else if ((op & 0xfc1f0003) == 0xf8010001) + { /* stdu rX,NUM(r1) */ + fdata->frameless = 0; + fdata->offset = SIGNED_SHORT (op & ~3UL); + offset = fdata->offset; + continue; + } + else if ((op & 0xfc1f016a) == 0x7c01016a) + { /* stdux rX,r1,rY */ + /* no way to figure out what r1 is going to be */ + fdata->frameless = 0; + offset = fdata->offset; + continue; + } + /* Load up minimal toc pointer */ + else if (((op >> 22) == 0x20f || /* l r31,... or l r30,... */ + (op >> 22) == 0x3af) /* ld r31,... or ld r30,... */ && !minimal_toc_loaded) - { /* l r31,... or l r30,... */ + { minimal_toc_loaded = 1; continue; @@ -1851,6 +1894,10 @@ rs6000_register_virtual_type (int n) int size = regsize (reg, tdep->wordsize); switch (size) { + case 0: + return builtin_type_int0; + case 4: + return builtin_type_int32; case 8: if (tdep->ppc_ev0_regnum <= n && n <= tdep->ppc_ev31_regnum) return builtin_type_vec64; @@ -1861,8 +1908,8 @@ rs6000_register_virtual_type (int n) return builtin_type_vec128; break; default: - return builtin_type_int32; - break; + internal_error (__FILE__, __LINE__, "Register %d size %d unknown", + n, size); } } } @@ -1901,7 +1948,7 @@ rs6000_register_convert_to_virtual (int n, struct type *type, static void rs6000_register_convert_to_raw (struct type *type, int n, - char *from, char *to) + const char *from, char *to) { if (TYPE_LENGTH (type) != REGISTER_RAW_SIZE (n)) { @@ -2121,7 +2168,7 @@ rs6000_create_inferior (int pid) /* Return real function address if ADDR (a function pointer) is in the data space and is therefore a special function pointer. */ -CORE_ADDR +static CORE_ADDR rs6000_convert_from_func_ptr_addr (CORE_ADDR addr) { struct obj_section *s; @@ -2867,22 +2914,20 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) else set_gdbarch_print_insn (gdbarch, gdb_print_insn_powerpc); - set_gdbarch_read_pc (gdbarch, generic_target_read_pc); set_gdbarch_write_pc (gdbarch, generic_target_write_pc); - set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); set_gdbarch_num_regs (gdbarch, v->nregs); set_gdbarch_num_pseudo_regs (gdbarch, v->npregs); set_gdbarch_register_name (gdbarch, rs6000_register_name); set_gdbarch_deprecated_register_size (gdbarch, wordsize); set_gdbarch_deprecated_register_bytes (gdbarch, off); - set_gdbarch_register_byte (gdbarch, rs6000_register_byte); - set_gdbarch_register_raw_size (gdbarch, rs6000_register_raw_size); + set_gdbarch_deprecated_register_byte (gdbarch, rs6000_register_byte); + set_gdbarch_deprecated_register_raw_size (gdbarch, rs6000_register_raw_size); set_gdbarch_deprecated_max_register_raw_size (gdbarch, 16); - set_gdbarch_register_virtual_size (gdbarch, generic_register_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, generic_register_size); set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 16); - set_gdbarch_register_virtual_type (gdbarch, rs6000_register_virtual_type); + set_gdbarch_deprecated_register_virtual_type (gdbarch, rs6000_register_virtual_type); set_gdbarch_ptr_bit (gdbarch, wordsize * TARGET_CHAR_BIT); set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT); @@ -2899,13 +2944,13 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_fix_call_dummy (gdbarch, rs6000_fix_call_dummy); set_gdbarch_frame_align (gdbarch, rs6000_frame_align); - set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); + set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); set_gdbarch_deprecated_push_return_address (gdbarch, ppc_push_return_address); set_gdbarch_believe_pcc_promotion (gdbarch, 1); - set_gdbarch_register_convertible (gdbarch, rs6000_register_convertible); - set_gdbarch_register_convert_to_virtual (gdbarch, rs6000_register_convert_to_virtual); - set_gdbarch_register_convert_to_raw (gdbarch, rs6000_register_convert_to_raw); + set_gdbarch_deprecated_register_convertible (gdbarch, rs6000_register_convertible); + set_gdbarch_deprecated_register_convert_to_virtual (gdbarch, rs6000_register_convert_to_virtual); + set_gdbarch_deprecated_register_convert_to_raw (gdbarch, rs6000_register_convert_to_raw); set_gdbarch_stab_reg_to_regnum (gdbarch, rs6000_stab_reg_to_regnum); /* Note: kevinb/2002-04-12: I'm not convinced that rs6000_push_arguments() is correct for the SysV ABI when the wordsize is 8, but I'm also @@ -2954,13 +2999,12 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_convert_from_func_ptr_addr (gdbarch, rs6000_convert_from_func_ptr_addr); } - set_gdbarch_frame_args_address (gdbarch, rs6000_frame_args_address); - set_gdbarch_frame_locals_address (gdbarch, rs6000_frame_args_address); + set_gdbarch_deprecated_frame_args_address (gdbarch, rs6000_frame_args_address); + set_gdbarch_deprecated_frame_locals_address (gdbarch, rs6000_frame_args_address); set_gdbarch_deprecated_saved_pc_after_call (gdbarch, rs6000_saved_pc_after_call); - /* We can't tell how many args there are - now that the C compiler delays popping them. */ - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); + /* Helpers for function argument information. */ + set_gdbarch_fetch_pointer_argument (gdbarch, rs6000_fetch_pointer_argument); /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); @@ -2989,6 +3033,8 @@ rs6000_info_powerpc_command (char *args, int from_tty) /* Initialization code. */ +extern initialize_file_ftype _initialize_rs6000_tdep; /* -Wmissing-prototypes */ + void _initialize_rs6000_tdep (void) { diff --git a/gdb/s390-nat.c b/gdb/s390-nat.c index 63e779bc19e..732cf94451a 100644 --- a/gdb/s390-nat.c +++ b/gdb/s390-nat.c @@ -60,20 +60,14 @@ s390_register_u_addr (int blockend, int regnum) retval = PT_CR_9 + ((regnum - (S390_FIRST_CR + 9)) * S390_CR_SIZE); else { -#ifdef GDBSERVER - error ("s390_register_u_addr invalid regnum %s %d regnum=%d", - __FILE__, (int) __LINE__, regnum); -#else internal_error (__FILE__, __LINE__, "s390_register_u_addr invalid regnum regnum=%d", regnum); -#endif retval = 0; } return retval + blockend; } -#ifndef GDBSERVER /* watch_areas are required if you put 2 or more watchpoints on the same address or overlapping areas gdb will call us to delete the watchpoint more than once when we try to delete them. @@ -251,9 +245,26 @@ supply_gregset (gregset_t * gregsetp) for (regi = 0; regi < S390_NUM_GPRS; regi++) supply_register (S390_GP0_REGNUM + regi, (char *) &gregp[S390_GP0_REGNUM + regi]); + +#if defined (CONFIG_ARCH_S390X) + /* On the s390x, each element of gregset_t is 8 bytes long, but + each access register is still only 32 bits long. So they're + packed two per element. It's apparently traditional that + gregset_t must be an array, so when the registers it provides + have different sizes, something has to get strange + somewhere. */ + { + unsigned int *acrs = (unsigned int *) &gregp[S390_FIRST_ACR]; + + for (regi = 0; regi < S390_NUM_ACRS; regi++) + supply_register (S390_FIRST_ACR + regi, (char *) &acrs[regi]); + } +#else for (regi = 0; regi < S390_NUM_ACRS; regi++) supply_register (S390_FIRST_ACR + regi, - (char *) &gregp[S390_FIRST_ACR + regi]); + (char *) &gregp[S390_FIRST_ACR + regi]); +#endif + /* unfortunately this isn't in gregsetp */ for (regi = 0; regi < S390_NUM_CRS; regi++) supply_register (S390_FIRST_CR + regi, NULL); @@ -284,12 +295,35 @@ fill_gregset (gregset_t * gregsetp, int regno) for (regi = 0; regi < S390_NUM_GPRS; regi++) regcache_collect (S390_GP0_REGNUM + regi, &gregp[S390_GP0_REGNUM + regi]); +#if defined (CONFIG_ARCH_S390X) + /* See the comments about the access registers in + supply_gregset, above. */ + { + unsigned int *acrs = (unsigned int *) &gregp[S390_FIRST_ACR]; + + for (regi = 0; regi < S390_NUM_ACRS; regi++) + regcache_collect (S390_FIRST_ACR + regi, &acrs[regi]); + } +#else for (regi = 0; regi < S390_NUM_ACRS; regi++) regcache_collect (S390_FIRST_ACR + regi, &gregp[S390_FIRST_ACR + regi]); +#endif } - else if (regno >= S390_PSWM_REGNUM && regno <= S390_LAST_ACR) + else if (regno >= S390_PSWM_REGNUM && regno < S390_FIRST_ACR) regcache_collect (regno, &gregp[regno]); + else if (regno >= S390_FIRST_ACR && regno <= S390_LAST_ACR) + { +#if defined (CONFIG_ARCH_S390X) + /* See the comments about the access registers in + supply_gregset, above. */ + unsigned int *acrs = (unsigned int *) &gregp[S390_FIRST_ACR]; + + regcache_collect (regno, &acrs[regno - S390_FIRST_ACR]); +#else + regcache_collect (regno, &gregp[regno]); +#endif + } } /* Given a pointer to a floating point register set in /proc format @@ -322,4 +356,3 @@ fill_fpregset (fpregset_t * fpregsetp, int regno) #error "libc files are inconsistent with linux/include/asm-s390/" #error "3) you didn't do a completely clean build & delete config.cache." #endif -#endif /* GDBSERVER */ diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index c7dce06a17b..87ddef0de16 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -45,7 +45,7 @@ /* Number of bytes of storage in the actual machine representation for register N. */ -int +static int s390_register_raw_size (int reg_nr) { if (S390_FP0_REGNUM <= reg_nr @@ -55,21 +55,21 @@ s390_register_raw_size (int reg_nr) return 4; } -int +static int s390x_register_raw_size (int reg_nr) { return (reg_nr == S390_FPC_REGNUM) || (reg_nr >= S390_FIRST_ACR && reg_nr <= S390_LAST_ACR) ? 4 : 8; } -int +static int s390_cannot_fetch_register (int regno) { return (regno >= S390_FIRST_CR && regno < (S390_FIRST_CR + 9)) || (regno >= (S390_FIRST_CR + 12) && regno <= S390_LAST_CR); } -int +static int s390_register_byte (int reg_nr) { if (reg_nr <= S390_GP_LAST_REGNUM) @@ -84,7 +84,6 @@ s390_register_byte (int reg_nr) return S390_FP0_OFFSET + (((reg_nr) - S390_FP0_REGNUM) * S390_FPR_SIZE); } -#ifndef GDBSERVER #define S390_MAX_INSTR_SIZE (6) #define S390_SYSCALL_OPCODE (0x0a) #define S390_SYSCALL_SIZE (2) @@ -119,7 +118,7 @@ struct frame_extra_info static CORE_ADDR s390_frame_saved_pc_nofix (struct frame_info *fi); -int +static int s390_readinstruction (bfd_byte instr[], CORE_ADDR at, struct disassemble_info *info) { @@ -150,7 +149,7 @@ s390_memset_extra_info (struct frame_extra_info *fextra_info) -const char * +static const char * s390_register_name (int reg_nr) { static char *register_names[] = { @@ -175,7 +174,7 @@ s390_register_name (int reg_nr) -int +static int s390_stab_reg_to_regnum (int regno) { return regno >= 64 ? S390_PSWM_REGNUM - 64 : @@ -210,7 +209,7 @@ is_arg_reg (int regidx) */ -int +static int s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info, struct frame_info *fi, int init_extra_info) { @@ -675,7 +674,7 @@ s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info, } -int +static int s390_check_function_end (CORE_ADDR pc) { bfd_byte instr[S390_MAX_INSTR_SIZE]; @@ -767,7 +766,7 @@ s390_sniff_pc_function_start (CORE_ADDR pc, struct frame_info *fi) -CORE_ADDR +static CORE_ADDR s390_function_start (struct frame_info *fi) { CORE_ADDR function_start = 0; @@ -782,7 +781,7 @@ s390_function_start (struct frame_info *fi) -int +static int s390_frameless_function_invocation (struct frame_info *fi) { struct frame_extra_info fextra_info, *fextra_info_ptr; @@ -881,7 +880,7 @@ s390_is_sigreturn (CORE_ADDR pc, struct frame_info *sighandler_fi, for the moment. For some reason the blockframe.c calls us with fi->next->fromleaf so this seems of little use to us. */ -CORE_ADDR +static CORE_ADDR s390_init_frame_pc_first (int next_fromleaf, struct frame_info *fi) { CORE_ADDR sigcaller_pc; @@ -901,7 +900,7 @@ s390_init_frame_pc_first (int next_fromleaf, struct frame_info *fi) return pc; } -void +static void s390_init_extra_frame_info (int fromleaf, struct frame_info *fi) { frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); @@ -916,7 +915,7 @@ s390_init_extra_frame_info (int fromleaf, struct frame_info *fi) &FEXTRA_INFOP contains struct frame_extra_info; TDATAP can be NULL, in which case the framedata are read. */ -void +static void s390_frame_init_saved_regs (struct frame_info *fi) { @@ -941,15 +940,6 @@ s390_frame_init_saved_regs (struct frame_info *fi) -CORE_ADDR -s390_frame_args_address (struct frame_info *fi) -{ - - /* Apparently gdb already knows gdb_args_offset itself */ - return get_frame_base (fi); -} - - static CORE_ADDR s390_frame_saved_pc_nofix (struct frame_info *fi) { @@ -979,7 +969,7 @@ s390_frame_saved_pc_nofix (struct frame_info *fi) return 0; } -CORE_ADDR +static CORE_ADDR s390_frame_saved_pc (struct frame_info *fi) { CORE_ADDR saved_pc = 0, sig_pc; @@ -1008,7 +998,7 @@ s390_frame_saved_pc (struct frame_info *fi) /* We want backtraces out of signal handlers so we don't set (get_frame_type (thisframe) == SIGTRAMP_FRAME) to 1 */ -CORE_ADDR +static CORE_ADDR s390_frame_chain (struct frame_info *thisframe) { CORE_ADDR prev_fp = 0; @@ -1088,7 +1078,7 @@ s390_frame_chain (struct frame_info *thisframe) /* a given return value in `regbuf' with a type `valtype', extract and copy its value into `valbuf' */ -void +static void s390_extract_return_value (struct type *valtype, char *regbuf, char *valbuf) { /* floats and doubles are returned in fpr0. fpr's have a size of 8 bytes. @@ -1146,7 +1136,7 @@ s390_promote_integer_argument (struct type *valtype, char *valbuf, return (value); } -void +static void s390_store_return_value (struct type *valtype, char *valbuf) { int arglen; @@ -1194,7 +1184,7 @@ gdb_print_insn_s390 (bfd_vma memaddr, disassemble_info * info) /* Not the most efficent code in the world */ -int +static int s390_fp_regnum (void) { int regno = S390_SP_REGNUM; @@ -1209,7 +1199,7 @@ s390_fp_regnum (void) return regno; } -CORE_ADDR +static CORE_ADDR s390_read_fp (void) { return read_register (s390_fp_regnum ()); @@ -1251,7 +1241,7 @@ s390_pop_frame_regular (struct frame_info *frame) machine state that was in effect before the frame was created. Used in the contexts of the "return" command, and of target function calls from the debugger. */ -void +static void s390_pop_frame (void) { /* This function checks for and handles generic dummy frames, and @@ -1501,7 +1491,7 @@ alignment_of (struct type *type) Our caller has taken care of any type promotions needed to satisfy prototypes or the old K&R argument-passing rules. */ -CORE_ADDR +static CORE_ADDR s390_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { @@ -1685,7 +1675,7 @@ s390_use_struct_convention (int gcc_p, struct type *value_type) /* Return the GDB type object for the "standard" data type of data in register N. */ -struct type * +static struct type * s390_register_virtual_type (int regno) { if (S390_FP0_REGNUM <= regno && regno < S390_FP0_REGNUM + S390_NUM_FPRS) @@ -1695,7 +1685,7 @@ s390_register_virtual_type (int regno) } -struct type * +static struct type * s390x_register_virtual_type (int regno) { return (regno == S390_FPC_REGNUM) || @@ -1705,7 +1695,7 @@ s390x_register_virtual_type (int regno) -void +static void s390_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) { write_register (S390_GP0_REGNUM + 2, addr); @@ -1713,7 +1703,7 @@ s390_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) -const static unsigned char * +static const unsigned char * s390_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) { static unsigned char breakpoint[] = { 0x0, 0x1 }; @@ -1724,7 +1714,7 @@ s390_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) /* Advance PC across any function entry prologue instructions to reach some "real" code. */ -CORE_ADDR +static CORE_ADDR s390_skip_prologue (CORE_ADDR pc) { struct frame_extra_info fextra_info; @@ -1737,7 +1727,7 @@ s390_skip_prologue (CORE_ADDR pc) Can't go through the frames for this because on some machines the new frame is not set up until the new function executes some instructions. */ -CORE_ADDR +static CORE_ADDR s390_saved_pc_after_call (struct frame_info *frame) { return ADDR_BITS_REMOVE (read_register (S390_RETADDR_REGNUM)); @@ -1775,7 +1765,7 @@ s390_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags) return NULL; } -int +static int s390_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr) { @@ -1788,7 +1778,7 @@ s390_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name return 0; } -struct gdbarch * +static struct gdbarch * s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { static LONGEST s390_call_dummy_words[] = { 0 }; @@ -1816,12 +1806,8 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_char_signed (gdbarch, 0); set_gdbarch_frame_args_skip (gdbarch, 0); - set_gdbarch_frame_args_address (gdbarch, s390_frame_args_address); set_gdbarch_deprecated_frame_chain (gdbarch, s390_frame_chain); 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); set_gdbarch_deprecated_store_struct_return (gdbarch, s390_store_struct_return); set_gdbarch_deprecated_extract_return_value (gdbarch, s390_extract_return_value); set_gdbarch_deprecated_store_return_value (gdbarch, s390_store_return_value); @@ -1853,7 +1839,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) produces the frame's chain-pointer. */ set_gdbarch_deprecated_frame_chain (gdbarch, s390_frame_chain); set_gdbarch_deprecated_saved_pc_after_call (gdbarch, s390_saved_pc_after_call); - set_gdbarch_register_byte (gdbarch, s390_register_byte); + set_gdbarch_deprecated_register_byte (gdbarch, s390_register_byte); set_gdbarch_pc_regnum (gdbarch, S390_PC_REGNUM); set_gdbarch_sp_regnum (gdbarch, S390_SP_REGNUM); set_gdbarch_deprecated_fp_regnum (gdbarch, S390_FP_REGNUM); @@ -1873,7 +1859,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_frame_align (gdbarch, s390_frame_align); set_gdbarch_deprecated_push_arguments (gdbarch, s390_push_arguments); - set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); + set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); set_gdbarch_deprecated_push_return_address (gdbarch, s390_push_return_address); set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (s390_call_dummy_words)); @@ -1883,19 +1869,18 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { case bfd_mach_s390_31: set_gdbarch_deprecated_register_size (gdbarch, 4); - set_gdbarch_register_raw_size (gdbarch, s390_register_raw_size); - set_gdbarch_register_virtual_size (gdbarch, s390_register_raw_size); - set_gdbarch_register_virtual_type (gdbarch, s390_register_virtual_type); + set_gdbarch_deprecated_register_raw_size (gdbarch, s390_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, s390_register_raw_size); + set_gdbarch_deprecated_register_virtual_type (gdbarch, s390_register_virtual_type); set_gdbarch_addr_bits_remove (gdbarch, s390_addr_bits_remove); set_gdbarch_deprecated_register_bytes (gdbarch, S390_REGISTER_BYTES); break; case bfd_mach_s390_64: set_gdbarch_deprecated_register_size (gdbarch, 8); - set_gdbarch_register_raw_size (gdbarch, s390x_register_raw_size); - set_gdbarch_register_virtual_size (gdbarch, s390x_register_raw_size); - set_gdbarch_register_virtual_type (gdbarch, - s390x_register_virtual_type); + set_gdbarch_deprecated_register_raw_size (gdbarch, s390x_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, s390x_register_raw_size); + set_gdbarch_deprecated_register_virtual_type (gdbarch, s390x_register_virtual_type); set_gdbarch_long_bit (gdbarch, 64); set_gdbarch_long_long_bit (gdbarch, 64); @@ -1911,13 +1896,15 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } /* Should be using push_dummy_call. */ - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); return gdbarch; } +extern initialize_file_ftype _initialize_s390_tdep; /* -Wmissing-prototypes */ + void _initialize_s390_tdep (void) { @@ -1927,5 +1914,3 @@ _initialize_s390_tdep (void) if (!deprecated_tm_print_insn) /* Someone may have already set it */ deprecated_tm_print_insn = gdb_print_insn_s390; } - -#endif /* GDBSERVER */ diff --git a/gdb/sentinel-frame.c b/gdb/sentinel-frame.c index dcc583ec98e..94c1ee31311 100644 --- a/gdb/sentinel-frame.c +++ b/gdb/sentinel-frame.c @@ -44,7 +44,7 @@ sentinel_frame_cache (struct regcache *regcache) /* Here the register value is taken direct from the register cache. */ -void +static void sentinel_frame_prev_register (struct frame_info *next_frame, void **this_prologue_cache, int regnum, int *optimized, @@ -70,7 +70,7 @@ sentinel_frame_prev_register (struct frame_info *next_frame, } } -void +static void sentinel_frame_this_id (struct frame_info *next_frame, void **this_prologue_cache, struct frame_id *this_id) diff --git a/gdb/ser-e7kpc.c b/gdb/ser-e7kpc.c index 063cca13d63..8496ae411a2 100644 --- a/gdb/ser-e7kpc.c +++ b/gdb/ser-e7kpc.c @@ -19,8 +19,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if defined __GO32__ || defined _WIN32 #include "defs.h" +#if defined __GO32__ || defined _WIN32 #include "serial.h" #include "gdb_string.h" @@ -425,6 +425,8 @@ static struct serial_ops e7000pc_ops = #endif /*_WIN32 or __GO32__*/ +extern initialize_file_ftype _initialize_ser_e7000pc; /* -Wmissing-prototypes */ + void _initialize_ser_e7000pc (void) { diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index cbaaa3689d4..655aaaa0367 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -362,7 +362,7 @@ sh_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) #define MSYMBOL_IS_SPECIAL(msym) \ (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0) -void +static void sh64_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym) { if (msym == NULL) @@ -1239,7 +1239,7 @@ is_media_pseudo (int rn) && rn <= tdep->FV_LAST_REGNUM); } -int +static int sh64_get_gdb_regnum (int gcc_regnum, CORE_ADDR pc) { return translate_insn_rn (gcc_regnum, pc_is_isa32 (pc)); @@ -1813,7 +1813,7 @@ sh64_init_extra_frame_info (int fromleaf, struct frame_info *fi) } } -void +static void sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval) @@ -1921,14 +1921,14 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, static CORE_ADDR sh_extract_struct_value_address (char *regbuf) { - return (extract_address ((regbuf), REGISTER_RAW_SIZE (0))); + return (extract_unsigned_integer ((regbuf), REGISTER_RAW_SIZE (0))); } static CORE_ADDR sh64_extract_struct_value_address (char *regbuf) { - return (extract_address ((regbuf + REGISTER_BYTE (STRUCT_RETURN_REGNUM)), - REGISTER_RAW_SIZE (STRUCT_RETURN_REGNUM))); + return (extract_unsigned_integer ((regbuf + REGISTER_BYTE (STRUCT_RETURN_REGNUM)), + REGISTER_RAW_SIZE (STRUCT_RETURN_REGNUM))); } static CORE_ADDR @@ -2123,7 +2123,7 @@ sh_push_arguments (int nargs, struct value **args, CORE_ADDR sp, if (argreg <= tdep->ARGLAST_REGNUM) { /* there's room in a register */ - regval = extract_address (val, REGISTER_RAW_SIZE (argreg)); + regval = extract_unsigned_integer (val, REGISTER_RAW_SIZE (argreg)); write_register (argreg++, regval); } /* Store the value 4 bytes at a time. This means that things @@ -2238,7 +2238,7 @@ sh64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, if (int_argreg <= tdep->ARGLAST_REGNUM) { /* there's room in a register */ - regval = extract_address (val, argreg_size); + regval = extract_unsigned_integer (val, argreg_size); write_register (int_argreg, regval); } /* Store the value 8 bytes at a time. This means that @@ -2297,8 +2297,9 @@ sh64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE) { memset (valbuf_tmp, 0, sizeof (valbuf_tmp)); - REGISTER_CONVERT_TO_VIRTUAL (regnum, - type, val, valbuf_tmp); + DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, + type, val, + valbuf_tmp); val = valbuf_tmp; } #endif @@ -3035,7 +3036,8 @@ sh64_show_regs (void) sh64_show_compact_regs (); } -void sh_show_regs_command (char *args, int from_tty) +static void +sh_show_regs_command (char *args, int from_tty) { if (sh_show_regs) (*sh_show_regs)(); @@ -3409,7 +3411,7 @@ sh_sh4_register_convert_to_virtual (int regnum, struct type *type, error ("sh_register_convert_to_virtual called with non DR register number"); } -void +static void sh_sh64_register_convert_to_virtual (int regnum, struct type *type, char *from, char *to) { @@ -3451,7 +3453,7 @@ sh_sh4_register_convert_to_raw (struct type *type, int regnum, error("sh_register_convert_to_raw called with non DR register number"); } -void +static void sh_sh64_register_convert_to_raw (struct type *type, int regnum, const void *from, void *to) { @@ -3476,7 +3478,7 @@ sh_sh64_register_convert_to_raw (struct type *type, int regnum, error("sh_register_convert_to_raw called with non DR register number"); } -void +static void sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, void *buffer) { @@ -3679,7 +3681,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, } } -void +static void sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, const void *buffer) { @@ -3715,7 +3717,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, } } -void +static void sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, const void *buffer) { @@ -4123,7 +4125,7 @@ sh_print_register (int regnum) do_pseudo_register (regnum); } -void +static void sh_do_registers_info (int regnum, int fpregs) { if (regnum != -1) /* do one specified register */ @@ -4175,7 +4177,7 @@ sh_do_registers_info (int regnum, int fpregs) } } -void +static void sh_compact_do_registers_info (int regnum, int fpregs) { struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); @@ -4201,7 +4203,7 @@ sh_compact_do_registers_info (int regnum, int fpregs) } } -void +static void sh64_do_registers_info (int regnum, int fpregs) { if (pc_is_isa32 (get_frame_pc (deprecated_selected_frame))) @@ -4306,7 +4308,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) struct gdbarch_tdep *tdep; gdbarch_register_name_ftype *sh_register_name; gdbarch_deprecated_store_return_value_ftype *sh_store_return_value; - gdbarch_register_virtual_type_ftype *sh_register_virtual_type; + gdbarch_deprecated_register_virtual_type_ftype *sh_register_virtual_type; /* If there is already a candidate, use it. */ arches = gdbarch_list_lookup_by_info (arches, &info); @@ -4393,9 +4395,9 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_store_return_value = sh_default_store_return_value; sh_register_virtual_type = sh_default_register_virtual_type; 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); + set_gdbarch_deprecated_register_raw_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_byte (gdbarch, sh_default_register_byte); break; case bfd_mach_sh2: sh_register_name = sh_sh_register_name; @@ -4403,9 +4405,9 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_store_return_value = sh_default_store_return_value; sh_register_virtual_type = sh_default_register_virtual_type; 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); + set_gdbarch_deprecated_register_raw_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_byte (gdbarch, sh_default_register_byte); break; case bfd_mach_sh2e: sh_register_name = sh_sh2e_register_name; @@ -4413,9 +4415,9 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_store_return_value = sh3e_sh4_store_return_value; sh_register_virtual_type = sh_sh3e_register_virtual_type; 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); + set_gdbarch_deprecated_register_raw_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_byte (gdbarch, sh_default_register_byte); set_gdbarch_fp0_regnum (gdbarch, 25); tdep->FPUL_REGNUM = 23; tdep->FPSCR_REGNUM = 24; @@ -4427,9 +4429,9 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_store_return_value = sh_default_store_return_value; sh_register_virtual_type = sh_default_register_virtual_type; 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); + set_gdbarch_deprecated_register_raw_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_byte (gdbarch, sh_default_register_byte); set_gdbarch_register_sim_regno (gdbarch, sh_dsp_register_sim_regno); tdep->DSR_REGNUM = 24; tdep->A0G_REGNUM = 25; @@ -4452,9 +4454,9 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_store_return_value = sh_default_store_return_value; sh_register_virtual_type = sh_default_register_virtual_type; 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); + set_gdbarch_deprecated_register_raw_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_byte (gdbarch, sh_default_register_byte); tdep->SSR_REGNUM = 41; tdep->SPC_REGNUM = 42; break; @@ -4464,9 +4466,9 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_store_return_value = sh3e_sh4_store_return_value; sh_register_virtual_type = sh_sh3e_register_virtual_type; 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); + set_gdbarch_deprecated_register_raw_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_byte (gdbarch, sh_default_register_byte); set_gdbarch_deprecated_extract_return_value (gdbarch, sh3e_sh4_extract_return_value); set_gdbarch_fp0_regnum (gdbarch, 25); tdep->FPUL_REGNUM = 23; @@ -4481,9 +4483,9 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_store_return_value = sh_default_store_return_value; sh_register_virtual_type = sh_default_register_virtual_type; 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); + set_gdbarch_deprecated_register_raw_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_byte (gdbarch, sh_default_register_byte); tdep->DSR_REGNUM = 24; tdep->A0G_REGNUM = 25; tdep->A0_REGNUM = 26; @@ -4509,9 +4511,9 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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_deprecated_register_raw_size (gdbarch, sh_sh4_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, sh_sh4_register_raw_size); + set_gdbarch_deprecated_register_byte (gdbarch, sh_sh4_register_byte); set_gdbarch_num_pseudo_regs (gdbarch, 12); set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4 * 4); set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4 * 4); @@ -4597,9 +4599,9 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_store_return_value = sh64_store_return_value; skip_prologue_hard_way = sh64_skip_prologue_hard_way; do_pseudo_register = sh64_do_pseudo_register; - set_gdbarch_register_raw_size (gdbarch, sh_sh64_register_raw_size); - set_gdbarch_register_virtual_size (gdbarch, sh_sh64_register_raw_size); - set_gdbarch_register_byte (gdbarch, sh_sh64_register_byte); + set_gdbarch_deprecated_register_raw_size (gdbarch, sh_sh64_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, sh_sh64_register_raw_size); + set_gdbarch_deprecated_register_byte (gdbarch, sh_sh64_register_byte); /* This seems awfully wrong!*/ /*set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);*/ /* should include the size of the pseudo regs. */ @@ -4631,19 +4633,17 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_store_return_value = sh_default_store_return_value; sh_register_virtual_type = sh_default_register_virtual_type; 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); + set_gdbarch_deprecated_register_raw_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, sh_default_register_raw_size); + set_gdbarch_deprecated_register_byte (gdbarch, sh_default_register_byte); break; } - set_gdbarch_read_pc (gdbarch, generic_target_read_pc); set_gdbarch_write_pc (gdbarch, generic_target_write_pc); - set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); set_gdbarch_register_name (gdbarch, sh_register_name); - set_gdbarch_register_virtual_type (gdbarch, sh_register_virtual_type); + set_gdbarch_deprecated_register_virtual_type (gdbarch, sh_register_virtual_type); set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT); set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT); @@ -4667,7 +4667,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue); set_gdbarch_deprecated_frame_saved_pc (gdbarch, sh_frame_saved_pc); set_gdbarch_deprecated_saved_pc_after_call (gdbarch, sh_saved_pc_after_call); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_believe_pcc_promotion (gdbarch, 1); /* Hook in ABI-specific overrides, if they have been registered. */ @@ -4687,6 +4686,8 @@ sh_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) /* FIXME: dump the rest of gdbarch_tdep. */ } +extern initialize_file_ftype _initialize_sh_tdep; /* -Wmissing-prototypes */ + void _initialize_sh_tdep (void) { diff --git a/gdb/sh3-rom.c b/gdb/sh3-rom.c index 7d07fa53c80..b946e6fd71c 100644 --- a/gdb/sh3-rom.c +++ b/gdb/sh3-rom.c @@ -343,6 +343,8 @@ sh3_close (int quitting) } } +extern initialize_file_ftype _initialize_sh3_rom; /* -Wmissing-prototypes */ + void _initialize_sh3_rom (void) { diff --git a/gdb/shnbsd-nat.c b/gdb/shnbsd-nat.c index e1b56e66405..ec400698553 100644 --- a/gdb/shnbsd-nat.c +++ b/gdb/shnbsd-nat.c @@ -1,5 +1,5 @@ /* Native-dependent code for SuperH running NetBSD, for GDB. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. This file is part of GDB. @@ -26,6 +26,7 @@ #include "defs.h" #include "inferior.h" +#include "sh-tdep.h" #include "shnbsd-tdep.h" /* Determine if PT_GETREGS fetches this register. */ diff --git a/gdb/signals/signals.c b/gdb/signals/signals.c index ca46a9ed1c7..c808d1fdeae 100644 --- a/gdb/signals/signals.c +++ b/gdb/signals/signals.c @@ -819,6 +819,8 @@ Use \"info signals\" for a list of symbolic signals."); } #ifndef GDBSERVER +extern initialize_file_ftype _initialize_signals; /* -Wmissing-prototype */ + void _initialize_signals (void) { diff --git a/gdb/solib-irix.c b/gdb/solib-irix.c index 26a776ff283..8400ad3a006 100644 --- a/gdb/solib-irix.c +++ b/gdb/solib-irix.c @@ -123,16 +123,12 @@ union irix_obj_info /* MIPS sign extends its 32 bit addresses. We could conceivably use extract_typed_address here, but to do so, we'd have to construct an - appropriate type. Calling extract_signed_integer or - extract_address seems simpler. */ + appropriate type. Calling extract_signed_integer seems simpler. */ static CORE_ADDR extract_mips_address (void *addr, int len) { - if (len <= 32) - return extract_signed_integer (addr, len); - else - return extract_address (addr, len); + return extract_signed_integer (addr, len); } /* Fetch and return the link map data associated with ADDR. Note that diff --git a/gdb/solib-legacy.c b/gdb/solib-legacy.c index 2dd9fa5fd02..a87eb21511a 100644 --- a/gdb/solib-legacy.c +++ b/gdb/solib-legacy.c @@ -142,6 +142,8 @@ legacy_svr4_fetch_link_map_offsets (void) #endif /* HAVE_LINK_H */ +extern initialize_file_ftype _initialize_svr4_lm; /* -Wmissing-prototypes */ + void _initialize_svr4_lm (void) { diff --git a/gdb/solib-sunos.c b/gdb/solib-sunos.c index 4072fab5f4c..b7444c64cc2 100644 --- a/gdb/solib-sunos.c +++ b/gdb/solib-sunos.c @@ -68,14 +68,16 @@ static char *main_name_list[] = NULL }; -/* Macro to extract an address from a solib structure. - When GDB is configured for some 32-bit targets (e.g. Solaris 2.7 - sparc), BFD is configured to handle 64-bit targets, so CORE_ADDR is - 64 bits. We have to extract only the significant bits of addresses - to get the right address when accessing the core file BFD. */ +/* Macro to extract an address from a solib structure. When GDB is + configured for some 32-bit targets (e.g. Solaris 2.7 sparc), BFD is + configured to handle 64-bit targets, so CORE_ADDR is 64 bits. We + have to extract only the significant bits of addresses to get the + right address when accessing the core file BFD. + + Assume that the address is unsigned. */ #define SOLIB_EXTRACT_ADDRESS(MEMBER) \ - extract_address (&(MEMBER), sizeof (MEMBER)) + extract_unsigned_integer (&(MEMBER), sizeof (MEMBER)) /* local data declarations */ @@ -108,7 +110,9 @@ LM_NEXT (struct so_list *so) int lm_next_offset = offsetof (struct link_map, lm_next); int lm_next_size = fieldsize (struct link_map, lm_next); - return extract_address (so->lm_info->lm + lm_next_offset, lm_next_size); + /* Assume that the address is unsigned. */ + return extract_unsigned_integer (so->lm_info->lm + lm_next_offset, + lm_next_size); } static CORE_ADDR @@ -117,7 +121,9 @@ LM_NAME (struct so_list *so) int lm_name_offset = offsetof (struct link_map, lm_name); int lm_name_size = fieldsize (struct link_map, lm_name); - return extract_address (so->lm_info->lm + lm_name_offset, lm_name_size); + /* Assume that the address is unsigned. */ + return extract_unsigned_integer (so->lm_info->lm + lm_name_offset, + lm_name_size); } static CORE_ADDR debug_base; /* Base of dynamic linker structures */ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 6c4c10ae013..d4335349790 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -81,6 +81,17 @@ static char *solib_break_names[] = "_dl_debug_state", "rtld_db_dlactivity", "_rtld_debug_state", + + /* On the 64-bit PowerPC, the linker symbol with the same name as + the C function points to a function descriptor, not to the entry + point. The linker symbol whose name is the C function name + prefixed with a '.' points to the function's entry point. So + when we look through this table, we ignore symbols that point + into the data section (thus skipping the descriptor's symbol), + and eventually try this one, giving us the real entry point + address. */ + "._dl_debug_state", + NULL }; @@ -105,14 +116,16 @@ static char *main_name_list[] = NULL }; -/* Macro to extract an address from a solib structure. - When GDB is configured for some 32-bit targets (e.g. Solaris 2.7 - sparc), BFD is configured to handle 64-bit targets, so CORE_ADDR is - 64 bits. We have to extract only the significant bits of addresses - to get the right address when accessing the core file BFD. */ +/* Macro to extract an address from a solib structure. When GDB is + configured for some 32-bit targets (e.g. Solaris 2.7 sparc), BFD is + configured to handle 64-bit targets, so CORE_ADDR is 64 bits. We + have to extract only the significant bits of addresses to get the + right address when accessing the core file BFD. + + Assume that the address is unsigned. */ #define SOLIB_EXTRACT_ADDRESS(MEMBER) \ - extract_address (&(MEMBER), sizeof (MEMBER)) + extract_unsigned_integer (&(MEMBER), sizeof (MEMBER)) /* local data declarations */ @@ -132,7 +145,9 @@ LM_NEXT (struct so_list *so) { struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS (); - return extract_address (so->lm_info->lm + lmo->l_next_offset, lmo->l_next_size); + /* Assume that the address is unsigned. */ + return extract_unsigned_integer (so->lm_info->lm + lmo->l_next_offset, + lmo->l_next_size); } static CORE_ADDR @@ -140,7 +155,9 @@ LM_NAME (struct so_list *so) { struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS (); - return extract_address (so->lm_info->lm + lmo->l_name_offset, lmo->l_name_size); + /* Assume that the address is unsigned. */ + return extract_unsigned_integer (so->lm_info->lm + lmo->l_name_offset, + lmo->l_name_size); } static int @@ -148,8 +165,9 @@ IGNORE_FIRST_LINK_MAP_ENTRY (struct so_list *so) { struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS (); - return extract_address (so->lm_info->lm + lmo->l_prev_offset, - lmo->l_prev_size) == 0; + /* Assume that the address is unsigned. */ + return extract_unsigned_integer (so->lm_info->lm + lmo->l_prev_offset, + lmo->l_prev_size) == 0; } static CORE_ADDR debug_base; /* Base of dynamic linker structures */ @@ -587,7 +605,8 @@ first_link_map_member (void) read_memory (debug_base + lmo->r_map_offset, r_map_buf, lmo->r_map_size); - lm = extract_address (r_map_buf, lmo->r_map_size); + /* Assume that the address is unsigned. */ + lm = extract_unsigned_integer (r_map_buf, lmo->r_map_size); /* FIXME: Perhaps we should validate the info somehow, perhaps by checking r_version for a known version number, or r_state for @@ -645,8 +664,9 @@ open_symbol_file_object (void *from_ttyp) /* Read address of name from target memory to GDB. */ read_memory (lm + lmo->l_name_offset, l_name_buf, lmo->l_name_size); - /* Convert the address to host format. */ - l_name = extract_address (l_name_buf, lmo->l_name_size); + /* Convert the address to host format. Assume that the address is + unsigned. */ + l_name = extract_unsigned_integer (l_name_buf, lmo->l_name_size); /* Free l_name_buf. */ do_cleanups (cleanups); @@ -820,9 +840,9 @@ svr4_fetch_objfile_link_map (struct objfile *objfile) /* Read address of name from target memory to GDB. */ read_memory (lm + lmo->l_name_offset, l_name_buf, lmo->l_name_size); - /* Extract this object's name. */ - name_address = extract_address (l_name_buf, - lmo->l_name_size); + /* Extract this object's name. Assume that the address is + unsigned. */ + name_address = extract_unsigned_integer (l_name_buf, lmo->l_name_size); target_read_string (name_address, &buffer, SO_NAME_MAX_PATH_SIZE - 1, &errcode); make_cleanup (xfree, buffer); @@ -843,9 +863,10 @@ svr4_fetch_objfile_link_map (struct objfile *objfile) return lm; } } - /* Not the file we wanted, continue checking. */ - lm = extract_address (objfile_lm_info.lm + lmo->l_next_offset, - lmo->l_next_size); + /* Not the file we wanted, continue checking. Assume that the + address is unsigned. */ + lm = extract_unsigned_integer (objfile_lm_info.lm + lmo->l_next_offset, + lmo->l_next_size); do_cleanups (old_chain); } return 0; @@ -1445,6 +1466,8 @@ init_fetch_link_map_offsets (struct gdbarch *gdbarch) static struct target_so_ops svr4_so_ops; +extern initialize_file_ftype _initialize_svr4_solib; /* -Wmissing-prototypes */ + void _initialize_svr4_solib (void) { diff --git a/gdb/solib.c b/gdb/solib.c index 289b84f34bf..82df65a6d0b 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -87,12 +87,19 @@ static char *solib_search_path = NULL; (or set of directories, as in LD_LIBRARY_PATH) to search for all shared libraries if not found in SOLIB_ABSOLUTE_PREFIX. - Search order: - * If path is absolute, look in SOLIB_ABSOLUTE_PREFIX. - * If path is absolute or relative, look for it literally (unmodified). + Search algorithm: + * If there is a solib_absolute_prefix and path is absolute: + * Search for solib_absolute_prefix/path. + * else + * Look for it literally (unmodified). * Look in SOLIB_SEARCH_PATH. - * Look in inferior's $PATH. - * Look in inferior's $LD_LIBRARY_PATH. + * If available, use target defined search function. + * If solib_absolute_prefix is NOT set, perform the following two searches: + * Look in inferior's $PATH. + * Look in inferior's $LD_LIBRARY_PATH. + * + * The last check avoids doing this search when targetting remote + * machines since solib_absolute_prefix will almost always be set. RETURNS @@ -147,7 +154,7 @@ solib_open (char *in_pathname, char **found_pathname) in_pathname++; } - /* If not found, next search the solib_search_path (if any). */ + /* If not found, search the solib_search_path (if any). */ if (found_file < 0 && solib_search_path != NULL) found_file = openp (solib_search_path, 1, in_pathname, O_RDONLY, 0, &temp_pathname); @@ -166,13 +173,13 @@ solib_open (char *in_pathname, char **found_pathname) (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) + if (found_file < 0 && solib_absolute_prefix == NULL) found_file = openp (get_in_environ (inferior_environ, "PATH"), 1, in_pathname, O_RDONLY, 0, &temp_pathname); /* If not found, next search the inferior's $LD_LIBRARY_PATH environment variable. */ - if (found_file < 0 && solib_search_path != NULL) + if (found_file < 0 && solib_absolute_prefix == NULL) found_file = openp (get_in_environ (inferior_environ, "LD_LIBRARY_PATH"), 1, in_pathname, O_RDONLY, 0, &temp_pathname); @@ -381,7 +388,7 @@ symbol_add_stub (void *arg) the section table. But we only use this for core files and processes we've just attached to, so that's okay. */ -void +static void update_solib_list (int from_tty, struct target_ops *target) { struct so_list *inferior = TARGET_SO_CURRENT_SOS (); @@ -856,6 +863,8 @@ reload_shared_libraries (char *ignored, int from_tty) solib_add (NULL, from_tty, NULL, auto_solib_add); } +extern initialize_file_ftype _initialize_solib; /* -Wmissing-prototypes */ + void _initialize_solib (void) { diff --git a/gdb/somread.c b/gdb/somread.c index 654ae067f75..cb7b048eafd 100644 --- a/gdb/somread.c +++ b/gdb/somread.c @@ -430,9 +430,10 @@ som_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs) int i; CORE_ADDR text_addr; - objfile->num_sections = SECT_OFF_MAX; + objfile->num_sections = bfd_count_sections (objfile->obfd); objfile->section_offsets = (struct section_offsets *) - obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS); + obstack_alloc (&objfile->psymbol_obstack, + SIZEOF_N_SECTION_OFFSETS (objfile->num_sections)); /* FIXME: ezannoni 2000-04-20 The section names in SOM are not .text, .data, etc, but $TEXT$, $DATA$,... We should initialize @@ -457,7 +458,7 @@ som_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs) break; text_addr = addrs->other[i].addr; - for (i = 0; i < SECT_OFF_MAX; i++) + for (i = 0; i < objfile->num_sections; i++) (objfile->section_offsets)->offsets[i] = text_addr; } } diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c index b634f6c87dd..33145e0150e 100644 --- a/gdb/sparc-nat.c +++ b/gdb/sparc-nat.c @@ -108,7 +108,7 @@ fetch_inferior_registers (int regno) = inferior_registers.r_pc; *(int *) &deprecated_registers[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc; - *(int *) ®isters[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y; + *(int *) &deprecated_registers[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y; for (i = G0_REGNUM; i <= O7_REGNUM; i++) deprecated_register_valid[i] = 1; diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 6735b0814ee..31718139b29 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -466,13 +466,6 @@ sparc_frame_chain (struct frame_info *frame) return ~ (CORE_ADDR) 0; } -CORE_ADDR -sparc_extract_struct_value_address (char *regbuf) -{ - return extract_address (regbuf + REGISTER_BYTE (O0_REGNUM), - REGISTER_RAW_SIZE (O0_REGNUM)); -} - /* Find the pc saved in frame FRAME. */ CORE_ADDR @@ -515,7 +508,7 @@ sparc_frame_saved_pc (struct frame_info *frame) stack layout has changed or the stack is corrupt. */ target_read_memory (sigcontext_addr + saved_pc_offset, scbuf, sizeof (scbuf)); - return extract_address (scbuf, sizeof (scbuf)); + return extract_unsigned_integer (scbuf, sizeof (scbuf)); } else if (get_frame_extra_info (frame)->in_prologue || (get_next_frame (frame) != NULL && @@ -541,7 +534,7 @@ sparc_frame_saved_pc (struct frame_info *frame) return PC_ADJUST (read_register (O7_REGNUM)); read_memory (addr, buf, SPARC_INTREG_SIZE); - return PC_ADJUST (extract_address (buf, SPARC_INTREG_SIZE)); + return PC_ADJUST (extract_unsigned_integer (buf, SPARC_INTREG_SIZE)); } /* Since an individual frame in the frame cache is defined by two @@ -1803,7 +1796,7 @@ get_longjmp_target (CORE_ADDR *pc) LONGJMP_TARGET_SIZE)) return 0; - *pc = extract_address (buf, LONGJMP_TARGET_SIZE); + *pc = extract_unsigned_integer (buf, LONGJMP_TARGET_SIZE); return 1; } @@ -2111,20 +2104,7 @@ sparc_print_registers (struct gdbarch *gdbarch, continue; } - /* FIXME: cagney/2002-08-03: This code shouldn't be necessary. - The function frame_register_read() should have returned the - pre-cooked register so no conversion is necessary. */ - /* Convert raw data to virtual format if necessary. */ - if (REGISTER_CONVERTIBLE (i)) - { - REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i), - raw_buffer, virtual_buffer); - } - else - { - memcpy (virtual_buffer, raw_buffer, - REGISTER_VIRTUAL_SIZE (i)); - } + memcpy (virtual_buffer, raw_buffer, REGISTER_VIRTUAL_SIZE (i)); /* If virtual format is floating, print it that way, and in raw hex. */ @@ -2206,7 +2186,7 @@ sparc_do_registers_info (int regnum, int all) #endif -int +static int gdb_print_insn_sparc (bfd_vma memaddr, disassemble_info *info) { /* It's necessary to override mach again because print_insn messes it up. */ @@ -2214,103 +2194,261 @@ gdb_print_insn_sparc (bfd_vma memaddr, disassemble_info *info) return print_insn_sparc (memaddr, info); } -/* The SPARC passes the arguments on the stack; arguments smaller - than an int are promoted to an int. The first 6 words worth of - args are also passed in registers o0 - o5. */ -CORE_ADDR -sparc32_push_arguments (int nargs, struct value **args, CORE_ADDR sp, - int struct_return, CORE_ADDR struct_addr) +#define SPARC_F0_REGNUM FP0_REGNUM /* %f0 */ +#define SPARC_F1_REGNUM (FP0_REGNUM + 1)/* %f1 */ +#define SPARC_O0_REGNUM O0_REGNUM /* %o0 */ +#define SPARC_O1_REGNUM O1_REGNUM /* %o1 */ + +/* Push the arguments onto the stack and into the appropriate registers. */ + +static CORE_ADDR +sparc32_do_push_arguments (struct regcache *regcache, int nargs, + struct value **args, CORE_ADDR sp) { - int i, j, oregnum; - int accumulate_size = 0; - struct sparc_arg + CORE_ADDR *addr; + int size = 0; + int i; + + /* Structure, union and quad-precision arguments are passed by + reference. We allocate space for these arguments on the stack + and record their addresses in an array. Array elements for + arguments that are passed by value will be set to zero.*/ + addr = alloca (nargs * sizeof (CORE_ADDR)); + + for (i = nargs - 1; i >= 0; i--) { - char *contents; + struct type *type = VALUE_ENCLOSING_TYPE (args[i]); + enum type_code code = TYPE_CODE (type); + int len = TYPE_LENGTH (type); + + /* Push the contents of structure, union and quad-precision + arguments on the stack. */ + if (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION || len > 8) + { + /* Keep the stack doubleword aligned. */ + sp -= (len + 7) & ~7; + write_memory (sp, VALUE_CONTENTS_ALL (args[i]), len); + addr[i] = sp; + size += 4; + } + else + { + addr[i] = 0; + size += (len > 4) ? 8 : 4; + } + } + + /* The needed space for outgoing arguments should be a multiple of 4. */ + gdb_assert (size % 4 == 0); + + /* Make sure we reserve space for the first six words of arguments + in the stack frame, even if we don't need them. */ + if (size < 24) + sp -= (24 - size); + + /* Make sure we end up with a doubleword aligned stack in the end. + Reserve an extra word if necessary in order to accomplish this. */ + if ((sp - size) % 8 == 0) + sp -= 4; + + /* Now push the arguments onto the stack. */ + for (i = nargs - 1; i >=0; i--) + { + char buf[8]; int len; - int offset; - }; - struct sparc_arg *sparc_args = - (struct sparc_arg *) alloca (nargs * sizeof (struct sparc_arg)); - struct sparc_arg *m_arg; - - /* Promote arguments if necessary, and calculate their stack offsets - and sizes. */ - for (i = 0, m_arg = sparc_args; i < nargs; i++, m_arg++) - { - struct value *arg = args[i]; - struct type *arg_type = check_typedef (VALUE_TYPE (arg)); - /* Cast argument to long if necessary as the compiler does it too. */ - switch (TYPE_CODE (arg_type)) + + if (addr[i]) { - case TYPE_CODE_INT: - case TYPE_CODE_BOOL: - case TYPE_CODE_CHAR: - case TYPE_CODE_RANGE: - case TYPE_CODE_ENUM: - if (TYPE_LENGTH (arg_type) < TYPE_LENGTH (builtin_type_long)) + store_unsigned_integer (buf, 4, addr[i]); + len = 4; + } + else + { + struct value *arg = args[i]; + + len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg)); + + /* Expand signed and unsigned bytes and halfwords as needed. */ + if (len < 4) { - arg_type = builtin_type_long; - arg = value_cast (arg_type, arg); + arg = value_cast (builtin_type_long, arg); + len = 4; } - break; - default: - break; + else if (len > 4 && len < 8) + { + arg = value_cast (builtin_type_long_long, arg); + len = 4; + } + + gdb_assert (len == 4 || len == 8); + memcpy (buf, VALUE_CONTENTS_ALL (arg), len); + } + + /* We always write the argument word on the stack. */ + sp -= len; + write_memory (sp, buf, len); + + /* If this argument occupies one of the first 6 words, write it + into the appropriate register too. */ + size -= len; + if (size < 24) + { + int regnum = SPARC_O0_REGNUM + (size / 4); + + regcache_cooked_write (regcache, regnum, buf); + if (len == 8 && size < 20) + regcache_cooked_write (regcache, regnum + 1, buf + 4); } - m_arg->len = TYPE_LENGTH (arg_type); - m_arg->offset = accumulate_size; - accumulate_size = (accumulate_size + m_arg->len + 3) & ~3; - m_arg->contents = VALUE_CONTENTS (arg); } - /* Make room for the arguments on the stack. */ - accumulate_size += DEPRECATED_CALL_DUMMY_STACK_ADJUST; - sp = ((sp - accumulate_size) & ~7) + DEPRECATED_CALL_DUMMY_STACK_ADJUST; + /* Reserve space for the struct/union return value pointer. */ + sp -= 4; + + /* Stack should be doubleword aligned at this point. */ + gdb_assert (sp % 8 == 0); + + /* Return the adjusted stack pointer. */ + return sp; +} + +/* The SPARC passes the arguments on the stack; arguments smaller + than an int are promoted to an int. The first 6 words worth of + args are also passed in registers o0 - o5. */ + +CORE_ADDR +sparc32_push_arguments (int nargs, struct value **args, CORE_ADDR sp, + int struct_return, CORE_ADDR struct_addr) +{ + sp = sparc32_do_push_arguments (current_regcache, nargs, args, sp); - /* `Push' arguments on the stack. */ - for (i = 0, oregnum = 0, m_arg = sparc_args; - i < nargs; - i++, m_arg++) + /* FIXME: kettenis/20030525: We don't let this function set the + struct/union return pointer just yet. */ +#if 0 + if (struct_return) { - write_memory (sp + m_arg->offset, m_arg->contents, m_arg->len); - for (j = 0; - j < m_arg->len && oregnum < 6; - j += SPARC_INTREG_SIZE, oregnum++) - deprecated_write_register_gen (O0_REGNUM + oregnum, m_arg->contents + j); + char buf[4]; + + /* The space for the struct/union return value pointer has + already been reserved. */ + store_unsigned_integer (buf, 4, struct_addr); + write (sp, buf, 4); } return sp; +#else + return sp + 4; +#endif } +/* Extract from REGCACHE a function return value of type TYPE and copy + that into VALBUF. -/* Extract from an array REGBUF containing the (raw) register state - a function return value of type TYPE, and copy that, in virtual format, - into VALBUF. */ + Note that REGCACHE specifies the register values for the frame of + the calling function. This means that we need to fetch the value + form %o0 and %o1, which correspond to %i0 and %i1 in the frame of + the called function. */ void -sparc32_extract_return_value (struct type *type, char *regbuf, char *valbuf) +sparc32_extract_return_value (struct type *type, struct regcache *regcache, + void *valbuf) { - int typelen = TYPE_LENGTH (type); - int regsize = REGISTER_RAW_SIZE (O0_REGNUM); + int len = TYPE_LENGTH (type); + char buf[8]; + + if (TYPE_CODE (type) == TYPE_CODE_FLT && SPARC_HAS_FPU) + { + if (len == 4 || len == 8) + { + regcache_cooked_read (regcache, SPARC_F0_REGNUM, buf); + regcache_cooked_read (regcache, SPARC_F1_REGNUM, buf + 4); + memcpy (valbuf, buf, len); + return; + } + else + internal_error (__FILE__, __LINE__, "\ +Cannot extract floating-point return value of %d bytes long.", len); + } + + if (len <= 4) + { + regcache_cooked_read (regcache, SPARC_O0_REGNUM, buf); + memcpy (valbuf, buf + 4 - len, len); + } + else if (len <= 8) + { + regcache_cooked_read (regcache, SPARC_O0_REGNUM, buf); + regcache_cooked_read (regcache, SPARC_O1_REGNUM, buf + 4); + memcpy (valbuf, buf + 8 - len, len); + } + else + internal_error (__FILE__, __LINE__, + "Cannot extract return value of %d bytes long.", len); +} + +/* Write into REGBUF a function return value VALBUF of type TYPE. */ + +void +sparc32_store_return_value (struct type *type, struct regcache *regcache, + const void *valbuf) +{ + int len = TYPE_LENGTH (type); + char buf[8]; if (TYPE_CODE (type) == TYPE_CODE_FLT && SPARC_HAS_FPU) - memcpy (valbuf, ®buf[REGISTER_BYTE (FP0_REGNUM)], typelen); + { + const char *buf = valbuf; + + if (len == 4) + { + regcache_cooked_write (regcache, SPARC_F0_REGNUM, buf); + return; + } + else if (len == 8) + { + regcache_cooked_write (regcache, SPARC_F0_REGNUM, buf); + regcache_cooked_write (regcache, SPARC_F1_REGNUM, buf + 4); + return; + } + else + internal_error (__FILE__, __LINE__, "\ +Cannot extract floating-point return value of %d bytes long.", len); + } + + /* Add leading zeros to the value. */ + memset (buf, 0, sizeof buf); + + if (len <= 4) + { + memcpy (buf + 4 - len, valbuf, len); + regcache_cooked_write (regcache, SPARC_O0_REGNUM, buf); + } + else if (len <= 8) + { + memcpy (buf + 8 - len, valbuf, len); + regcache_cooked_write (regcache, SPARC_O0_REGNUM, buf); + regcache_cooked_write (regcache, SPARC_O1_REGNUM, buf); + } else - memcpy (valbuf, - ®buf[O0_REGNUM * regsize + - (typelen >= regsize - || TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE ? 0 - : regsize - typelen)], - typelen); + internal_error (__FILE__, __LINE__, + "Cannot extract return value of %d bytes long.", len); } +/* Extract from REGCACHE the address in which a function should return + its structure value. */ -/* Write into appropriate registers a function return value - of type TYPE, given in virtual format. On SPARCs with FPUs, - float values are returned in %f0 (and %f1). In all other cases, - values are returned in register %o0. */ +CORE_ADDR +sparc_extract_struct_value_address (struct regcache *regcache) +{ + ULONGEST addr; -void + regcache_cooked_read_unsigned (regcache, SPARC_O0_REGNUM, &addr); + return addr; +} + +/* FIXME: kettenis/2003/05/24: Still used for sparc64. */ + +static void sparc_store_return_value (struct type *type, char *valbuf) { int regno; @@ -2459,6 +2597,8 @@ static struct gdbarch * sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches); static void sparc_dump_tdep (struct gdbarch *, struct ui_file *); +extern initialize_file_ftype _initialize_sparc_tdep; /* -Wmissing-prototypes */ + void _initialize_sparc_tdep (void) { @@ -2473,7 +2613,7 @@ _initialize_sparc_tdep (void) /* Compensate for stack bias. Note that we currently don't handle mixed 32/64 bit code. */ -CORE_ADDR +static CORE_ADDR sparc64_read_sp (void) { CORE_ADDR sp = read_register (SP_REGNUM); @@ -2483,7 +2623,7 @@ sparc64_read_sp (void) return sp; } -CORE_ADDR +static CORE_ADDR sparc64_read_fp (void) { CORE_ADDR fp = read_register (DEPRECATED_FP_REGNUM); @@ -2493,7 +2633,7 @@ sparc64_read_fp (void) return fp; } -void +static void sparc64_write_sp (CORE_ADDR val) { CORE_ADDR oldsp = read_register (SP_REGNUM); @@ -2517,7 +2657,7 @@ sparc64_write_sp (CORE_ADDR val) for both; this means that if the arguments alternate between int and float, we will waste every other register of both types. */ -CORE_ADDR +static CORE_ADDR sparc64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_retaddr) { @@ -2634,7 +2774,7 @@ sparc64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* Values <= 32 bytes are returned in o0-o3 (floating-point values are returned in f0-f3). */ -void +static void sp64_extract_return_value (struct type *type, char *regbuf, char *valbuf, int bitoffset) { @@ -2691,7 +2831,7 @@ sp64_extract_return_value (struct type *type, char *regbuf, char *valbuf, } } -extern void +static void sparc64_extract_return_value (struct type *type, char *regbuf, char *valbuf) { sp64_extract_return_value (type, regbuf, valbuf, 0); @@ -2717,7 +2857,7 @@ sparc32_stack_align (CORE_ADDR addr) return ((addr + 7) & -8); } -extern CORE_ADDR +static CORE_ADDR sparc64_stack_align (CORE_ADDR addr) { return ((addr + 15) & -16); @@ -2855,7 +2995,7 @@ sparc64_register_name (int regno) // OBSOLETE } #endif -CORE_ADDR +static CORE_ADDR sparc_push_return_address (CORE_ADDR pc_unused, CORE_ADDR sp) { if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT) @@ -3014,19 +3154,6 @@ sparc_saved_pc_after_call (struct frame_info *fi) return sparc_pc_adjust (read_register (RP_REGNUM)); } -/* Convert registers between 'raw' and 'virtual' formats. - They are the same on sparc, so there's nothing to do. */ - -static void -sparc_convert_to_virtual (int regnum, struct type *type, char *from, char *to) -{ /* do nothing (should never be called) */ -} - -static void -sparc_convert_to_raw (struct type *type, int regnum, char *from, char *to) -{ /* do nothing (should never be called) */ -} - /* Init saved regs: nothing to do, just a place-holder function. */ static void @@ -3061,7 +3188,7 @@ sparc_call_dummy_address (void) /* Supply the Y register number to those that need it. */ -int +static int sparc_y_regnum (void) { return gdbarch_tdep (current_gdbarch)->y_regnum; @@ -3076,7 +3203,7 @@ sparc_reg_struct_has_addr (int gcc_p, struct type *type) return (gcc_p != 1); } -int +static int sparc_intreg_size (void) { return SPARC_INTREG_SIZE; @@ -3092,6 +3219,16 @@ sparc_return_value_on_stack (struct type *type) return 0; } +/* Get the ith function argument for the current function. */ +static CORE_ADDR +sparc_fetch_pointer_argument (struct frame_info *frame, int argi, + struct type *type) +{ + CORE_ADDR addr; + frame_read_register (frame, O0_REGNUM + argi, &addr); + return addr; +} + /* * Gdbarch "constructor" function. */ @@ -3164,14 +3301,14 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_from_pc (gdbarch, sparc_breakpoint_from_pc); set_gdbarch_decr_pc_after_break (gdbarch, 0); set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sparc_extract_struct_value_address); + set_gdbarch_extract_struct_value_address (gdbarch, + sparc_extract_struct_value_address); set_gdbarch_deprecated_fix_call_dummy (gdbarch, sparc_gdbarch_fix_call_dummy); set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_deprecated_fp_regnum (gdbarch, SPARC_FP_REGNUM); set_gdbarch_fp0_regnum (gdbarch, SPARC_FP0_REGNUM); set_gdbarch_deprecated_frame_chain (gdbarch, sparc_frame_chain); 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_deprecated_frame_saved_pc (gdbarch, sparc_frame_saved_pc); set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue); @@ -3186,12 +3323,6 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_pop_frame (gdbarch, sparc_pop_frame); set_gdbarch_deprecated_push_return_address (gdbarch, sparc_push_return_address); 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, - sparc_convert_to_virtual); - set_gdbarch_register_convertible (gdbarch, - generic_register_convertible_not); set_gdbarch_reg_struct_has_addr (gdbarch, sparc_reg_struct_has_addr); set_gdbarch_return_value_on_stack (gdbarch, sparc_return_value_on_stack); set_gdbarch_deprecated_saved_pc_after_call (gdbarch, sparc_saved_pc_after_call); @@ -3202,6 +3333,9 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); set_gdbarch_write_pc (gdbarch, generic_target_write_pc); + /* Helper for function argument information. */ + set_gdbarch_fetch_pointer_argument (gdbarch, sparc_fetch_pointer_argument); + /* * Settings that depend only on 32/64 bit word size */ @@ -3291,14 +3425,12 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_pc_regnum (gdbarch, SPARC32_PC_REGNUM); set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_deprecated_push_arguments (gdbarch, sparc32_push_arguments); - set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_register_byte (gdbarch, sparc32_register_byte); - set_gdbarch_register_raw_size (gdbarch, sparc32_register_size); + set_gdbarch_deprecated_register_byte (gdbarch, sparc32_register_byte); + set_gdbarch_deprecated_register_raw_size (gdbarch, sparc32_register_size); set_gdbarch_deprecated_register_size (gdbarch, 4); - set_gdbarch_register_virtual_size (gdbarch, sparc32_register_size); - set_gdbarch_register_virtual_type (gdbarch, - sparc32_register_virtual_type); + set_gdbarch_deprecated_register_virtual_size (gdbarch, sparc32_register_size); + set_gdbarch_deprecated_register_virtual_type (gdbarch, sparc32_register_virtual_type); #ifdef SPARC32_CALL_DUMMY_ON_STACK set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_32)); #else @@ -3309,7 +3441,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_store_struct_return (gdbarch, sparc32_store_struct_return); set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention); - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); tdep->y_regnum = SPARC32_Y_REGNUM; tdep->fp_max_regnum = SPARC_FP0_REGNUM + 32; tdep->intreg_size = 4; @@ -3347,12 +3479,11 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_read_sp (gdbarch, sparc64_read_sp); /* Some of the registers aren't 64 bits, but it's a lot simpler just to assume they all are (since most of them are). */ - set_gdbarch_register_byte (gdbarch, sparc64_register_byte); - set_gdbarch_register_raw_size (gdbarch, sparc64_register_size); + set_gdbarch_deprecated_register_byte (gdbarch, sparc64_register_byte); + set_gdbarch_deprecated_register_raw_size (gdbarch, sparc64_register_size); set_gdbarch_deprecated_register_size (gdbarch, 8); - set_gdbarch_register_virtual_size (gdbarch, sparc64_register_size); - set_gdbarch_register_virtual_type (gdbarch, - sparc64_register_virtual_type); + set_gdbarch_deprecated_register_virtual_size (gdbarch, sparc64_register_size); + set_gdbarch_deprecated_register_virtual_type (gdbarch, sparc64_register_virtual_type); #ifdef SPARC64_CALL_DUMMY_ON_STACK set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_64)); #else @@ -3379,11 +3510,11 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) switch (info.bfd_arch_info->mach) { case bfd_mach_sparc: - set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value); + set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value); + set_gdbarch_store_return_value (gdbarch, sparc32_store_return_value); set_gdbarch_num_regs (gdbarch, 72); set_gdbarch_deprecated_register_bytes (gdbarch, 32*4 + 32*4 + 8*4); set_gdbarch_register_name (gdbarch, sparc32_register_name); - set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value); #if 0 // OBSOLETE tdep->has_fpu = 1; /* (all but sparclet and sparclite) */ #endif @@ -3415,11 +3546,11 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) // OBSOLETE break; #endif case bfd_mach_sparc_v8plus: - set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value); + set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value); + set_gdbarch_store_return_value (gdbarch, sparc32_store_return_value); set_gdbarch_num_regs (gdbarch, 72); set_gdbarch_deprecated_register_bytes (gdbarch, 32*4 + 32*4 + 8*4); set_gdbarch_register_name (gdbarch, sparc32_register_name); - set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value); tdep->print_insn_mach = bfd_mach_sparc; tdep->fp_register_bytes = 32 * 4; #if 0 @@ -3427,11 +3558,11 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) #endif break; case bfd_mach_sparc_v8plusa: - set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value); + set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value); + set_gdbarch_store_return_value (gdbarch, sparc32_store_return_value); set_gdbarch_num_regs (gdbarch, 72); set_gdbarch_deprecated_register_bytes (gdbarch, 32*4 + 32*4 + 8*4); set_gdbarch_register_name (gdbarch, sparc32_register_name); - set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value); #if 0 // OBSOLETE tdep->has_fpu = 1; /* (all but sparclet and sparclite) */ #endif diff --git a/gdb/sparcnbsd-tdep.c b/gdb/sparcnbsd-tdep.c index ab984ff88ad..4fe05aa9ce0 100644 --- a/gdb/sparcnbsd-tdep.c +++ b/gdb/sparcnbsd-tdep.c @@ -1,5 +1,5 @@ /* Target-dependent code for SPARC systems running NetBSD. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. This file is part of GDB. @@ -26,6 +26,8 @@ #include "value.h" #include "osabi.h" +#include "gdb_string.h" + #include "sparcnbsd-tdep.h" #include "nbsd-tdep.h" @@ -445,7 +447,7 @@ sparcnbsd_get_longjmp_target_32 (CORE_ADDR *pc) if (target_read_memory (jb_addr + 12, buf, sizeof (buf))) return 0; - *pc = extract_address (buf, sizeof (buf)); + *pc = extract_unsigned_integer (buf, sizeof (buf)); return 1; } @@ -461,7 +463,7 @@ sparcnbsd_get_longjmp_target_64 (CORE_ADDR *pc) if (target_read_memory (jb_addr + 16, buf, sizeof (buf))) return 0; - *pc = extract_address (buf, sizeof (buf)); + *pc = extract_unsigned_integer (buf, sizeof (buf)); return 1; } diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 4e3c8ec5a90..d99a2caccce 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -105,6 +105,8 @@ static void fix_common_block (struct symbol *, int); static int read_type_number (char **, int *); +static struct type *read_type (char **, struct objfile *); + static struct type *read_range_type (char **, int[2], struct objfile *); static struct type *read_sun_builtin_type (char **, int[2], struct objfile *); @@ -146,6 +148,8 @@ static struct type *read_array_type (char **, struct type *, static struct field *read_args (char **, int, struct objfile *, int *, int *); +static void add_undefined_type (struct type *); + static int read_cpp_abbrev (struct field_info *, char **, struct type *, struct objfile *); @@ -248,7 +252,7 @@ static struct symbol *current_symbol = NULL; This can be used for finding the type associated with that pair or for associating a new type with the pair. */ -struct type ** +static struct type ** dbx_lookup_type (int typenums[2]) { register int filenum = typenums[0]; @@ -2259,7 +2263,7 @@ error_type (char **pp, struct objfile *objfile) assume that type information starts with a digit, '-', or '(' in deciding whether to call read_type. */ -struct type * +static struct type * read_type (register char **pp, struct objfile *objfile) { register struct type *type = 0; @@ -5128,7 +5132,7 @@ fix_common_block (struct symbol *sym, int valu) /* Add a type to the list of undefined types to be checked through once this file has been read in. */ -void +static void add_undefined_type (struct type *type) { if (undef_types_length == undef_types_allocated) diff --git a/gdb/stabsread.h b/gdb/stabsread.h index b70f16242ee..91db978153c 100644 --- a/gdb/stabsread.h +++ b/gdb/stabsread.h @@ -130,16 +130,10 @@ EXTERN int n_this_object_header_files; EXTERN int n_allocated_this_object_header_files; -extern struct type *read_type (char **, struct objfile *); - extern void cleanup_undefined_types (void); -extern struct type **dbx_lookup_type (int[2]); - extern long read_number (char **, int); -extern void add_undefined_type (struct type *); - extern struct symbol *define_symbol (CORE_ADDR, char *, int, int, struct objfile *); diff --git a/gdb/stack.c b/gdb/stack.c index f99d88c5204..988e3c9bc50 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -40,6 +40,8 @@ #include "annotate.h" #include "ui-out.h" #include "block.h" +#include "stack.h" +#include "gdb_assert.h" #include "dictionary.h" /* Prototypes for exported functions. */ @@ -72,8 +74,6 @@ void frame_command (char *, int); static void current_frame_command (char *, int); -static void select_frame_command (char *, int); - static void print_frame_arg_vars (struct frame_info *, struct ui_file *); static void catch_info (char *, int); @@ -169,6 +169,225 @@ struct print_args_args static int print_args_stub (void *); +/* Print nameless args on STREAM. + FI is the frameinfo for this frame, START is the offset + of the first nameless arg, and NUM is the number of nameless args to + print. FIRST is nonzero if this is the first argument (not just + the first nameless arg). */ + +static void +print_frame_nameless_args (struct frame_info *fi, long start, int num, + int first, struct ui_file *stream) +{ + int i; + CORE_ADDR argsaddr; + long arg_value; + + for (i = 0; i < num; i++) + { + QUIT; + argsaddr = get_frame_args_address (fi); + if (!argsaddr) + return; + arg_value = read_memory_integer (argsaddr + start, sizeof (int)); + if (!first) + fprintf_filtered (stream, ", "); + fprintf_filtered (stream, "%ld", arg_value); + first = 0; + start += sizeof (int); + } +} + +/* Print the arguments of a stack frame, given the function FUNC + running in that frame (as a symbol), the info on the frame, + and the number of args according to the stack frame (or -1 if unknown). */ + +/* References here and elsewhere to "number of args according to the + stack frame" appear in all cases to refer to "number of ints of args + according to the stack frame". At least for VAX, i386, isi. */ + +static void +print_frame_args (struct symbol *func, struct frame_info *fi, int num, + struct ui_file *stream) +{ + struct block *b = NULL; + int first = 1; + struct dict_iterator iter; + register struct symbol *sym; + struct value *val; + /* Offset of next stack argument beyond the one we have seen that is + at the highest offset. + -1 if we haven't come to a stack argument yet. */ + long highest_offset = -1; + int arg_size; + /* Number of ints of arguments that we have printed so far. */ + int args_printed = 0; + struct cleanup *old_chain, *list_chain; + struct ui_stream *stb; + + stb = ui_out_stream_new (uiout); + old_chain = make_cleanup_ui_out_stream_delete (stb); + + if (func) + { + b = SYMBOL_BLOCK_VALUE (func); + + ALL_BLOCK_SYMBOLS (b, iter, sym) + { + QUIT; + + /* Keep track of the highest stack argument offset seen, and + skip over any kinds of symbols we don't care about. */ + + switch (SYMBOL_CLASS (sym)) + { + case LOC_ARG: + case LOC_REF_ARG: + { + long current_offset = SYMBOL_VALUE (sym); + arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym)); + + /* Compute address of next argument by adding the size of + this argument and rounding to an int boundary. */ + current_offset = + ((current_offset + arg_size + sizeof (int) - 1) + & ~(sizeof (int) - 1)); + + /* If this is the highest offset seen yet, set highest_offset. */ + if (highest_offset == -1 + || (current_offset > highest_offset)) + highest_offset = current_offset; + + /* Add the number of ints we're about to print to args_printed. */ + args_printed += (arg_size + sizeof (int) - 1) / sizeof (int); + } + + /* We care about types of symbols, but don't need to keep track of + stack offsets in them. */ + case LOC_REGPARM: + 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. */ + default: + continue; + } + + /* We have to look up the symbol because arguments can have + two entries (one a parameter, one a local) and the one we + want is the local, which lookup_symbol will find for us. + This includes gcc1 (not gcc2) on the sparc when passing a + small structure and gcc2 when the argument type is float + and it is passed as a double and converted to float by + the prologue (in the latter case the type of the LOC_ARG + symbol is double and the type of the LOC_LOCAL symbol is + float). */ + /* But if the parameter name is null, don't try it. + Null parameter names occur on the RS/6000, for traceback tables. + FIXME, should we even print them? */ + + if (*DEPRECATED_SYMBOL_NAME (sym)) + { + struct symbol *nsym; + nsym = lookup_symbol + (DEPRECATED_SYMBOL_NAME (sym), + b, VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); + if (SYMBOL_CLASS (nsym) == LOC_REGISTER) + { + /* There is a LOC_ARG/LOC_REGISTER pair. This means that + it was passed on the stack and loaded into a register, + or passed in a register and stored in a stack slot. + GDB 3.x used the LOC_ARG; GDB 4.0-4.11 used the LOC_REGISTER. + + Reasons for using the LOC_ARG: + (1) because find_saved_registers may be slow for remote + debugging, + (2) because registers are often re-used and stack slots + rarely (never?) are. Therefore using the stack slot is + much less likely to print garbage. + + Reasons why we might want to use the LOC_REGISTER: + (1) So that the backtrace prints the same value as + "print foo". I see no compelling reason why this needs + to be the case; having the backtrace print the value which + was passed in, and "print foo" print the value as modified + within the called function, makes perfect sense to me. + + Additional note: It might be nice if "info args" displayed + both values. + One more note: There is a case with sparc structure passing + where we need to use the LOC_REGISTER, but this is dealt with + by creating a single LOC_REGPARM in symbol reading. */ + + /* Leave sym (the LOC_ARG) alone. */ + ; + } + else + sym = nsym; + } + + /* Print the current arg. */ + if (!first) + ui_out_text (uiout, ", "); + ui_out_wrap_hint (uiout, " "); + + annotate_arg_begin (); + + list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL); + fprintf_symbol_filtered (stb->stream, SYMBOL_PRINT_NAME (sym), + SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI); + ui_out_field_stream (uiout, "name", stb); + annotate_arg_name_end (); + ui_out_text (uiout, "="); + + /* Avoid value_print because it will deref ref parameters. We just + want to print their addresses. Print ??? for args whose address + we do not know. We pass 2 as "recurse" to val_print because our + standard indentation here is 4 spaces, and val_print indents + 2 for each recurse. */ + val = read_var_value (sym, fi); + + annotate_arg_value (val == NULL ? NULL : VALUE_TYPE (val)); + + if (val) + { + val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0, + VALUE_ADDRESS (val), + stb->stream, 0, 0, 2, Val_no_prettyprint); + ui_out_field_stream (uiout, "value", stb); + } + else + ui_out_text (uiout, "???"); + + /* Invoke ui_out_tuple_end. */ + do_cleanups (list_chain); + + annotate_arg_end (); + + first = 0; + } + } + + /* Don't print nameless args in situations where we don't know + enough about the stack to find them. */ + if (num != -1) + { + long start; + + if (highest_offset == -1) + start = FRAME_ARGS_SKIP; + else + start = highest_offset; + + print_frame_nameless_args (fi, start, num - args_printed, + first, stream); + } + do_cleanups (old_chain); +} + /* Pass the args the way catch_errors wants them. */ static int @@ -177,7 +396,13 @@ print_args_stub (void *args) int numargs; struct print_args_args *p = (struct print_args_args *) args; - numargs = FRAME_NUM_ARGS (p->fi); + if (FRAME_NUM_ARGS_P ()) + { + numargs = FRAME_NUM_ARGS (p->fi); + gdb_assert (numargs >= 0); + } + else + numargs = -1; print_frame_args (p->func, p->fi, numargs, p->stream); return 0; } @@ -761,15 +986,22 @@ frame_info (char *addr_exp, int from_tty) print_address_numeric (arg_list, 1, gdb_stdout); printf_filtered (","); - numargs = FRAME_NUM_ARGS (fi); - if (numargs < 0) - puts_filtered (" args: "); - else if (numargs == 0) - puts_filtered (" no args."); - else if (numargs == 1) - puts_filtered (" 1 arg: "); + if (!FRAME_NUM_ARGS_P ()) + { + numargs = -1; + puts_filtered (" args: "); + } else - printf_filtered (" %d args: ", numargs); + { + numargs = FRAME_NUM_ARGS (fi); + gdb_assert (numargs >= 0); + if (numargs == 0) + puts_filtered (" no args."); + else if (numargs == 1) + puts_filtered (" 1 arg: "); + else + printf_filtered (" %d args: ", numargs); + } print_frame_args (func, fi, numargs, gdb_stdout); puts_filtered ("\n"); } @@ -1077,13 +1309,13 @@ backtrace_full_command (char *arg, int from_tty) Return 1 if any variables were printed; 0 otherwise. */ static int -print_block_frame_locals (struct block *b, register struct frame_info *fi, - int num_tabs, register struct ui_file *stream) +print_block_frame_locals (struct block *b, struct frame_info *fi, + int num_tabs, struct ui_file *stream) { struct dict_iterator iter; - register int j; - register struct symbol *sym; - register int values_printed = 0; + int j; + struct symbol *sym; + int values_printed = 0; ALL_BLOCK_SYMBOLS (b, iter, sym) { @@ -1462,14 +1694,7 @@ find_relative_frame (register struct frame_info *frame, and select it. See parse_frame_specification for more info on proper frame expressions. */ -/* ARGSUSED */ void -select_frame_command_wrapper (char *level_exp, int from_tty) -{ - select_frame_command (level_exp, from_tty); -} - -static void select_frame_command (char *level_exp, int from_tty) { struct frame_info *frame; diff --git a/gdb/std-regs.c b/gdb/std-regs.c index 93d5102661c..1241852383a 100644 --- a/gdb/std-regs.c +++ b/gdb/std-regs.c @@ -133,6 +133,8 @@ value_of_builtin_frame_ps_reg (struct frame_info *frame) error ("Standard register ``$ps'' is not available for this target"); } +extern initialize_file_ftype _initialize_frame_reg; /* -Wmissing-prototypes */ + void _initialize_frame_reg (void) { diff --git a/gdb/symfile.c b/gdb/symfile.c index fb36ddbfc8d..2677350426c 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -369,6 +369,22 @@ find_lowest_section (bfd *abfd, asection *sect, void *obj) *lowest = sect; } +/* Create a new section_addr_info, with room for NUM_SECTIONS. */ + +struct section_addr_info * +alloc_section_addr_info (size_t num_sections) +{ + struct section_addr_info *sap; + size_t size; + + size = (sizeof (struct section_addr_info) + + sizeof (struct other_sections) * (num_sections - 1)); + sap = (struct section_addr_info *) xmalloc (size); + memset (sap, 0, size); + sap->num_sections = num_sections; + + return sap; +} /* Build (allocate and populate) a section_addr_info struct from an existing section table. */ @@ -381,14 +397,13 @@ build_section_addr_info_from_section_table (const struct section_table *start, const struct section_table *stp; int oidx; - sap = xmalloc (sizeof (struct section_addr_info)); - memset (sap, 0, sizeof (struct section_addr_info)); + sap = alloc_section_addr_info (end - start); for (stp = start, oidx = 0; stp != end; stp++) { if (bfd_get_section_flags (stp->bfd, stp->the_bfd_section) & (SEC_ALLOC | SEC_LOAD) - && oidx < MAX_SECTIONS) + && oidx < end - start) { sap->other[oidx].addr = stp->addr; sap->other[oidx].name @@ -409,7 +424,7 @@ free_section_addr_info (struct section_addr_info *sap) { int idx; - for (idx = 0; idx < MAX_SECTIONS; idx++) + for (idx = 0; idx < sap->num_sections; idx++) if (sap->other[idx].name) xfree (sap->other[idx].name); xfree (sap); @@ -482,14 +497,16 @@ default_symfile_offsets (struct objfile *objfile, { int i; - objfile->num_sections = SECT_OFF_MAX; + objfile->num_sections = bfd_count_sections (objfile->obfd); objfile->section_offsets = (struct section_offsets *) - obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS); - memset (objfile->section_offsets, 0, SIZEOF_SECTION_OFFSETS); + obstack_alloc (&objfile->psymbol_obstack, + SIZEOF_N_SECTION_OFFSETS (objfile->num_sections)); + memset (objfile->section_offsets, 0, + SIZEOF_N_SECTION_OFFSETS (objfile->num_sections)); /* Now calculate offsets for section that were specified by the caller. */ - for (i = 0; i < MAX_SECTIONS && addrs->other[i].name; i++) + for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++) { struct other_sections *osp ; @@ -549,26 +566,11 @@ syms_from_objfile (struct objfile *objfile, int mainline, int verbo) { - asection *lower_sect; - asection *sect; - CORE_ADDR lower_offset; - struct section_addr_info local_addr; + struct section_addr_info *local_addr = NULL; struct cleanup *old_chain; - int i; gdb_assert (! (addrs && offsets)); - /* If ADDRS and OFFSETS are both NULL, put together a dummy address - list. We now establish the convention that an addr of zero means - no load address was specified. */ - if (! addrs && ! offsets) - { - memset (&local_addr, 0, sizeof (local_addr)); - addrs = &local_addr; - } - - /* Now either addrs or offsets is non-zero. */ - init_entry_point_info (objfile); find_sym_fns (objfile); @@ -579,6 +581,19 @@ syms_from_objfile (struct objfile *objfile, if an error occurs during symbol reading. */ old_chain = make_cleanup_free_objfile (objfile); + /* If ADDRS and OFFSETS are both NULL, put together a dummy address + list. We now establish the convention that an addr of zero means + no load address was specified. */ + if (! addrs && ! offsets) + { + local_addr + = alloc_section_addr_info (bfd_count_sections (objfile->obfd)); + make_cleanup (xfree, local_addr); + addrs = local_addr; + } + + /* Now either addrs or offsets is non-zero. */ + if (mainline) { /* We will modify the main symbol table, make sure that all its users @@ -607,8 +622,13 @@ syms_from_objfile (struct objfile *objfile, We no longer warn if the lowest section is not a text segment (as happens for the PA64 port. */ - if (!mainline) + if (!mainline && addrs && addrs->other[0].name) { + asection *lower_sect; + asection *sect; + CORE_ADDR lower_offset; + int i; + /* Find lowest loadable section to be used as starting point for continguous sections. FIXME!! won't work without call to find .text first, but this assumes text is lowest section. */ @@ -640,9 +660,7 @@ syms_from_objfile (struct objfile *objfile, (the loadable section directly below it in memory). this_offset = lower_offset = lower_addr - lower_orig_addr */ - /* Calculate offsets for sections. */ - if (addrs) - for (i=0 ; i < MAX_SECTIONS && addrs->other[i].name; i++) + for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++) { if (addrs->other[i].addr != 0) { @@ -726,7 +744,7 @@ syms_from_objfile (struct objfile *objfile, int i; for (i = 0; - !s_addr && i < MAX_SECTIONS && addrs->other[i].name; + !s_addr && i < addrs->num_sections && addrs->other[i].name; i++) if (strcmp (bfd_section_name (s->objfile->obfd, s->the_bfd_section), @@ -760,13 +778,6 @@ syms_from_objfile (struct objfile *objfile, /* Discard cleanups as symbol reading was successful. */ discard_cleanups (old_chain); - - /* Call this after reading in a new symbol table to give target - dependent code a crack at the new symbols. For instance, this - could be used to update the values of target-specific symbols GDB - needs to keep track of (such as _sigtramp, or whatever). */ - - TARGET_SYMFILE_POSTREAD (objfile); } /* Perform required actions after either reading in the initial @@ -824,10 +835,8 @@ symbol_file_add_with_addrs_or_offsets (char *name, int from_tty, struct partial_symtab *psymtab; char *debugfile; bfd *abfd; - struct section_addr_info orig_addrs; - - if (addrs) - orig_addrs = *addrs; + struct section_addr_info *orig_addrs; + struct cleanup *my_cleanups; /* Open a bfd for the file, and give user a chance to burp if we'd be interactively wiping out any existing symbols. */ @@ -842,6 +851,11 @@ symbol_file_add_with_addrs_or_offsets (char *name, int from_tty, objfile = allocate_objfile (abfd, flags); + orig_addrs = alloc_section_addr_info (bfd_count_sections (abfd)); + my_cleanups = make_cleanup (xfree, orig_addrs); + if (addrs) + *orig_addrs = *addrs; + /* If the objfile uses a mapped symbol file, and we have a psymtab for it, then skip reading any symbols at this time. */ @@ -908,7 +922,7 @@ symbol_file_add_with_addrs_or_offsets (char *name, int from_tty, if (addrs != NULL) { objfile->separate_debug_objfile - = symbol_file_add (debugfile, from_tty, &orig_addrs, 0, flags); + = symbol_file_add (debugfile, from_tty, orig_addrs, 0, flags); } else { @@ -947,6 +961,8 @@ symbol_file_add_with_addrs_or_offsets (char *name, int from_tty, time. */ gdb_flush (gdb_stdout); + do_cleanups (my_cleanups); + if (objfile->sf == NULL) return objfile; /* No symbols. */ @@ -1664,15 +1680,21 @@ add_symbol_file_command (char *args, int from_tty) int expecting_sec_name = 0; int expecting_sec_addr = 0; - struct + struct sect_opt { char *name; char *value; - } sect_opts[SECT_OFF_MAX]; + }; - struct section_addr_info section_addrs; + struct section_addr_info *section_addrs; + struct sect_opt *sect_opts = NULL; + size_t num_sect_opts = 0; struct cleanup *my_cleanups = make_cleanup (null_cleanup, NULL); + num_sect_opts = 16; + sect_opts = (struct sect_opt *) xmalloc (num_sect_opts + * sizeof (struct sect_opt)); + dont_repeat (); if (args == NULL) @@ -1681,9 +1703,6 @@ add_symbol_file_command (char *args, int from_tty) /* Make a copy of the string that we can safely write into. */ args = xstrdup (args); - /* Ensure section_addrs is initialized */ - memset (§ion_addrs, 0, sizeof (section_addrs)); - while (*args != '\000') { /* Any leading spaces? */ @@ -1716,7 +1735,14 @@ add_symbol_file_command (char *args, int from_tty) to load the program. */ sect_opts[section_index].name = ".text"; sect_opts[section_index].value = arg; - section_index++; + if (++section_index > num_sect_opts) + { + num_sect_opts *= 2; + sect_opts = ((struct sect_opt *) + xrealloc (sect_opts, + num_sect_opts + * sizeof (struct sect_opt))); + } } else { @@ -1733,8 +1759,6 @@ add_symbol_file_command (char *args, int from_tty) else if (strcmp (arg, "-s") == 0) { - if (section_index >= SECT_OFF_MAX) - error ("Too many sections specified."); expecting_sec_name = 1; expecting_sec_addr = 1; } @@ -1751,7 +1775,14 @@ add_symbol_file_command (char *args, int from_tty) { sect_opts[section_index].value = arg; expecting_sec_addr = 0; - section_index++; + if (++section_index > num_sect_opts) + { + num_sect_opts *= 2; + sect_opts = ((struct sect_opt *) + xrealloc (sect_opts, + num_sect_opts + * sizeof (struct sect_opt))); + } } else error ("USAGE: add-symbol-file [-mapped] [-readnow] [-s ]*"); @@ -1767,22 +1798,20 @@ add_symbol_file_command (char *args, int from_tty) string. */ printf_filtered ("add symbol table from file \"%s\" at\n", filename); + section_addrs = alloc_section_addr_info (section_index); + make_cleanup (xfree, section_addrs); for (i = 0; i < section_index; i++) { CORE_ADDR addr; char *val = sect_opts[i].value; char *sec = sect_opts[i].name; - val = sect_opts[i].value; - if (val[0] == '0' && val[1] == 'x') - addr = strtoul (val+2, NULL, 16); - else - addr = strtoul (val, NULL, 10); + addr = parse_and_eval_address (val); /* Here we store the section offsets in the order they were entered on the command line. */ - section_addrs.other[sec_num].name = sec; - section_addrs.other[sec_num].addr = addr; + section_addrs->other[sec_num].name = sec; + section_addrs->other[sec_num].addr = addr; printf_filtered ("\t%s_addr = %s\n", sec, local_hex_string ((unsigned long)addr)); @@ -1798,7 +1827,7 @@ add_symbol_file_command (char *args, int from_tty) if (from_tty && (!query ("%s", ""))) error ("Not confirmed."); - symbol_file_add (filename, from_tty, §ion_addrs, 0, flags); + symbol_file_add (filename, from_tty, section_addrs, 0, flags); /* Getting new symbols may change our opinion about what is frameless. */ @@ -1895,8 +1924,10 @@ reread_symbols (void) /* Save the offsets, we will nuke them with the rest of the psymbol_obstack. */ num_offsets = objfile->num_sections; - offsets = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS); - memcpy (offsets, objfile->section_offsets, SIZEOF_SECTION_OFFSETS); + offsets = ((struct section_offsets *) + alloca (SIZEOF_N_SECTION_OFFSETS (num_offsets))); + memcpy (offsets, objfile->section_offsets, + SIZEOF_N_SECTION_OFFSETS (num_offsets)); /* Nuke all the state that we will re-read. Much of the following code which sets things to NULL really is necessary to tell @@ -1931,6 +1962,7 @@ reread_symbols (void) objfile->psymtabs = NULL; objfile->free_psymtabs = NULL; objfile->msymbols = NULL; + objfile->sym_private = NULL; objfile->minimal_symbol_count = 0; memset (&objfile->msymbol_hash, 0, sizeof (objfile->msymbol_hash)); @@ -1964,8 +1996,10 @@ reread_symbols (void) /* We use the same section offsets as from last time. I'm not sure whether that is always correct for shared libraries. */ objfile->section_offsets = (struct section_offsets *) - obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS); - memcpy (objfile->section_offsets, offsets, SIZEOF_SECTION_OFFSETS); + obstack_alloc (&objfile->psymbol_obstack, + SIZEOF_N_SECTION_OFFSETS (num_offsets)); + memcpy (objfile->section_offsets, offsets, + SIZEOF_N_SECTION_OFFSETS (num_offsets)); objfile->num_sections = num_offsets; /* What the hell is sym_new_init for, anyway? The concept of @@ -2009,14 +2043,6 @@ reread_symbols (void) again now. */ objfile->mtime = new_modtime; reread_one = 1; - - /* Call this after reading in a new symbol table to give target - dependent code a crack at the new symbols. For instance, this - could be used to update the values of target-specific symbols GDB - needs to keep track of (such as _sigtramp, or whatever). */ - - TARGET_SYMFILE_POSTREAD (objfile); - reread_separate_symbols (objfile); } } @@ -2957,7 +2983,7 @@ pc_in_mapped_range (CORE_ADDR pc, asection *section) /* Return true if the mapped ranges of sections A and B overlap, false otherwise. */ -int +static int sections_overlap (asection *a, asection *b) { /* FIXME: need bfd *, so we can use bfd_section_vma methods. */ diff --git a/gdb/symfile.h b/gdb/symfile.h index ca67dda52c3..fbb17bd8ce1 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -1,7 +1,7 @@ /* Definitions for reading symbol files into GDB. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003 - Free Software Foundation, Inc. + + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -26,113 +26,117 @@ /* This file requires that you first include "bfd.h" and "symtab.h". */ /* Opaque declarations. */ +struct section_table; struct objfile; 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 - grown as necessary via realloc. Each objfile typically has two of these, - one for global symbols and one for static symbols. Although this adds - a level of indirection for storing or accessing the partial symbols, - it allows us to throw away duplicate psymbols and set all pointers - to the single saved instance. */ +/* 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 grown as necessary via realloc. Each objfile typically + has two of these, one for global symbols and one for static + symbols. Although this adds a level of indirection for storing or + accessing the partial symbols, it allows us to throw away duplicate + psymbols and set all pointers to the single saved instance. */ struct psymbol_allocation_list - { +{ - /* Pointer to beginning of dynamically allocated array of pointers to - partial symbols. The array is dynamically expanded as necessary to - accommodate more pointers. */ + /* Pointer to beginning of dynamically allocated array of pointers + to partial symbols. The array is dynamically expanded as + necessary to accommodate more pointers. */ - struct partial_symbol **list; + struct partial_symbol **list; - /* Pointer to next available slot in which to store a pointer to a partial - symbol. */ + /* Pointer to next available slot in which to store a pointer to a + partial symbol. */ - struct partial_symbol **next; + struct partial_symbol **next; - /* Number of allocated pointer slots in current dynamic array (not the - number of bytes of storage). The "next" pointer will always point - somewhere between list[0] and list[size], and when at list[size] the - array will be expanded on the next attempt to store a pointer. */ + /* Number of allocated pointer slots in current dynamic array (not + the number of bytes of storage). The "next" pointer will always + point somewhere between list[0] and list[size], and when at + list[size] the array will be expanded on the next attempt to + store a pointer. */ - int size; - }; + int size; +}; /* Define an array of addresses to accommodate non-contiguous dynamic loading of modules. This is for use when entering commands, so we - can keep track of the section names until we read the file and - can map them to bfd sections. This structure is also used by - solib.c to communicate the section addresses in shared objects to - symbol_file_add (). */ - -#define MAX_SECTIONS 64 -struct section_addr_info + can keep track of the section names until we read the file and can + map them to bfd sections. This structure is also used by solib.c + to communicate the section addresses in shared objects to + symbol_file_add (). */ + +struct section_addr_info { + /* The number of sections for which address information is + available. */ + size_t num_sections; /* Sections whose names are file format dependent. */ struct other_sections { CORE_ADDR addr; char *name; int sectindex; - } other[MAX_SECTIONS]; + } other[1]; }; /* Structure to keep track of symbol reading functions for various object file types. */ struct sym_fns - { +{ - /* BFD flavour that we handle, or (as a special kludge, see xcoffread.c, - (enum bfd_flavour)-1 for xcoff). */ + /* BFD flavour that we handle, or (as a special kludge, see + xcoffread.c, (enum bfd_flavour)-1 for xcoff). */ - enum bfd_flavour sym_flavour; + enum bfd_flavour sym_flavour; - /* Initializes anything that is global to the entire symbol table. It is - called during symbol_file_add, when we begin debugging an entirely new - program. */ + /* Initializes anything that is global to the entire symbol table. + It is called during symbol_file_add, when we begin debugging an + entirely new program. */ - void (*sym_new_init) (struct objfile *); + void (*sym_new_init) (struct objfile *); - /* Reads any initial information from a symbol file, and initializes the - struct sym_fns SF in preparation for sym_read(). It is called every - time we read a symbol file for any reason. */ + /* Reads any initial information from a symbol file, and initializes + the struct sym_fns SF in preparation for sym_read(). It is + called every time we read a symbol file for any reason. */ - void (*sym_init) (struct objfile *); + void (*sym_init) (struct objfile *); - /* sym_read (objfile, mainline) - Reads a symbol file into a psymtab (or possibly a symtab). - OBJFILE is the objfile struct for the file we are reading. - MAINLINE is 1 if this is the - main symbol table being read, and 0 if a secondary - symbol file (e.g. shared library or dynamically loaded file) - is being read. */ + /* sym_read (objfile, mainline) Reads a symbol file into a psymtab + (or possibly a symtab). OBJFILE is the objfile struct for the + file we are reading. MAINLINE is 1 if this is the main symbol + table being read, and 0 if a secondary symbol file (e.g. shared + library or dynamically loaded file) is being read. */ - void (*sym_read) (struct objfile *, int); + void (*sym_read) (struct objfile *, int); - /* Called when we are finished with an objfile. Should do all cleanup - that is specific to the object file format for the particular objfile. */ + /* Called when we are finished with an objfile. Should do all + cleanup that is specific to the object file format for the + particular objfile. */ - void (*sym_finish) (struct objfile *); + void (*sym_finish) (struct objfile *); - /* This function produces a file-dependent section_offsets structure, - allocated in the objfile's storage, and based on the parameter. - The parameter is currently a CORE_ADDR (FIXME!) for backward compatibility - with the higher levels of GDB. It should probably be changed to - a string, where NULL means the default, and others are parsed in a file - dependent way. */ + /* This function produces a file-dependent section_offsets + structure, allocated in the objfile's storage, and based on the + parameter. The parameter is currently a CORE_ADDR (FIXME!) for + backward compatibility with the higher levels of GDB. It should + probably be changed to a string, where NULL means the default, + and others are parsed in a file dependent way. */ - void (*sym_offsets) (struct objfile *, struct section_addr_info *); + void (*sym_offsets) (struct objfile *, struct section_addr_info *); - /* Finds the next struct sym_fns. They are allocated and initialized - in whatever module implements the functions pointed to; an - initializer calls add_symtab_fns to add them to the global chain. */ + /* Finds the next struct sym_fns. They are allocated and + initialized in whatever module implements the functions pointed + to; an initializer calls add_symtab_fns to add them to the global + chain. */ - struct sym_fns *next; + struct sym_fns *next; - }; +}; /* The default version of sym_fns.sym_offsets for readers that don't do anything special. */ @@ -144,7 +148,7 @@ extern void default_symfile_offsets (struct objfile *objfile, extern void extend_psymbol_list (struct psymbol_allocation_list *, struct objfile *); -/* Add any kind of symbol to a psymbol_allocation_list. */ +/* Add any kind of symbol to a psymbol_allocation_list. */ /* #include "demangle.h" */ @@ -163,7 +167,6 @@ extern void add_psymbol_with_dem_name_to_list (char *, int, char *, int, enum language, struct objfile *); - extern void init_psymbol_list (struct objfile *, int); extern void sort_pst_symbols (struct partial_symtab *); @@ -179,24 +182,30 @@ extern void add_symtab_fns (struct sym_fns *); extern void init_entry_point_info (struct objfile *); extern void syms_from_objfile (struct objfile *, - struct section_addr_info *, - struct section_offsets *, int, - int, int); + struct section_addr_info *, + struct section_offsets *, int, int, int); extern void new_symfile_objfile (struct objfile *, int, int); extern struct objfile *symbol_file_add (char *, int, struct section_addr_info *, int, int); -/* Build (allocate and populate) a section_addr_info struct from - an existing section table. */ +/* Create a new section_addr_info, with room for NUM_SECTIONS. */ -struct section_table; -extern struct section_addr_info * -build_section_addr_info_from_section_table (const struct section_table *start, - const struct section_table *end); +extern struct section_addr_info *alloc_section_addr_info (size_t + num_sections); + +/* Build (allocate and populate) a section_addr_info struct from an + existing section table. */ + +extern struct section_addr_info + *build_section_addr_info_from_section_table (const struct section_table + *start, + const struct section_table + *end); -/* Free all memory allocated by build_section_addr_info_from_section_table. */ +/* Free all memory allocated by + build_section_addr_info_from_section_table. */ extern void free_section_addr_info (struct section_addr_info *); @@ -207,14 +216,14 @@ extern struct partial_symtab *start_psymtab_common (struct objfile *, struct partial_symbol **, struct partial_symbol **); -/* Make a copy of the string at PTR with SIZE characters in the symbol obstack - (and add a null character at the end in the copy). - Returns the address of the copy. */ +/* Make a copy of the string at PTR with SIZE characters in the symbol + obstack (and add a null character at the end in the copy). Returns + the address of the copy. */ extern char *obsavestring (const char *, int, struct obstack *); -/* Concatenate strings S1, S2 and S3; return the new string. - Space is found in the symbol_obstack. */ +/* Concatenate strings S1, S2 and S3; return the new string. Space is + found in the symbol_obstack. */ extern char *obconcat (struct obstack *obstackp, const char *, const char *, const char *); @@ -229,7 +238,7 @@ extern char *obconcat (struct obstack *obstackp, const char *, const char *, this flag and then add the shared library symbols as needed. Note that there is a potential for confusion, since if the shared library symbols are not loaded, commands like "info fun" will *not* - report all the functions that are actually present. */ + report all the functions that are actually present. */ extern int auto_solib_add; @@ -238,8 +247,7 @@ extern int auto_solib_add; known to the debugger would cause the total shared library symbol size to exceed this threshhold, then the shlib's symbols are not added. The threshold is ignored if the user explicitly asks for a - shlib to be added, such as when using the "sharedlibrary" - command. */ + shlib to be added, such as when using the "sharedlibrary" command. */ extern int auto_solib_limit; @@ -258,58 +266,59 @@ extern bfd *symfile_bfd_open (char *); extern int get_section_index (struct objfile *, char *); /* Utility functions for overlay sections: */ -extern enum overlay_debugging_state { - ovly_off, - ovly_on, +extern enum overlay_debugging_state +{ + ovly_off, + ovly_on, ovly_auto } overlay_debugging; extern int overlay_cache_invalid; -/* return the "mapped" overlay section containing the PC */ +/* Return the "mapped" overlay section containing the PC. */ extern asection *find_pc_mapped_section (CORE_ADDR); -/* return any overlay section containing the PC (even in its LMA region) */ +/* Return any overlay section containing the PC (even in its LMA + region). */ extern asection *find_pc_overlay (CORE_ADDR); -/* return true if the section is an overlay */ +/* Return true if the section is an overlay. */ extern int section_is_overlay (asection *); -/* return true if the overlay section is currently "mapped" */ +/* Return true if the overlay section is currently "mapped". */ extern int section_is_mapped (asection *); -/* return true if pc belongs to section's VMA */ +/* Return true if pc belongs to section's VMA. */ extern CORE_ADDR pc_in_mapped_range (CORE_ADDR, asection *); -/* return true if pc belongs to section's LMA */ +/* Return true if pc belongs to section's LMA. */ extern CORE_ADDR pc_in_unmapped_range (CORE_ADDR, asection *); -/* map an address from a section's LMA to its VMA */ +/* Map an address from a section's LMA to its VMA. */ extern CORE_ADDR overlay_mapped_address (CORE_ADDR, asection *); -/* map an address from a section's VMA to its LMA */ +/* Map an address from a section's VMA to its LMA. */ extern CORE_ADDR overlay_unmapped_address (CORE_ADDR, asection *); -/* convert an address in an overlay section (force into VMA range) */ +/* Convert an address in an overlay section (force into VMA range). */ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *); -/* Load symbols from a file. */ +/* Load symbols from a file. */ extern void symbol_file_add_main (char *args, int from_tty); -/* Clear GDB symbol tables. */ +/* Clear GDB symbol tables. */ extern void symbol_file_clear (int from_tty); extern bfd_byte *symfile_relocate_debug_section (bfd *abfd, asection *sectp, - bfd_byte *buf); + bfd_byte * buf); /* From dwarfread.c */ -extern void -dwarf_build_psymtabs (struct objfile *, int, file_ptr, unsigned int, - file_ptr, unsigned int); +extern void dwarf_build_psymtabs (struct objfile *, int, file_ptr, + unsigned int, file_ptr, unsigned int); /* From dwarf2read.c */ -extern int dwarf2_has_info (bfd * abfd); +extern int dwarf2_has_info (bfd *abfd); extern void dwarf2_build_psymtabs (struct objfile *, int); extern void dwarf2_build_frame_info (struct objfile *); @@ -318,17 +327,17 @@ extern void dwarf2_build_frame_info (struct objfile *); /* Hack to force structures to exist before use in parameter list. */ struct ecoff_debug_hack - { - struct ecoff_debug_swap *a; - struct ecoff_debug_info *b; - }; -extern void -mdebug_build_psymtabs (struct objfile *, - const struct ecoff_debug_swap *, - struct ecoff_debug_info *); - -extern void -elfmdebug_build_psymtabs (struct objfile *, - const struct ecoff_debug_swap *, asection *); +{ + struct ecoff_debug_swap *a; + struct ecoff_debug_info *b; +}; + +extern void mdebug_build_psymtabs (struct objfile *, + const struct ecoff_debug_swap *, + struct ecoff_debug_info *); + +extern void elfmdebug_build_psymtabs (struct objfile *, + const struct ecoff_debug_swap *, + asection *); #endif /* !defined(SYMFILE_H) */ diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 6997cb51026..afcafc42fca 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -88,27 +88,19 @@ static void free_symtab_block (struct objfile *, struct block *); /* Free a struct block <- B and all the symbols defined in that block. */ +/* FIXME: carlton/2003-04-28: I don't believe this is currently ever + used. */ + static void free_symtab_block (struct objfile *objfile, struct block *b) { struct dict_iterator iter; - struct symbol *sym, *prev_sym; - - prev_sym = dict_iterator_first (BLOCK_DICT (b), &iter); + struct symbol *sym; - /* Make sure there's at least one symbol to free! */ - if (prev_sym) + ALL_BLOCK_SYMBOLS (b, iter, sym) { - for (sym = dict_iterator_next (&iter); sym; - sym = dict_iterator_next (&iter)) - { - xmfree (objfile->md, DEPRECATED_SYMBOL_NAME (prev_sym)); - xmfree (objfile->md, prev_sym); - prev_sym = sym; - } - - xmfree (objfile->md, DEPRECATED_SYMBOL_NAME (prev_sym)); - xmfree (objfile->md, prev_sym); + xmfree (objfile->md, DEPRECATED_SYMBOL_NAME (sym)); + xmfree (objfile->md, sym); } dict_free (BLOCK_DICT (b)); @@ -158,7 +150,7 @@ free_symtab (register struct symtab *s) break; } - /* If there is other memory to free, free it. */ + /* If there is a single block of memory to free, free it. */ if (s->free_func != NULL) s->free_func (s); @@ -453,13 +445,13 @@ static void dump_symtab (struct objfile *objfile, struct symtab *symtab, struct ui_file *outfile) { - register int i; + int i; struct dict_iterator iter; int len, blen; - register struct linetable *l; + struct linetable *l; struct blockvector *bv; struct symbol *sym; - register struct block *b; + struct block *b; int depth; fprintf_filtered (outfile, "\nSymtab for file %s\n", symtab->filename); @@ -506,18 +498,8 @@ dump_symtab (struct objfile *objfile, struct symtab *symtab, /* NOTE: carlton/2002-09-23: If there is demand for it, we can cook up something to put in here. */ -#if 0 - /* drow/2002-07-10: We could save the total symbols count - even if we're using a hashtable, but nothing else but this message - wants it. */ - blen = BLOCK_BUCKETS (b); - if (BLOCK_HASHTABLE (b)) - fprintf_filtered (outfile, ", %d buckets in ", blen); - else - fprintf_filtered (outfile, ", %d syms in ", blen); -#else - fprintf_filtered (outfile, " in "); -#endif + fprintf_filtered (outfile, ", %d syms/buckets in ", + dict_size (BLOCK_DICT (b))); print_address_numeric (BLOCK_START (b), 1, outfile); fprintf_filtered (outfile, ".."); print_address_numeric (BLOCK_END (b), 1, outfile); diff --git a/gdb/symtab.c b/gdb/symtab.c index d8eed3517d2..678e5e5c118 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -47,6 +47,7 @@ #include "gdb_obstack.h" #include "block.h" +#include "dictionary.h" #include #include @@ -79,11 +80,6 @@ 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, - domain_enum); - static struct symbol *lookup_symbol_aux (const char *name, const char *linkage_name, const struct block *block, @@ -138,17 +134,6 @@ static void print_msymbol_info (struct minimal_symbol *); static void symtab_symbol_info (char *, domain_enum, int); -static void overload_list_add_symbol (struct symbol *sym, - const char *oload_name); - -static void make_symbol_overload_list_using (const char *func_name, - const char *namespace, - const struct block *block); - -static void make_symbol_overload_list_qualified (const char *func_name); - -static void read_in_psymtabs (const char *oload_name); - void _initialize_symtab (void); /* */ @@ -1226,7 +1211,7 @@ lookup_symbol_aux_minsyms (const char *name, bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); - /* This call used to pass `DEPRECATED_SYMBOL_NAME (msymbol)' as the + /* This call used to pass `SYMBOL_LINKAGE_NAME (msymbol)' as the `name' argument to lookup_block_symbol. But the name of a minimal symbol is always mangled, so that seems to be clearly the wrong thing to pass as the @@ -1494,7 +1479,7 @@ lookup_symbol_global (const char *name, linkage name matches it. Check the global symbols if GLOBAL, the static symbols if not */ -static struct partial_symbol * +struct partial_symbol * lookup_partial_symbol (struct partial_symtab *pst, const char *name, const char *linkage_name, int global, domain_enum domain) @@ -1770,10 +1755,11 @@ lookup_block_symbol (register const struct block *block, const char *name, if (!BLOCK_FUNCTION (block)) { for (sym = dict_iter_name_first (BLOCK_DICT (block), name, &iter); - sym; sym = dict_iter_name_next (name, &iter)) + sym != NULL; + sym = dict_iter_name_next (name, &iter)) { if (SYMBOL_DOMAIN (sym) == domain - && (linkage_name + && (linkage_name != NULL ? strcmp (SYMBOL_LINKAGE_NAME (sym), linkage_name) == 0 : 1)) return sym; } @@ -1782,20 +1768,20 @@ lookup_block_symbol (register const struct block *block, const char *name, else { /* Note that parameter symbols do not always show up last in the - list. This loop makes sure to take anything else other than - parameter symbols first; it only uses parameter symbols as a - last resort. Note that this only takes up extra computation - time on a match. */ + list; this loop makes sure to take anything else other than + parameter symbols first; it only uses parameter symbols as a + last resort. Note that this only takes up extra computation + time on a match. */ struct symbol *sym_found = NULL; for (sym = dict_iter_name_first (BLOCK_DICT (block), name, &iter); - sym; sym = dict_iter_name_next (name, &iter)) + sym != NULL; + sym = dict_iter_name_next (name, &iter)) { if (SYMBOL_DOMAIN (sym) == domain - && (linkage_name + && (linkage_name != NULL ? 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 @@ -1941,12 +1927,12 @@ find_pc_sect_symtab (CORE_ADDR pc, asection *section) struct symbol *sym = NULL; ALL_BLOCK_SYMBOLS (b, iter, sym) - { - fixup_symbol_section (sym, objfile); - if (section == SYMBOL_BFD_SECTION (sym)) - break; - } - if ((sym == NULL)) + { + fixup_symbol_section (sym, objfile); + if (section == SYMBOL_BFD_SECTION (sym)) + break; + } + if (sym == NULL) continue; /* no symbol in this symtab matches section */ } distance = BLOCK_END (b) - BLOCK_START (b); @@ -2097,7 +2083,8 @@ 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_LINKAGE_NAME (msymbol), NULL, NULL); + mfunsym = lookup_minimal_symbol_text (SYMBOL_LINKAGE_NAME (msymbol), + NULL, NULL); if (mfunsym == NULL) /* I eliminated this warning since it is coming out * in the following situation: @@ -2108,12 +2095,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", DEPRECATED_SYMBOL_NAME (msymbol)) */ ; + /* warning ("In stub for %s; unable to find real function/line info", SYMBOL_LINKAGE_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", DEPRECATED_SYMBOL_NAME (msymbol)) */ ; + /* warning ("In stub for %s; unable to find real function/line info", SYMBOL_LINKAGE_NAME (msymbol)) */ ; /* fall through */ else return find_pc_line (SYMBOL_VALUE (mfunsym), 0); @@ -3310,12 +3297,12 @@ rbreak_command (char *regexp, int from_tty) { if (p->msymbol == NULL) { - char *string = (char *) alloca (strlen (p->symtab->filename) - + strlen (DEPRECATED_SYMBOL_NAME (p->symbol)) - + 4); + char *string = alloca (strlen (p->symtab->filename) + + strlen (SYMBOL_LINKAGE_NAME (p->symbol)) + + 4); strcpy (string, p->symtab->filename); strcat (string, ":'"); - strcat (string, DEPRECATED_SYMBOL_NAME (p->symbol)); + strcat (string, SYMBOL_LINKAGE_NAME (p->symbol)); strcat (string, "'"); break_command (string, from_tty); print_symbol_info (FUNCTIONS_DOMAIN, @@ -3326,7 +3313,7 @@ rbreak_command (char *regexp, int from_tty) } else { - break_command (DEPRECATED_SYMBOL_NAME (p->msymbol), from_tty); + break_command (SYMBOL_LINKAGE_NAME (p->msymbol), from_tty); printf_filtered (" %s;\n", SYMBOL_PRINT_NAME (p->msymbol)); } @@ -3343,17 +3330,8 @@ static int return_val_index; static char **return_val; #define COMPLETION_LIST_ADD_SYMBOL(symbol, sym_text, len, text, word) \ - do { \ - if (SYMBOL_DEMANGLED_NAME (symbol) != NULL) \ - /* Put only the mangled name on the list. */ \ - /* Advantage: "b foo" completes to "b foo(int, int)" */ \ - /* Disadvantage: "b foo__i" doesn't complete. */ \ - completion_list_add_name \ - (SYMBOL_DEMANGLED_NAME (symbol), (sym_text), (len), (text), (word)); \ - else \ completion_list_add_name \ - (DEPRECATED_SYMBOL_NAME (symbol), (sym_text), (len), (text), (word)); \ - } while (0) + (SYMBOL_NATURAL_NAME (symbol), (sym_text), (len), (text), (word)) /* Test to see if the symbol specified by SYMNAME (which is already demangled for C++ symbols) matches SYM_TEXT in the first SYM_TEXT_LEN @@ -3524,14 +3502,14 @@ language_search_unquoted_string (char *text, char *p) char ** make_symbol_completion_list (char *text, char *word) { - register struct symbol *sym; - register struct symtab *s; - register struct partial_symtab *ps; - register struct minimal_symbol *msymbol; - register struct objfile *objfile; - register struct block *b, *surrounding_static_block = 0; + struct symbol *sym; + struct symtab *s; + struct partial_symtab *ps; + struct minimal_symbol *msymbol; + struct objfile *objfile; + struct block *b, *surrounding_static_block = 0; struct dict_iterator iter; - register int j; + int j; struct partial_symbol **psym; /* The symbol we are completing on. Points in same buffer as text. */ char *sym_text; @@ -3655,12 +3633,13 @@ make_symbol_completion_list (char *text, char *word) text string. Only complete on types visible from current context. */ ALL_BLOCK_SYMBOLS (b, iter, sym) - { - COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); - if (SYMBOL_CLASS (sym) == LOC_TYPEDEF) - { - struct type *t = SYMBOL_TYPE (sym); - enum type_code c = TYPE_CODE (t); + { + QUIT; + COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); + if (SYMBOL_CLASS (sym) == LOC_TYPEDEF) + { + struct type *t = SYMBOL_TYPE (sym); + enum type_code c = TYPE_CODE (t); if (c == TYPE_CODE_UNION || c == TYPE_CODE_STRUCT) { @@ -3686,9 +3665,9 @@ make_symbol_completion_list (char *text, char *word) QUIT; b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK); ALL_BLOCK_SYMBOLS (b, iter, sym) - { - COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); - } + { + COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); + } } ALL_SYMTABS (objfile, s) @@ -3699,9 +3678,9 @@ make_symbol_completion_list (char *text, char *word) if (b == surrounding_static_block) continue; ALL_BLOCK_SYMBOLS (b, iter, sym) - { - COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); - } + { + COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); + } } return (return_val); @@ -3796,15 +3775,15 @@ make_file_symbol_completion_list (char *text, char *word, char *srcfile) b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK); ALL_BLOCK_SYMBOLS (b, iter, sym) - { - COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); - } + { + COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); + } b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK); ALL_BLOCK_SYMBOLS (b, iter, sym) - { - COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); - } + { + COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); + } return (return_val); } @@ -4042,280 +4021,6 @@ in_prologue (CORE_ADDR pc, CORE_ADDR func_start) return func_addr <= pc && pc < sal.end; } - -/* Begin overload resolution functions */ - -char * -remove_params (const char *demangled_name) -{ - const char *argp; - char *new_name; - int depth; - - if (demangled_name == NULL) - return NULL; - - /* First find the end of the arg list. */ - argp = strrchr (demangled_name, ')'); - if (argp == NULL) - return NULL; - - /* Back up to the beginning. */ - depth = 1; - - while (argp-- > demangled_name) - { - if (*argp == ')') - depth ++; - else if (*argp == '(') - { - depth --; - - if (depth == 0) - break; - } - } - if (depth != 0) - internal_error (__FILE__, __LINE__, - "bad demangled name %s\n", demangled_name); - while (argp[-1] == ' ' && argp > demangled_name) - argp --; - - new_name = xmalloc (argp - demangled_name + 1); - memcpy (new_name, demangled_name, argp - demangled_name); - new_name[argp - demangled_name] = '\0'; - return new_name; -} - -/* Helper routine for make_symbol_completion_list. */ - -static int sym_return_val_size; -static int sym_return_val_index; -static struct symbol **sym_return_val; - -/* Test to see if the symbol specified by SYMNAME (which is already - demangled for C++ symbols) matches SYM_TEXT in the first SYM_TEXT_LEN - characters. If so, add it to the current completion list. */ - -static void -overload_list_add_symbol (struct symbol *sym, const char *oload_name) -{ - int newsize; - int i; - char *sym_name; - - /* If there is no type information, we can't do anything, so skip */ - if (SYMBOL_TYPE (sym) == NULL) - return; - - /* skip any symbols that we've already considered. */ - for (i = 0; i < sym_return_val_index; ++i) - if (!strcmp (DEPRECATED_SYMBOL_NAME (sym), DEPRECATED_SYMBOL_NAME (sym_return_val[i]))) - return; - - /* Get the demangled name without parameters */ - sym_name = remove_params (SYMBOL_DEMANGLED_NAME (sym)); - if (!sym_name) - return; - - /* skip symbols that cannot match */ - if (strcmp (sym_name, oload_name) != 0) - { - xfree (sym_name); - return; - } - - xfree (sym_name); - - /* We have a match for an overload instance, so add SYM to the current list - * of overload instances */ - if (sym_return_val_index + 3 > sym_return_val_size) - { - newsize = (sym_return_val_size *= 2) * sizeof (struct symbol *); - sym_return_val = (struct symbol **) xrealloc ((char *) sym_return_val, newsize); - } - sym_return_val[sym_return_val_index++] = sym; - sym_return_val[sym_return_val_index] = NULL; -} - -/* Return a null-terminated list of pointers to function symbols that - match name of the supplied symbol FSYM and that occur within the - namespace given by the initial substring of NAMESPACE_NAME of - length NAMESPACE_LEN. Apply using directives from BLOCK. This is - used in finding all overloaded instances of a function name. This - has been modified from make_symbol_completion_list. */ - -/* FIXME: carlton/2003-01-30: Should BLOCK be here? Maybe it's better - to use get_selected_block (0). */ - -struct symbol ** -make_symbol_overload_list (const char *func_name, - const char *namespace, - const struct block *block) -{ - struct cleanup *old_cleanups; - - sym_return_val_size = 100; - sym_return_val_index = 0; - sym_return_val = xmalloc ((sym_return_val_size + 1) * - sizeof (struct symbol *)); - sym_return_val[0] = NULL; - - old_cleanups = make_cleanup (xfree, sym_return_val); - - make_symbol_overload_list_using (func_name, namespace, - block); - - discard_cleanups (old_cleanups); - - return sym_return_val; -} - -/* This applies the using directives to add namespaces to search in, - and then searches for overloads in all of those namespaces. It - adds the symbols found to sym_return_val. Arguments are as in - make_symbol_overload_list. */ - -static void -make_symbol_overload_list_using (const char *func_name, - const char *namespace, - const struct block *block) -{ - const struct using_direct *current; - - /* First, go through the using directives. If any of them apply, - look in the appropriate namespaces for new functions to match - on. */ - - for (current = block_using (block); - current != NULL; - current = current->next) - { - if (strcmp (namespace, current->outer) == 0) - { - make_symbol_overload_list_using (func_name, - current->inner, - block); - } - } - - /* Now, add names for this namespace. */ - - if (namespace[0] == '\0') - { - make_symbol_overload_list_qualified (func_name); - } - else - { - char *concatenated_name - = alloca (strlen (namespace) + 2 + strlen (func_name) + 1); - strcpy (concatenated_name, namespace); - strcat (concatenated_name, "::"); - strcat (concatenated_name, func_name); - make_symbol_overload_list_qualified (concatenated_name); - } -} - -/* This does the bulk of the work of finding overloaded symbols. - FUNC_NAME is the name of the overloaded function we're looking for - (possibly including namespace info); NEW_LIST is 1 if we should - allocate a new list of overloads and 0 if we should continue using - the same old list. */ - -static void -make_symbol_overload_list_qualified (const char *func_name) -{ - struct symbol *sym; - struct symtab *s; - struct objfile *objfile; - const struct block *b, *surrounding_static_block = 0; - struct dict_iterator iter; - const struct dictionary *dict; - - /* Look through the partial symtabs for all symbols which begin - by matching FUNC_NAME. Make sure we read that symbol table in. */ - - read_in_psymtabs (func_name); - - /* Search upwards from currently selected frame (so that we can - complete on local vars. */ - - for (b = get_selected_block (0); b != NULL; b = BLOCK_SUPERBLOCK (b)) - { - dict = BLOCK_DICT (b); - - for (sym = dict_iter_name_first (dict, func_name, &iter); - sym; - sym = dict_iter_name_next (func_name, &iter)) - { - overload_list_add_symbol (sym, func_name); - } - } - - surrounding_static_block = block_static_block (get_selected_block (0)); - - /* Go through the symtabs and check the externs and statics for - symbols which match. */ - - /* FIXME: carlton/2003-01-30: Why are we checking all the statics? - Also, this shouldn't check all the globals if there's an - anonymous namespace involved somewhere. */ - - ALL_SYMTABS (objfile, s) - { - QUIT; - b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK); - dict = BLOCK_DICT (b); - - for (sym = dict_iter_name_first (dict, func_name, &iter); - sym; - sym = dict_iter_name_next (func_name, &iter)) - { - overload_list_add_symbol (sym, func_name); - } - } - - ALL_SYMTABS (objfile, s) - { - QUIT; - b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK); - /* Don't do this block twice. */ - if (b == surrounding_static_block) - continue; - dict = BLOCK_DICT (b); - - for (sym = dict_iter_name_first (dict, func_name, &iter); - sym; - sym = dict_iter_name_next (func_name, &iter)) - { - overload_list_add_symbol (sym, func_name); - } - } -} - -/* Look through the partial symtabs for all symbols which begin - by matching FUNC_NAME. Make sure we read that symbol table in. */ - -static void -read_in_psymtabs (const char *func_name) -{ - struct partial_symtab *ps; - struct objfile *objfile; - - ALL_PSYMTABS (objfile, ps) - { - if (ps->readin) - continue; - - if ((lookup_partial_symbol (ps, func_name, NULL, 1, VAR_DOMAIN) - != NULL) - || (lookup_partial_symbol (ps, func_name, NULL, 0, VAR_DOMAIN) - != NULL)) - psymtab_to_symtab (ps); - } -} - -/* End of overload resolution functions */ struct symtabs_and_lines decode_line_spec (char *string, int funfirstline) diff --git a/gdb/symtab.h b/gdb/symtab.h index 42d42f2204f..40bea1413b2 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -398,8 +398,9 @@ enum address_class /* Value is in register number SYMBOL_VALUE. Just like LOC_REGISTER except this is an argument. Probably the cleaner way to handle this would be to separate address_class (which would include - separate ARG and LOCAL to deal with FRAME_ARGS_ADDRESS versus - FRAME_LOCALS_ADDRESS), and an is_argument flag. + separate ARG and LOCAL to deal with the frame's arguments + (get_frame_args_address) versus the frame's locals + (get_frame_locals_address), and an is_argument flag. For some symbol formats (stabs, for some compilers at least), the compiler generates two symbols, an argument and a register. @@ -443,9 +444,9 @@ enum address_class /* Value is arg at SYMBOL_VALUE offset in stack frame. Differs from LOC_LOCAL in that symbol is an argument; differs from LOC_ARG in - that we find it in the frame (FRAME_LOCALS_ADDRESS), not in the - arglist (FRAME_ARGS_ADDRESS). Added for i960, which passes args - in regs then copies to frame. */ + that we find it in the frame (get_frame_locals_address), not in + the arglist (get_frame_args_address). Added for i960, which + passes args in regs then copies to frame. */ LOC_LOCAL_ARG, @@ -749,9 +750,6 @@ struct section_offsets (sizeof (struct section_offsets) \ + sizeof (((struct section_offsets *) 0)->offsets) * ((n)-1)) -/* The maximum possible size of a section_offsets table. */ -#define SIZEOF_SECTION_OFFSETS (SIZEOF_N_SECTION_OFFSETS (SECT_OFF_MAX)) - /* Each source file or header is represented by a struct symtab. These objects are chained through the `next' field. */ @@ -1050,6 +1048,13 @@ extern struct symbol *lookup_symbol_aux_block (const char *name, const domain_enum domain, struct symtab **symtab); +/* Lookup a partial symbol. */ + +extern struct partial_symbol *lookup_partial_symbol (struct partial_symtab *, + const char *, + const char *, int, + domain_enum); + /* lookup a symbol by name, within a specified block */ extern struct symbol *lookup_block_symbol (const struct block *, const char *, @@ -1320,12 +1325,6 @@ extern char **make_symbol_completion_list (char *, char *); extern char **make_file_symbol_completion_list (char *, char *, char *); -extern char *remove_params (const char *demangled_name); - -extern struct symbol **make_symbol_overload_list (const char *, - const char *, - const struct block *); - extern char **make_source_files_completion_list (char *, char *); /* symtab.c */ diff --git a/gdb/target.c b/gdb/target.c index fd0165a19ba..e7382081b9b 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -95,6 +95,8 @@ static void debug_to_attach (char *, int); static void debug_to_detach (char *, int); +static void debug_to_disconnect (char *, int); + static void debug_to_resume (ptid_t, int, enum target_signal); static ptid_t debug_to_wait (ptid_t, struct target_waitstatus *); @@ -371,6 +373,9 @@ cleanup_target (struct target_ops *t) de_fault (to_detach, (void (*) (char *, int)) target_ignore); + de_fault (to_disconnect, + (void (*) (char *, int)) + tcomplain); de_fault (to_resume, (void (*) (ptid_t, int, enum target_signal)) noprocess); @@ -556,6 +561,7 @@ update_current_target (void) INHERIT (to_attach, t); INHERIT (to_post_attach, t); INHERIT (to_detach, t); + INHERIT (to_disconnect, t); INHERIT (to_resume, t); INHERIT (to_wait, t); INHERIT (to_post_wait, t); @@ -1140,6 +1146,16 @@ target_detach (char *args, int from_tty) (current_target.to_detach) (args, from_tty); } +void +target_disconnect (char *args, int from_tty) +{ + /* Handle any optimized stores to the inferior. */ +#ifdef DO_DEFERRED_STORES + DO_DEFERRED_STORES; +#endif + (current_target.to_disconnect) (args, from_tty); +} + void target_link (char *modname, CORE_ADDR *t_reloc) { @@ -1561,6 +1577,15 @@ debug_to_detach (char *args, int from_tty) fprintf_unfiltered (gdb_stdlog, "target_detach (%s, %d)\n", args, from_tty); } +static void +debug_to_disconnect (char *args, int from_tty) +{ + debug_target.to_disconnect (args, from_tty); + + fprintf_unfiltered (gdb_stdlog, "target_disconnect (%s, %d)\n", + args, from_tty); +} + static void debug_to_resume (ptid_t ptid, int step, enum target_signal siggnal) { @@ -2202,6 +2227,7 @@ setup_target_debug (void) current_target.to_attach = debug_to_attach; current_target.to_post_attach = debug_to_post_attach; current_target.to_detach = debug_to_detach; + current_target.to_disconnect = debug_to_disconnect; current_target.to_resume = debug_to_resume; current_target.to_wait = debug_to_wait; current_target.to_post_wait = debug_to_post_wait; diff --git a/gdb/target.h b/gdb/target.h index cd822799ed6..a3e10e8ddd0 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -198,6 +198,7 @@ struct target_ops void (*to_attach) (char *, int); void (*to_post_attach) (int); void (*to_detach) (char *, int); + void (*to_disconnect) (char *, int); void (*to_resume) (ptid_t, int, enum target_signal); ptid_t (*to_wait) (ptid_t, struct target_waitstatus *); void (*to_post_wait) (ptid_t, int); @@ -414,6 +415,11 @@ extern struct target_stack_item *target_stack; extern void target_detach (char *, int); +/* Disconnect from the current target without resuming it (leaving it + waiting for a debugger). */ + +extern void target_disconnect (char *, int); + /* Resume execution of the target process PTID. STEP says whether to single-step or to run free; SIGGNAL is the signal to be given to the target, or TARGET_SIGNAL_0 for no signal. The caller may not @@ -945,12 +951,6 @@ extern void (*target_new_objfile_hook) (struct objfile *); #define target_get_thread_local_address_p() \ (target_get_thread_local_address != NULL) -/* Hook to call target-dependent code after reading in a new symbol table. */ - -#ifndef TARGET_SYMFILE_POSTREAD -#define TARGET_SYMFILE_POSTREAD(OBJFILE) -#endif - /* Hook to call target dependent code just after inferior target process has started. */ diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 862a9245e44..36de27ac9fd 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,137 @@ +2003-06-24 Joel Brobecker + + * gdb.base/bang.exp: New testcase. + +2003-06-23 Joel Brobecker + + * gdb.base/langs.exp: Add some tests for the "minimal" language + support. + +2003-06-23 Elena Zannoni + + * gdb.objc/basicclass.exp: Return -1 if we cannot compile + the testcase. + +2003-06-22 Daniel Jacobowitz + + * gdb.base/relocate.exp: Test add-symbol-file with a variable + offset. + +2003-06-22 Daniel Jacobowitz + + * gdb.c++/pr-1210.cc: New file. + * gdb.c++/pr-1210.exp: New file. + +2003-06-21 Daniel Jacobowitz + + * lib/mi-support.exp (mi_run_cmd): Expect an MI response to + 000-exec-continue. + +2003-06-15 Mark Kettenis + + * gdb.base/attach.exp: Use -1 for the ID of a nonexistent process + on *-*-*bsd* instead of *-*-freebsd*. + +2003-06-14 Andrew Cagney + + * gdb.base/store.exp: Test longest and doublest. Test all + parameters. Weaken return statement match. + * gdb.base/store.c: Add longest and doublest - aka long long and + long double functions. Put all parameters into local register + variables. Use negative values. + +2003-06-14 Andrew Cagney + + * gdb.base/fileio.c: Include , and . Gag + -Wformat errors. Add lost line. Use WEXITSTATUS to get system + exit status. + * gdb.base/fileio.exp: Disable target when nointerrupts and + noinferiorio, instead of limiting it to remote. Use remote_exec + instead of system. + +2003-06-12 Jeff Johnston + + * gdb.base/float.exp: Add ia64 support. + +2003-06-12 Corinna Vinschen + + * gdb.base/fileio.exp: Run only on remote targets. + +2003-06-10 Corinna Vinschen + + * gdb.base/fileio.c: New file, testing File-I/O. + * gdb.base/fileio.exp: Ditto. + +2003-06-09 Raoul Gough + + * gdb.base/shreloc.exp: New file, check symbol values obtained from + shared objects after relocation at load time (gdb PR/1132). + * gdb.base/shreloc.c, gdb.base/shreloc1.c, gdb.base/shreloc2.c: + as above, part of the shared object relocation test. + +2003-06-08 Mark Kettenis + + * gdb.base/readline.exp: Add tests for operate-and-get-next with a + fully filled history list. + * gdb.base/gdb_history: New file. + + * gdb.base/signals.exp: XFAIL "continue to func1" on + i*86-*-freebsd*. + + * gdb.base/attach.exp: When trying to attach to a nonexistent + process, make it possible to specify the PID based on the target, + and do so for *-*-freebsd*. + +2003-06-02 Richard Henderson + + * gdb.base/float.exp: Add expected regexp for alpha-*-*. + +2003-06-02 Richard Henderson + + * gdb.base/selftest.exp: Next over lim_at_start initialization. + +2003-06-02 Richard Henderson + + * gdb.base/dump.exp [alpha*-*-*]: Add -taso linker switch. + +2003-06-01 Daniel Jacobowitz + + * gdb.asm/asm-source.exp: Dissassemble from &globalvar instead + of globalvar. + +2003-06-01 Mark Kettenis + + * gdb.asm/asm-source.exp: Check for memory read errors in + disassembler test on *BSD too. + +2003-06-01 Richard Henderson + + * gdb.asm/alpha.inc (gdbasm_enter): Use numeric register names + for .frame. + (gdbasm_call): Lose ldgp. + (gdbasm_startup): Add frame information. + * gdb.asm/asm-source.exp (alpha*-*): Add -no-mdebug to asm-flags. + +2003-05-31 Mark Kettenis + + * gdb.base/float.exp: Expect similar output for x86_64-*-* as for + i?86-*-*. + +2003-05-30 Mark Kettenis + + * gdb.asm/asm-source.exp: Make sure the final link succeeds on + FreeBSD. + +2003-05-29 Richard Henderson + + * gdb.asm/alpha.inc: New file. + * gdb.asm/asm-source.exp: Use it. + +2003-05-29 Jim Blandy + + * gdb.base/corefile.exp: Find corefiles on Linux, which names them + 'core.PID'. + 2003-06-16 David Carlton * gdb.c++/namespace.exp: Add 'maint cp namespace' test. diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp index e4aa7be4fd9..8c3f00325ad 100644 --- a/gdb/testsuite/gdb.asm/asm-source.exp +++ b/gdb/testsuite/gdb.asm/asm-source.exp @@ -36,6 +36,12 @@ set asm-flags "" set link-flags "" switch -glob -- [istarget] { + "alpha*-*-*" { + set asm-arch alpha + # ??? Won't work with ecoff systems like Tru64, but then we also + # don't have any other -g flag that creates mdebug output. + set asm-flags "-gdwarf2 -no-mdebug -I${srcdir}/${subdir} -I${objdir}/${subdir}" + } "*arm-*-*" { set asm-arch arm } @@ -99,6 +105,15 @@ if { "${asm-arch}" == "" } { gdb_suppress_entire_file "Assembly source test -- not implemented for this target." } +# On FreeBSD, crt1.o the final link will fail because of unresolved +# symbols. It turns out that libc.so references symbols that are +# normally provided by crt1.o, which isn't linked in since we specify +# -nostartfiles. Using -nostdlib doesn't help since target_compile +# automatically adds -lm. Linking statically avoids this mess. +if [istarget "*-*-freebsd*"] then { + set link-flags "-static" +} + # Watch out, we are invoking the assembler, but the testsuite sets multilib # switches according to compiler syntax. If we pass these options straight # to the assembler, they won't always make sense. If we don't pass them to @@ -304,7 +319,7 @@ proc test_dis { command var } { global gdb_prompt send_gdb "${command}\n" gdb_expect { - -re "${var}.*:.*Cannot access" { + -re "${var}.*:.*(Cannot access|Bad address)" { # The "disassembler" was only accessing the local # executable and that would cause attempts to disassemble # variables to fail (memory not valid). @@ -321,7 +336,7 @@ proc test_dis { command var } { # See if we can look at a global variable, three ways gdb_test "print globalvar" ".* = 11" "look at global variable" -test_dis "x/i globalvar" "globalvar" +test_dis "x/i &globalvar" "globalvar" test_dis "disassem &globalvar &globalvar+1" "globalvar" # See if we can look at a static variable, three ways diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp index c561080f4fe..66e9f0ec311 100644 --- a/gdb/testsuite/gdb.base/attach.exp +++ b/gdb/testsuite/gdb.base/attach.exp @@ -106,32 +106,42 @@ proc do_attach_tests {} { } # Verify that we cannot attach to what appears to be a valid - # process ID, but is a process that doesn't exist. (I don't - # believe any process is ever assigned #0, at least on HPUX.) + # process ID, but is a process that doesn't exist. Traditionally, + # most systems didn't have a process with ID 0, so we take that as + # the default. However, there are a few exceptions. # - send_gdb "attach 0\n" + set boguspid 0 + if { [istarget "*-*-*bsd*"] } { + # In FreeBSD 5.0, PID 0 is used for "swapper". Use -1 instead + # (which should have the desired effect on any version of + # FreeBSD, and probably other *BSD's too). + set boguspid -1 + } + send_gdb "attach $boguspid\n" gdb_expect { - -re "Attaching to.*, process 0.*No such process.*$gdb_prompt $"\ - { - # Response expected on HP-UX 10.20 (i.e., ptrace-based). - pass "attach to nonexistent process is prohibited" - } - -re "Attaching to.*, process 0 failed.*Hint.*$gdb_prompt $"\ - { - # Response expected on HP-UX 11.0 (i.e., ttrace-based). - pass "attach to nonexistent process is prohibited" - } - -re "Attaching to.*, process 0.*denied.*$gdb_prompt $"\ - {pass "attach to nonexistent process is prohibited"} - -re "Attaching to.*, process 0.*Operation not permitted.*$gdb_prompt $"\ - {pass "attach to nonexistent process is prohibited"} - -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $"\ - { - # Response expected from /proc-based systems. - pass "attach to nonexistent process is prohibited" - } - -re "$gdb_prompt $" {fail "attach to nonexistent process is prohibited"} - timeout {fail "(timeout) attach to nonexistent process is prohibited"} + -re "Attaching to.*, process $boguspid.*No such process.*$gdb_prompt $"\ + { + # Response expected on ptrace-based systems (i.e. HP-UX 10.20). + pass "attach to nonexistent process is prohibited" + } + -re "Attaching to.*, process $boguspid failed.*Hint.*$gdb_prompt $"\ + { + # Response expected on ttrace-based systems (i.e. HP-UX 11.0). + pass "attach to nonexistent process is prohibited" + } + -re "Attaching to.*, process $boguspid.*denied.*$gdb_prompt $"\ + {pass "attach to nonexistent process is prohibited"} + -re "Attaching to.*, process $boguspid.*not permitted.*$gdb_prompt $"\ + {pass "attach to nonexistent process is prohibited"} + -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $"\ + { + # Response expected from /proc-based systems. + pass "attach to nonexistent process is prohibited" + } + -re "$gdb_prompt $" {fail "attach to nonexistent process is prohibited"} + timeout { + fail "(timeout) attach to nonexistent process is prohibited" + } } # Verify that we can attach to the process by first giving its diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp index 73217775e0d..d059ef56b25 100644 --- a/gdb/testsuite/gdb.base/corefile.exp +++ b/gdb/testsuite/gdb.base/corefile.exp @@ -54,16 +54,30 @@ if [get_compiler_info ${binfile}] { # allows us to generate a core on systems where it does. # # Some systems append "core" to the name of the program; others append -# the name of the program to "core". +# the name of the program to "core"; still others (like Linux, as of +# May 2003) create cores named "core.PID". In the latter case, we +# could have many core files lying around, and it may be difficult to +# tell which one is ours, so let's run the program in a subdirectory. set found 0 -catch "system \"(cd ${objdir}/${subdir}; ulimit -c unlimited; ${binfile}; true) >/dev/null 2>&1\"" +set coredir "${objdir}/${subdir}/coredir.[getpid]" +file mkdir $coredir +catch "system \"(cd ${coredir}; ulimit -c unlimited; ${binfile}; true) >/dev/null 2>&1\"" # remote_exec host "${binfile}" -foreach i "${objdir}/${subdir}/core ${objdir}/${subdir}/core.coremaker.c ${binfile}.core" { +foreach i "${coredir}/core ${coredir}/core.coremaker.c ${binfile}.core" { if [remote_file build exists $i] { remote_exec build "mv $i ${objdir}/${subdir}/corefile" set found 1 } } +# Check for "core.PID". +if { $found == 0 } { + set names [glob -nocomplain -directory $coredir core.*] + if {[llength $names] == 1} { + set corefile [file join $coredir [lindex $names 0]] + remote_exec build "mv $corefile ${objdir}/${subdir}/corefile" + set found 1 + } +} if { $found == 0 } { # The braindamaged HPUX shell quits after the ulimit -c above # without executing ${binfile}. So we try again without the @@ -77,11 +91,15 @@ if { $found == 0 } { set found 1 } } +} + +# Try to clean up after ourselves. +remote_file build delete [file join $coredir coremmap.data] +remote_exec build "rmdir $coredir" - if { $found == 0 } { - warning "can't generate a core file - core tests suppressed - check ulimit -c" - return 0 - } +if { $found == 0 } { + warning "can't generate a core file - core tests suppressed - check ulimit -c" + return 0 } # diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp index 5885307cea7..1120d41321c 100644 --- a/gdb/testsuite/gdb.base/dump.exp +++ b/gdb/testsuite/gdb.base/dump.exp @@ -31,8 +31,15 @@ set testfile "dump" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} +set options {debug} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { +if [istarget "alpha*-*-*"] then { + # SREC etc cannot handle 64-bit addresses. Force the test + # program into the low 31 bits of the address space. + lappend options "additional_flags=-Wl,-taso" +} + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${options}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } diff --git a/gdb/testsuite/gdb.base/float.exp b/gdb/testsuite/gdb.base/float.exp index 66943eff7dd..7aa75f35889 100644 --- a/gdb/testsuite/gdb.base/float.exp +++ b/gdb/testsuite/gdb.base/float.exp @@ -51,12 +51,16 @@ if ![runto_main] then { # Test "info float". -if { [istarget "arm*-*-*"] || \ +if { [istarget "alpha*-*-*"] } then { + gdb_test "info float" "f0.*" "info float" +} elseif { [istarget "arm*-*-*"] || \ [istarget "xscale*-*-*"] || \ [istarget "strongarm*-*-*"] } then { gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float" -} elseif [istarget "i?86-*-*"] then { +} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } then { gdb_test "info float" "R7:.*Status Word:.*Opcode:.*" "info float" +} elseif [istarget "ia64-*-*"] then { + gdb_test "info float" "f0.*f1.*f127.*" "info float" } else { gdb_test "info float" "No floating.point info available for this processor." "info float" } diff --git a/gdb/testsuite/gdb.base/langs.exp b/gdb/testsuite/gdb.base/langs.exp index 9ed1e91a289..8006bbfd788 100644 --- a/gdb/testsuite/gdb.base/langs.exp +++ b/gdb/testsuite/gdb.base/langs.exp @@ -145,5 +145,20 @@ if [runto csub] then { } } +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load $binfile + +# Try exercising the "minimal" language a bit... + +if [runto csub] then { + gdb_test "set lang minimal" \ + "Warning: the current language does not match this frame." \ + "set lang to minimal" + + gdb_test "print x" " = 5000" "print parameter value" +} + set timeout $oldtimeout return 0 diff --git a/gdb/testsuite/gdb.base/readline.exp b/gdb/testsuite/gdb.base/readline.exp index 8edd1333db4..511cb6ba2e5 100644 --- a/gdb/testsuite/gdb.base/readline.exp +++ b/gdb/testsuite/gdb.base/readline.exp @@ -169,7 +169,7 @@ set timeout 30 # A simple test of operate-and-get-next. operate_and_get_next "Simple operate-and-get-next" \ "p 1" ".* = 1" \ - "p 2" ".* = 2"\ + "p 2" ".* = 2" \ "p 3" ".* = 3" # Test operate-and-get-next with a secondary prompt. @@ -179,12 +179,44 @@ operate_and_get_next "operate-and-get-next with secondary prompt" \ "end" ".* = 5" +# Now repeat the first test with a history file that fills the entire +# history list. + +if [info exists env(GDBHISTFILE)] { + set old_gdbhistfile $env(GDBHISTFILE) +} +if [info exists env(HISTSIZE)] { + set old_histsize $env(HISTSIZE) +} +set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history" +set env(HISTSIZE) "10" + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir + +operate_and_get_next "Simple operate-and-get-next" \ + "p 7" ".* = 7" \ + "p 8" ".* = 8" \ + "p 9" ".* = 9" + + # Restore globals modified in this test... if [info exists old_inputrc] { set env(INPUTRC) $old_inputrc } else { unset env(INPUTRC) } +if [info exists old_gdbhistfile] { + set env(GDBHISTFILE) $old_gdbhistfile +} else { + unset env(GDBHISTFILE) +} +if [info exists old_histsize] { + set env(HISTSIZE) $old_histsize +} else { + unset env(HISTSIZE) +} set timeout $oldtimeout1 return 0 diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base/relocate.exp index bcaa48adbc2..8d8ff90bc9e 100644 --- a/gdb/testsuite/gdb.base/relocate.exp +++ b/gdb/testsuite/gdb.base/relocate.exp @@ -105,4 +105,30 @@ if { "${function_foo_addr}" == "${function_bar_addr}" } { pass "functions have different addresses" } +# Now use a variable as an offset to add-symbol-file, and check that +# the functions' addresses change. + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir + +gdb_test "set \$offset = 0x10000" "" + +# Load the object file. +gdb_test "add-symbol-file ${binfile} \$offset" \ + "Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\." \ + "add-symbol-file ${testfile}.o \$offset" \ + "add symbol table from file \".*${testfile}\\.o\" at\[ \t\r\n\]+\.text_addr = 0x10000\[\r\n\]+\\(y or n\\) " \ + "y" + +# Print the addresses of functions. +set new_function_foo_addr [get_var_address function_foo] + +# Make sure they have different addresses. +if { "${function_foo_addr}" == "${new_function_foo_addr}" } { + fail "function foo has a different address" +} else { + pass "function foo has a different address" +} + return 0 diff --git a/gdb/testsuite/gdb.base/selftest.exp b/gdb/testsuite/gdb.base/selftest.exp index 5d9419ed298..a899e360111 100644 --- a/gdb/testsuite/gdb.base/selftest.exp +++ b/gdb/testsuite/gdb.base/selftest.exp @@ -115,6 +115,10 @@ proc do_steps_and_nexts {} { set description "next over init_malloc and everything it calls" set command "next" } + -re ".*lim_at_start.*$gdb_prompt $" { + set description "next over lim_at_start initialization" + set command "next" + } -re ".*count . 0x3.*$gdb_prompt $" { set description "next over conditional stack alignment code 1" set command "next" diff --git a/gdb/testsuite/gdb.base/signals.exp b/gdb/testsuite/gdb.base/signals.exp index be974550e21..a07e3a8500a 100644 --- a/gdb/testsuite/gdb.base/signals.exp +++ b/gdb/testsuite/gdb.base/signals.exp @@ -195,6 +195,7 @@ proc signal_tests_1 {} { # a SIGTRAP, but with different symptoms. setup_xfail "vax-*-ultrix*" setup_xfail "i*86-*-bsd*" + setup_xfail "i*86-*-freebsd*" setup_xfail "i*86-pc-linux-gnu*" setup_xfail "i*86-*-solaris2*" send_gdb "continue\n" diff --git a/gdb/testsuite/gdb.base/store.c b/gdb/testsuite/gdb.base/store.c index 802945fcce1..46acc6a1c81 100644 --- a/gdb/testsuite/gdb.base/store.c +++ b/gdb/testsuite/gdb.base/store.c @@ -31,6 +31,14 @@ add_long (register long u, register long v) return u + v; } +typedef long long longest; + +longest +add_longest (register longest u, register longest v) +{ + return u + v; +} + float add_float (register float u, register float v) { @@ -43,56 +51,82 @@ add_double (register double u, register double v) return u + v; } +typedef long double doublest; + +doublest +add_doublest (register doublest u, register doublest v) +{ + return u + v; +} + /* */ char wack_char (register char u, register char v) { - register char l = u; - l = add_char (l, v); + register char l = u, r = v; + l = add_char (l, r); return l; } short wack_short (register short u, register short v) { - register short l = u; - l = add_short (l, v); + register short l = u, r = v; + l = add_short (l, r); return l; } int wack_int (register int u, register int v) { - register int l = u; - l = add_int (l, v); + register int l = u, r = v; + l = add_int (l, r); return l; } long wack_long (register long u, register long v) { - register long l = u; - l = add_long (l, v); + register long l = u, r = v; + l = add_long (l, r); + return l; +} + +long +wack_longest (register longest u, register longest v) +{ + register longest l = u, r = v; + l = add_longest (l, r); return l; } float wack_float (register float u, register float v) { - register float l = u; - l = add_float (l, v); + register float l = u, r = v; + l = add_float (l, r); return l; } double wack_double (register double u, register double v) { - register double l = u; - l = add_double (l, v); + register double l = u, r = v; + l = add_double (l, r); + return l; +} + +doublest +wack_doublest (register doublest u, register doublest v) +{ + register doublest l = u, r = v; + l = add_doublest (l, r); return l; } +/* */ + struct s_1 { short s[1]; } z_1, s_1; struct s_2 { short s[2]; } z_2, s_2; struct s_3 { short s[3]; } z_3, s_3; @@ -219,20 +253,24 @@ int main () { /* These calls are for current frame test. */ - wack_char (1, 2); - wack_short (1, 2); - wack_int (1, 2); - wack_long (1, 2); - wack_float (1, 2); - wack_double (1, 2); + wack_char (-1, -2); + wack_short (-1, -2); + wack_int (-1, -2); + wack_long (-1, -2); + wack_longest (-1, -2); + wack_float (-1, -2); + wack_double (-1, -2); + wack_doublest (-1, -2); /* These calls are for up frame. */ - wack_char (1, 2); - wack_short (1, 2); - wack_int (1, 2); - wack_long (1, 2); - wack_float (1, 2); - wack_double (1, 2); + wack_char (-1, -2); + wack_short (-1, -2); + wack_int (-1, -2); + wack_long (-1, -2); + wack_longest (-1, -2); + wack_float (-1, -2); + wack_double (-1, -2); + wack_doublest (-1, -2); /* These calls are for current frame test. */ wack_struct_1 (); diff --git a/gdb/testsuite/gdb.base/store.exp b/gdb/testsuite/gdb.base/store.exp index d6e941a19b6..5e0e60eb793 100644 --- a/gdb/testsuite/gdb.base/store.exp +++ b/gdb/testsuite/gdb.base/store.exp @@ -54,43 +54,49 @@ if ![runto_main] then { # -proc check_set { t old new add } { +proc check_set { t l r new add } { global gdb_prompt gdb_test "tbreak wack_${t}" - gdb_test "continue" "register ${t} l = u;" "continue set ${t}" - gdb_test "next" "l = add_${t} .l, v.;" "next ${t}" - gdb_test "print l" " = ${old}" "print old ${t}" + gdb_test "continue" "register ${t} l = u, r = v;" "continue to wack_${t}" + gdb_test "next" "l = add_${t} .l, r.;" "next ${t}" + gdb_test "print l" " = ${l}" "print old l - ${t}" + gdb_test "print r" " = ${r}" "print old r - ${t}" gdb_test "set variable l = 4" - gdb_test "print l" " = ${new}" "print new ${t}" + gdb_test "print l" " = ${new}" "print new l - ${t}" gdb_test "next" "return l;" - gdb_test "print l" " = ${add}" "print add ${t}" + gdb_test "print l" " = ${add}" "print add - ${t}" } -check_set "char" "1 ..001." "4 ..004." "6 ..006." -check_set "short" "1" "4" "6" -check_set "int" "1" "4" "6" -check_set "long" "1" "4" "6" -check_set "float" "1" "4" "6" -check_set "double" "1" "4" "6" +check_set "char" "-1 .*" "-2 .*" "4 ..004." "2 ..002." +check_set "short" "-1" "-2" "4" "2" +check_set "int" "-1" "-2" "4" "2" +check_set "long" "-1" "-2" "4" "2" +check_set "longest" "-1" "-2" "4" "2" +check_set "float" "-1" "-2" "4" "2" +check_set "double" "-1" "-2" "4" "2" +check_set "doublest" "-1" "-2" "4" "2" # -proc up_set { t old new } { +proc up_set { t l r new } { global gdb_prompt gdb_test "tbreak add_${t}" - gdb_test "continue" "return u . v;" "continue up ${t}" - gdb_test "up" "l = add_${t} .l, v.;" "up ${t}" - gdb_test "print l" " = ${old}" "print old up ${t}" + gdb_test "continue" "return u . v;" "continue to add_${t}" + gdb_test "up" "l = add_${t} .l, r.;" "up ${t}" + gdb_test "print l" " = ${l}" "up print old l - ${t}" + gdb_test "print r" " = ${r}" "up print old r - ${t}" gdb_test "set variable l = 4" - gdb_test "print l" " = ${new}" "print new up ${t}" + gdb_test "print l" " = ${new}" "up print new l - ${t}" } -up_set "char" "1 ..001." "4 ..004." -up_set "short" "1" "4" -up_set "int" "1" "4" -up_set "long" "1" "4" -up_set "float" "1" "4" -up_set "double" "1" "4" +up_set "char" "-1 .*" "-2 .*" "4 ..004." +up_set "short" "-1" "-2" "4" +up_set "int" "-1" "-2" "4" +up_set "long" "-1" "-2" "4" +up_set "longest" "-1" "-2" "4" +up_set "float" "-1" "-2" "4" +up_set "double" "-1" "-2" "4" +up_set "doublest" "-1" "-2" "4" # @@ -133,7 +139,11 @@ proc check_field { t } { gdb_test "tbreak wack_field_${t}" gdb_test "continue" "register struct f_${t} u = f_${t};" \ "continue field ${t}" - gdb_test "next" "return u;" "next field ${t}" + + # Match either the return statement, or the line immediatly after + # it. The compiler can end up merging the return statement into + # the return instruction. + gdb_test "next" "(return u;|\})" "next field ${t}" gdb_test "print u" " = {i = 1, j = 1, k = 1}" "old field ${t}" gdb_test "set variable u = F_${t}" diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 59076280ce8..4239a3761f3 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -636,7 +636,7 @@ proc mi_run_cmd {args} { } send_gdb "000-exec-continue\n"; gdb_expect 60 { - -re "Continu\[^\r\n\]*\[\r\n\]" {} + -re "000\\^running\[\r\n\]+$mi_gdb_prompt$" {} default {} } return; diff --git a/gdb/thread-db.c b/gdb/thread-db.c index 0a6138b3afa..a039ca28add 100644 --- a/gdb/thread-db.c +++ b/gdb/thread-db.c @@ -775,64 +775,73 @@ check_event (ptid_t ptid) td_thrinfo_t ti; td_err_e err; CORE_ADDR stop_pc; + int loop = 0; /* Bail out early if we're not at a thread event breakpoint. */ stop_pc = read_pc_pid (ptid) - DECR_PC_AFTER_BREAK; if (stop_pc != td_create_bp_addr && stop_pc != td_death_bp_addr) return; - err = td_ta_event_getmsg_p (thread_agent, &msg); - if (err != TD_OK) + /* If we are at a create breakpoint, we do not know what new lwp + was created and cannot specifically locate the event message for it. + We have to call td_ta_event_getmsg() to get + the latest message. Since we have no way of correlating whether + the event message we get back corresponds to our breakpoint, we must + loop and read all event messages, processing them appropriately. + This guarantees we will process the correct message before continuing + from the breakpoint. + + Currently, death events are not enabled. If they are enabled, + the death event can use the td_thr_event_getmsg() interface to + get the message specifically for that lwp and avoid looping + below. */ + + loop = 1; + + do { - if (err == TD_NOMSG) - return; + err = td_ta_event_getmsg_p (thread_agent, &msg); + if (err != TD_OK) + { + if (err == TD_NOMSG) + return; - error ("Cannot get thread event message: %s", thread_db_err_str (err)); - } + error ("Cannot get thread event message: %s", + thread_db_err_str (err)); + } - err = td_thr_get_info_p (msg.th_p, &ti); - if (err != TD_OK) - error ("check_event: cannot get thread info: %s", - thread_db_err_str (err)); + err = td_thr_get_info_p (msg.th_p, &ti); + if (err != TD_OK) + error ("Cannot get thread info: %s", thread_db_err_str (err)); - ptid = BUILD_THREAD (ti.ti_tid, GET_PID (ptid)); + ptid = BUILD_THREAD (ti.ti_tid, GET_PID (ptid)); - switch (msg.event) - { - case TD_CREATE: -#if 0 - /* FIXME: kettenis/2000-08-26: Since we use td_ta_event_getmsg, - there is no guarantee that the breakpoint will match the - event. Should we use td_thr_event_getmsg instead? */ + switch (msg.event) + { + case TD_CREATE: - if (stop_pc != td_create_bp_addr) - error ("Thread creation event doesn't match breakpoint."); -#endif + /* We may already know about this thread, for instance when the + user has issued the `info threads' command before the SIGTRAP + for hitting the thread creation breakpoint was reported. */ + if (!in_thread_list (ptid)) + attach_thread (ptid, msg.th_p, &ti, 1); - /* We may already know about this thread, for instance when the - user has issued the `info threads' command before the SIGTRAP - for hitting the thread creation breakpoint was reported. */ - if (!in_thread_list (ptid)) - attach_thread (ptid, msg.th_p, &ti, 1); - return; + break; - case TD_DEATH: -#if 0 - /* FIXME: See TD_CREATE. */ + case TD_DEATH: - if (stop_pc != td_death_bp_addr) - error ("Thread death event doesn't match breakpoint."); -#endif + if (!in_thread_list (ptid)) + error ("Spurious thread death event."); - if (!in_thread_list (ptid)) - error ("Spurious thread death event."); + detach_thread (ptid, 1); - detach_thread (ptid, 1); - return; + break; - default: - error ("Spurious thread event."); + default: + error ("Spurious thread event."); + } } + while (loop); } static ptid_t @@ -1011,6 +1020,18 @@ thread_db_mourn_inferior (void) proc_handle.pid = 0; target_beneath->to_mourn_inferior (); + + /* Detach thread_db target ops if not dealing with a statically + linked threaded program. This allows a corefile to be debugged + after finishing debugging of a threaded program. At present, + debugging a statically-linked threaded program is broken, but + the check is added below in the event that it is fixed in the + future. */ + if (!keep_thread_db) + { + unpush_target (&thread_db_ops); + using_thread_db = 0; + } } static int diff --git a/gdb/top.c b/gdb/top.c index fea71dfd87f..3efebecb3ec 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -171,6 +171,11 @@ int target_executing = 0; /* Level of control structure. */ static int control_level; +/* Sbrk location on entry to main. Used for statistics only. */ +#ifdef HAVE_SBRK +char *lim_at_start; +#endif + /* Signal to catch ^Z typed while reading a command: SIGTSTP or SIGCONT. */ #ifndef STOP_SIGNAL @@ -485,7 +490,7 @@ struct catch_errors_args void *func_args; }; -int +static int do_catch_errors (struct ui_out *uiout, void *data) { struct catch_errors_args *args = data; @@ -782,10 +787,8 @@ command_loop (void) if (display_space) { #ifdef HAVE_SBRK - extern char **environ; char *lim = (char *) sbrk (0); - - space_at_cmd_start = (long) (lim - (char *) &environ); + space_at_cmd_start = lim - lim_at_start; #endif } @@ -805,9 +808,8 @@ command_loop (void) if (display_space) { #ifdef HAVE_SBRK - extern char **environ; char *lim = (char *) sbrk (0); - long space_now = lim - (char *) &environ; + long space_now = lim - lim_at_start; long space_diff = space_now - space_at_cmd_start; printf_unfiltered ("Space used: %ld (%c%ld for this command)\n", @@ -1059,7 +1061,7 @@ static int operate_saved_history = -1; /* This is put on the appropriate hook and helps operate-and-get-next do its work. */ -void +static void gdb_rl_operate_and_get_next_completion (void) { int delta = where_history () - operate_saved_history; diff --git a/gdb/top.h b/gdb/top.h index ca0b3d13dc6..50361dc07ab 100644 --- a/gdb/top.h +++ b/gdb/top.h @@ -70,5 +70,16 @@ extern char *source_error; extern char *source_pre_error; extern int history_expansion_p; extern int server_command; +extern char *lim_at_start; + +extern void show_commands (char *args, int from_tty); + +extern void set_history (char *, int); + +extern void show_history (char *, int); + +extern void set_verbose (char *, int, struct cmd_list_element *); + +extern void do_restore_instream_cleanup (void *stream); #endif diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index f44f9aa9a48..9ab34614aa0 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,3 +1,31 @@ +2003-06-22 Daniel Jacobowitz + + * tui-hooks.c: Update include order. + * tui.c: Likewise. + * tuiCommand.c: Likewise. + * tuiData.c: Likewise. + * tuiDataWin.c: Likewise. + * tuiDisassem.c: Likewise. + * tuiGeneralWin.c: Likewise. + * tuiIO.c: Likewise. + * tuiLayout.c: Likewise. + * tuiRegs.c: Likewise. + * tuiSource.c: Likewise. + * tuiSourceWin.c: Likewise. + * tuiStack.c: Likewise. + * tuiWin.c: Likewise. + +2003-06-12 Andreas Schwab + + * tuiSource.c (tuiVerticalSourceScroll): Use get_frame_pc. + * tuiSourceWin.c (tuiHorizontalSourceScroll): Likewise. + * tuiStack.c (tui_get_function_from_frame): Likewise. + (tuiShowFrameInfo): Likewise. + * tuiWin.c (_makeVisibleWithNewHeight): Likewise. + * tui-hooks.c (tui_selected_frame_level_changed_hook): Likewise. + * tuiDisassem.c (tuiVerticalDisassemScroll): Likewise. + Include "disasm.h". + 2003-05-08 Andrew Cagney * tuiRegs.c: Use MAX_REGISTER_SIZE instead of diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index db6c3f666bf..e00ba857773 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -1,6 +1,6 @@ /* GDB hooks for TUI. - Copyright 2001, 2002 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -19,23 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ - -#include "config.h" -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif -#endif - #include "defs.h" #include "symtab.h" #include "inferior.h" @@ -66,6 +49,14 @@ #include "tuiDataWin.h" #include "tuiSourceWin.h" +#ifdef HAVE_NCURSES_H +#include +#else +#ifdef HAVE_CURSES_H +#include +#endif +#endif + int tui_target_has_run = 0; static void (* tui_target_new_objfile_chain) (struct objfile*); @@ -250,7 +241,7 @@ tui_selected_frame_level_changed_hook (int level) { struct symtab *s; - s = find_pc_symtab (fi->pc); + s = find_pc_symtab (get_frame_pc (fi)); /* elz: this if here fixes the problem with the pc not being displayed in the tui asm layout, with no debug symbols. The value of s would be 0 here, and select_source_symtab would abort the diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 517cf461cc5..7e665d58a79 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -1,6 +1,6 @@ /* General functions for the WDB TUI. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -22,23 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ - -#include "config.h" -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif -#endif - #include #include #include @@ -70,6 +53,14 @@ #include "symtab.h" #include "source.h" +#ifdef HAVE_NCURSES_H +#include +#else +#ifdef HAVE_CURSES_H +#include +#endif +#endif + /* Tells whether the TUI is active or not. */ int tui_active = 0; static int tui_finish_init = 1; diff --git a/gdb/tui/tuiCommand.c b/gdb/tui/tuiCommand.c index ca3d5318ea9..675b34c5443 100644 --- a/gdb/tui/tuiCommand.c +++ b/gdb/tui/tuiCommand.c @@ -1,6 +1,6 @@ /* Specific command window processing. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -22,15 +22,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ +#include "defs.h" +#include +#include "tui.h" +#include "tuiData.h" +#include "tuiWin.h" +#include "tuiIO.h" -#include "config.h" #ifdef HAVE_NCURSES_H #include #else @@ -39,13 +37,6 @@ #endif #endif -#include "defs.h" -#include -#include "tui.h" -#include "tuiData.h" -#include "tuiWin.h" -#include "tuiIO.h" - /***************************************** ** STATIC LOCAL FUNCTIONS FORWARD DECLS ** diff --git a/gdb/tui/tuiData.c b/gdb/tui/tuiData.c index 225583ea70c..5acc33cc67d 100644 --- a/gdb/tui/tuiData.c +++ b/gdb/tui/tuiData.c @@ -1,6 +1,6 @@ /* TUI data manipulation routines. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -22,15 +22,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ +#include "defs.h" +#include "symtab.h" +#include "tui.h" +#include "tuiData.h" +#include "tuiGeneralWin.h" -#include "config.h" #ifdef HAVE_NCURSES_H #include #else @@ -39,12 +36,6 @@ #endif #endif -#include "defs.h" -#include "symtab.h" -#include "tui.h" -#include "tuiData.h" -#include "tuiGeneralWin.h" - /**************************** ** GLOBAL DECLARATIONS ****************************/ diff --git a/gdb/tui/tuiDataWin.c b/gdb/tui/tuiDataWin.c index e729afc7f72..f3bedd2d6b9 100644 --- a/gdb/tui/tuiDataWin.c +++ b/gdb/tui/tuiDataWin.c @@ -1,6 +1,6 @@ /* Data/register window display. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -22,15 +22,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ +#include "defs.h" +#include "tui.h" +#include "tuiData.h" +#include "tuiGeneralWin.h" +#include "tuiRegs.h" -#include "config.h" #ifdef HAVE_NCURSES_H #include #else @@ -39,12 +36,6 @@ #endif #endif -#include "defs.h" -#include "tui.h" -#include "tuiData.h" -#include "tuiGeneralWin.h" -#include "tuiRegs.h" - /***************************************** ** STATIC LOCAL FUNCTIONS FORWARD DECLS ** diff --git a/gdb/tui/tuiDisassem.c b/gdb/tui/tuiDisassem.c index 0ddf32c1b99..e36c5df521b 100644 --- a/gdb/tui/tuiDisassem.c +++ b/gdb/tui/tuiDisassem.c @@ -1,6 +1,6 @@ /* Disassembly display. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -22,29 +22,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ - -#include "config.h" -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif -#endif - #include "defs.h" #include "symtab.h" #include "breakpoint.h" #include "frame.h" #include "value.h" #include "source.h" +#include "disasm.h" #include "tui.h" #include "tuiData.h" @@ -54,6 +38,14 @@ #include "tuiStack.h" #include "tui-file.h" +#ifdef HAVE_NCURSES_H +#include +#else +#ifdef HAVE_CURSES_H +#include +#endif +#endif + struct tui_asm_line { CORE_ADDR addr; @@ -408,7 +400,7 @@ tuiVerticalDisassemScroll (TuiScrollDirection scrollDirection, content = (TuiWinContent) disassemWin->generic.content; if (cursal.symtab == (struct symtab *) NULL) - s = find_pc_symtab (deprecated_selected_frame->pc); + s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); else s = cursal.symtab; diff --git a/gdb/tui/tuiGeneralWin.c b/gdb/tui/tuiGeneralWin.c index e250ca2ac78..42faf756284 100644 --- a/gdb/tui/tuiGeneralWin.c +++ b/gdb/tui/tuiGeneralWin.c @@ -1,6 +1,6 @@ /* General window behavior. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -22,15 +22,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ +#include "defs.h" +#include "tui.h" +#include "tuiData.h" +#include "tuiGeneralWin.h" +#include "tuiWin.h" -#include "config.h" #ifdef HAVE_NCURSES_H #include #else @@ -39,12 +36,6 @@ #endif #endif -#include "defs.h" -#include "tui.h" -#include "tuiData.h" -#include "tuiGeneralWin.h" -#include "tuiWin.h" - /*********************** ** PUBLIC FUNCTIONS ***********************/ diff --git a/gdb/tui/tuiIO.c b/gdb/tui/tuiIO.c index f53cef39d23..1a8bbc2037a 100644 --- a/gdb/tui/tuiIO.c +++ b/gdb/tui/tuiIO.c @@ -1,6 +1,6 @@ /* TUI support I/O functions. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -22,24 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ - -#include "config.h" -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif -#endif - -#include #include "defs.h" #include "terminal.h" #include "target.h" @@ -59,6 +41,15 @@ #include "cli-out.h" #include #include +#include + +#ifdef HAVE_NCURSES_H +#include +#else +#ifdef HAVE_CURSES_H +#include +#endif +#endif /* Use definition from readline 4.3. */ #undef CTRL_CHAR diff --git a/gdb/tui/tuiLayout.c b/gdb/tui/tuiLayout.c index cddbd14342f..b79bfcb8c28 100644 --- a/gdb/tui/tuiLayout.c +++ b/gdb/tui/tuiLayout.c @@ -1,6 +1,6 @@ /* TUI layout window management. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -22,23 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ - -#include "config.h" -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif -#endif - #include "defs.h" #include "command.h" #include "symtab.h" @@ -56,6 +39,14 @@ #include "tuiSourceWin.h" #include "tuiDisassem.h" +#ifdef HAVE_NCURSES_H +#include +#else +#ifdef HAVE_CURSES_H +#include +#endif +#endif + /******************************* ** Static Local Decls ********************************/ diff --git a/gdb/tui/tuiRegs.c b/gdb/tui/tuiRegs.c index 61b933444da..9f0b1a4d845 100644 --- a/gdb/tui/tuiRegs.c +++ b/gdb/tui/tuiRegs.c @@ -1,6 +1,6 @@ /* TUI display registers in window. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -22,23 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ - -#include "config.h" -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif -#endif - #include "defs.h" #include "tui.h" #include "tuiData.h" @@ -55,6 +38,14 @@ #include "tuiGeneralWin.h" #include "tui-file.h" +#ifdef HAVE_NCURSES_H +#include +#else +#ifdef HAVE_CURSES_H +#include +#endif +#endif + /***************************************** ** LOCAL DEFINITIONS ** ******************************************/ diff --git a/gdb/tui/tuiSource.c b/gdb/tui/tuiSource.c index ceccd64532e..6428130d780 100644 --- a/gdb/tui/tuiSource.c +++ b/gdb/tui/tuiSource.c @@ -1,6 +1,6 @@ /* TUI display source window. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -22,23 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ - -#include "config.h" -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif -#endif - #include "defs.h" #include #include "symtab.h" @@ -53,6 +36,13 @@ #include "tuiSourceWin.h" #include "tuiSource.h" +#ifdef HAVE_NCURSES_H +#include +#else +#ifdef HAVE_CURSES_H +#include +#endif +#endif /* Function to display source in the source window. */ TuiStatus @@ -340,7 +330,7 @@ tuiVerticalSourceScroll (TuiScrollDirection scrollDirection, struct symtab_and_line cursal = get_current_source_symtab_and_line (); if (cursal.symtab == (struct symtab *) NULL) - s = find_pc_symtab (deprecated_selected_frame->pc); + s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); else s = cursal.symtab; diff --git a/gdb/tui/tuiSourceWin.c b/gdb/tui/tuiSourceWin.c index ae844ce7029..cf5a0793f65 100644 --- a/gdb/tui/tuiSourceWin.c +++ b/gdb/tui/tuiSourceWin.c @@ -1,6 +1,6 @@ /* TUI display source/assembly window. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -22,23 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ - -#include "config.h" -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif -#endif - #include "defs.h" #include #include "symtab.h" @@ -56,6 +39,13 @@ #include "tuiSource.h" #include "tuiDisassem.h" +#ifdef HAVE_NCURSES_H +#include +#else +#ifdef HAVE_CURSES_H +#include +#endif +#endif /* Function to display the "main" routine. */ void @@ -355,7 +345,7 @@ tuiHorizontalSourceScroll (TuiWinInfoPtr winInfo, struct symtab_and_line cursal = get_current_source_symtab_and_line (); if (cursal.symtab == (struct symtab *) NULL) - s = find_pc_symtab (deprecated_selected_frame->pc); + s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); else s = cursal.symtab; diff --git a/gdb/tui/tuiStack.c b/gdb/tui/tuiStack.c index 69a6b6c662f..a6ad07af1c3 100644 --- a/gdb/tui/tuiStack.c +++ b/gdb/tui/tuiStack.c @@ -1,6 +1,6 @@ /* TUI display locator. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -22,23 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ - -#include "config.h" -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif -#endif - #include "defs.h" #include "symtab.h" #include "breakpoint.h" @@ -56,6 +39,13 @@ #include "tuiSourceWin.h" #include "tui-file.h" +#ifdef HAVE_NCURSES_H +#include +#else +#ifdef HAVE_CURSES_H +#include +#endif +#endif /* Get a printable name for the function at the address. The symbol name is demangled if demangling is turned on. @@ -233,7 +223,7 @@ tui_get_function_from_frame (struct frame_info *fi) struct ui_file *stream = tui_sfileopen (256); char *p; - print_address_symbolic (fi->pc, stream, demangle, ""); + print_address_symbolic (get_frame_pc (fi), stream, demangle, ""); p = tui_file_get_strbuf (stream); /* Use simple heuristics to isolate the function name. The symbol can @@ -356,7 +346,7 @@ tuiShowFrameInfo (struct frame_info *fi) tui_set_locator_info (sal.symtab == 0 ? "??" : sal.symtab->filename, tui_get_function_from_frame (fi), sal.line, - fi->pc); + get_frame_pc (fi)); tuiShowLocatorContent (); startLine = 0; for (i = 0; i < (sourceWindows ())->count; i++) @@ -374,10 +364,11 @@ tuiShowFrameInfo (struct frame_info *fi) } else { - if (find_pc_partial_function (fi->pc, (char **) NULL, &low, (CORE_ADDR) NULL) == 0) + if (find_pc_partial_function (get_frame_pc (fi), (char **) NULL, + &low, (CORE_ADDR) NULL) == 0) error ("No function contains program counter for selected frame.\n"); else - low = tuiGetLowDisassemblyAddress (low, fi->pc); + low = tuiGetLowDisassemblyAddress (low, get_frame_pc (fi)); } if (winInfo == srcWin) diff --git a/gdb/tui/tuiWin.c b/gdb/tui/tuiWin.c index 9ad82f57a65..ecd4920601b 100644 --- a/gdb/tui/tuiWin.c +++ b/gdb/tui/tuiWin.c @@ -1,6 +1,6 @@ /* TUI window generic functions. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. @@ -27,26 +27,6 @@ Author: Susan B. Macchia */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ - -#include "config.h" -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif -#endif - -#include -#include -#include #include "defs.h" #include "command.h" #include "symtab.h" @@ -66,6 +46,18 @@ #include "tuiSourceWin.h" #include "tuiDataWin.h" +#ifdef HAVE_NCURSES_H +#include +#else +#ifdef HAVE_CURSES_H +#include +#endif +#endif + +#include +#include +#include + /******************************* ** Static Local Decls ********************************/ @@ -1406,7 +1398,7 @@ _makeVisibleWithNewHeight (TuiWinInfoPtr winInfo) struct symtab_and_line cursal = get_current_source_symtab_and_line (); - s = find_pc_symtab (deprecated_selected_frame->pc); + s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); if (winInfo->generic.type == SRC_WIN) line.lineNo = cursal.line; else diff --git a/gdb/typeprint.c b/gdb/typeprint.c index ab8bf674a9b..00b0eae2342 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -33,7 +33,7 @@ #include "target.h" #include "language.h" #include "cp-abi.h" - +#include "typeprint.h" #include "gdb_string.h" #include diff --git a/gdb/ui-file.c b/gdb/ui-file.c index 3af6d2cc3b2..6ad5414b19f 100644 --- a/gdb/ui-file.c +++ b/gdb/ui-file.c @@ -25,9 +25,12 @@ #include "ui-file.h" #include "gdb_string.h" +#include + static ui_file_isatty_ftype null_file_isatty; static ui_file_write_ftype null_file_write; static ui_file_fputs_ftype null_file_fputs; +static ui_file_read_ftype null_file_read; static ui_file_flush_ftype null_file_flush; static ui_file_delete_ftype null_file_delete; static ui_file_rewind_ftype null_file_rewind; @@ -39,6 +42,7 @@ struct ui_file ui_file_flush_ftype *to_flush; ui_file_write_ftype *to_write; ui_file_fputs_ftype *to_fputs; + ui_file_read_ftype *to_read; ui_file_delete_ftype *to_delete; ui_file_isatty_ftype *to_isatty; ui_file_rewind_ftype *to_rewind; @@ -56,6 +60,7 @@ ui_file_new (void) set_ui_file_flush (file, null_file_flush); set_ui_file_write (file, null_file_write); set_ui_file_fputs (file, null_file_fputs); + set_ui_file_read (file, null_file_read); set_ui_file_isatty (file, null_file_isatty); set_ui_file_rewind (file, null_file_rewind); set_ui_file_put (file, null_file_put); @@ -123,6 +128,15 @@ null_file_write (struct ui_file *file, } } +static long +null_file_read (struct ui_file *file, + char *buf, + long sizeof_buf) +{ + errno = EBADF; + return 0; +} + static void null_file_fputs (const char *buf, struct ui_file *file) { @@ -186,6 +200,12 @@ ui_file_write (struct ui_file *file, file->to_write (file, buf, length_buf); } +long +ui_file_read (struct ui_file *file, char *buf, long length_buf) +{ + return file->to_read (file, buf, length_buf); +} + void fputs_unfiltered (const char *buf, struct ui_file *file) { @@ -223,6 +243,12 @@ set_ui_file_write (struct ui_file *file, file->to_write = write; } +void +set_ui_file_read (struct ui_file *file, ui_file_read_ftype *read) +{ + file->to_read = read; +} + void set_ui_file_fputs (struct ui_file *file, ui_file_fputs_ftype *fputs) { @@ -383,6 +409,7 @@ mem_file_write (struct ui_file *file, static ui_file_write_ftype stdio_file_write; static ui_file_fputs_ftype stdio_file_fputs; +static ui_file_read_ftype stdio_file_read; static ui_file_isatty_ftype stdio_file_isatty; static ui_file_delete_ftype stdio_file_delete; static struct ui_file *stdio_file_new (FILE * file, int close_p); @@ -409,6 +436,7 @@ stdio_file_new (FILE *file, int close_p) set_ui_file_flush (ui_file, stdio_file_flush); set_ui_file_write (ui_file, stdio_file_write); set_ui_file_fputs (ui_file, stdio_file_fputs); + set_ui_file_read (ui_file, stdio_file_read); set_ui_file_isatty (ui_file, stdio_file_isatty); return ui_file; } @@ -437,6 +465,16 @@ stdio_file_flush (struct ui_file *file) fflush (stdio->file); } +static long +stdio_file_read (struct ui_file *file, char *buf, long length_buf) +{ + struct stdio_file *stdio = ui_file_data (file); + if (stdio->magic != &stdio_file_magic) + internal_error (__FILE__, __LINE__, + "stdio_file_read: bad magic number"); + return read (fileno (stdio->file), buf, length_buf); +} + static void stdio_file_write (struct ui_file *file, const char *buf, long length_buf) { diff --git a/gdb/ui-file.h b/gdb/ui-file.h index 989c343dfa0..8b28d1a4139 100644 --- a/gdb/ui-file.h +++ b/gdb/ui-file.h @@ -41,6 +41,9 @@ extern void set_ui_file_write (struct ui_file *stream, ui_file_write_ftype *fput typedef void (ui_file_fputs_ftype) (const char *, struct ui_file * stream); extern void set_ui_file_fputs (struct ui_file *stream, ui_file_fputs_ftype * fputs); +typedef long (ui_file_read_ftype) (struct ui_file * stream, char *buf, long length_buf); +extern void set_ui_file_read (struct ui_file *stream, ui_file_read_ftype *fread); + typedef int (ui_file_isatty_ftype) (struct ui_file * stream); extern void set_ui_file_isatty (struct ui_file *stream, ui_file_isatty_ftype * isatty); @@ -78,6 +81,8 @@ extern char *ui_file_xstrdup (struct ui_file *file, long *length); +extern long ui_file_read (struct ui_file *file, char *buf, long length_buf); + /* Create/open a memory based file. Can be used as a scratch buffer for collecting output. */ extern struct ui_file *mem_fileopen (void); diff --git a/gdb/ui-out.c b/gdb/ui-out.c index ed32da3ded8..71e6d6ac070 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -436,15 +436,6 @@ make_cleanup_ui_out_end (struct ui_out *uiout, return make_cleanup (do_cleanup_end, end_cleanup_data); } -struct cleanup * -make_cleanup_ui_out_begin_end (struct ui_out *uiout, - enum ui_out_type type, - const char *id) -{ - ui_out_begin (uiout, type, id); - return make_cleanup_ui_out_end (uiout, type); -} - struct cleanup * make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout, const char *id) diff --git a/gdb/utils.c b/gdb/utils.c index 6d62f1c64ba..96a2490480d 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -689,42 +689,49 @@ static void internal_vproblem (struct internal_problem *problem, const char *file, int line, const char *fmt, va_list ap) { - static char msg[] = "Recursive internal problem.\n"; static int dejavu; int quit_p; int dump_core_p; + char *reason; /* Don't allow infinite error/warning recursion. */ - switch (dejavu) - { - case 0: - dejavu = 1; - break; - case 1: - dejavu = 2; - fputs_unfiltered (msg, gdb_stderr); - abort (); /* NOTE: GDB has only three calls to abort(). */ - default: - dejavu = 3; - write (STDERR_FILENO, msg, sizeof (msg)); - exit (1); - } + { + static char msg[] = "Recursive internal problem.\n"; + switch (dejavu) + { + case 0: + dejavu = 1; + break; + case 1: + dejavu = 2; + fputs_unfiltered (msg, gdb_stderr); + abort (); /* NOTE: GDB has only three calls to abort(). */ + default: + dejavu = 3; + write (STDERR_FILENO, msg, sizeof (msg)); + exit (1); + } + } /* Try to get the message out and at the start of a new line. */ target_terminal_ours (); begin_line (); - /* The error/warning message. Format using a style similar to a - compiler error message. */ - fprintf_unfiltered (gdb_stderr, "%s:%d: %s: ", file, line, problem->name); - vfprintf_unfiltered (gdb_stderr, fmt, ap); - fputs_unfiltered ("\n", gdb_stderr); - - /* Provide more details so that the user knows that they are living - on the edge. */ - fprintf_unfiltered (gdb_stderr, "\ -A problem internal to GDB has been detected. Further\n\ -debugging may prove unreliable.\n"); + /* Create a string containing the full error/warning message. Need + to call query with this full string, as otherwize the reason + (error/warning) and question become separated. Format using a + style similar to a compiler error message. Include extra detail + so that the user knows that they are living on the edge. */ + { + char *msg; + xasprintf (&msg, fmt, ap); + xasprintf (&reason, "\ +%s:%d: %s: %s\n\ +A problem internal to GDB has been detected,\n\ +further debugging may prove unreliable.", file, line, problem->name, msg); + xfree (msg); + make_cleanup (xfree, reason); + } switch (problem->should_quit) { @@ -732,7 +739,7 @@ debugging may prove unreliable.\n"); /* Default (yes/batch case) is to quit GDB. When in batch mode this lessens the likelhood of GDB going into an infinate loop. */ - quit_p = query ("Quit this debugging session? "); + quit_p = query ("%s\nQuit this debugging session? ", reason); break; case AUTO_BOOLEAN_TRUE: quit_p = 1; @@ -750,7 +757,7 @@ debugging may prove unreliable.\n"); /* Default (yes/batch case) is to dump core. This leaves a GDB `dropping' so that it is easier to see that something went wrong in GDB. */ - dump_core_p = query ("Create a core file of GDB? "); + dump_core_p = query ("%s\nCreate a core file of GDB? ", reason); break; break; case AUTO_BOOLEAN_TRUE: diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 0f896a49fb3..19bdec398e0 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -797,7 +797,7 @@ v850_scan_prologue (CORE_ADDR pc, struct prologue_info *pi) when trying to get the value of caller-saves registers for an inner frame. */ -CORE_ADDR +static CORE_ADDR v850_find_callers_reg (struct frame_info *fi, int regnum) { for (; fi; fi = get_next_frame (fi)) @@ -819,7 +819,7 @@ v850_find_callers_reg (struct frame_info *fi, int regnum) just return the stack pointer that was in use at the time the function call was made. */ -CORE_ADDR +static CORE_ADDR v850_frame_chain (struct frame_info *fi) { struct prologue_info pi; @@ -850,7 +850,7 @@ v850_frame_chain (struct frame_info *fi) /* Function: skip_prologue Return the address of the first code past the prologue of the function. */ -CORE_ADDR +static CORE_ADDR v850_skip_prologue (CORE_ADDR pc) { CORE_ADDR func_addr, func_end; @@ -880,7 +880,7 @@ v850_skip_prologue (CORE_ADDR pc) This routine gets called when either the user uses the `return' command, or the call dummy breakpoint gets hit. */ -void +static void v850_pop_frame (void) { struct frame_info *frame = get_current_frame (); @@ -917,7 +917,7 @@ v850_pop_frame (void) Stack space for the args has NOT been allocated: that job is up to us. */ -CORE_ADDR +static CORE_ADDR v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { @@ -973,7 +973,7 @@ v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp, { CORE_ADDR regval; - regval = extract_address (val, v850_register_raw_size (argreg)); + regval = extract_unsigned_integer (val, v850_register_raw_size (argreg)); write_register (argreg, regval); len -= v850_register_raw_size (argreg); @@ -997,7 +997,7 @@ v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp, Set up the return address for the inferior function call. Needed for targets where we don't actually execute a JSR/BSR instruction */ -CORE_ADDR +static CORE_ADDR v850_push_return_address (CORE_ADDR pc, CORE_ADDR sp) { write_register (E_RP_REGNUM, CALL_DUMMY_ADDRESS ()); @@ -1011,7 +1011,7 @@ v850_push_return_address (CORE_ADDR pc, CORE_ADDR sp) instead of RP, because that's where "caller" of the dummy-frame will be found. */ -CORE_ADDR +static CORE_ADDR v850_frame_saved_pc (struct frame_info *fi) { if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi), @@ -1030,7 +1030,7 @@ v850_frame_saved_pc (struct frame_info *fi) trap */ -void +static void v850_fix_call_dummy (char *dummy, CORE_ADDR sp, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p) { @@ -1068,8 +1068,8 @@ v850_extract_return_value (struct type *type, char *regbuf, char *valbuf) /* Aggregates and return values > 8 bytes are returned in memory, pointed to by R6. */ return_buffer = - extract_address (regbuf + REGISTER_BYTE (E_V0_REGNUM), - REGISTER_RAW_SIZE (E_V0_REGNUM)); + extract_unsigned_integer (regbuf + REGISTER_BYTE (E_V0_REGNUM), + REGISTER_RAW_SIZE (E_V0_REGNUM)); read_memory (return_buffer, valbuf, TYPE_LENGTH (type)); } @@ -1086,8 +1086,8 @@ v850_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) static CORE_ADDR v850_extract_struct_value_address (char *regbuf) { - return extract_address (regbuf + v850_register_byte (E_V0_REGNUM), - v850_register_raw_size (E_V0_REGNUM)); + return extract_unsigned_integer (regbuf + v850_register_byte (E_V0_REGNUM), + v850_register_raw_size (E_V0_REGNUM)); } static void @@ -1231,12 +1231,12 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_name (gdbarch, v850_register_name); set_gdbarch_deprecated_register_size (gdbarch, v850_reg_size); set_gdbarch_deprecated_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_deprecated_register_byte (gdbarch, v850_register_byte); + set_gdbarch_deprecated_register_raw_size (gdbarch, v850_register_raw_size); set_gdbarch_deprecated_max_register_raw_size (gdbarch, v850_reg_size); - set_gdbarch_register_virtual_size (gdbarch, v850_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, v850_register_raw_size); set_gdbarch_deprecated_max_register_virtual_size (gdbarch, v850_reg_size); - set_gdbarch_register_virtual_type (gdbarch, v850_reg_virtual_type); + set_gdbarch_deprecated_register_virtual_type (gdbarch, v850_reg_virtual_type); set_gdbarch_deprecated_target_read_fp (gdbarch, v850_target_read_fp); @@ -1262,8 +1262,6 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_function_start_offset (gdbarch, 0); /* This value is almost never non-zero... */ set_gdbarch_frame_args_skip (gdbarch, 0); - /* OK to default this value to 'unknown'. */ - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); /* * Call Dummies @@ -1288,11 +1286,13 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); /* Should be using push_dummy_call. */ - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); return gdbarch; } +extern initialize_file_ftype _initialize_v850_tdep; /* -Wmissing-prototypes */ + void _initialize_v850_tdep (void) { diff --git a/gdb/valops.c b/gdb/valops.c index 0bc88071030..f0d1a2a0f95 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -36,6 +36,7 @@ #include "block.h" #include "infcall.h" #include "dictionary.h" +#include "cp-support.h" #include #include "gdb_string.h" @@ -552,22 +553,6 @@ value_assign (struct value *toval, struct value *fromval) COERCE_ARRAY (fromval); CHECK_TYPEDEF (type); - /* If TOVAL is a special machine register requiring conversion - of program values to a special raw format, - convert FROMVAL's contents now, with result in `raw_buffer', - and set USE_BUFFER to the number of bytes to write. */ - - if (VALUE_REGNO (toval) >= 0) - { - int regno = VALUE_REGNO (toval); - if (CONVERT_REGISTER_P (regno)) - { - struct type *fromtype = check_typedef (VALUE_TYPE (fromval)); - VALUE_TO_REGISTER (fromtype, regno, VALUE_CONTENTS (fromval), raw_buffer); - use_buffer = REGISTER_RAW_SIZE (regno); - } - } - /* Since modifying a register can trash the frame chain, and modifying memory can trash the frame cache, we save the old frame and then restore the new frame afterwards. */ @@ -641,17 +626,8 @@ value_assign (struct value *toval, struct value *fromval) case lval_reg_frame_relative: case lval_register: { - /* value is stored in a series of registers in the frame - specified by the structure. Copy that value out, modify - it, and copy it back in. */ - int amount_copied; - int amount_to_copy; - char *buffer; - int value_reg; - int reg_offset; - int byte_offset; - int regno; struct frame_info *frame; + int value_reg; /* Figure out which frame this is in currently. */ if (VALUE_LVAL (toval) == lval_register) @@ -661,101 +637,83 @@ value_assign (struct value *toval, struct value *fromval) } else { - for (frame = get_current_frame (); - frame && get_frame_base (frame) != VALUE_FRAME (toval); - frame = get_prev_frame (frame)) - ; + frame = frame_find_by_id (VALUE_FRAME_ID (toval)); value_reg = VALUE_FRAME_REGNUM (toval); } if (!frame) error ("Value being assigned to is no longer active."); - - /* Locate the first register that falls in the value that - needs to be transfered. Compute the offset of the value in - that register. */ - { - int offset; - for (reg_offset = value_reg, offset = 0; - offset + REGISTER_RAW_SIZE (reg_offset) <= VALUE_OFFSET (toval); - reg_offset++); - byte_offset = VALUE_OFFSET (toval) - offset; - } - - /* Compute the number of register aligned values that need to - be copied. */ - if (VALUE_BITSIZE (toval)) - amount_to_copy = byte_offset + 1; - else - amount_to_copy = byte_offset + TYPE_LENGTH (type); - - /* And a bounce buffer. Be slightly over generous. */ - buffer = (char *) alloca (amount_to_copy + MAX_REGISTER_SIZE); - - /* Copy it in. */ - for (regno = reg_offset, amount_copied = 0; - amount_copied < amount_to_copy; - amount_copied += REGISTER_RAW_SIZE (regno), regno++) - { - frame_register_read (frame, regno, buffer + amount_copied); - } - /* Modify what needs to be modified. */ - if (VALUE_BITSIZE (toval)) - { - modify_field (buffer + byte_offset, - value_as_long (fromval), - VALUE_BITPOS (toval), VALUE_BITSIZE (toval)); - } - else if (use_buffer) + if (VALUE_LVAL (toval) == lval_reg_frame_relative + && CONVERT_REGISTER_P (VALUE_FRAME_REGNUM (toval), type)) { - memcpy (buffer + VALUE_OFFSET (toval), raw_buffer, use_buffer); + /* If TOVAL is a special machine register requiring + conversion of program values to a special raw format. */ + VALUE_TO_REGISTER (frame, VALUE_FRAME_REGNUM (toval), + type, VALUE_CONTENTS (fromval)); } else { - memcpy (buffer + byte_offset, VALUE_CONTENTS (fromval), - TYPE_LENGTH (type)); - /* Do any conversion necessary when storing this type to - more than one register. */ -#ifdef REGISTER_CONVERT_FROM_TYPE - REGISTER_CONVERT_FROM_TYPE (value_reg, type, - (buffer + byte_offset)); -#endif - } + /* TOVAL is stored in a series of registers in the frame + specified by the structure. Copy that value out, + modify it, and copy it back in. */ + int amount_copied; + int amount_to_copy; + char *buffer; + int reg_offset; + int byte_offset; + int regno; + + /* Locate the first register that falls in the value that + needs to be transfered. Compute the offset of the + value in that register. */ + { + int offset; + for (reg_offset = value_reg, offset = 0; + offset + REGISTER_RAW_SIZE (reg_offset) <= VALUE_OFFSET (toval); + reg_offset++); + byte_offset = VALUE_OFFSET (toval) - offset; + } - /* Copy it out. */ - for (regno = reg_offset, amount_copied = 0; - amount_copied < amount_to_copy; - amount_copied += REGISTER_RAW_SIZE (regno), regno++) - { - enum lval_type lval; - CORE_ADDR addr; - int optim; - int realnum; + /* Compute the number of register aligned values that need + to be copied. */ + if (VALUE_BITSIZE (toval)) + amount_to_copy = byte_offset + 1; + else + amount_to_copy = byte_offset + TYPE_LENGTH (type); - /* Just find out where to put it. */ - frame_register (frame, regno, &optim, &lval, &addr, &realnum, - NULL); + /* And a bounce buffer. Be slightly over generous. */ + buffer = (char *) alloca (amount_to_copy + MAX_REGISTER_SIZE); + + /* Copy it in. */ + for (regno = reg_offset, amount_copied = 0; + amount_copied < amount_to_copy; + amount_copied += REGISTER_RAW_SIZE (regno), regno++) + frame_register_read (frame, regno, buffer + amount_copied); - if (optim) - error ("Attempt to assign to a value that was optimized out."); - if (lval == lval_memory) - write_memory (addr, buffer + amount_copied, - REGISTER_RAW_SIZE (regno)); - else if (lval == lval_register) - regcache_cooked_write (current_regcache, realnum, - (buffer + amount_copied)); + /* Modify what needs to be modified. */ + if (VALUE_BITSIZE (toval)) + modify_field (buffer + byte_offset, + value_as_long (fromval), + VALUE_BITPOS (toval), VALUE_BITSIZE (toval)); + else if (use_buffer) + memcpy (buffer + VALUE_OFFSET (toval), raw_buffer, use_buffer); else - error ("Attempt to assign to an unmodifiable value."); - } + memcpy (buffer + byte_offset, VALUE_CONTENTS (fromval), + TYPE_LENGTH (type)); + + /* Copy it out. */ + for (regno = reg_offset, amount_copied = 0; + amount_copied < amount_to_copy; + amount_copied += REGISTER_RAW_SIZE (regno), regno++) + put_frame_register (frame, regno, buffer + amount_copied); + } if (register_changed_hook) register_changed_hook (-1); target_changed_event (); - + break; } - break; - default: error ("Left operand of assignment is not an lvalue."); @@ -2808,7 +2766,6 @@ value_of_local (const char *name, int complain) { struct symbol *func, *sym; struct block *b; - int i; struct value * ret; if (deprecated_selected_frame == 0) diff --git a/gdb/value.h b/gdb/value.h index 4c5453651ff..51235f9b142 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -25,6 +25,7 @@ #define VALUE_H 1 #include "doublest.h" +#include "frame.h" /* For struct frame_id. */ struct block; struct expression; @@ -77,12 +78,12 @@ struct value For BITS_BIG_ENDIAN=1 targets, it is the position of the MSB. */ int bitpos; - /* Frame value is relative to. In practice, this address is only - used if the value is stored in several registers in other than - the current frame, and these registers have not all been saved - at the same place in memory. This will be described in the - lval enum above as "lval_reg_frame_relative". */ - CORE_ADDR frame_addr; + /* Frame value is relative to. In practice, this ID is only used if + the value is stored in several registers in other than the + current frame, and these registers have not all been saved at the + same place in memory. This will be described in the lval enum + above as "lval_reg_frame_relative". */ + struct frame_id frame_id; /* Type of the value. */ struct type *type; @@ -216,7 +217,7 @@ extern int value_fetch_lazy (struct value *val); #define VALUE_ADDRESS(val) (val)->location.address #define VALUE_INTERNALVAR(val) (val)->location.internalvar #define VALUE_FRAME_REGNUM(val) ((val)->location.regnum) -#define VALUE_FRAME(val) ((val)->frame_addr) +#define VALUE_FRAME_ID(val) ((val)->frame_id) #define VALUE_OFFSET(val) (val)->offset #define VALUE_BITSIZE(val) (val)->bitsize #define VALUE_BITPOS(val) (val)->bitpos diff --git a/gdb/values.c b/gdb/values.c index ffbfe3d1669..2dc2ed8c302 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -90,7 +90,7 @@ allocate_value (struct type *type) VALUE_ENCLOSING_TYPE (val) = type; VALUE_LVAL (val) = not_lval; VALUE_ADDRESS (val) = 0; - VALUE_FRAME (val) = 0; + VALUE_FRAME_ID (val) = null_frame_id; VALUE_OFFSET (val) = 0; VALUE_BITPOS (val) = 0; VALUE_BITSIZE (val) = 0; @@ -222,7 +222,7 @@ value_copy (struct value *arg) VALUE_OFFSET (val) = VALUE_OFFSET (arg); VALUE_BITPOS (val) = VALUE_BITPOS (arg); VALUE_BITSIZE (val) = VALUE_BITSIZE (arg); - VALUE_FRAME (val) = VALUE_FRAME (arg); + VALUE_FRAME_ID (val) = VALUE_FRAME_ID (arg); VALUE_REGNO (val) = VALUE_REGNO (arg); VALUE_LAZY (val) = VALUE_LAZY (arg); VALUE_OPTIMIZED_OUT (val) = VALUE_OPTIMIZED_OUT (arg); diff --git a/gdb/varobj.c b/gdb/varobj.c index 0c9f0484268..1c5fc6382f5 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -1379,9 +1379,8 @@ make_cleanup_free_variable (struct varobj *var) return make_cleanup (do_free_variable_cleanup, var); } -/* This returns the type of the variable. This skips past typedefs - and returns the real type of the variable. It also dereferences - pointers and references. +/* This returns the type of the variable. It also skips past typedefs + to return the real type of the variable. NOTE: TYPE_TARGET_TYPE should NOT be used anywhere in this file except within get_target_type and get_type. */ @@ -1391,8 +1390,8 @@ get_type (struct varobj *var) struct type *type; type = var->type; - while (type != NULL && TYPE_CODE (type) == TYPE_CODE_TYPEDEF) - type = TYPE_TARGET_TYPE (type); + if (type != NULL) + type = check_typedef (type); return type; } @@ -1423,8 +1422,8 @@ get_target_type (struct type *type) if (type != NULL) { type = TYPE_TARGET_TYPE (type); - while (type != NULL && TYPE_CODE (type) == TYPE_CODE_TYPEDEF) - type = TYPE_TARGET_TYPE (type); + if (type != NULL) + type = check_typedef (type); } return type; diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index 814fedd8543..c2a3fbb5033 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -34,16 +34,10 @@ #include "vax-tdep.h" static gdbarch_register_name_ftype vax_register_name; -static gdbarch_register_byte_ftype vax_register_byte; -static gdbarch_register_raw_size_ftype vax_register_raw_size; -static gdbarch_register_virtual_size_ftype vax_register_virtual_size; -static gdbarch_register_virtual_type_ftype vax_register_virtual_type; static gdbarch_skip_prologue_ftype vax_skip_prologue; static gdbarch_frame_num_args_ftype vax_frame_num_args; static gdbarch_deprecated_frame_chain_ftype vax_frame_chain; -static gdbarch_frame_args_address_ftype vax_frame_args_address; -static gdbarch_frame_locals_address_ftype vax_frame_locals_address; static gdbarch_deprecated_extract_return_value_ftype vax_extract_return_value; static gdbarch_deprecated_extract_struct_value_address_ftype @@ -140,7 +134,7 @@ vax_sigtramp_saved_pc (struct frame_info *frame) /* Get sigcontext address, it is the third parameter on the stack. */ if (get_next_frame (frame)) sigcontext_addr = read_memory_typed_address - (FRAME_ARGS_ADDRESS (get_next_frame (frame)) + (DEPRECATED_FRAME_ARGS_ADDRESS (get_next_frame (frame)) + FRAME_ARGS_SKIP + sigcontext_offs, builtin_type_void_data_ptr); else @@ -162,46 +156,30 @@ vax_frame_saved_pc (struct frame_info *frame) return (read_memory_integer (get_frame_base (frame) + 16, 4)); } -CORE_ADDR -vax_frame_args_address_correct (struct frame_info *frame) -{ - /* Cannot find the AP register value directly from the FP value. Must - find it saved in the frame called by this one, or in the AP register - for the innermost frame. However, there is no way to tell the - difference between the innermost frame and a frame for which we - just don't know the frame that it called (e.g. "info frame 0x7ffec789"). - For the sake of argument, suppose that the stack is somewhat trashed - (which is one reason that "info frame" exists). So, return 0 (indicating - we don't know the address of the arglist) if we don't know what frame - this frame calls. */ - if (get_next_frame (frame)) - return (read_memory_integer (get_frame_base (get_next_frame (frame)) + 8, 4)); - - return (0); -} - static CORE_ADDR vax_frame_args_address (struct frame_info *frame) { - /* In most of GDB, getting the args address is too important to - just say "I don't know". This is sometimes wrong for functions - that aren't on top of the stack, but c'est la vie. */ + /* In most of GDB, getting the args address is too important to just + say "I don't know". This is sometimes wrong for functions that + aren't on top of the stack, but c'est la vie. */ if (get_next_frame (frame)) return (read_memory_integer (get_frame_base (get_next_frame (frame)) + 8, 4)); - - return (read_register (VAX_AP_REGNUM)); -} - -static CORE_ADDR -vax_frame_locals_address (struct frame_info *frame) -{ - return (get_frame_base (frame)); + /* Cannot find the AP register value directly from the FP value. + Must find it saved in the frame called by this one, or in the AP + register for the innermost frame. However, there is no way to + tell the difference between the innermost frame and a frame for + which we just don't know the frame that it called (e.g. "info + frame 0x7ffec789"). For the sake of argument, suppose that the + stack is somewhat trashed (which is one reason that "info frame" + exists). So, return 0 (indicating we don't know the address of + the arglist) if we don't know what frame this frame calls. */ + return 0; } static int vax_frame_num_args (struct frame_info *fi) { - return (0xff & read_memory_integer (FRAME_ARGS_ADDRESS (fi), 1)); + return (0xff & read_memory_integer (DEPRECATED_FRAME_ARGS_ADDRESS (fi), 1)); } static CORE_ADDR @@ -300,7 +278,8 @@ vax_store_return_value (struct type *valtype, char *valbuf) static CORE_ADDR vax_extract_struct_value_address (char *regbuf) { - return (extract_address (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0))); + return (extract_unsigned_integer (regbuf + REGISTER_BYTE (0), + REGISTER_RAW_SIZE (0))); } static const unsigned char * @@ -380,13 +359,13 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_name (gdbarch, vax_register_name); set_gdbarch_deprecated_register_size (gdbarch, VAX_REGISTER_SIZE); set_gdbarch_deprecated_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_deprecated_register_byte (gdbarch, vax_register_byte); + set_gdbarch_deprecated_register_raw_size (gdbarch, vax_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_deprecated_register_virtual_size (gdbarch, vax_register_virtual_size); set_gdbarch_deprecated_max_register_virtual_size (gdbarch, VAX_MAX_REGISTER_VIRTUAL_SIZE); - set_gdbarch_register_virtual_type (gdbarch, vax_register_virtual_type); + set_gdbarch_deprecated_register_virtual_type (gdbarch, vax_register_virtual_type); /* Frame and stack info */ set_gdbarch_skip_prologue (gdbarch, vax_skip_prologue); @@ -399,8 +378,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_frame_chain (gdbarch, vax_frame_chain); set_gdbarch_deprecated_frame_saved_pc (gdbarch, vax_frame_saved_pc); - set_gdbarch_frame_args_address (gdbarch, vax_frame_args_address); - set_gdbarch_frame_locals_address (gdbarch, vax_frame_locals_address); + set_gdbarch_deprecated_frame_args_address (gdbarch, vax_frame_args_address); set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, vax_frame_init_saved_regs); @@ -434,7 +412,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_believe_pcc_promotion (gdbarch, 1); /* Should be using push_dummy_call. */ - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); @@ -444,6 +422,8 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return (gdbarch); } +extern initialize_file_ftype _initialize_vax_tdep; /* -Wmissing-prototypes */ + void _initialize_vax_tdep (void) { diff --git a/gdb/version.in b/gdb/version.in index 0729879472b..0e6ab966497 100644 --- a/gdb/version.in +++ b/gdb/version.in @@ -1 +1 @@ -2003-05-23-cvs +2003-06-27-cvs diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index 72e8c3f4c73..c2227cd29fe 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -842,14 +842,17 @@ solib_symbols_add (char *name, int from_tty, CORE_ADDR load_addr) else { /* Fallback on handling just the .text section. */ - struct section_addr_info section_addrs; + struct section_addr_info *section_addrs; + struct cleanup *my_cleanups; - memset (§ion_addrs, 0, sizeof (section_addrs)); - section_addrs.other[0].name = ".text"; - section_addrs.other[0].addr = load_addr; + section_addrs = alloc_section_addr_info (1); + my_cleanups = make_cleanup (xfree, section_addrs); + section_addrs->other[0].name = ".text"; + section_addrs->other[0].addr = load_addr; result = safe_symbol_file_add (name, from_tty, §ion_addrs, 0, OBJF_SHARED); + do_cleanups (my_cleanups); } return result; diff --git a/gdb/wince.c b/gdb/wince.c index 322564e015e..41541dc11cb 100644 --- a/gdb/wince.c +++ b/gdb/wince.c @@ -56,6 +56,9 @@ #include "wince-stub.h" #include #include "regcache.h" +#ifdef MIPS +#include "mips-tdep.h" +#endif /* The ui's event loop. */ extern int (*ui_loop_hook) (int signo); diff --git a/gdb/x86-64-linux-nat.c b/gdb/x86-64-linux-nat.c index 044236ce320..4a989ce07a7 100644 --- a/gdb/x86-64-linux-nat.c +++ b/gdb/x86-64-linux-nat.c @@ -25,20 +25,30 @@ #include "inferior.h" #include "gdbcore.h" #include "regcache.h" + #include "gdb_assert.h" #include "gdb_string.h" -#include "x86-64-tdep.h" - #include #include #include #include #include +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" + +#include "x86-64-tdep.h" + +/* The register sets used in GNU/Linux ELF core-dumps are identical to + the register sets used by `ptrace'. The corresponding types are + `elf_gregset_t' for the general-purpose registers (with + `elf_greg_t' the type of a single GP register) and `elf_fpregset_t' + for the floating-point registers. */ + /* Mapping between the general-purpose registers in `struct user' format and GDB's register array layout. */ - -static int x86_64_regmap[] = { +static int regmap[] = +{ RAX, RBX, RCX, RDX, RSI, RDI, RBP, RSP, R8, R9, R10, R11, @@ -47,85 +57,12 @@ static int x86_64_regmap[] = { DS, ES, FS, GS }; -static unsigned long -x86_64_linux_dr_get (int regnum) -{ - int tid; - unsigned long value; - - /* FIXME: kettenis/2001-01-29: It's not clear what we should do with - multi-threaded processes here. For now, pretend there is just - one thread. */ - tid = PIDGET (inferior_ptid); - - /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the - ptrace call fails breaks debugging remote targets. The correct - way to fix this is to add the hardware breakpoint and watchpoint - stuff to the target vectore. For now, just return zero if the - ptrace call fails. */ - errno = 0; - value = ptrace (PT_READ_U, tid, - offsetof (struct user, u_debugreg[regnum]), 0); - if (errno != 0) -#if 0 - perror_with_name ("Couldn't read debug register"); -#else - return 0; -#endif - - return value; -} - -static void -x86_64_linux_dr_set (int regnum, unsigned long value) -{ - int tid; - - /* FIXME: kettenis/2001-01-29: It's not clear what we should do with - multi-threaded processes here. For now, pretend there is just - one thread. */ - tid = PIDGET (inferior_ptid); - - errno = 0; - ptrace (PT_WRITE_U, tid, offsetof (struct user, u_debugreg[regnum]), value); - if (errno != 0) - perror_with_name ("Couldn't write debug register"); -} - -void -x86_64_linux_dr_set_control (unsigned long control) -{ - x86_64_linux_dr_set (DR_CONTROL, control); -} - -void -x86_64_linux_dr_set_addr (int regnum, CORE_ADDR addr) -{ - gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR); - - x86_64_linux_dr_set (DR_FIRSTADDR + regnum, addr); -} - -void -x86_64_linux_dr_reset_addr (int regnum) -{ - gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR); - - x86_64_linux_dr_set (DR_FIRSTADDR + regnum, 0L); -} - -unsigned long -x86_64_linux_dr_get_status (void) -{ - return x86_64_linux_dr_get (DR_STATUS); -} - - -/* The register sets used in GNU/Linux ELF core-dumps are identical to - the register sets used by `ptrace'. */ +/* Which ptrace request retrieves which registers? + These apply to the corresponding SET requests as well. */ #define GETREGS_SUPPLIES(regno) \ - (0 <= (regno) && (regno) < x86_64_num_gregs) + (0 <= (regno) && (regno) < X86_64_NUM_GREGS) + #define GETFPREGS_SUPPLIES(regno) \ (FP0_REGNUM <= (regno) && (regno) <= MXCSR_REGNUM) @@ -137,13 +74,13 @@ x86_64_linux_dr_get_status (void) in *GREGSETP. */ void -supply_gregset (elf_gregset_t * gregsetp) +supply_gregset (elf_gregset_t *gregsetp) { elf_greg_t *regp = (elf_greg_t *) gregsetp; int i; - for (i = 0; i < x86_64_num_gregs; i++) - supply_register (i, (char *) (regp + x86_64_regmap[i])); + for (i = 0; i < X86_64_NUM_GREGS; i++) + supply_register (i, regp + regmap[i]); } /* Fill register REGNO (if it is a general-purpose register) in @@ -151,14 +88,14 @@ supply_gregset (elf_gregset_t * gregsetp) do this for all registers. */ void -fill_gregset (elf_gregset_t * gregsetp, int regno) +fill_gregset (elf_gregset_t *gregsetp, int regno) { elf_greg_t *regp = (elf_greg_t *) gregsetp; int i; - for (i = 0; i < x86_64_num_gregs; i++) - if ((regno == -1 || regno == i)) - regcache_collect (i, (char *) (regp + x86_64_regmap[i])); + for (i = 0; i < X86_64_NUM_GREGS; i++) + if (regno == -1 || regno == i) + regcache_collect (i, regp + regmap[i]); } /* Fetch all general-purpose registers from process/thread TID and @@ -195,73 +132,23 @@ store_regs (int tid, int regno) /* Transfering floating-point registers between GDB, inferiors and cores. */ -static void * -x86_64_fxsave_offset (elf_fpregset_t * fxsave, int regnum) -{ - const char *reg_name; - int reg_index; - - gdb_assert (x86_64_num_gregs - 1 < regnum && regnum < x86_64_num_regs); - - reg_name = x86_64_register_name (regnum); - - if (reg_name[0] == 's' && reg_name[1] == 't') - { - reg_index = reg_name[2] - '0'; - return &fxsave->st_space[reg_index * 2]; - } - - if (reg_name[0] == 'x' && reg_name[1] == 'm' && reg_name[2] == 'm') - { - reg_index = reg_name[3] - '0'; - return &fxsave->xmm_space[reg_index * 4]; - } - - if (strcmp (reg_name, "mxcsr") == 0) - return &fxsave->mxcsr; - - return NULL; -} - /* Fill GDB's register array with the floating-point and SSE register - values in *FXSAVE. This function masks off any of the reserved - bits in *FXSAVE. */ + values in *FPREGSETP. */ void -supply_fpregset (elf_fpregset_t * fxsave) +supply_fpregset (elf_fpregset_t *fpregsetp) { - int i, reg_st0, reg_mxcsr; - - reg_st0 = x86_64_register_number ("st0"); - reg_mxcsr = x86_64_register_number ("mxcsr"); - - gdb_assert (reg_st0 > 0 && reg_mxcsr > reg_st0); - - for (i = reg_st0; i <= reg_mxcsr; i++) - supply_register (i, x86_64_fxsave_offset (fxsave, i)); + x86_64_supply_fxsave ((char *) fpregsetp); } /* Fill register REGNUM (if it is a floating-point or SSE register) in - *FXSAVE with the value in GDB's register array. If REGNUM is -1, do - this for all registers. This function doesn't touch any of the - reserved bits in *FXSAVE. */ + *FPREGSETP with the value in GDB's register array. If REGNUM is + -1, do this for all registers. */ void -fill_fpregset (elf_fpregset_t * fxsave, int regnum) +fill_fpregset (elf_fpregset_t *fpregsetp, int regnum) { - int i, last_regnum = MXCSR_REGNUM; - void *ptr; - - if (gdbarch_tdep (current_gdbarch)->num_xmm_regs == 0) - last_regnum = FOP_REGNUM; - - for (i = FP0_REGNUM; i <= last_regnum; i++) - if (regnum == -1 || regnum == i) - { - ptr = x86_64_fxsave_offset (fxsave, i); - if (ptr) - regcache_collect (i, ptr); - } + x86_64_fill_fxsave ((char *) fpregsetp, regnum); } /* Fetch all floating-point registers from process/thread TID and store @@ -308,8 +195,9 @@ fetch_inferior_registers (int regno) int tid; /* GNU/Linux LWP ID's are process ID's. */ - if ((tid = TIDGET (inferior_ptid)) == 0) - tid = PIDGET (inferior_ptid); /* Not a threaded program. */ + tid = TIDGET (inferior_ptid); + if (tid == 0) + tid = PIDGET (inferior_ptid); /* Not a threaded program. */ if (regno == -1) { @@ -335,16 +223,18 @@ fetch_inferior_registers (int regno) } /* Store register REGNO back into the child process. If REGNO is -1, - do this for all registers (including the floating point and SSE + do this for all registers (including the floating-point and SSE registers). */ + void store_inferior_registers (int regno) { int tid; /* GNU/Linux LWP ID's are process ID's. */ - if ((tid = TIDGET (inferior_ptid)) == 0) - tid = PIDGET (inferior_ptid); /* Not a threaded program. */ + tid = TIDGET (inferior_ptid); + if (tid == 0) + tid = PIDGET (inferior_ptid); /* Not a threaded program. */ if (regno == -1) { @@ -370,123 +260,75 @@ store_inferior_registers (int regno) } -static const unsigned char linux_syscall[] = { 0x0f, 0x05 }; - -#define LINUX_SYSCALL_LEN (sizeof linux_syscall) - -/* The system call number is stored in the %rax register. */ -#define LINUX_SYSCALL_REGNUM 0 /* %rax */ +static unsigned long +x86_64_linux_dr_get (int regnum) +{ + int tid; + unsigned long value; -/* We are specifically interested in the sigreturn and rt_sigreturn - system calls. */ + /* FIXME: kettenis/2001-01-29: It's not clear what we should do with + multi-threaded processes here. For now, pretend there is just + one thread. */ + tid = PIDGET (inferior_ptid); -#ifndef SYS_sigreturn -#define SYS_sigreturn __NR_sigreturn -#endif -#ifndef SYS_rt_sigreturn -#define SYS_rt_sigreturn __NR_rt_sigreturn + /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the + ptrace call fails breaks debugging remote targets. The correct + way to fix this is to add the hardware breakpoint and watchpoint + stuff to the target vectore. For now, just return zero if the + ptrace call fails. */ + errno = 0; + value = ptrace (PT_READ_U, tid, + offsetof (struct user, u_debugreg[regnum]), 0); + if (errno != 0) +#if 0 + perror_with_name ("Couldn't read debug register"); +#else + return 0; #endif -/* Offset to saved processor flags, from . */ -#define LINUX_SIGCONTEXT_EFLAGS_OFFSET (152) -/* Offset to saved processor registers from */ -#define LINUX_UCONTEXT_SIGCONTEXT_OFFSET (36) - -/* Interpreting register set info found in core files. */ -/* Provide registers to GDB from a core file. - - CORE_REG_SECT points to an array of bytes, which are the contents - of a `note' from a core file which BFD thinks might contain - register contents. CORE_REG_SIZE is its size. - - WHICH says which register set corelow suspects this is: - 0 --- the general-purpose register set, in elf_gregset_t format - 2 --- the floating-point register set, in elf_fpregset_t format - - REG_ADDR isn't used on GNU/Linux. */ + return value; +} static void -fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, - int which, CORE_ADDR reg_addr) +x86_64_linux_dr_set (int regnum, unsigned long value) { - elf_gregset_t gregset; - elf_fpregset_t fpregset; - switch (which) - { - case 0: - if (core_reg_size != sizeof (gregset)) - warning ("Wrong size gregset in core file."); - else - { - memcpy (&gregset, core_reg_sect, sizeof (gregset)); - supply_gregset (&gregset); - } - break; - - case 2: - if (core_reg_size != sizeof (fpregset)) - warning ("Wrong size fpregset in core file."); - else - { - memcpy (&fpregset, core_reg_sect, sizeof (fpregset)); - supply_fpregset (&fpregset); - } - break; - - default: - /* We've covered all the kinds of registers we know about here, - so this must be something we wouldn't know what to do with - anyway. Just ignore it. */ - break; - } -} + int tid; -/* Register that we are able to handle GNU/Linux ELF core file formats. */ + /* FIXME: kettenis/2001-01-29: It's not clear what we should do with + multi-threaded processes here. For now, pretend there is just + one thread. */ + tid = PIDGET (inferior_ptid); -static struct core_fns linux_elf_core_fns = { - bfd_target_elf_flavour, /* core_flavour */ - default_check_format, /* check_format */ - default_core_sniffer, /* core_sniffer */ - fetch_core_registers, /* core_read_registers */ - NULL /* next */ -}; - + errno = 0; + ptrace (PT_WRITE_U, tid, offsetof (struct user, u_debugreg[regnum]), value); + if (errno != 0) + perror_with_name ("Couldn't write debug register"); +} -#if !defined (offsetof) -#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) -#endif +void +x86_64_linux_dr_set_control (unsigned long control) +{ + x86_64_linux_dr_set (DR_CONTROL, control); +} -/* Return the address of register REGNUM. BLOCKEND is the value of - u.u_ar0, which should point to the registers. */ -CORE_ADDR -x86_64_register_u_addr (CORE_ADDR blockend, int regnum) +void +x86_64_linux_dr_set_addr (int regnum, CORE_ADDR addr) { - struct user u; - CORE_ADDR fpstate; - CORE_ADDR ubase; - ubase = blockend; - if (IS_FP_REGNUM (regnum)) - { - fpstate = ubase + ((char *) &u.i387.st_space - (char *) &u); - return (fpstate + 16 * (regnum - FP0_REGNUM)); - } - else if (IS_SSE_REGNUM (regnum)) - { - fpstate = ubase + ((char *) &u.i387.xmm_space - (char *) &u); - return (fpstate + 16 * (regnum - XMM0_REGNUM)); - } - else - return (ubase + 8 * x86_64_regmap[regnum]); + gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR); + + x86_64_linux_dr_set (DR_FIRSTADDR + regnum, addr); } void -_initialize_x86_64_linux_nat (void) +x86_64_linux_dr_reset_addr (int regnum) { - add_core_fns (&linux_elf_core_fns); + gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR); + + x86_64_linux_dr_set (DR_FIRSTADDR + regnum, 0L); } -int -kernel_u_size (void) +unsigned long +x86_64_linux_dr_get_status (void) { - return (sizeof (struct user)); + return x86_64_linux_dr_get (DR_STATUS); } diff --git a/gdb/x86-64-linux-tdep.c b/gdb/x86-64-linux-tdep.c index 932e6d6f01b..8532685c896 100644 --- a/gdb/x86-64-linux-tdep.c +++ b/gdb/x86-64-linux-tdep.c @@ -24,19 +24,21 @@ #include "defs.h" #include "inferior.h" #include "gdbcore.h" -#include "gdb_string.h" #include "regcache.h" -#include "x86-64-tdep.h" -#include "dwarf2cfi.h" #include "osabi.h" -#define LINUX_SIGTRAMP_INSN0 (0x48) /* mov $NNNNNNNN,%rax */ -#define LINUX_SIGTRAMP_OFFSET0 (0) -#define LINUX_SIGTRAMP_INSN1 (0x0f) /* syscall */ -#define LINUX_SIGTRAMP_OFFSET1 (7) +#include "gdb_string.h" + +#include "x86-64-tdep.h" + +#define LINUX_SIGTRAMP_INSN0 0x48 /* mov $NNNNNNNN, %rax */ +#define LINUX_SIGTRAMP_OFFSET0 0 +#define LINUX_SIGTRAMP_INSN1 0x0f /* syscall */ +#define LINUX_SIGTRAMP_OFFSET1 7 -static const unsigned char linux_sigtramp_code[] = { - /* mov $__NR_rt_sigreturn,%rax */ +static const unsigned char linux_sigtramp_code[] = +{ + /* mov $__NR_rt_sigreturn, %rax */ LINUX_SIGTRAMP_INSN0, 0xc7, 0xc0, 0x0f, 0x00, 0x00, 0x00, /* syscall */ LINUX_SIGTRAMP_INSN1, 0x05 @@ -51,6 +53,14 @@ static CORE_ADDR x86_64_linux_sigtramp_start (CORE_ADDR pc) { unsigned char buf[LINUX_SIGTRAMP_LEN]; + + /* We only recognize a signal trampoline if PC is at the start of + one of the two instructions. We optimize for finding the PC at + the start, as will be the case when the trampoline is not the + first frame on the stack. We assume that in the case where the + PC is not at the start of the instruction sequence, there will be + a few trailing readable bytes on the stack. */ + if (read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0) return 0; @@ -71,133 +81,93 @@ x86_64_linux_sigtramp_start (CORE_ADDR pc) return pc; } -#define LINUX_SIGINFO_SIZE 0 - -/* Offset to struct sigcontext in ucontext, from . */ -#define LINUX_UCONTEXT_SIGCONTEXT_OFFSET 40 - -/* Offset to saved PC in sigcontext, from . */ -#define LINUX_SIGCONTEXT_PC_OFFSET 128 -#define LINUX_SIGCONTEXT_FP_OFFSET 120 - -/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the - address of the associated sigcontext structure. */ -static CORE_ADDR -x86_64_linux_sigcontext_addr (struct frame_info *frame) -{ - CORE_ADDR pc; - ULONGEST rsp; - - pc = x86_64_linux_sigtramp_start (get_frame_pc (frame)); - if (pc) - { - if (get_next_frame (frame)) - /* If this isn't the top frame, the next frame must be for the - signal handler itself. The sigcontext structure is part of - the user context. */ - return get_frame_base (get_next_frame (frame)) + LINUX_SIGINFO_SIZE + - LINUX_UCONTEXT_SIGCONTEXT_OFFSET; - - - /* This is the top frame. */ - rsp = read_register (SP_REGNUM); - return rsp + LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET; - - } - - error ("Couldn't recognize signal trampoline."); - return 0; -} - -/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the - saved program counter. */ - -static CORE_ADDR -x86_64_linux_sigtramp_saved_pc (struct frame_info *frame) -{ - CORE_ADDR addr; - - addr = x86_64_linux_sigcontext_addr (frame); - return read_memory_integer (addr + LINUX_SIGCONTEXT_PC_OFFSET, 8); -} - -/* Immediately after a function call, return the saved pc. */ - -CORE_ADDR -x86_64_linux_saved_pc_after_call (struct frame_info *frame) -{ - if ((get_frame_type (frame) == SIGTRAMP_FRAME)) - return x86_64_linux_sigtramp_saved_pc (frame); - - return read_memory_integer (read_register (SP_REGNUM), 8); -} - -/* Saved Pc. Get it from sigcontext if within sigtramp. */ -CORE_ADDR -x86_64_linux_frame_saved_pc (struct frame_info *frame) -{ - if ((get_frame_type (frame) == SIGTRAMP_FRAME)) - return x86_64_linux_sigtramp_saved_pc (frame); - return cfi_get_ra (frame); -} - /* Return whether PC is in a GNU/Linux sigtramp routine. */ -int -x86_64_linux_in_sigtramp (CORE_ADDR pc, char *name) +static int +x86_64_linux_pc_in_sigtramp (CORE_ADDR pc, char *name) { - if (name) - return strcmp ("__restore_rt", name) == 0; - - return (x86_64_linux_sigtramp_start (pc) != 0); + /* If we have NAME, we can optimize the search. The trampoline is + named __restore_rt. However, it isn't dynamically exported from + the shared C library, so the trampoline may appear to be part of + the preceding function. This should always be sigaction, + __sigaction, or __libc_sigaction (all aliases to the same + function). */ + if (name == NULL || strstr (name, "sigaction") != NULL) + return (x86_64_linux_sigtramp_start (pc) != 0); + + return (strcmp ("__restore_rt", name) == 0); } -CORE_ADDR -x86_64_linux_frame_chain (struct frame_info *fi) -{ - ULONGEST addr; - CORE_ADDR fp, pc; - - if (!(get_frame_type (fi) == SIGTRAMP_FRAME)) - { - fp = cfi_frame_chain (fi); - if (fp) - return fp; - else - addr = get_frame_base (fi); - } - else - addr = get_frame_base (get_next_frame (fi)); - - addr += LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET; - - fp = read_memory_integer (addr + LINUX_SIGCONTEXT_FP_OFFSET, 8) + 8; +/* Offset to struct sigcontext in ucontext, from . */ +#define X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 40 - return fp; -} +/* Assuming NEXT_FRAME is a frame following a GNU/Linux sigtramp + routine, return the address of the associated sigcontext structure. */ -CORE_ADDR -x86_64_init_frame_pc (int fromleaf, struct frame_info *fi) +static CORE_ADDR +x86_64_linux_sigcontext_addr (struct frame_info *next_frame) { - CORE_ADDR addr; - - if (get_next_frame (fi) - && (get_frame_type (get_next_frame (fi)) == SIGTRAMP_FRAME)) - { - addr = get_frame_base (get_next_frame (get_next_frame (fi))) - + LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET; - return read_memory_integer (addr + LINUX_SIGCONTEXT_PC_OFFSET, 8); - } - else - return cfi_init_frame_pc (fromleaf, fi); + CORE_ADDR sp; + char buf[8]; + + frame_unwind_register (next_frame, SP_REGNUM, buf); + sp = extract_unsigned_integer (buf, 8); + + /* The sigcontext structure is part of the user context. A pointer + to the user context is passed as the third argument to the signal + handler, i.e. in %rdx. Unfortunately %rdx isn't preserved across + function calls so we can't use it. Fortunately the user context + is part of the signal frame and the unwound %rsp directly points + at it. */ + return sp + X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET; } +/* From . */ +static int x86_64_linux_sc_reg_offset[X86_64_NUM_GREGS] = +{ + 13 * 8, /* %rax */ + 11 * 8, /* %rbx */ + 14 * 8, /* %rcx */ + 12 * 8, /* %rdx */ + 9 * 8, /* %rsi */ + 8 * 8, /* %rdi */ + 10 * 8, /* %rbp */ + 15 * 8, /* %rsp */ + 0 * 8, /* %r8 */ + 1 * 8, /* %r9 */ + 2 * 8, /* %r10 */ + 3 * 8, /* %r11 */ + 4 * 8, /* %r12 */ + 5 * 8, /* %r13 */ + 6 * 8, /* %r14 */ + 7 * 8, /* %r15 */ + 16 * 8, /* %rip */ + 17 * 8, /* %eflags */ + -1, /* %ds */ + -1, /* %es */ + + /* FIXME: kettenis/2002030531: The registers %fs and %gs are + available in `struct sigcontext'. However, they only occupy two + bytes instead of four, which makes using them here rather + difficult. Leave them out for now. */ + -1, /* %fs */ + -1 /* %gs */ +}; + static void x86_64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); x86_64_init_abi (info, gdbarch); + + set_gdbarch_pc_in_sigtramp (gdbarch, x86_64_linux_pc_in_sigtramp); + + tdep->sigcontext_addr = x86_64_linux_sigcontext_addr; + tdep->sc_reg_offset = x86_64_linux_sc_reg_offset; + tdep->sc_num_regs = X86_64_NUM_GREGS; } + /* Provide a prototype to silence -Wmissing-prototypes. */ extern void _initialize_x86_64_linux_tdep (void); diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index 121c85eef39..0fe24853f83 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -21,249 +21,207 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include "arch-utils.h" +#include "block.h" +#include "dummy-frame.h" +#include "frame.h" +#include "frame-base.h" +#include "frame-unwind.h" #include "inferior.h" -#include "gdbcore.h" #include "gdbcmd.h" -#include "arch-utils.h" +#include "gdbcore.h" +#include "objfiles.h" #include "regcache.h" #include "symfile.h" -#include "objfiles.h" -#include "x86-64-tdep.h" -#include "dwarf2cfi.h" + #include "gdb_assert.h" -#include "block.h" + +#include "x86-64-tdep.h" +#include "i387-tdep.h" /* Register numbers of various important registers. */ -#define RAX_REGNUM 0 -#define RDX_REGNUM 3 -#define RDI_REGNUM 5 -#define EFLAGS_REGNUM 17 -#define ST0_REGNUM 22 -#define XMM1_REGNUM 39 - -struct register_info + +#define X86_64_RAX_REGNUM 0 /* %rax */ +#define X86_64_RDX_REGNUM 3 /* %rdx */ +#define X86_64_RDI_REGNUM 5 /* %rdi */ +#define X86_64_RBP_REGNUM 6 /* %rbp */ +#define X86_64_RSP_REGNUM 7 /* %rsp */ +#define X86_64_RIP_REGNUM 16 /* %rip */ +#define X86_64_EFLAGS_REGNUM 17 /* %eflags */ +#define X86_64_ST0_REGNUM 22 /* %st0 */ +#define X86_64_XMM0_REGNUM 38 /* %xmm0 */ +#define X86_64_XMM1_REGNUM 39 /* %xmm1 */ + +struct x86_64_register_info { - int size; char *name; struct type **type; }; -/* x86_64_register_raw_size_table[i] is the number of bytes of storage in - GDB's register array occupied by register i. */ -static struct register_info x86_64_register_info_table[] = { - /* 0 */ {8, "rax", &builtin_type_int64}, - /* 1 */ {8, "rbx", &builtin_type_int64}, - /* 2 */ {8, "rcx", &builtin_type_int64}, - /* 3 */ {8, "rdx", &builtin_type_int64}, - /* 4 */ {8, "rsi", &builtin_type_int64}, - /* 5 */ {8, "rdi", &builtin_type_int64}, - /* 6 */ {8, "rbp", &builtin_type_void_func_ptr}, - /* 7 */ {8, "rsp", &builtin_type_void_func_ptr}, - /* 8 */ {8, "r8", &builtin_type_int64}, - /* 9 */ {8, "r9", &builtin_type_int64}, - /* 10 */ {8, "r10", &builtin_type_int64}, - /* 11 */ {8, "r11", &builtin_type_int64}, - /* 12 */ {8, "r12", &builtin_type_int64}, - /* 13 */ {8, "r13", &builtin_type_int64}, - /* 14 */ {8, "r14", &builtin_type_int64}, - /* 15 */ {8, "r15", &builtin_type_int64}, - /* 16 */ {8, "rip", &builtin_type_void_func_ptr}, - /* 17 */ {4, "eflags", &builtin_type_int32}, - /* 18 */ {4, "ds", &builtin_type_int32}, - /* 19 */ {4, "es", &builtin_type_int32}, - /* 20 */ {4, "fs", &builtin_type_int32}, - /* 21 */ {4, "gs", &builtin_type_int32}, - /* 22 */ {10, "st0", &builtin_type_i387_ext}, - /* 23 */ {10, "st1", &builtin_type_i387_ext}, - /* 24 */ {10, "st2", &builtin_type_i387_ext}, - /* 25 */ {10, "st3", &builtin_type_i387_ext}, - /* 26 */ {10, "st4", &builtin_type_i387_ext}, - /* 27 */ {10, "st5", &builtin_type_i387_ext}, - /* 28 */ {10, "st6", &builtin_type_i387_ext}, - /* 29 */ {10, "st7", &builtin_type_i387_ext}, - /* 30 */ {4, "fctrl", &builtin_type_int32}, - /* 31 */ {4, "fstat", &builtin_type_int32}, - /* 32 */ {4, "ftag", &builtin_type_int32}, - /* 33 */ {4, "fiseg", &builtin_type_int32}, - /* 34 */ {4, "fioff", &builtin_type_int32}, - /* 35 */ {4, "foseg", &builtin_type_int32}, - /* 36 */ {4, "fooff", &builtin_type_int32}, - /* 37 */ {4, "fop", &builtin_type_int32}, - /* 38 */ {16, "xmm0", &builtin_type_v4sf}, - /* 39 */ {16, "xmm1", &builtin_type_v4sf}, - /* 40 */ {16, "xmm2", &builtin_type_v4sf}, - /* 41 */ {16, "xmm3", &builtin_type_v4sf}, - /* 42 */ {16, "xmm4", &builtin_type_v4sf}, - /* 43 */ {16, "xmm5", &builtin_type_v4sf}, - /* 44 */ {16, "xmm6", &builtin_type_v4sf}, - /* 45 */ {16, "xmm7", &builtin_type_v4sf}, - /* 46 */ {16, "xmm8", &builtin_type_v4sf}, - /* 47 */ {16, "xmm9", &builtin_type_v4sf}, - /* 48 */ {16, "xmm10", &builtin_type_v4sf}, - /* 49 */ {16, "xmm11", &builtin_type_v4sf}, - /* 50 */ {16, "xmm12", &builtin_type_v4sf}, - /* 51 */ {16, "xmm13", &builtin_type_v4sf}, - /* 52 */ {16, "xmm14", &builtin_type_v4sf}, - /* 53 */ {16, "xmm15", &builtin_type_v4sf}, - /* 54 */ {4, "mxcsr", &builtin_type_int32} -}; - -/* This array is a mapping from Dwarf-2 register - numbering to GDB's one. Dwarf-2 numbering is - defined in x86-64 ABI, section 3.6. */ -static int x86_64_dwarf2gdb_regno_map[] = { - 0, 3, 2, 1, /* RAX, RDX, RCX, RBX */ - 4, 5, 6, 7, /* RSI, RDI, RBP, RSP */ - 8, 9, 10, 11, /* R8 - R11 */ - 12, 13, 14, 15, /* R12 - R15 */ - -1, /* RA - not mapped */ - XMM1_REGNUM - 1, XMM1_REGNUM, /* XMM0 ... */ - XMM1_REGNUM + 1, XMM1_REGNUM + 2, - XMM1_REGNUM + 3, XMM1_REGNUM + 4, - XMM1_REGNUM + 5, XMM1_REGNUM + 6, - XMM1_REGNUM + 7, XMM1_REGNUM + 8, - XMM1_REGNUM + 9, XMM1_REGNUM + 10, - XMM1_REGNUM + 11, XMM1_REGNUM + 12, - XMM1_REGNUM + 13, XMM1_REGNUM + 14, /* ... XMM15 */ - ST0_REGNUM + 0, ST0_REGNUM + 1, /* ST0 ... */ - ST0_REGNUM + 2, ST0_REGNUM + 3, - ST0_REGNUM + 4, ST0_REGNUM + 5, - ST0_REGNUM + 6, ST0_REGNUM + 7 /* ... ST7 */ +static struct x86_64_register_info x86_64_register_info[] = +{ + { "rax", &builtin_type_int64 }, + { "rbx", &builtin_type_int64 }, + { "rcx", &builtin_type_int64 }, + { "rdx", &builtin_type_int64 }, + { "rsi", &builtin_type_int64 }, + { "rdi", &builtin_type_int64 }, + { "rbp", &builtin_type_void_data_ptr }, + { "rsp", &builtin_type_void_data_ptr }, + + /* %r8 is indeed register number 8. */ + { "r8", &builtin_type_int64 }, + { "r9", &builtin_type_int64 }, + { "r10", &builtin_type_int64 }, + { "r11", &builtin_type_int64 }, + { "r12", &builtin_type_int64 }, + { "r13", &builtin_type_int64 }, + { "r14", &builtin_type_int64 }, + { "r15", &builtin_type_int64 }, + { "rip", &builtin_type_void_func_ptr }, + { "eflags", &builtin_type_int32 }, + { "ds", &builtin_type_int32 }, + { "es", &builtin_type_int32 }, + { "fs", &builtin_type_int32 }, + { "gs", &builtin_type_int32 }, + + /* %st0 is register number 22. */ + { "st0", &builtin_type_i387_ext }, + { "st1", &builtin_type_i387_ext }, + { "st2", &builtin_type_i387_ext }, + { "st3", &builtin_type_i387_ext }, + { "st4", &builtin_type_i387_ext }, + { "st5", &builtin_type_i387_ext }, + { "st6", &builtin_type_i387_ext }, + { "st7", &builtin_type_i387_ext }, + { "fctrl", &builtin_type_int32 }, + { "fstat", &builtin_type_int32 }, + { "ftag", &builtin_type_int32 }, + { "fiseg", &builtin_type_int32 }, + { "fioff", &builtin_type_int32 }, + { "foseg", &builtin_type_int32 }, + { "fooff", &builtin_type_int32 }, + { "fop", &builtin_type_int32 }, + + /* %xmm0 is register number 38. */ + { "xmm0", &builtin_type_v4sf }, + { "xmm1", &builtin_type_v4sf }, + { "xmm2", &builtin_type_v4sf }, + { "xmm3", &builtin_type_v4sf }, + { "xmm4", &builtin_type_v4sf }, + { "xmm5", &builtin_type_v4sf }, + { "xmm6", &builtin_type_v4sf }, + { "xmm7", &builtin_type_v4sf }, + { "xmm8", &builtin_type_v4sf }, + { "xmm9", &builtin_type_v4sf }, + { "xmm10", &builtin_type_v4sf }, + { "xmm11", &builtin_type_v4sf }, + { "xmm12", &builtin_type_v4sf }, + { "xmm13", &builtin_type_v4sf }, + { "xmm14", &builtin_type_v4sf }, + { "xmm15", &builtin_type_v4sf }, + { "mxcsr", &builtin_type_int32 } }; -static int x86_64_dwarf2gdb_regno_map_length = - sizeof (x86_64_dwarf2gdb_regno_map) / - sizeof (x86_64_dwarf2gdb_regno_map[0]); - -/* Number of all registers */ -#define X86_64_NUM_REGS (sizeof (x86_64_register_info_table) / \ - sizeof (x86_64_register_info_table[0])) - -/* Number of general registers. */ -#define X86_64_NUM_GREGS (22) - -int x86_64_num_regs = X86_64_NUM_REGS; -int x86_64_num_gregs = X86_64_NUM_GREGS; +/* Total number of registers. */ +#define X86_64_NUM_REGS \ + (sizeof (x86_64_register_info) / sizeof (x86_64_register_info[0])) -/* Did we already print a note about frame pointer? */ -int omit_fp_note_printed = 0; +/* Return the name of register REGNUM. */ -/* Number of bytes of storage in the actual machine representation for - register REGNO. */ -int -x86_64_register_raw_size (int regno) +static const char * +x86_64_register_name (int regnum) { - return x86_64_register_info_table[regno].size; -} - -/* x86_64_register_byte_table[i] is the offset into the register file of the - start of register number i. We initialize this from - x86_64_register_info_table. */ -int x86_64_register_byte_table[X86_64_NUM_REGS]; + if (regnum >= 0 && regnum < X86_64_NUM_REGS) + return x86_64_register_info[regnum].name; -/* Index within `registers' of the first byte of the space for register REGNO. */ -int -x86_64_register_byte (int regno) -{ - return x86_64_register_byte_table[regno]; + return NULL; } /* Return the GDB type object for the "standard" data type of data in - register N. */ + register REGNUM. */ + static struct type * -x86_64_register_virtual_type (int regno) +x86_64_register_type (struct gdbarch *gdbarch, int regnum) { - return *x86_64_register_info_table[regno].type; -} + gdb_assert (regnum >= 0 && regnum < X86_64_NUM_REGS); -/* x86_64_register_convertible is true if register N's virtual format is - different from its raw format. Note that this definition assumes - that the host supports IEEE 32-bit floats, since it doesn't say - that SSE registers need conversion. Even if we can't find a - counterexample, this is still sloppy. */ -int -x86_64_register_convertible (int regno) -{ - return IS_FP_REGNUM (regno); + return *x86_64_register_info[regnum].type; } -/* Convert data from raw format for register REGNUM in buffer FROM to - virtual format with type TYPE in buffer TO. In principle both - formats are identical except that the virtual format has two extra - bytes appended that aren't used. We set these to zero. */ -void -x86_64_register_convert_to_virtual (int regnum, struct type *type, - char *from, char *to) -{ - char buf[12]; +/* DWARF Register Number Mapping as defined in the System V psABI, + section 3.6. */ - /* We only support floating-point values. */ - if (TYPE_CODE (type) != TYPE_CODE_FLT) - { - warning ("Cannot convert floating-point register value " - "to non-floating-point type."); - memset (to, 0, TYPE_LENGTH (type)); - return; - } - /* First add the necessary padding. */ - memcpy (buf, from, FPU_REG_RAW_SIZE); - memset (buf + FPU_REG_RAW_SIZE, 0, sizeof buf - FPU_REG_RAW_SIZE); - /* Convert to TYPE. This should be a no-op, if TYPE is equivalent - to the extended floating-point format used by the FPU. */ - convert_typed_floating (to, type, buf, - x86_64_register_virtual_type (regnum)); -} +static int x86_64_dwarf_regmap[] = +{ + /* General Purpose Registers RAX, RDX, RCX, RBX, RSI, RDI. */ + X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, 3, 2, + 4, X86_64_RDI_REGNUM, + + /* Frame Pointer Register RBP. */ + X86_64_RBP_REGNUM, + + /* Stack Pointer Register RSP. */ + X86_64_RSP_REGNUM, + + /* Extended Integer Registers 8 - 15. */ + 8, 9, 10, 11, 12, 13, 14, 15, + + /* Return Address RA. Not mapped. */ + -1, + + /* SSE Registers 0 - 7. */ + X86_64_XMM0_REGNUM + 0, X86_64_XMM1_REGNUM, + X86_64_XMM0_REGNUM + 2, X86_64_XMM0_REGNUM + 3, + X86_64_XMM0_REGNUM + 4, X86_64_XMM0_REGNUM + 5, + X86_64_XMM0_REGNUM + 6, X86_64_XMM0_REGNUM + 7, + + /* Extended SSE Registers 8 - 15. */ + X86_64_XMM0_REGNUM + 8, X86_64_XMM0_REGNUM + 9, + X86_64_XMM0_REGNUM + 10, X86_64_XMM0_REGNUM + 11, + X86_64_XMM0_REGNUM + 12, X86_64_XMM0_REGNUM + 13, + X86_64_XMM0_REGNUM + 14, X86_64_XMM0_REGNUM + 15, + + /* Floating Point Registers 0-7. */ + X86_64_ST0_REGNUM + 0, X86_64_ST0_REGNUM + 1, + X86_64_ST0_REGNUM + 2, X86_64_ST0_REGNUM + 3, + X86_64_ST0_REGNUM + 4, X86_64_ST0_REGNUM + 5, + X86_64_ST0_REGNUM + 6, X86_64_ST0_REGNUM + 7 +}; -/* Convert data from virtual format with type TYPE in buffer FROM to - raw format for register REGNUM in buffer TO. Simply omit the two - unused bytes. */ +static const int x86_64_dwarf_regmap_len = + (sizeof (x86_64_dwarf_regmap) / sizeof (x86_64_dwarf_regmap[0])); -void -x86_64_register_convert_to_raw (struct type *type, int regnum, - char *from, char *to) -{ - gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT && TYPE_LENGTH (type) == 12); - /* Simply omit the two unused bytes. */ - memcpy (to, from, FPU_REG_RAW_SIZE); -} +/* Convert DWARF register number REG to the appropriate register + number used by GDB. */ -/* Dwarf-2 <-> GDB register numbers mapping. */ -int -x86_64_dwarf2_reg_to_regnum (int dw_reg) +static int +x86_64_dwarf_reg_to_regnum (int reg) { - if (dw_reg < 0 || dw_reg > x86_64_dwarf2gdb_regno_map_length) - { - warning ("Dwarf-2 uses unmapped register #%d\n", dw_reg); - return dw_reg; - } + int regnum = -1; - return x86_64_dwarf2gdb_regno_map[dw_reg]; -} + if (reg >= 0 || reg < x86_64_dwarf_regmap_len) + regnum = x86_64_dwarf_regmap[reg]; -/* Push the return address (pointing to the call dummy) onto the stack - and return the new value for the stack pointer. */ + if (regnum == -1) + warning ("Unmapped DWARF Register #%d encountered\n", reg); -static CORE_ADDR -x86_64_push_return_address (CORE_ADDR pc, CORE_ADDR sp) -{ - char buf[8]; - - store_unsigned_integer (buf, 8, CALL_DUMMY_ADDRESS ()); - write_memory (sp - 8, buf, 8); - return sp - 8; + return regnum; } -static void -x86_64_pop_frame (void) +/* Return nonzero if a value of type TYPE stored in register REGNUM + needs any special handling. */ + +static int +x86_64_convert_register_p (int regnum, struct type *type) { - generic_pop_current_frame (cfi_pop_frame); + return i386_fp_regnum_p (regnum); } /* The returning of values is done according to the special algorithm. - Some types are returned in registers an some (big structures) in memory. - See ABI for details. - */ + Some types are returned in registers an some (big structures) in + memory. See the System V psABI for details. */ #define MAX_CLASSES 4 @@ -282,27 +240,27 @@ enum x86_64_reg_class }; /* Return the union class of CLASS1 and CLASS2. - See the x86-64 ABI for details. */ + See the System V psABI for details. */ static enum x86_64_reg_class merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) { - /* Rule #1: If both classes are equal, this is the resulting class. */ + /* Rule (a): If both classes are equal, this is the resulting class. */ if (class1 == class2) return class1; - /* Rule #2: If one of the classes is NO_CLASS, the resulting class + /* Rule (b): If one of the classes is NO_CLASS, the resulting class is the other class. */ if (class1 == X86_64_NO_CLASS) return class2; if (class2 == X86_64_NO_CLASS) return class1; - /* Rule #3: If one of the classes is MEMORY, the result is MEMORY. */ + /* Rule (c): If one of the classes is MEMORY, the result is MEMORY. */ if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS) return X86_64_MEMORY_CLASS; - /* Rule #4: If one of the classes is INTEGER, the result is INTEGER. */ + /* Rule (d): If one of the classes is INTEGER, the result is INTEGER. */ if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS) || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS)) return X86_64_INTEGERSI_CLASS; @@ -310,12 +268,13 @@ merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS) return X86_64_INTEGER_CLASS; - /* Rule #5: If one of the classes is X87 or X87UP class, MEMORY is used. */ + /* Rule (e): If one of the classes is X87 or X87UP class, MEMORY is + used as class. */ if (class1 == X86_64_X87_CLASS || class1 == X86_64_X87UP_CLASS || class2 == X86_64_X87_CLASS || class2 == X86_64_X87UP_CLASS) return X86_64_MEMORY_CLASS; - /* Rule #6: Otherwise class SSE is used. */ + /* Rule (f): Otherwise class SSE is used. */ return X86_64_SSE_CLASS; } @@ -325,7 +284,7 @@ merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) is returned. As a special case for zero sized containers, classes[0] will be NO_CLASS and 1 is returned. - See the x86-64 psABI for details. */ + See the System V psABI for details. */ static int classify_argument (struct type *type, @@ -533,7 +492,8 @@ examine_argument (enum x86_64_reg_class classes[MAX_CLASSES], memory. If this function returns 1, GDB will call STORE_STRUCT_RETURN and EXTRACT_STRUCT_VALUE_ADDRESS else STORE_RETURN_VALUE and EXTRACT_RETURN_VALUE will be used. */ -int + +static int x86_64_use_struct_convention (int gcc_p, struct type *value_type) { enum x86_64_reg_class class[MAX_CLASSES]; @@ -550,7 +510,7 @@ x86_64_use_struct_convention (int gcc_p, struct type *value_type) function return value of TYPE, and copy that, in virtual format, into VALBUF. */ -void +static void x86_64_extract_return_value (struct type *type, struct regcache *regcache, void *valbuf) { @@ -561,15 +521,15 @@ x86_64_extract_return_value (struct type *type, struct regcache *regcache, int intreg = 0; int ssereg = 0; int offset = 0; - int ret_int_r[RET_INT_REGS] = { RAX_REGNUM, RDX_REGNUM }; - int ret_sse_r[RET_SSE_REGS] = { XMM0_REGNUM, XMM1_REGNUM }; + int ret_int_r[RET_INT_REGS] = { X86_64_RAX_REGNUM, X86_64_RDX_REGNUM }; + int ret_sse_r[RET_SSE_REGS] = { X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM }; if (!n || !examine_argument (class, n, &needed_intregs, &needed_sseregs) || needed_intregs > RET_INT_REGS || needed_sseregs > RET_SSE_REGS) { /* memory class */ CORE_ADDR addr; - regcache_cooked_read (regcache, RAX_REGNUM, &addr); + regcache_cooked_read (regcache, X86_64_RAX_REGNUM, &addr); read_memory (addr, valbuf, TYPE_LENGTH (type)); return; } @@ -610,12 +570,12 @@ x86_64_extract_return_value (struct type *type, struct regcache *regcache, ssereg++; break; case X86_64_X87_CLASS: - regcache_cooked_read_part (regcache, FP0_REGNUM, + regcache_cooked_read_part (regcache, X86_64_ST0_REGNUM, 0, 8, (char *) valbuf + offset); offset += 8; break; case X86_64_X87UP_CLASS: - regcache_cooked_read_part (regcache, FP0_REGNUM, + regcache_cooked_read_part (regcache, X86_64_ST0_REGNUM, 8, 2, (char *) valbuf + offset); offset += 8; break; @@ -628,33 +588,37 @@ x86_64_extract_return_value (struct type *type, struct regcache *regcache, } } -static void -x86_64_frame_init_saved_regs (struct frame_info *fi) -{ - /* Do nothing. Everything is handled by the stack unwinding code. */ -} - #define INT_REGS 6 -#define SSE_REGS 16 +#define SSE_REGS 8 -CORE_ADDR -x86_64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, - int struct_return, CORE_ADDR struct_addr) +static CORE_ADDR +x86_64_push_arguments (struct regcache *regcache, int nargs, + struct value **args, CORE_ADDR sp) { int intreg = 0; int ssereg = 0; + /* For varargs functions we have to pass the total number of SSE arguments + in %rax. So, let's count this number. */ + int total_sse_args = 0; + /* Once an SSE/int argument is passed on the stack, all subsequent + arguments are passed there. */ + int sse_stack = 0; + int int_stack = 0; int i; - static int int_parameter_registers[INT_REGS] = { - 5 /* RDI */ , 4 /* RSI */ , - 3 /* RDX */ , 2 /* RCX */ , - 8 /* R8 */ , 9 /* R9 */ + char buf[8]; + static int int_parameter_registers[INT_REGS] = + { + X86_64_RDI_REGNUM, 4, /* %rdi, %rsi */ + X86_64_RDX_REGNUM, 2, /* %rdx, %rcx */ + 8, 9 /* %r8, %r9 */ }; - /* XMM0 - XMM15 */ - static int sse_parameter_registers[SSE_REGS] = { - XMM1_REGNUM - 1, XMM1_REGNUM, XMM1_REGNUM + 1, XMM1_REGNUM + 2, - XMM1_REGNUM + 3, XMM1_REGNUM + 4, XMM1_REGNUM + 5, XMM1_REGNUM + 6, - XMM1_REGNUM + 7, XMM1_REGNUM + 8, XMM1_REGNUM + 9, XMM1_REGNUM + 10, - XMM1_REGNUM + 11, XMM1_REGNUM + 12, XMM1_REGNUM + 13, XMM1_REGNUM + 14 + /* %xmm0 - %xmm7 */ + static int sse_parameter_registers[SSE_REGS] = + { + X86_64_XMM0_REGNUM + 0, X86_64_XMM1_REGNUM, + X86_64_XMM0_REGNUM + 2, X86_64_XMM0_REGNUM + 3, + X86_64_XMM0_REGNUM + 4, X86_64_XMM0_REGNUM + 5, + X86_64_XMM0_REGNUM + 6, X86_64_XMM0_REGNUM + 7, }; int stack_values_count = 0; int *stack_values; @@ -667,55 +631,78 @@ x86_64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int needed_sseregs; if (!n || - !examine_argument (class, n, &needed_intregs, &needed_sseregs) - || intreg / 2 + needed_intregs > INT_REGS - || ssereg / 2 + needed_sseregs > SSE_REGS) + !examine_argument (class, n, &needed_intregs, &needed_sseregs)) { /* memory class */ stack_values[stack_values_count++] = i; } else { int j; + int offset = 0; + + if (intreg / 2 + needed_intregs > INT_REGS) + int_stack = 1; + if (ssereg / 2 + needed_sseregs > SSE_REGS) + sse_stack = 1; + total_sse_args += needed_sseregs; + for (j = 0; j < n; j++) { - int offset = 0; switch (class[j]) { case X86_64_NO_CLASS: break; case X86_64_INTEGER_CLASS: - deprecated_write_register_gen (int_parameter_registers - [(intreg + 1) / 2], - VALUE_CONTENTS_ALL (args[i]) + offset); - offset += 8; - intreg += 2; + if (int_stack) + stack_values[stack_values_count++] = i; + else + { + regcache_cooked_write + (regcache, int_parameter_registers[(intreg + 1) / 2], + VALUE_CONTENTS_ALL (args[i]) + offset); + offset += 8; + intreg += 2; + } break; case X86_64_INTEGERSI_CLASS: - { - LONGEST num - = extract_signed_integer (VALUE_CONTENTS_ALL (args[i]) - + offset, 4); - regcache_raw_write_signed (current_regcache, - int_parameter_registers[intreg / 2], num); - - offset += 8; - intreg++; - break; - } + if (int_stack) + stack_values[stack_values_count++] = i; + else + { + LONGEST val = extract_signed_integer + (VALUE_CONTENTS_ALL (args[i]) + offset, 4); + regcache_cooked_write_signed + (regcache, int_parameter_registers[intreg / 2], val); + + offset += 8; + intreg++; + } + break; case X86_64_SSEDF_CLASS: case X86_64_SSESF_CLASS: case X86_64_SSE_CLASS: - deprecated_write_register_gen (sse_parameter_registers - [(ssereg + 1) / 2], - VALUE_CONTENTS_ALL (args[i]) + offset); - offset += 8; - ssereg += 2; + if (sse_stack) + stack_values[stack_values_count++] = i; + else + { + regcache_cooked_write + (regcache, sse_parameter_registers[(ssereg + 1) / 2], + VALUE_CONTENTS_ALL (args[i]) + offset); + offset += 8; + ssereg += 2; + } break; case X86_64_SSEUP_CLASS: - deprecated_write_register_gen (sse_parameter_registers[ssereg / 2], - VALUE_CONTENTS_ALL (args[i]) + offset); - offset += 8; - ssereg++; + if (sse_stack) + stack_values[stack_values_count++] = i; + else + { + regcache_cooked_write + (regcache, sse_parameter_registers[ssereg / 2], + VALUE_CONTENTS_ALL (args[i]) + offset); + offset += 8; + ssereg++; + } break; case X86_64_X87_CLASS: case X86_64_MEMORY_CLASS: @@ -732,50 +719,71 @@ x86_64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, } } } + + /* Push any remaining arguments onto the stack. */ while (--stack_values_count >= 0) { struct value *arg = args[stack_values[stack_values_count]]; int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg)); - len += 7; - len -= len % 8; - sp -= len; + + /* Make sure the stack stays eightbyte-aligned. */ + sp -= (len + 7) & ~7; write_memory (sp, VALUE_CONTENTS_ALL (arg), len); } + + /* Write number of SSE type arguments to RAX to take care of varargs + functions. */ + store_unsigned_integer (buf, 8, total_sse_args); + regcache_cooked_write (regcache, X86_64_RAX_REGNUM, buf); + return sp; } /* Write into the appropriate registers a function return value stored in VALBUF of type TYPE, given in virtual format. */ -void + +static void x86_64_store_return_value (struct type *type, struct regcache *regcache, const void *valbuf) { int len = TYPE_LENGTH (type); - if (TYPE_CODE_FLT == TYPE_CODE (type)) + /* First handle long doubles. */ + if (TYPE_CODE_FLT == TYPE_CODE (type) && len == 16) { - /* Floating-point return values can be found in %st(0). */ - if (len == TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT - && TARGET_LONG_DOUBLE_FORMAT == &floatformat_i387_ext) - { - /* Copy straight over. */ - regcache_cooked_write (regcache, FP0_REGNUM, valbuf); - } - else - { - char buf[FPU_REG_RAW_SIZE]; - DOUBLEST val; - - /* Convert the value found in VALBUF to the extended - floating point format used by the FPU. This is probably - not exactly how it would happen on the target itself, but - it is the best we can do. */ - val = deprecated_extract_floating (valbuf, TYPE_LENGTH (type)); - floatformat_from_doublest (&floatformat_i387_ext, &val, buf); - regcache_cooked_write_part (regcache, FP0_REGNUM, - 0, FPU_REG_RAW_SIZE, buf); - } + ULONGEST fstat; + char buf[FPU_REG_RAW_SIZE]; + + /* Returning floating-point values is a bit tricky. Apart from + storing the return value in %st(0), we have to simulate the + state of the FPU at function return point. */ + + /* Convert the value found in VALBUF to the extended + floating-point format used by the FPU. This is probably + not exactly how it would happen on the target itself, but + it is the best we can do. */ + convert_typed_floating (valbuf, type, buf, builtin_type_i387_ext); + regcache_raw_write (regcache, X86_64_ST0_REGNUM, buf); + + /* Set the top of the floating-point register stack to 7. The + actual value doesn't really matter, but 7 is what a normal + function return would end up with if the program started out + with a freshly initialized FPU. */ + regcache_raw_read_unsigned (regcache, FSTAT_REGNUM, &fstat); + fstat |= (7 << 11); + regcache_raw_write_unsigned (regcache, FSTAT_REGNUM, fstat); + + /* Mark %st(1) through %st(7) as empty. Since we set the top of + the floating-point register stack to 7, the appropriate value + for the tag word is 0x3fff. */ + regcache_raw_write_unsigned (regcache, FTAG_REGNUM, 0x3fff); + } + else if (TYPE_CODE_FLT == TYPE_CODE (type)) + { + /* Handle double and float variables. */ + regcache_cooked_write (regcache, X86_64_XMM0_REGNUM, valbuf); } + /* XXX: What about complex floating point types? */ else { int low_size = REGISTER_RAW_SIZE (0); @@ -797,126 +805,391 @@ x86_64_store_return_value (struct type *type, struct regcache *regcache, } -const char * -x86_64_register_name (int reg_nr) +static CORE_ADDR +x86_64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, + struct regcache *regcache, CORE_ADDR bp_addr, + int nargs, struct value **args, CORE_ADDR sp, + int struct_return, CORE_ADDR struct_addr) { - if (reg_nr < 0 || reg_nr >= X86_64_NUM_REGS) - return NULL; - return x86_64_register_info_table[reg_nr].name; + char buf[8]; + + /* Pass arguments. */ + sp = x86_64_push_arguments (regcache, nargs, args, sp); + + /* Pass "hidden" argument". */ + if (struct_return) + { + store_unsigned_integer (buf, 8, struct_addr); + regcache_cooked_write (regcache, X86_64_RDI_REGNUM, buf); + } + + /* Store return address. */ + sp -= 8; + store_unsigned_integer (buf, 8, bp_addr); + write_memory (sp, buf, 8); + + /* Finally, update the stack pointer... */ + store_unsigned_integer (buf, 8, sp); + regcache_cooked_write (regcache, X86_64_RSP_REGNUM, buf); + + /* ...and fake a frame pointer. */ + regcache_cooked_write (regcache, X86_64_RBP_REGNUM, buf); + + return sp + 16; } + -int -x86_64_register_number (const char *name) +/* The maximum number of saved registers. This should include %rip. */ +#define X86_64_NUM_SAVED_REGS X86_64_NUM_GREGS + +struct x86_64_frame_cache { - int reg_nr; + /* Base address. */ + CORE_ADDR base; + CORE_ADDR sp_offset; + CORE_ADDR pc; - for (reg_nr = 0; reg_nr < X86_64_NUM_REGS; reg_nr++) - if (strcmp (name, x86_64_register_info_table[reg_nr].name) == 0) - return reg_nr; - return -1; + /* Saved registers. */ + CORE_ADDR saved_regs[X86_64_NUM_SAVED_REGS]; + CORE_ADDR saved_sp; + + /* Do we have a frame? */ + int frameless_p; +}; + +/* Allocate and initialize a frame cache. */ + +static struct x86_64_frame_cache * +x86_64_alloc_frame_cache (void) +{ + struct x86_64_frame_cache *cache; + int i; + + cache = FRAME_OBSTACK_ZALLOC (struct x86_64_frame_cache); + + /* Base address. */ + cache->base = 0; + cache->sp_offset = -8; + cache->pc = 0; + + /* Saved registers. We initialize these to -1 since zero is a valid + offset (that's where %rbp is supposed to be stored). */ + for (i = 0; i < X86_64_NUM_SAVED_REGS; i++) + cache->saved_regs[i] = -1; + cache->saved_sp = 0; + + /* Frameless until proven otherwise. */ + cache->frameless_p = 1; + + return cache; } - -/* Store the address of the place in which to copy the structure the - subroutine will return. This is called from call_function. */ -void -x86_64_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) +/* Do a limited analysis of the prologue at PC and update CACHE + accordingly. Bail out early if CURRENT_PC is reached. Return the + address where the analysis stopped. + + We will handle only functions beginning with: + + pushq %rbp 0x55 + movq %rsp, %rbp 0x48 0x89 0xe5 + + Any function that doesn't start with this sequence will be assumed + to have no prologue and thus no valid frame pointer in %rbp. */ + +static CORE_ADDR +x86_64_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc, + struct x86_64_frame_cache *cache) { - write_register (RDI_REGNUM, addr); + static unsigned char proto[3] = { 0x48, 0x89, 0xe5 }; + unsigned char buf[3]; + unsigned char op; + + if (current_pc <= pc) + return current_pc; + + op = read_memory_unsigned_integer (pc, 1); + + if (op == 0x55) /* pushq %rbp */ + { + /* Take into account that we've executed the `pushq %rbp' that + starts this instruction sequence. */ + cache->saved_regs[X86_64_RBP_REGNUM] = 0; + cache->sp_offset += 8; + + /* If that's all, return now. */ + if (current_pc <= pc + 1) + return current_pc; + + /* Check for `movq %rsp, %rbp'. */ + read_memory (pc + 1, buf, 3); + if (memcmp (buf, proto, 3) != 0) + return pc + 1; + + /* OK, we actually have a frame. */ + cache->frameless_p = 0; + return pc + 4; + } + + return pc; } -int -x86_64_frameless_function_invocation (struct frame_info *frame) +/* Return PC of first real instruction. */ + +static CORE_ADDR +x86_64_skip_prologue (CORE_ADDR start_pc) { - return 0; + struct x86_64_frame_cache cache; + CORE_ADDR pc; + + pc = x86_64_analyze_prologue (start_pc, 0xffffffffffffffff, &cache); + if (cache.frameless_p) + return start_pc; + + return pc; } + -/* We will handle only functions beginning with: - 55 pushq %rbp - 48 89 e5 movq %rsp,%rbp - Any function that doesn't start with this sequence - will be assumed to have no prologue and thus no valid - frame pointer in %rbp. */ -#define PROLOG_BUFSIZE 4 -int -x86_64_function_has_prologue (CORE_ADDR pc) +/* Normal frames. */ + +static struct x86_64_frame_cache * +x86_64_frame_cache (struct frame_info *next_frame, void **this_cache) { + struct x86_64_frame_cache *cache; + char buf[8]; int i; - unsigned char prolog_expect[PROLOG_BUFSIZE] = { 0x55, 0x48, 0x89, 0xe5 }, - prolog_buf[PROLOG_BUFSIZE]; - read_memory (pc, (char *) prolog_buf, PROLOG_BUFSIZE); + if (*this_cache) + return *this_cache; - /* First check, whether pc points to pushq %rbp, movq %rsp,%rbp. */ - for (i = 0; i < PROLOG_BUFSIZE; i++) - if (prolog_expect[i] != prolog_buf[i]) - return 0; /* ... no, it doesn't. Nothing to skip. */ - - return 1; + cache = x86_64_alloc_frame_cache (); + *this_cache = cache; + + frame_unwind_register (next_frame, X86_64_RBP_REGNUM, buf); + cache->base = extract_unsigned_integer (buf, 8); + if (cache->base == 0) + return cache; + + /* For normal frames, %rip is stored at 8(%rbp). */ + cache->saved_regs[X86_64_RIP_REGNUM] = 8; + + cache->pc = frame_func_unwind (next_frame); + if (cache->pc != 0) + x86_64_analyze_prologue (cache->pc, frame_pc_unwind (next_frame), cache); + + if (cache->frameless_p) + { + /* We didn't find a valid frame, which means that CACHE->base + currently holds the frame pointer for our calling frame. If + we're at the start of a function, or somewhere half-way its + prologue, the function's frame probably hasn't been fully + setup yet. Try to reconstruct the base address for the stack + frame by looking at the stack pointer. For truly "frameless" + functions this might work too. */ + + frame_unwind_register (next_frame, X86_64_RSP_REGNUM, buf); + cache->base = extract_unsigned_integer (buf, 8) + cache->sp_offset; + } + + /* Now that we have the base address for the stack frame we can + calculate the value of %rsp in the calling frame. */ + cache->saved_sp = cache->base + 16; + + /* Adjust all the saved registers such that they contain addresses + instead of offsets. */ + for (i = 0; i < X86_64_NUM_SAVED_REGS; i++) + if (cache->saved_regs[i] != -1) + cache->saved_regs[i] += cache->base; + + return cache; } -/* If a function with debugging information and known beginning - is detected, we will return pc of the next line in the source - code. With this approach we effectively skip the prolog. */ +static void +x86_64_frame_this_id (struct frame_info *next_frame, void **this_cache, + struct frame_id *this_id) +{ + struct x86_64_frame_cache *cache = + x86_64_frame_cache (next_frame, this_cache); + + /* This marks the outermost frame. */ + if (cache->base == 0) + return; -CORE_ADDR -x86_64_skip_prologue (CORE_ADDR pc) + (*this_id) = frame_id_build (cache->base + 16, cache->pc); +} + +static void +x86_64_frame_prev_register (struct frame_info *next_frame, void **this_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep) { + struct x86_64_frame_cache *cache = + x86_64_frame_cache (next_frame, this_cache); + + gdb_assert (regnum >= 0); + + if (regnum == SP_REGNUM && cache->saved_sp) + { + *optimizedp = 0; + *lvalp = not_lval; + *addrp = 0; + *realnump = -1; + if (valuep) + { + /* Store the value. */ + store_unsigned_integer (valuep, 8, cache->saved_sp); + } + return; + } + + if (regnum < X86_64_NUM_SAVED_REGS && cache->saved_regs[regnum] != -1) + { + *optimizedp = 0; + *lvalp = lval_memory; + *addrp = cache->saved_regs[regnum]; + *realnump = -1; + if (valuep) + { + /* Read the value in from memory. */ + read_memory (*addrp, valuep, + register_size (current_gdbarch, regnum)); + } + return; + } + + frame_register_unwind (next_frame, regnum, + optimizedp, lvalp, addrp, realnump, valuep); +} + +static const struct frame_unwind x86_64_frame_unwind = +{ + NORMAL_FRAME, + x86_64_frame_this_id, + x86_64_frame_prev_register +}; + +static const struct frame_unwind * +x86_64_frame_p (CORE_ADDR pc) +{ + return &x86_64_frame_unwind; +} + + +/* Signal trampolines. */ + +/* FIXME: kettenis/20030419: Perhaps, we can unify the 32-bit and + 64-bit variants. This would require using identical frame caches + on both platforms. */ + +static struct x86_64_frame_cache * +x86_64_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache) +{ + struct x86_64_frame_cache *cache; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + CORE_ADDR addr; + char buf[8]; int i; - struct symtab_and_line v_sal; - struct symbol *v_function; - CORE_ADDR endaddr; - if (! x86_64_function_has_prologue (pc)) - return pc; + if (*this_cache) + return *this_cache; - /* OK, we have found the prologue and want PC of the first - non-prologue instruction. */ - pc += PROLOG_BUFSIZE; + cache = x86_64_alloc_frame_cache (); - v_function = find_pc_function (pc); - v_sal = find_pc_line (pc, 0); + frame_unwind_register (next_frame, X86_64_RSP_REGNUM, buf); + cache->base = extract_unsigned_integer (buf, 8) - 8; - /* If pc doesn't point to a function with debuginfo, some of the - following may be NULL. */ - if (!v_function || !v_function->ginfo.value.block || !v_sal.symtab) - return pc; + addr = tdep->sigcontext_addr (next_frame); + gdb_assert (tdep->sc_reg_offset); + gdb_assert (tdep->sc_num_regs <= X86_64_NUM_SAVED_REGS); + for (i = 0; i < tdep->sc_num_regs; i++) + if (tdep->sc_reg_offset[i] != -1) + cache->saved_regs[i] = addr + tdep->sc_reg_offset[i]; - endaddr = BLOCK_END (SYMBOL_BLOCK_VALUE (v_function)); + *this_cache = cache; + return cache; +} - for (i = 0; i < v_sal.symtab->linetable->nitems; i++) - if (v_sal.symtab->linetable->item[i].pc >= pc - && v_sal.symtab->linetable->item[i].pc < endaddr) - { - pc = v_sal.symtab->linetable->item[i].pc; - break; - } +static void +x86_64_sigtramp_frame_this_id (struct frame_info *next_frame, + void **this_cache, struct frame_id *this_id) +{ + struct x86_64_frame_cache *cache = + x86_64_sigtramp_frame_cache (next_frame, this_cache); - return pc; + (*this_id) = frame_id_build (cache->base + 16, frame_pc_unwind (next_frame)); } static void -x86_64_save_dummy_frame_tos (CORE_ADDR sp) +x86_64_sigtramp_frame_prev_register (struct frame_info *next_frame, + void **this_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep) +{ + /* Make sure we've initialized the cache. */ + x86_64_sigtramp_frame_cache (next_frame, this_cache); + + x86_64_frame_prev_register (next_frame, this_cache, regnum, + optimizedp, lvalp, addrp, realnump, valuep); +} + +static const struct frame_unwind x86_64_sigtramp_frame_unwind = +{ + SIGTRAMP_FRAME, + x86_64_sigtramp_frame_this_id, + x86_64_sigtramp_frame_prev_register +}; + +static const struct frame_unwind * +x86_64_sigtramp_frame_p (CORE_ADDR pc) +{ + char *name; + + find_pc_partial_function (pc, &name, NULL, NULL); + if (PC_IN_SIGTRAMP (pc, name)) + { + gdb_assert (gdbarch_tdep (current_gdbarch)->sigcontext_addr); + + return &x86_64_sigtramp_frame_unwind; + } + + return NULL; +} + + +static CORE_ADDR +x86_64_frame_base_address (struct frame_info *next_frame, void **this_cache) { - /* We must add the size of the return address that is already - put on the stack. */ - generic_save_dummy_frame_tos (sp + - TYPE_LENGTH (builtin_type_void_func_ptr)); + struct x86_64_frame_cache *cache = + x86_64_frame_cache (next_frame, this_cache); + + return cache->base; } +static const struct frame_base x86_64_frame_base = +{ + &x86_64_frame_unwind, + x86_64_frame_base_address, + x86_64_frame_base_address, + x86_64_frame_base_address +}; + static struct frame_id -x86_64_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *frame) +x86_64_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) { - CORE_ADDR base; - frame_unwind_unsigned_register (frame, SP_REGNUM, &base); - return frame_id_build (base, frame_pc_unwind (frame)); + char buf[8]; + CORE_ADDR fp; + + frame_unwind_register (next_frame, X86_64_RBP_REGNUM, buf); + fp = extract_unsigned_integer (buf, 8); + + return frame_id_build (fp + 16, frame_pc_unwind (next_frame)); } void x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - int i, sum; /* The x86-64 has 16 SSE registers. */ tdep->num_xmm_regs = 16; @@ -932,115 +1205,97 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_long_double_bit (gdbarch, 128); set_gdbarch_num_regs (gdbarch, X86_64_NUM_REGS); + set_gdbarch_register_name (gdbarch, x86_64_register_name); + set_gdbarch_register_type (gdbarch, x86_64_register_type); /* Register numbers of various important registers. */ - set_gdbarch_sp_regnum (gdbarch, 7); /* %rsp */ - set_gdbarch_deprecated_fp_regnum (gdbarch, 6); /* %rbp */ - set_gdbarch_pc_regnum (gdbarch, 16); /* %rip */ - set_gdbarch_ps_regnum (gdbarch, 17); /* %eflags */ - set_gdbarch_fp0_regnum (gdbarch, X86_64_NUM_GREGS); /* %st(0) */ + set_gdbarch_sp_regnum (gdbarch, X86_64_RSP_REGNUM); /* %rsp */ + set_gdbarch_pc_regnum (gdbarch, X86_64_RIP_REGNUM); /* %rip */ + set_gdbarch_ps_regnum (gdbarch, X86_64_EFLAGS_REGNUM); /* %eflags */ + set_gdbarch_fp0_regnum (gdbarch, X86_64_ST0_REGNUM); /* %st(0) */ /* The "default" register numbering scheme for the x86-64 is - referred to as the "DWARF register number mapping" in the psABI. - The preferred debugging format for all known x86-64 targets is - actually DWARF2, and GCC doesn't seem to support DWARF (that is - DWARF-1), but we provide the same mapping just in case. This - mapping is also used for stabs, which GCC does support. */ - set_gdbarch_stab_reg_to_regnum (gdbarch, x86_64_dwarf2_reg_to_regnum); - set_gdbarch_dwarf_reg_to_regnum (gdbarch, x86_64_dwarf2_reg_to_regnum); - set_gdbarch_dwarf2_reg_to_regnum (gdbarch, x86_64_dwarf2_reg_to_regnum); - - /* We don't override SDB_REG_RO_REGNUM, sice COFF doesn't seem to be - in use on any of the supported x86-64 targets. */ - - set_gdbarch_register_name (gdbarch, x86_64_register_name); - set_gdbarch_deprecated_register_size (gdbarch, 8); + referred to as the "DWARF Register Number Mapping" in the System + V psABI. The preferred debugging format for all known x86-64 + targets is actually DWARF2, and GCC doesn't seem to support DWARF + (that is DWARF-1), but we provide the same mapping just in case. + This mapping is also used for stabs, which GCC does support. */ + set_gdbarch_stab_reg_to_regnum (gdbarch, x86_64_dwarf_reg_to_regnum); + set_gdbarch_dwarf_reg_to_regnum (gdbarch, x86_64_dwarf_reg_to_regnum); + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, x86_64_dwarf_reg_to_regnum); - /* Total amount of space needed to store our copies of the machine's - register (SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS + - SIZEOF_SSE_REGS) */ - for (i = 0, sum = 0; i < X86_64_NUM_REGS; i++) - sum += x86_64_register_info_table[i].size; - set_gdbarch_deprecated_register_bytes (gdbarch, sum); + /* We don't override SDB_REG_RO_REGNUM, since COFF doesn't seem to + be in use on any of the supported x86-64 targets. */ - set_gdbarch_register_raw_size (gdbarch, x86_64_register_raw_size); - set_gdbarch_register_byte (gdbarch, x86_64_register_byte); - set_gdbarch_register_virtual_type (gdbarch, x86_64_register_virtual_type); + /* Call dummy code. */ + set_gdbarch_push_dummy_call (gdbarch, x86_64_push_dummy_call); - set_gdbarch_register_convertible (gdbarch, x86_64_register_convertible); - set_gdbarch_register_convert_to_virtual (gdbarch, - x86_64_register_convert_to_virtual); - set_gdbarch_register_convert_to_raw (gdbarch, - x86_64_register_convert_to_raw); - - /* Getting saved registers is handled by unwind information. */ - set_gdbarch_deprecated_get_saved_register (gdbarch, cfi_get_saved_register); - - /* FIXME: kettenis/20021026: Should we set parm_boundary to 64 here? */ - set_gdbarch_deprecated_target_read_fp (gdbarch, cfi_read_fp); + set_gdbarch_convert_register_p (gdbarch, x86_64_convert_register_p); + set_gdbarch_register_to_value (gdbarch, i387_register_to_value); + set_gdbarch_value_to_register (gdbarch, i387_value_to_register); set_gdbarch_extract_return_value (gdbarch, x86_64_extract_return_value); - - set_gdbarch_deprecated_push_arguments (gdbarch, x86_64_push_arguments); - set_gdbarch_deprecated_push_return_address (gdbarch, x86_64_push_return_address); - set_gdbarch_deprecated_pop_frame (gdbarch, x86_64_pop_frame); - set_gdbarch_deprecated_store_struct_return (gdbarch, x86_64_store_struct_return); 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_deprecated_frame_init_saved_regs (gdbarch, x86_64_frame_init_saved_regs); set_gdbarch_skip_prologue (gdbarch, x86_64_skip_prologue); - set_gdbarch_deprecated_frame_chain (gdbarch, x86_64_linux_frame_chain); - set_gdbarch_frameless_function_invocation (gdbarch, - x86_64_frameless_function_invocation); - /* FIXME: kettenis/20021026: These two are GNU/Linux-specific and - should be moved elsewhere. */ - set_gdbarch_deprecated_frame_saved_pc (gdbarch, x86_64_linux_frame_saved_pc); - set_gdbarch_deprecated_saved_pc_after_call (gdbarch, x86_64_linux_saved_pc_after_call); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); - /* FIXME: kettenis/20021026: This one is GNU/Linux-specific too. */ - set_gdbarch_pc_in_sigtramp (gdbarch, x86_64_linux_in_sigtramp); - + /* Avoid wiring in the MMX registers for now. */ set_gdbarch_num_pseudo_regs (gdbarch, 0); - /* Build call frame information (CFI) from DWARF2 frame debug info. */ - set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info); - - /* Initialization of per-frame CFI. */ - 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); - - /* Cons up virtual frame pointer for trace. */ - set_gdbarch_virtual_frame_pointer (gdbarch, cfi_virtual_frame_pointer); + set_gdbarch_unwind_dummy_id (gdbarch, x86_64_unwind_dummy_id); /* FIXME: kettenis/20021026: This is ELF-specific. Fine for now, since all supported x86-64 targets are ELF, but that might change in the future. */ set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section); - - /* Dummy frame helper functions. */ - set_gdbarch_save_dummy_frame_tos (gdbarch, x86_64_save_dummy_frame_tos); - set_gdbarch_unwind_dummy_id (gdbarch, x86_64_unwind_dummy_id); + + frame_unwind_append_predicate (gdbarch, x86_64_sigtramp_frame_p); + frame_unwind_append_predicate (gdbarch, x86_64_frame_p); + frame_base_set_default (gdbarch, &x86_64_frame_base); } + + +#define I387_FISEG_REGNUM FISEG_REGNUM +#define I387_FOSEG_REGNUM FOSEG_REGNUM + +/* The 64-bit FXSAVE format differs from the 32-bit format in the + sense that the instruction pointer and data pointer are simply + 64-bit offsets into the code segment and the data segment instead + of a selector offset pair. The functions below store the upper 32 + bits of these pointers (instead of just the 16-bits of the segment + selector). */ + +/* Fill GDB's register array with the floating-point and SSE register + values in *FXSAVE. This function masks off any of the reserved + bits in *FXSAVE. */ void -_initialize_x86_64_tdep (void) +x86_64_supply_fxsave (char *fxsave) { - /* Initialize the table saying where each register starts in the - register file. */ - { - int i, offset; + i387_supply_fxsave (fxsave); - offset = 0; - for (i = 0; i < X86_64_NUM_REGS; i++) - { - x86_64_register_byte_table[i] = offset; - offset += x86_64_register_info_table[i].size; - } - } + if (fxsave) + { + supply_register (I387_FISEG_REGNUM, fxsave + 12); + supply_register (I387_FOSEG_REGNUM, fxsave + 20); + } +} + +/* Fill register REGNUM (if it is a floating-point or SSE register) in + *FXSAVE with the value in GDB's register array. If REGNUM is -1, do + this for all registers. This function doesn't touch any of the + reserved bits in *FXSAVE. */ + +void +x86_64_fill_fxsave (char *fxsave, int regnum) +{ + i387_fill_fxsave (fxsave, regnum); + + if (regnum == -1 || regnum == I387_FISEG_REGNUM) + regcache_collect (I387_FISEG_REGNUM, fxsave + 12); + if (regnum == -1 || regnum == I387_FOSEG_REGNUM) + regcache_collect (I387_FOSEG_REGNUM, fxsave + 20); } diff --git a/gdb/x86-64-tdep.h b/gdb/x86-64-tdep.h index 6885a7cb856..70ceffbbda2 100644 --- a/gdb/x86-64-tdep.h +++ b/gdb/x86-64-tdep.h @@ -1,6 +1,8 @@ -/* Target-dependent code for GDB, the GNU debugger. - Copyright 2001 +/* Target-dependent code for the x86-64. + + Copyright 2001, 2003 Free Software Foundation, Inc. + Contributed by Jiri Smid, SuSE Labs. This file is part of GDB. @@ -28,19 +30,22 @@ struct frame_info; #include "i386-tdep.h" -extern int x86_64_num_regs; -extern int x86_64_num_gregs; +/* Number of general purpose registers. */ +#define X86_64_NUM_GREGS 22 + +void x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch); -int x86_64_register_number (const char *name); -const char *x86_64_register_name (int reg_nr); +/* Fill GDB's register array with the floating-point and SSE register + values in *FXSAVE. This function masks off any of the reserved + bits in *FXSAVE. */ -gdbarch_deprecated_frame_saved_pc_ftype x86_64_linux_frame_saved_pc; -gdbarch_deprecated_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call; -gdbarch_pc_in_sigtramp_ftype x86_64_linux_in_sigtramp; -CORE_ADDR x86_64_linux_frame_chain (struct frame_info *fi); -CORE_ADDR x86_64_init_frame_pc (int fromleaf, struct frame_info *fi); -int x86_64_function_has_prologue (CORE_ADDR pc); +void x86_64_supply_fxsave (char *fxsave); -void x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch); +/* Fill register REGNUM (if it is a floating-point or SSE register) in + *FXSAVE with the value in GDB's register array. If REGNUM is -1, do + this for all registers. This function doesn't touch any of the + reserved bits in *FXSAVE. */ + +void x86_64_fill_fxsave (char *fxsave, int regnum); -#endif +#endif /* x86-64-tdep.h */ diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 94c9a1cf835..70081922424 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -2980,9 +2980,10 @@ xcoff_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs) asection *sect = NULL; int i; - objfile->num_sections = SECT_OFF_MAX; + objfile->num_sections = bfd_count_sections (objfile->obfd); objfile->section_offsets = (struct section_offsets *) - obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS); + obstack_alloc (&objfile->psymbol_obstack, + SIZEOF_N_SECTION_OFFSETS (objfile->num_sections)); /* Initialize the section indexes for future use. */ sect = bfd_get_section_by_name (objfile->obfd, ".text"); diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index f792423a544..076bd23464d 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -228,8 +228,8 @@ xstormy16_extract_return_value (struct type *type, char *regbuf, char *valbuf) /* Aggregates and return values > 12 bytes are returned in memory, pointed to by R2. */ return_buffer = - extract_address (regbuf + REGISTER_BYTE (E_PTR_RET_REGNUM), - REGISTER_RAW_SIZE (E_PTR_RET_REGNUM)); + extract_unsigned_integer (regbuf + REGISTER_BYTE (E_PTR_RET_REGNUM), + REGISTER_RAW_SIZE (E_PTR_RET_REGNUM)); read_memory (return_buffer, valbuf, TYPE_LENGTH (type)); } @@ -307,7 +307,7 @@ xstormy16_push_arguments (int nargs, struct value **args, CORE_ADDR sp, (which may or may not be the same as before). */ -CORE_ADDR +static CORE_ADDR xstormy16_push_return_address (CORE_ADDR pc, CORE_ADDR sp) { unsigned char buf[xstormy16_pc_size]; @@ -410,9 +410,8 @@ xstormy16_store_return_value (struct type *type, char *valbuf) static CORE_ADDR xstormy16_extract_struct_value_address (char *regbuf) { - return extract_address (regbuf + - xstormy16_register_byte (E_PTR_RET_REGNUM), - xstormy16_reg_size); + return extract_unsigned_integer (regbuf + xstormy16_register_byte (E_PTR_RET_REGNUM), + xstormy16_reg_size); } /* Function: xstormy16_use_struct_convention @@ -962,7 +961,7 @@ static CORE_ADDR xstormy16_pointer_to_address (struct type *type, const void *buf) { enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type)); - CORE_ADDR addr = extract_address (buf, TYPE_LENGTH (type)); + CORE_ADDR addr = extract_unsigned_integer (buf, TYPE_LENGTH (type)); if (target == TYPE_CODE_FUNC || target == TYPE_CODE_METHOD) { @@ -996,7 +995,7 @@ xstormy16_stack_align (CORE_ADDR addr) return addr; } -void +static void xstormy16_save_dummy_frame_tos (CORE_ADDR sp) { generic_save_dummy_frame_tos (sp - xstormy16_pc_size); @@ -1040,12 +1039,12 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_name (gdbarch, xstormy16_register_name); set_gdbarch_deprecated_register_size (gdbarch, xstormy16_reg_size); set_gdbarch_deprecated_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_deprecated_register_byte (gdbarch, xstormy16_register_byte); + set_gdbarch_deprecated_register_raw_size (gdbarch, xstormy16_register_raw_size); set_gdbarch_deprecated_max_register_raw_size (gdbarch, xstormy16_pc_size); - set_gdbarch_register_virtual_size (gdbarch, xstormy16_register_raw_size); + set_gdbarch_deprecated_register_virtual_size (gdbarch, xstormy16_register_raw_size); set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4); - set_gdbarch_register_virtual_type (gdbarch, xstormy16_reg_virtual_type); + set_gdbarch_deprecated_register_virtual_type (gdbarch, xstormy16_reg_virtual_type); /* * Frame Info @@ -1076,8 +1075,6 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_function_start_offset (gdbarch, 0); /* This value is almost never non-zero... */ set_gdbarch_frame_args_skip (gdbarch, 0); - /* OK to default this value to 'unknown'. */ - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); /* * Call Dummies @@ -1107,7 +1104,7 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_stack_align (gdbarch, xstormy16_stack_align); - set_gdbarch_save_dummy_frame_tos (gdbarch, xstormy16_save_dummy_frame_tos); + set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, xstormy16_save_dummy_frame_tos); set_gdbarch_skip_trampoline_code (gdbarch, xstormy16_skip_trampoline_code); @@ -1115,7 +1112,7 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) xstormy16_in_solib_call_trampoline); /* Should be using push_dummy_call. */ - set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); return gdbarch; } @@ -1124,6 +1121,8 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) Initializer function for the Sanyo Xstormy16a module. Called by gdb at start-up. */ +extern initialize_file_ftype _initialize_xstormy16_tdep; /* -Wmissing-prototypes */ + void _initialize_xstormy16_tdep (void) { diff --git a/include/ChangeLog b/include/ChangeLog index 8dfa46f77c9..f061efa770f 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,37 @@ +2003-06-25 Alan Modra + + * bfdlink.h: Correct spelling of "relocatable". + +2003-06-22 Zack Weinberg + + * safe-ctype.h (HC_UNKNOWN, HC_ASCII, HC_EBCDIC): Rename to + HOST_CHARSET_UNKNOWN, HOST_CHARSET_ASCII, HOST_CHARSET_EBCDIC + respectively. + +2003-06-21 Zack Weinberg + + * safe-ctype.h (HC_UNKNOWN, HC_ASCII, HC_EBCDIC, HOST_CHARSET): + New #defines. + +2003-06-17 Kaveh R. Ghazi + + * ansidecl.h: Delete HAVE_LONG_DOUBLE GCC bootstrap support. + +2003-05-23 Jakub Jelinek + + * bfdlink.h (struct bfd_link_info): Add execstack and noexecstack. + * elf/common.h (PT_GNU_STACK): Define. + +2003-06-03 H.J. Lu + + * bfdlink.h (LD_DEFINITION_IN_DISCARDED_SECTION): New. + +2003-05-30 Ulrich Drepper + Jakub Jelinek + + * bfdlink.h (struct bfd_link_info): Add pie and executable + bits. + 2003-05-21 Nick Clifton * bfdlink.h (struct bfd_link_hash_table): Fix typo in comment. diff --git a/include/ansidecl.h b/include/ansidecl.h index f8f2d737bf0..d2c87768ce2 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -312,15 +312,4 @@ So instead we use the macro below and test it against specific values. */ #define __extension__ #endif -/* Bootstrap support: Adjust certain macros defined by Autoconf, - which are only valid for the stage1 compiler. If we detect - a modern version of GCC, we are probably in stage2 or beyond, - so unconditionally reset the values. Note that const, inline, - etc. have been dealt with above. */ -#if (GCC_VERSION >= 2007) -# ifndef HAVE_LONG_DOUBLE -# define HAVE_LONG_DOUBLE 1 -# endif -#endif /* GCC >= 2.7 */ - #endif /* ansidecl.h */ diff --git a/include/bfdlink.h b/include/bfdlink.h index 89d916ee83b..10746ee98e0 100644 --- a/include/bfdlink.h +++ b/include/bfdlink.h @@ -1,5 +1,5 @@ /* bfdlink.h -- header file for BFD link routines - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support. @@ -204,7 +204,7 @@ struct bfd_sym_chain struct bfd_link_info { /* TRUE if BFD should generate a relocatable object file. */ - unsigned int relocateable: 1; + unsigned int relocatable: 1; /* TRUE if BFD should generate relocation information in the final executable. */ @@ -291,6 +291,20 @@ struct bfd_link_info /* TRUE if relaxation is being finalized. */ unsigned int relax_finalizing: 1; + /* TRUE if generating a position independent executable. */ + unsigned int pie: 1; + + /* TRUE if generating an executable, position independent or not. */ + unsigned int executable : 1; + + /* TRUE if PT_GNU_STACK segment should be created with PF_R|PF_W|PF_X + flags. */ + unsigned int execstack: 1; + + /* TRUE if PT_GNU_STACK segment should be created with PF_R|PF_W + flags. */ + unsigned int noexecstack: 1; + /* Which symbols to strip. */ enum bfd_link_strip strip; @@ -414,7 +428,7 @@ struct bfd_link_callbacks /* A function which is called to add a symbol to a set. ENTRY is the link hash table entry for the set itself (e.g., __CTOR_LIST__). RELOC is the relocation to use for an entry in - the set when generating a relocateable file, and is also used to + the set when generating a relocatable file, and is also used to get the size of the entry when generating an executable file. ABFD, SEC and VALUE identify the value to add to the set. */ bfd_boolean (*add_to_set) @@ -425,7 +439,7 @@ struct bfd_link_callbacks destructor is found. This is only called by some object file formats. CONSTRUCTOR is TRUE for a constructor, FALSE for a destructor. This will use BFD_RELOC_CTOR when generating a - relocateable file. NAME is the name of the symbol found. ABFD, + relocatable file. NAME is the name of the symbol found. ABFD, SECTION and VALUE are the value of the symbol. */ bfd_boolean (*constructor) PARAMS ((struct bfd_link_info *, bfd_boolean constructor, @@ -489,6 +503,9 @@ struct bfd_link_callbacks ld. */ bfd_boolean (*error_handler) PARAMS ((int id, const char * fmt, ...)); + +/* Identifiers of linker error messages used by error_handler. */ +#define LD_DEFINITION_IN_DISCARDED_SECTION 1 }; /* The linker builds link_order structures which tell the code how to diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index 59e05e318ad..eb4b7ccb55e 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,3 +1,17 @@ +2003-06-13 Robert Millan + + * common.h (GNU_ABI_TAG_NETBSD): New tag. + (GNU_ABI_TAG_FREEBSD): New tag. + +2003-06-10 Richard Sandiford + + * h8.h (E_H8_MACH_H8300SXN): New flag. + +2003-06-03 Nick Clifton + + * v850.h (R_V850_32): Rename to R_V850_ABS32. + Add R_V850_REL32. + 2003-05-15 Roland McGrath * common.h (NT_AUXV, AT_*): New macros. diff --git a/include/elf/common.h b/include/elf/common.h index f342d573710..1a843393d85 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -288,6 +288,7 @@ #define PT_HIPROC 0x7FFFFFFF /* Processor-specific */ #define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550) +#define PT_GNU_STACK (PT_LOOS + 0x474e551) /* Program segment permissions, in program header p_flags field. */ @@ -396,6 +397,8 @@ #define GNU_ABI_TAG_LINUX 0 #define GNU_ABI_TAG_HURD 1 #define GNU_ABI_TAG_SOLARIS 2 +#define GNU_ABI_TAG_FREEBSD 3 +#define GNU_ABI_TAG_NETBSD 4 /* Values for NetBSD .note.netbsd.ident notes. Note name is "NetBSD". */ diff --git a/include/elf/h8.h b/include/elf/h8.h index 79c0a34fb32..1aad7a4ed5b 100644 --- a/include/elf/h8.h +++ b/include/elf/h8.h @@ -95,5 +95,6 @@ END_RELOC_NUMBERS (R_H8_max) #define E_H8_MACH_H8300HN 0x00830000 #define E_H8_MACH_H8300SN 0x00840000 #define E_H8_MACH_H8300SX 0x00850000 +#define E_H8_MACH_H8300SXN 0x00860000 #endif diff --git a/include/elf/v850.h b/include/elf/v850.h index a15c9ee0864..c949ab01f8c 100644 --- a/include/elf/v850.h +++ b/include/elf/v850.h @@ -53,7 +53,7 @@ START_RELOC_NUMBERS (v850_reloc_type) RELOC_NUMBER (R_V850_HI16_S, 3) RELOC_NUMBER (R_V850_HI16, 4) RELOC_NUMBER (R_V850_LO16, 5) - RELOC_NUMBER (R_V850_32, 6) + RELOC_NUMBER (R_V850_ABS32, 6) RELOC_NUMBER (R_V850_16, 7) RELOC_NUMBER (R_V850_8, 8) RELOC_NUMBER( R_V850_SDA_16_16_OFFSET, 9) /* For ld.b, st.b, set1, clr1, not1, tst1, movea, movhi */ @@ -75,6 +75,7 @@ START_RELOC_NUMBERS (v850_reloc_type) RELOC_NUMBER (R_V850_LONGCALL, 25) RELOC_NUMBER (R_V850_LONGJUMP, 26) RELOC_NUMBER (R_V850_ALIGN, 27) + RELOC_NUMBER (R_V850_REL32, 28) END_RELOC_NUMBERS (R_V850_max) diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog index 77a8551a460..79c817871ec 100644 --- a/include/gdb/ChangeLog +++ b/include/gdb/ChangeLog @@ -1,3 +1,7 @@ +2003-06-10 Corinna Vinschen + + * gdb/fileio.h: New file. + 2003-05-07 Andrew Cagney * sim-d10v.h (sim_d10v_translate_addr): Add regcache parameter. diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index 48004d0b674..e100c119316 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,11 +1,65 @@ +2003-06-25 Richard Sandiford + + * h8300.h (IMM2_NS, IMM8_NS, IMM16_NS): Remove. + (IMM8U, IMM8U_NS): Define. + (h8_opcodes): Use IMM8U_NS for mov.[wl] #xx:8,@yy. + +2003-06-25 Richard Sandiford + + * h8300.h (h8_opcodes): Fix the mov.l @(dd:32,ERs),ERd and + mov.l ERs,@(dd:32,ERd) entries. + +2003-06-23 H.J. Lu + + * i386.h (i386_optab): Support Intel Precott New Instructions. + +2003-06-10 Gary Hade + + * ppc.h (PPC_OPERAND_DQ): Define. + +2003-06-10 Richard Sandiford + + * h8300.h (IMM4_NS, IMM8_NS): New. + (h8_opcodes): Replace IMM4 with IMM4_NS in mov.b and mov.w entries. + Likewise IMM8 for mov.w and mov.l. Likewise IMM16U for mov.l. + +2003-06-03 Michael Snyder + + * h8300.h (enum h8_model): Add AV_H8S to distinguish from H8H. + (ldc): Split ccr ops from exr ops (which are only available + on H8S or H8SX). + (stc): Ditto. + (andc, orc, xorc): Ditto. + (ldmac, stmac, clrmac, mac): Change access to AV_H8S. + +2003-06-03 Michael Snyder + and Bernd Schmidt + and Alexandre Oliva + * h8300.h: Add support for h8300sx instruction set. + +2003-05-23 Jason Eckhardt + + * i860.h (expand_type): Add XP_ONLY. + (scyc.b): New XP instruction. + (ldio.l): Likewise. + (ldio.s): Likewise. + (ldio.b): Likewise. + (ldint.l): Likewise. + (ldint.s): Likewise. + (ldint.b): Likewise. + (stio.l): Likewise. + (stio.s): Likewise. + (stio.b): Likewise. + (pfld.q): Likewise. + 2003-05-20 Jason Eckhardt - opcode/i860.h (flush): Set lower 3 bits properly and use 'L' + * i860.h (flush): Set lower 3 bits properly and use 'L' for the immediate operand type instead of 'i'. 2003-05-20 Jason Eckhardt - opcode/i860.h (fzchks): Both S and R bits must be set. + * i860.h (fzchks): Both S and R bits must be set. (pfzchks): Likewise. (faddp): Likewise. (pfaddp): Likewise. @@ -125,7 +179,7 @@ fields. (h8_opcodes). Modify initializer and initializer macros to no longer initialize the removed fields. - + 2002-11-19 Svein E. Seldal * tic4x.h (c4x_insts): Fixed LDHI constraint @@ -162,10 +216,10 @@ * cgen.h: Test __BFD_H_SEEN__ rather than BFD_VERSION_DATE. 2002-09-30 Gavin Romig-Koch - Ken Raeburn - Aldy Hernandez - Eric Christopher - Richard Sandiford + Ken Raeburn + Aldy Hernandez + Eric Christopher + Richard Sandiford * mips.h: Update comment for new opcodes. (OP_MASK_VECBYTE, OP_SH_VECBYTE): New. @@ -176,12 +230,12 @@ Don't match CPU_R4111 with INSN_4100. 2002-08-19 Elena Zannoni - - From matthew green - * ppc.h (PPC_OPCODE_SPE): New opcode flag for Powerpc e500 + From matthew green + + * ppc.h (PPC_OPCODE_SPE): New opcode flag for Powerpc e500 instructions. - (PPC_OPCODE_ISEL, PPC_OPCODE_BRLOCK, PPC_OPCODE_PMR, + (PPC_OPCODE_ISEL, PPC_OPCODE_BRLOCK, PPC_OPCODE_PMR, PPC_OPCODE_CACHELCK, PPC_OPCODE_RFMCI): New opcode flags for the e500x2 Integer select, branch locking, performance monitor, cache locking and machine check APUs, respectively. @@ -236,9 +290,9 @@ 2002-05-17 Andrey Volkov - * h8300.h: Corrected defs of all control regs + * h8300.h: Corrected defs of all control regs and eepmov instr. - + 2002-04-11 Alan Modra * i386.h: Add intel mode cmpsd and movsd. @@ -505,9 +559,9 @@ Mon Dec 31 16:45:41 2001 Jeffrey A Law (law@cygnus.com) 2001-02-02 Patrick Macdonald - * cgen.h (CGEN_SYNTAX_CHAR_TYPE): Typedef as unsigned short. - (CGEN_MAX_SYNTAX_ELEMENTS): Rename from CGEN_MAX_SYNTAX_BYTES. - (CGEN_SYNTAX): Define using CGEN_MAX_SYNTAX_ELEMENTS. + * cgen.h (CGEN_SYNTAX_CHAR_TYPE): Typedef as unsigned short. + (CGEN_MAX_SYNTAX_ELEMENTS): Rename from CGEN_MAX_SYNTAX_BYTES. + (CGEN_SYNTAX): Define using CGEN_MAX_SYNTAX_ELEMENTS. 2001-01-24 Karsten Keil @@ -582,35 +636,35 @@ Mon Dec 31 16:45:41 2001 Jeffrey A Law (law@cygnus.com) 2000-12-01 Chris Demetriou - mips.h (OP_MASK_SYSCALL, OP_SH_SYSCALL): Delete. - (OP_MASK_CODE20, OP_SH_CODE20): Define, with values of old - OP_*_SYSCALL definitions. - (OP_SH_CODE19, OP_MASK_CODE19): Define, for use as - 19 bit wait codes. - (MIPS operand specifier comments): Remove 'm', add 'U' and - 'J', and update the meaning of 'B' so that it's more general. - - * mips.h (INSN_ISA1, INSN_ISA2, INSN_ISA3, INSN_ISA4, - INSN_ISA5): Renumber, redefine to mean the ISA at which the - instruction was added. - (INSN_ISA32): New constant. - (INSN_4650, INSN_4010, INSN_4100, INSN_3900, INSN_GP32): - Renumber to avoid new and/or renumbered INSN_* constants. - (INSN_MIPS32): Delete. - (ISA_UNKNOWN): New constant to indicate unknown ISA. - (ISA_MIPS1, ISA_MIPS2, ISA_MIPS3, ISA_MIPS4, ISA_MIPS5, - ISA_MIPS32): New constants, defined to be the mask of INSN_* - constants available at that ISA level. - (CPU_UNKNOWN): New constant to indicate unknown CPU. - (CPU_4K, CPU_MIPS32_4K): Rename the former to the latter, - define it with a unique value. - (OPCODE_IS_MEMBER): Update for new ISA membership-related - constant meanings. - - * mips.h (INSN_ISA64, ISA_MIPS5, ISA_MIPS64): New - definitions. - - * mips.h (CPU_SB1): New constant. + mips.h (OP_MASK_SYSCALL, OP_SH_SYSCALL): Delete. + (OP_MASK_CODE20, OP_SH_CODE20): Define, with values of old + OP_*_SYSCALL definitions. + (OP_SH_CODE19, OP_MASK_CODE19): Define, for use as + 19 bit wait codes. + (MIPS operand specifier comments): Remove 'm', add 'U' and + 'J', and update the meaning of 'B' so that it's more general. + + * mips.h (INSN_ISA1, INSN_ISA2, INSN_ISA3, INSN_ISA4, + INSN_ISA5): Renumber, redefine to mean the ISA at which the + instruction was added. + (INSN_ISA32): New constant. + (INSN_4650, INSN_4010, INSN_4100, INSN_3900, INSN_GP32): + Renumber to avoid new and/or renumbered INSN_* constants. + (INSN_MIPS32): Delete. + (ISA_UNKNOWN): New constant to indicate unknown ISA. + (ISA_MIPS1, ISA_MIPS2, ISA_MIPS3, ISA_MIPS4, ISA_MIPS5, + ISA_MIPS32): New constants, defined to be the mask of INSN_* + constants available at that ISA level. + (CPU_UNKNOWN): New constant to indicate unknown CPU. + (CPU_4K, CPU_MIPS32_4K): Rename the former to the latter, + define it with a unique value. + (OPCODE_IS_MEMBER): Update for new ISA membership-related + constant meanings. + + * mips.h (INSN_ISA64, ISA_MIPS5, ISA_MIPS64): New + definitions. + + * mips.h (CPU_SB1): New constant. 2000-10-20 Jakub Jelinek @@ -791,14 +845,14 @@ Fri Apr 21 13:20:53 2000 Richard Henderson 2000-03-02 J"orn Rennecke - * d30v.h: - (SHORT_B2r, SHORT_B3, SHORT_B3r, SHORT_B3b, SHORT_B3br): Updated. - (SHORT_D1r, SHORT_D2, SHORT_D2r, SHORT_D2Br, SHORT_U): Updated. - (SHORT_F, SHORT_AF, SHORT_T, SHORT_A5, SHORT_CMP, SHORT_CMPU): Updated. - (SHORT_A1, SHORT_AA, SHORT_RA, SHORT_MODINC, SHORT_MODDEC): Updated. - (SHORT_C1, SHORT_C2, SHORT_UF, SHORT_A2, SHORT_NONE, LONG): Updated. - (LONG_U, LONG_Ur, LONG_CMP, LONG_M, LONG_M2, LONG_2, LONG_2r): Updated. - (LONG_2b, LONG_2br, LONG_D, LONG_Dr, LONG_Dbr): Updated. + * d30v.h: + (SHORT_B2r, SHORT_B3, SHORT_B3r, SHORT_B3b, SHORT_B3br): Updated. + (SHORT_D1r, SHORT_D2, SHORT_D2r, SHORT_D2Br, SHORT_U): Updated. + (SHORT_F, SHORT_AF, SHORT_T, SHORT_A5, SHORT_CMP, SHORT_CMPU): Updated. + (SHORT_A1, SHORT_AA, SHORT_RA, SHORT_MODINC, SHORT_MODDEC): Updated. + (SHORT_C1, SHORT_C2, SHORT_UF, SHORT_A2, SHORT_NONE, LONG): Updated. + (LONG_U, LONG_Ur, LONG_CMP, LONG_M, LONG_M2, LONG_2, LONG_2r): Updated. + (LONG_2b, LONG_2br, LONG_D, LONG_Dr, LONG_Dbr): Updated. 2000-02-25 Alan Modra @@ -808,7 +862,7 @@ Fri Apr 21 13:20:53 2000 Richard Henderson 2000-02-24 Nick Clifton * cgen.h (cgen_cpu_desc): Rename field 'flags' to - 'signed_overflow_ok_p'. + 'signed_overflow_ok_p'. Delete prototypes for cgen_set_flags() and cgen_get_flags(). 2000-02-24 Andrew Haley @@ -877,14 +931,14 @@ Wed Nov 24 20:28:58 1999 Jeffrey A Law (law@cygnus.com) Sun Oct 10 01:46:56 1999 Jerry Quinn - * hppa.h (pa_opcodes): Add load and store cache control to + * hppa.h (pa_opcodes): Add load and store cache control to instructions. Add ordered access load and store. * hppa.h (pa_opcode): Add new entries for addb and addib. * hppa.h (pa_opcodes): Fix cmpb and cmpib entries. - * hppa.h (pa_opcodes): Add entries for cmpb and cmpib. + * hppa.h (pa_opcodes): Add entries for cmpb and cmpib. Thu Oct 7 00:12:25 MDT 1999 Diego Novillo @@ -968,22 +1022,22 @@ Sat Aug 28 00:25:25 1999 Jerry Quinn * hppa.h (pa_opcodes): Add extrd, extrw, depd, depdi, depw, depwi. Add supporting args. - * hppa.h: Document new completers and args. - * hppa.h (pa_opcodes): Add 64 bit patterns and pa2.0 syntax for uxor, + * hppa.h: Document new completers and args. + * hppa.h (pa_opcodes): Add 64 bit patterns and pa2.0 syntax for uxor, uaddcm, dcor, addi, add, sub, subi, shladd, rfi, and probe. Add pa2.0 extensions for ssm, rsm, pdtlb, pitlb. Add performance instructions pmenb and pmdis. - * hppa.h (pa_opcodes): Add pa2.0 instructions hadd, hshl, + * hppa.h (pa_opcodes): Add pa2.0 instructions hadd, hshl, hshr, hsub, mixh, mixw, permh. * hppa.h (pa_opcodes): Change completers in instructions to use 'c' prefix. - * hppa.h (pa_opcodes): Add popbts, new forms of bb, havg, + * hppa.h (pa_opcodes): Add popbts, new forms of bb, havg, hshladd, hshradd, shrpd, and shrpw instructions. Update arg comments. - * hppa.h (pa_opcodes): Change fmpyfadd, fmpynfadd, fneg, + * hppa.h (pa_opcodes): Change fmpyfadd, fmpynfadd, fneg, fnegabs to use 'I' instead of 'F'. 1999-08-21 Alan Modra @@ -1001,7 +1055,7 @@ Fri Aug 6 09:46:35 1999 Jerry Quinn * hppa.h (pa_opcodes): Add 64 bit versions of or, xor, and, and andcm. Add 32 and 64 bit version of cmpclr, cmpiclr. - * hppa.h: Document 64 bit condition completers. + * hppa.h: Document 64 bit condition completers. Thu Aug 5 16:56:07 1999 Jerry Quinn @@ -1020,7 +1074,7 @@ Wed Jul 28 02:04:24 1999 Jerry Quinn * hppa.h (pa_opcodes): Mark all PA2.0 opcodes with FLAG_STRICT. - * hppa.h (pa_opcodes): Change xmpyu, fmpyfadd, + * hppa.h (pa_opcodes): Change xmpyu, fmpyfadd, and fmpynfadd to use 'J' and 'K' instead of 'E' and 'X'. 1999-07-13 Alan Modra @@ -1177,22 +1231,22 @@ Sat Feb 13 14:13:44 1999 Richard Henderson Mon Feb 1 21:09:14 1999 Catherine Moore - * i386.h (d_Suf, x_Suf, sld_Suf, sldx_Suf, bwld_Suf): Define. - (x_FP, d_FP, dls_FP, sldx_FP): Define. - Change *Suf definitions to include x and d suffixes. - (movsx): Use w_Suf and b_Suf. - (movzx): Likewise. - (movs): Use bwld_Suf. - (fld): Change ordering. Use sld_FP. - (fild): Add Intel Syntax equivalent of fildq. - (fst): Use sld_FP. - (fist): Use sld_FP. - (fstp): Use sld_FP. Add x_FP version. - (fistp): LLongMem version for Intel Syntax. - (fcom, fcomp): Use sld_FP. - (fadd, fiadd, fsub): Use sld_FP. - (fsubr): Use sld_FP. - (fmul, fimul, fdvi, fidiv, fdivr): Use sld_FP. + * i386.h (d_Suf, x_Suf, sld_Suf, sldx_Suf, bwld_Suf): Define. + (x_FP, d_FP, dls_FP, sldx_FP): Define. + Change *Suf definitions to include x and d suffixes. + (movsx): Use w_Suf and b_Suf. + (movzx): Likewise. + (movs): Use bwld_Suf. + (fld): Change ordering. Use sld_FP. + (fild): Add Intel Syntax equivalent of fildq. + (fst): Use sld_FP. + (fist): Use sld_FP. + (fstp): Use sld_FP. Add x_FP version. + (fistp): LLongMem version for Intel Syntax. + (fcom, fcomp): Use sld_FP. + (fadd, fiadd, fsub): Use sld_FP. + (fsubr): Use sld_FP. + (fmul, fimul, fdvi, fidiv, fdivr): Use sld_FP. 1999-01-27 Doug Evans @@ -1762,7 +1816,7 @@ Fri Apr 4 14:02:32 1997 Ian Lance Taylor Tue Mar 25 22:57:26 1997 Stu Grossman (grossman@critters.cygnus.com) - * v850.h (extract): Make unsigned. + * v850.h (extract): Make unsigned. Mon Mar 24 14:38:15 1997 Ian Lance Taylor @@ -1980,7 +2034,7 @@ Wed Oct 2 21:31:26 1996 Jeffrey A Law (law@cygnus.com) Fri Sep 27 18:26:46 1996 Stu Grossman (grossman@critters.cygnus.com) - * v850.h: Add new flag to indicate this instruction uses a PC + * v850.h: Add new flag to indicate this instruction uses a PC displacement. Fri Sep 13 14:58:13 1996 Jeffrey A Law (law@cygnus.com) @@ -2349,9 +2403,9 @@ Mon Jan 23 16:45:43 1995 Ken Raeburn Sat Jan 21 17:50:38 1995 Pat Rankin (rankin@eql.caltech.edu) - * vax.h (struct vot_wot, field `args'): Make it pointer to const + * vax.h (struct vot_wot, field `args'): Make it pointer to const char. - (struct vot, field `name'): ditto. + (struct vot, field `name'): ditto. Thu Jan 19 14:47:53 1995 Ken Raeburn @@ -2607,7 +2661,7 @@ Thu Aug 5 09:15:17 1993 Jim Kingdon (kingdon@lioth.cygnus.com) Fri Jul 30 18:41:11 1993 John Gilmore (gnu@cygnus.com) - * sparc.h (F_JSR, F_UNBR, F_CONDBR): Add new flags to mark + * sparc.h (F_JSR, F_UNBR, F_CONDBR): Add new flags to mark jump instructions, for use in disassemblers. Thu Jul 22 07:25:27 1993 Ian Lance Taylor (ian@cygnus.com) @@ -2726,29 +2780,29 @@ Fri Apr 9 13:26:16 1993 Jim Kingdon (kingdon@cygnus.com) Thu Mar 18 13:45:31 1993 Per Bothner (bothner@rtl.cygnus.com) - * i386.h: 486 extensions from John Hassey (hassey@dg-rtp.dg.com). - * mips.h: Add casts, to suppress warnings about shifting too much. - * m68k.h: Document the placement code '9'. + * i386.h: 486 extensions from John Hassey (hassey@dg-rtp.dg.com). + * mips.h: Add casts, to suppress warnings about shifting too much. + * m68k.h: Document the placement code '9'. Thu Feb 18 02:03:14 1993 John Gilmore (gnu@cygnus.com) - * m68k.h (BREAK_UP_BIG_DECL, AND_OTHER_PART): Add kludge which + * m68k.h (BREAK_UP_BIG_DECL, AND_OTHER_PART): Add kludge which allows callers to break up the large initialized struct full of opcodes into two half-sized ones. This permits GCC to compile this module, since it takes exponential space for initializers. - (numopcodes, endop): Revise to use AND_OTHER_PART in size calcs. + (numopcodes, endop): Revise to use AND_OTHER_PART in size calcs. Thu Feb 4 02:06:56 1993 John Gilmore (gnu@cygnus.com) - * a29k.h: Remove RCS crud, update GPL to v2, update copyrights. - * convex.h: Added, from GDB's convx-opcode.h. Added CONST to all + * a29k.h: Remove RCS crud, update GPL to v2, update copyrights. + * convex.h: Added, from GDB's convx-opcode.h. Added CONST to all initialized structs in it. Thu Jan 28 21:32:22 1993 John Gilmore (gnu@cygnus.com) Delta 88 changes inspired by Carl Greco, : - * m88k.h (PMEM): Avoid previous definition from . - (AND): Change to AND_ to avoid ansidecl.h `AND' conflict. + * m88k.h (PMEM): Avoid previous definition from . + (AND): Change to AND_ to avoid ansidecl.h `AND' conflict. Sat Jan 23 18:10:49 PST 1993 Ralph Campbell (ralphc@pyramid.com) @@ -2764,7 +2818,7 @@ Sun Jan 3 14:13:35 1993 Steve Chamberlain (sac@thepub.cygnus.com) Mon Dec 21 21:29:08 1992 Stu Grossman (grossman at cygnus.com) - * hppa.h: Move handy aliases to the front. Fix masks for extract + * hppa.h: Move handy aliases to the front. Fix masks for extract and deposit instructions. Sat Dec 12 16:09:48 1992 Ian Lance Taylor (ian@cygnus.com) @@ -2799,7 +2853,7 @@ Tue Sep 22 14:08:14 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) Tue Sep 22 00:38:41 1992 John Gilmore (gnu@cygnus.com) - * mips.h (break): Disassemble the argument. Patch from + * mips.h (break): Disassemble the argument. Patch from jonathan@cs.stanford.edu (Jonathan Stone). Wed Sep 9 11:25:28 1992 Ian Lance Taylor (ian@cygnus.com) @@ -2836,10 +2890,10 @@ Wed Aug 19 11:22:24 1992 Ian Lance Taylor (ian@cygnus.com) Fri Aug 14 14:20:38 1992 Per Bothner (bothner@cygnus.com) - * m68k.h: Merged in patches (mostly m68040-specific) from + * m68k.h: Merged in patches (mostly m68040-specific) from Colin Smith . - * m68k.h: Merged m68kmri.h and m68k.h (using the former as a + * m68k.h: Merged m68kmri.h and m68k.h (using the former as a base). Also cleaned up duplicates, re-ordered instructions for the sake of dis-assembling (so aliases come after standard names). * m68kmri.h: Now just defines some macros, and #includes m68k.h. @@ -2857,24 +2911,24 @@ Mon Aug 10 23:22:33 1992 Ken Raeburn (raeburn@cygnus.com) Sun Jun 28 13:29:03 1992 Fred Fish (fnf@cygnus.com) - * h8300.h: Finish filling in all the holes in the opcode table, + * h8300.h: Finish filling in all the holes in the opcode table, so that the Lucid C compiler can digest this as well... Fri Jun 26 21:27:17 1992 John Gilmore (gnu at cygnus.com) - * i386.h: Add setc, setnc, addr16, data16, repz, repnz aliases. + * i386.h: Add setc, setnc, addr16, data16, repz, repnz aliases. Fix opcodes on various sizes of fild/fist instructions (16bit=no suffix, 32bit="l" suffix, 64bit="ll" suffix). Use tabs to indent for comments. Fixes suggested by Minh Tran-Le. Thu Jun 25 16:13:26 1992 Stu Grossman (grossman at cygnus.com) - * h8300.h: Fill in all the holes in the opcode table so that the + * h8300.h: Fill in all the holes in the opcode table so that the losing HPUX C compiler can digest this... Thu Jun 11 12:15:25 1992 John Gilmore (gnu at cygnus.com) - * mips.h: Fix decoding of coprocessor instructions, somewhat. + * mips.h: Fix decoding of coprocessor instructions, somewhat. (Fix by Eric Anderson, 3jean@maas-neotek.arc.nasa.gov.) Thu May 28 11:17:44 1992 Jim Wilson (wilson@sphagnum.cygnus.com) @@ -2884,35 +2938,35 @@ Thu May 28 11:17:44 1992 Jim Wilson (wilson@sphagnum.cygnus.com) Tue May 5 14:23:27 1992 Per Bothner (bothner@rtl.cygnus.com) - * mips.h: Add some more opcode synonyms (from Frank Yellin, + * mips.h: Add some more opcode synonyms (from Frank Yellin, fy@lucid.com). Thu Apr 16 18:25:26 1992 Per Bothner (bothner@cygnus.com) - * rs6k.h: New version from IBM (Metin). + * rs6k.h: New version from IBM (Metin). Thu Apr 9 00:31:19 1992 Per Bothner (bothner@rtl.cygnus.com) * rs6k.h: Fix incorrect extended opcode for instructions `fm' - and `fd'. (From metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik).) + and `fd'. (From metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik).) Tue Apr 7 13:38:47 1992 Stu Grossman (grossman at cygnus.com) - * rs6k.h: Move from ../../gdb/rs6k-opcode.h. + * rs6k.h: Move from ../../gdb/rs6k-opcode.h. Fri Apr 3 11:30:20 1992 Fred Fish (fnf@cygnus.com) - * m68k.h (one, two): Cast macro args to unsigned to suppress + * m68k.h (one, two): Cast macro args to unsigned to suppress complaints from compiler and lint about integer overflow during shift. Sun Mar 29 12:22:08 1992 John Gilmore (gnu at cygnus.com) - * sparc.h (OP): Avoid signed overflow when shifting to high order bit. + * sparc.h (OP): Avoid signed overflow when shifting to high order bit. Fri Mar 6 00:22:38 1992 John Gilmore (gnu at cygnus.com) - * mips.h: Make bitfield layout depend on the HOST compiler, + * mips.h: Make bitfield layout depend on the HOST compiler, not on the TARGET system. Fri Feb 21 01:29:51 1992 K. Richard Pixley (rich@cygnus.com) @@ -2927,15 +2981,15 @@ Thu Jan 30 07:31:44 1992 Steve Chamberlain (sac at rtl.cygnus.com) Thu Jan 30 01:07:24 1992 John Gilmore (gnu at cygnus.com) - * sparc.h: Remove "cypress" architecture. Remove "fitox" and + * sparc.h: Remove "cypress" architecture. Remove "fitox" and similar instructions -- they've been renamed to "fitoq", etc. REALLY fix tsubcctv. Fix "fcmpeq" and "fcmpq" which had wrong number of arguments. - * h8300.h: Remove extra ; which produces compiler warning. + * h8300.h: Remove extra ; which produces compiler warning. Tue Jan 28 22:59:22 1992 Stu Grossman (grossman at cygnus.com) - * sparc.h: fix opcode for tsubcctv. + * sparc.h: fix opcode for tsubcctv. Tue Jan 7 17:19:39 1992 K. Richard Pixley (rich at cygnus.com) @@ -2943,7 +2997,7 @@ Tue Jan 7 17:19:39 1992 K. Richard Pixley (rich at cygnus.com) Fri Dec 27 10:55:50 1991 Per Bothner (bothner at cygnus.com) - * sparc.h (nop): Made the 'lose' field be even tighter, + * sparc.h (nop): Made the 'lose' field be even tighter, so only a standard 'nop' is disassembled as a nop. Sun Dec 22 12:18:18 1991 Michael Tiemann (tiemann at cygnus.com) @@ -2953,7 +3007,7 @@ Sun Dec 22 12:18:18 1991 Michael Tiemann (tiemann at cygnus.com) Wed Dec 18 17:19:44 1991 Stu Grossman (grossman at cygnus.com) - * m68k.h, sparc.h: ANSIfy enums. + * m68k.h, sparc.h: ANSIfy enums. Tue Dec 10 00:22:20 1991 K. Richard Pixley (rich at rtl.cygnus.com) diff --git a/include/opcode/h8300.h b/include/opcode/h8300.h index 02f415be846..bfac3f8c73e 100644 --- a/include/opcode/h8300.h +++ b/include/opcode/h8300.h @@ -26,119 +26,219 @@ typedef int op_type; -#define Hex0 0 -#define Hex1 1 -#define Hex2 2 -#define Hex3 3 -#define Hex4 4 -#define Hex5 5 -#define Hex6 6 -#define Hex7 7 -#define Hex8 8 -#define Hex9 9 -#define HexA 10 -#define HexB 11 -#define HexC 12 -#define HexD 13 -#define HexE 14 -#define HexF 15 - -#define L_8 0x01 -#define L_16 0x02 -#define L_32 0x04 -#define L_P 0x08 -#define L_24 0x10 -#define MEMRELAX 0x20 /* Move insn which may relax. */ -#define SRC 0x40 -#define DST 0x80 - -#define REG 0x100 -#define EXR 0x200 -#define MACREG 0x800 -#define SRC_IN_DST 0x400 -#define IMM 0x1000 -#define DISP 0x2000 -#define IND 0x4000 -#define INC 0x8000 -#define DEC 0x10000 -#define L_3 0x20000 -#define KBIT 0x40000 -#define DBIT 0x80000 -#define DISPREG 0x100000 -#define IGNORE 0x200000 -#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 CCR 0x4000000 -#define ABS 0x8000000 -#define ABSJMP 0x10000000 -#define ABS8MEM 0x20000000 -#define PCREL 0x40000000 -#define MEMIND 0x80000000 - -#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 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 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 DISP8 (PCREL | L_8) -#define DISP16 (PCREL | L_16) - -#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 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 RDIND (DST | IND) -#define RSIND (SRC | IND) - -#define MS32 (SRC | L_32 | MACREG) -#define MD32 (DST | L_32 | MACREG) +enum h8_flags { + L_2 = 0x10, + L_3 = 0x20, + /* 3 bit constant, zero not accepted. */ + L_3NZ = 0x30, + L_4 = 0x40, + L_5 = 0x50, + L_8 = 0x60, + L_8U = 0x70, + L_16 = 0x80, + L_16U = 0x90, + L_24 = 0xA0, + L_32 = 0xB0, + L_P = 0xC0, + + /* Mask to isolate the L_x size bits. */ + SIZE = 0xF0, + + REG = 0x0100, + ABS = 0x0200, + MEMIND = 0x0300, + IMM = 0x0400, + DISP = 0x0500, + IND = 0x0600, + POSTINC = 0x0700, + POSTDEC = 0x0800, + PREINC = 0x0900, + PREDEC = 0x0A00, + PCREL = 0x0B00, + KBIT = 0x0C00, + DBIT = 0x0D00, + CONST_2 = 0x0E00, + CONST_4 = 0x0F00, + CONST_8 = 0x1000, + CONST_16 = 0x1100, + INDEXB = 0x1200, + INDEXW = 0x1300, + INDEXL = 0x1400, + PCIDXB = 0x1500, + PCIDXW = 0x1600, + PCIDXL = 0x1700, + VECIND = 0x1800, + LOWREG = 0x1900, + DATA = 0x2000, + + /* Synonyms. */ + INC = POSTINC, + DEC = PREDEC, + /* Control Registers. */ + CCR = 0x4000, + EXR = 0x4100, + MACH = 0x4200, + MACL = 0x4300, + RESERV1 = 0x4400, + RESERV2 = 0x4500, + VBR = 0x4600, + SBR = 0x4700, + MACREG = 0x4800, + CCR_EXR = 0x4900, + VBR_SBR = 0x4A00, + CC_EX_VB_SB = 0x4B00, + RESERV3 = 0x4C00, + RESERV4 = 0x4D00, + RESERV5 = 0x4E00, + RESERV6 = 0x4F00, + + /* Mask to isolate the addressing mode bits (REG .. PREDEC). */ + MODE = 0x7F00, + + CTRL = 0x4000, + + NO_SYMBOLS = 0x8000, + SRC = 0x10000, + DST = 0x20000, + OP3 = 0x40000, + MEMRELAX = 0x80000, /* Move insn which may relax. */ + + DISPREG = 0x100000, + IGNORE = 0x200000, + ABSJMP = 0x400000, + + B00 = 0x800000, /* Bit 0 must be low. */ + B01 = 0x1000000, /* Bit 0 must be high. */ + B10 = 0x2000000, /* Bit 1 must be low. */ + B11 = 0x4000000, /* Bit 1 must be high. */ + B20 = 0x8000000, /* Bit 2 must be low. */ + B21 = 0x10000000, /* Bit 2 must be high. */ + B30 = 0x20000000, /* Bit 3 must be low. */ + B31 = 0x40000000, /* Bit 3 must be high. */ + E = 0x80000000, /* End of nibble sequence. */ + + /* Immediates smaller than 8 bits are always unsigned. */ + IMM3 = IMM | L_3, + IMM4 = IMM | L_4, + IMM5 = IMM | L_5, + IMM3NZ = IMM | L_3NZ, + IMM2 = IMM | L_2, + + IMM8 = IMM | SRC | L_8, + IMM8U = IMM | SRC | L_8U, + IMM16 = IMM | SRC | L_16, + IMM16U = IMM | SRC | L_16U, + IMM32 = IMM | SRC | L_32, + + IMM3NZ_NS = IMM3NZ | NO_SYMBOLS, + IMM4_NS = IMM4 | NO_SYMBOLS, + IMM8U_NS = IMM8U | NO_SYMBOLS, + IMM16U_NS = IMM16U | NO_SYMBOLS, + + RD8 = DST | L_8 | REG, + RD16 = DST | L_16 | REG, + RD32 = DST | L_32 | REG, + R3_8 = OP3 | L_8 | REG, + R3_16 = OP3 | L_16 | REG, + R3_32 = OP3 | L_32 | REG, + RS8 = SRC | L_8 | REG, + RS16 = SRC | L_16 | REG, + RS32 = SRC | L_32 | REG, + + RSP = SRC | L_P | REG, + RDP = DST | L_P | REG, + + PCREL8 = PCREL | L_8, + PCREL16 = PCREL | L_16, + + OP3PCREL8 = OP3 | PCREL | L_8, + OP3PCREL16 = OP3 | PCREL | L_16, + + INDEXB16 = INDEXB | L_16, + INDEXW16 = INDEXW | L_16, + INDEXL16 = INDEXL | L_16, + INDEXB16D = INDEXB | L_16 | DST, + INDEXW16D = INDEXW | L_16 | DST, + INDEXL16D = INDEXL | L_16 | DST, + + INDEXB32 = INDEXB | L_32, + INDEXW32 = INDEXW | L_32, + INDEXL32 = INDEXL | L_32, + INDEXB32D = INDEXB | L_32 | DST, + INDEXW32D = INDEXW | L_32 | DST, + INDEXL32D = INDEXL | L_32 | DST, + + DISP2SRC = DISP | L_2 | SRC, + DISP16SRC = DISP | L_16 | SRC, + DISP32SRC = DISP | L_32 | SRC, + + DISP2DST = DISP | L_2 | DST, + DISP16DST = DISP | L_16 | DST, + DISP32DST = DISP | L_32 | DST, + + DSTDISPREG = DST | DISPREG, + SRCDISPREG = SRC | DISPREG, + + ABS8SRC = SRC | ABS | L_8, + ABS16SRC = SRC | ABS | L_16U, + ABS24SRC = SRC | ABS | L_24, + ABS32SRC = SRC | ABS | L_32, + + ABS8DST = DST | ABS | L_8, + ABS16DST = DST | ABS | L_16U, + ABS24DST = DST | ABS | L_24, + ABS32DST = DST | ABS | L_32, + + ABS8OP3 = OP3 | ABS | L_8, + ABS16OP3 = OP3 | ABS | L_16U, + ABS24OP3 = OP3 | ABS | L_24, + ABS32OP3 = OP3 | ABS | L_32, + + RDDEC = DST | DEC, + RSINC = SRC | INC, + RDINC = DST | INC, + + RSPOSTINC = SRC | POSTINC, + RDPOSTINC = DST | POSTINC, + RSPREINC = SRC | PREINC, + RDPREINC = DST | PREINC, + RSPOSTDEC = SRC | POSTDEC, + RDPOSTDEC = DST | POSTDEC, + RSPREDEC = SRC | PREDEC, + RDPREDEC = DST | PREDEC, + + RSIND = SRC | IND, + RDIND = DST | IND, + R3_IND = OP3 | IND, + +#define MS32 (SRC | L_32 | MACREG) +#define MD32 (DST | L_32 | MACREG) #if 1 -#define OR8 RS8 /* ??? OR as in One Register? */ -#define OR16 RS16 -#define OR32 RS32 + OR8 = RS8, /* ??? OR as in One Register. */ + OR16 = RS16, + OR32 = RS32, #else -#define OR8 RD8 -#define OR16 RD16 -#define OR32 RD32 + OR8 = RD8, + OR16 = RD16, + OR32 = RD32 #endif +}; + +enum ctrlreg { + C_CCR = 0, + C_EXR = 1, + C_MACH = 2, + C_MACL = 3, + C_VBR = 6, + C_SBR = 7 +}; + +enum {MAX_CODE_NIBBLES = 33}; struct code { - op_type nib[30]; + op_type nib[MAX_CODE_NIBBLES]; }; struct arg @@ -146,10 +246,18 @@ struct arg op_type nib[3]; }; +/* Availability of instructions on processor models. */ +enum h8_model { + AV_H8, + AV_H8H, + AV_H8S, + AV_H8SX +}; + struct h8_opcode { int how; - int inbase; + enum h8_model available; int time; char *name; struct arg args; @@ -158,454 +266,1629 @@ struct h8_opcode #ifdef DEFINE_TABLE -#define BITOP(code, imm, name, op00, op01,op10,op11, op20,op21,op30)\ -{ code, 1, 2, name, {{imm,RD8,E}}, {{op00, op01, imm, RD8, E, 0, 0, 0, 0}}},\ -{ code, 1, 6, name, {{imm,RDIND,E}},{{op10, op11, B30|RDIND, 0, op00,op01, imm, 0, E}}},\ -{ code, 1, 6, name, {{imm,ABS8DST,E}},{{op20, op21, ABS8DST, IGNORE, op00,op01, imm, 0,E}}}\ -,{ code, 0, 6, name, {{imm,ABS16DST,E}},{{0x6,0xa,0x1,op30,ABS16DST,IGNORE,IGNORE,IGNORE, op00,op01, imm, 0,E}}},\ -{ code, 0, 6, name, {{imm,ABS32DST,E}},{{0x6,0xa,0x3,op30,ABS32DST,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE, op00,op01, imm, 0,E}}} - - -#define EBITOP(code, imm, name, op00, op01,op10,op11, op20,op21,op30)\ - BITOP(code,imm, name, op00+1, op01, op10,op11, op20,op21,op30),\ - BITOP(code,RS8, name, op00, op01, op10,op11, op20,op21,op30) - -#define WTWOP(code,name, op1, op2) \ -{ code, 1, 2, name, {{RS16, RD16, E}}, {{ op1, op2, RS16, RD16, E, 0, 0, 0, 0}}} +#define DATA2 DATA, DATA +#define DATA3 DATA, DATA, DATA +#define DATA5 DATA, DATA, DATA, DATA, DATA +#define DATA7 DATA, DATA, DATA, DATA, DATA, DATA, DATA + +#define IMM8LIST IMM8, DATA +#define IMM16LIST IMM16, DATA3 +#define IMM16ULIST IMM16U, DATA3 +#define IMM24LIST IMM24, DATA5 +#define IMM32LIST IMM32, DATA7 + +#define DISP16LIST DISP | L_16, DATA3 +#define DISP24LIST DISP | L_24, DATA5 +#define DISP32LIST DISP | L_32, DATA7 + +#define ABS8LIST ABS | L_8, DATA +#define ABS16LIST ABS | L_16U, DATA3 +#define ABS24LIST ABS | L_24, DATA5 +#define ABS32LIST ABS | L_32, DATA7 + +#define DSTABS8LIST DST | ABS | L_8, DATA +#define DSTABS16LIST DST | ABS | L_16U, DATA3 +#define DSTABS24LIST DST | ABS | L_24, DATA5 +#define DSTABS32LIST DST | ABS | L_32, DATA7 + +#define OP3ABS8LIST OP3 | ABS | L_8, DATA +#define OP3ABS16LIST OP3 | ABS | L_16, DATA3 +#define OP3ABS24LIST OP3 | ABS | L_24, DATA5 +#define OP3ABS32LIST OP3 | ABS | L_32, DATA7 + +#define DSTDISP16LIST DST | DISP | L_16, DATA3 +#define DSTDISP24LIST DST | DISP | L_24, DATA5 +#define DSTDISP32LIST DST | DISP | L_32, DATA7 + +#define A16LIST L_16, DATA3 +#define A24LIST L_24, DATA5 +#define A32LIST L_32, DATA7 + +/* Extended Operand Prefixes: */ + +#define PREFIX_010 0x0, 0x1, 0x0 +#define PREFIX_015 0x0, 0x1, 0x5 +#define PREFIX_017 0x0, 0x1, 0x7 + +#define PREFIX_0100 0x0, 0x1, 0x0, 0x0 +#define PREFIX_010_D2 0x0, 0x1, 0x0, B30 | B21 | DISP2SRC +#define PREFIX_0101 0x0, 0x1, 0x0, 0x1 +#define PREFIX_0102 0x0, 0x1, 0x0, 0x2 +#define PREFIX_0103 0x0, 0x1, 0x0, 0x3 +#define PREFIX_0104 0x0, 0x1, 0x0, 0x4 +#define PREFIX_0105 0x0, 0x1, 0x0, 0x5 +#define PREFIX_0106 0x0, 0x1, 0x0, 0x6 +#define PREFIX_0107 0x0, 0x1, 0x0, 0x7 +#define PREFIX_0108 0x0, 0x1, 0x0, 0x8 +#define PREFIX_0109 0x0, 0x1, 0x0, 0x9 +#define PREFIX_010A 0x0, 0x1, 0x0, 0xa +#define PREFIX_010D 0x0, 0x1, 0x0, 0xd +#define PREFIX_010E 0x0, 0x1, 0x0, 0xe + +#define PREFIX_0150 0x0, 0x1, 0x5, 0x0 +#define PREFIX_015_D2 0x0, 0x1, 0x5, B30 | B21 | DISP2SRC +#define PREFIX_0151 0x0, 0x1, 0x5, 0x1 +#define PREFIX_0152 0x0, 0x1, 0x5, 0x2 +#define PREFIX_0153 0x0, 0x1, 0x5, 0x3 +#define PREFIX_0154 0x0, 0x1, 0x5, 0x4 +#define PREFIX_0155 0x0, 0x1, 0x5, 0x5 +#define PREFIX_0156 0x0, 0x1, 0x5, 0x6 +#define PREFIX_0157 0x0, 0x1, 0x5, 0x7 +#define PREFIX_0158 0x0, 0x1, 0x5, 0x8 +#define PREFIX_0159 0x0, 0x1, 0x5, 0x9 +#define PREFIX_015A 0x0, 0x1, 0x5, 0xa +#define PREFIX_015D 0x0, 0x1, 0x5, 0xd +#define PREFIX_015E 0x0, 0x1, 0x5, 0xe +#define PREFIX_015F 0x0, 0x1, 0x5, 0xf + +#define PREFIX_0170 0x0, 0x1, 0x7, 0x0 +#define PREFIX_017_D2S 0x0, 0x1, 0x7, B30 | B21 | DISP2SRC +#define PREFIX_017_D2D 0x0, 0x1, 0x7, B30 | B21 | DISP2DST +#define PREFIX_0171 0x0, 0x1, 0x7, 0x1 +#define PREFIX_0172 0x0, 0x1, 0x7, 0x2 +#define PREFIX_0173 0x0, 0x1, 0x7, 0x3 +#define PREFIX_0174 0x0, 0x1, 0x7, 0x4 +#define PREFIX_0175 0x0, 0x1, 0x7, 0x5 +#define PREFIX_0176 0x0, 0x1, 0x7, 0x6 +#define PREFIX_0177 0x0, 0x1, 0x7, 0x7 +#define PREFIX_0178 0x0, 0x1, 0x7, 0x8 +#define PREFIX_0179 0x0, 0x1, 0x7, 0x9 +#define PREFIX_017A 0x0, 0x1, 0x7, 0xa +#define PREFIX_017D 0x0, 0x1, 0x7, 0xd +#define PREFIX_017E 0x0, 0x1, 0x7, 0xe +#define PREFIX_017F 0x0, 0x1, 0x7, 0xf + +#define PREFIX_6A15 0x6, 0xa, 0x1, 0x5 +#define PREFIX_6A35 0x6, 0xa, 0x3, 0x5 +#define PREFIX_6B15 0x6, 0xb, 0x1, 0x5 +#define PREFIX_6B35 0x6, 0xb, 0x3, 0x5 + +#define PREFIX_78R4 0x7, 0x8, B31 | DISPREG, 0x4 +#define PREFIX_78R5 0x7, 0x8, B31 | DISPREG, 0x5 +#define PREFIX_78R6 0x7, 0x8, B31 | DISPREG, 0x6 +#define PREFIX_78R7 0x7, 0x8, B31 | DISPREG, 0x7 + +#define PREFIX_78R4W 0x7, 0x8, B30 | DISPREG, 0x4 +#define PREFIX_78R5W 0x7, 0x8, B30 | DISPREG, 0x5 +#define PREFIX_78R6W 0x7, 0x8, B30 | DISPREG, 0x6 +#define PREFIX_78R7W 0x7, 0x8, B30 | DISPREG, 0x7 + +#define PREFIX_78R4WD 0x7, 0x8, B30 | DSTDISPREG, 0x4 +#define PREFIX_78R5WD 0x7, 0x8, B30 | DSTDISPREG, 0x5 +#define PREFIX_78R6WD 0x7, 0x8, B30 | DSTDISPREG, 0x6 +#define PREFIX_78R7WD 0x7, 0x8, B30 | DSTDISPREG, 0x7 + +#define PREFIX_7974 0x7, 0x9, 0x7, 0x4 +#define PREFIX_7A74 0x7, 0xa, 0x7, 0x4 +#define PREFIX_7A7C 0x7, 0xa, 0x7, 0xc + + +/* Source standard fragment: */ +#define FROM_IND 0, RSIND +#define FROM_POSTINC 8, RSPOSTINC +#define FROM_POSTDEC 10, RSPOSTDEC +#define FROM_PREINC 9, RSPREINC +#define FROM_PREDEC 11, RSPREDEC +#define FROM_DISP2 B30 | B20 | DISP2SRC, DISPREG +#define FROM_DISP16 12, B30 | DISPREG +#define FROM_DISP32 12, B31 | DISPREG +#define FROM_DISP16B 13, B30 | DISPREG +#define FROM_DISP16W 14, B30 | DISPREG +#define FROM_DISP16L 15, B30 | DISPREG +#define FROM_DISP32B 13, B31 | DISPREG +#define FROM_DISP32W 14, B31 | DISPREG +#define FROM_DISP32L 15, B31 | DISPREG +#define FROM_ABS16 4, B30 | IGNORE +#define FROM_ABS32 4, B31 | IGNORE + +/* Destination standard fragment: */ +#define TO_IND 0, RDIND +#define TO_IND_MOV 0, RDIND | B30 +#define TO_POSTINC 8, RDPOSTINC +#define TO_POSTINC_MOV 8, RDPOSTINC | B30 +#define TO_POSTDEC 10, RDPOSTDEC +#define TO_POSTDEC_MOV 10, RDPOSTDEC | B30 +#define TO_PREINC 9, RDPREINC +#define TO_PREINC_MOV 9, RDPREINC | B30 +#define TO_PREDEC 11, RDPREDEC +#define TO_PREDEC_MOV 11, RDPREDEC | B30 +#define TO_DISP2 B30 | B20 | DISP2DST, DSTDISPREG +#define TO_DISP2_MOV B30 | B20 | DISP2DST, DSTDISPREG | B30 +#define TO_DISP16 12, B30 | DSTDISPREG +#define TO_DISP32 12, B31 | DSTDISPREG +#define TO_DISP16B 13, B30 | DSTDISPREG +#define TO_DISP16W 14, B30 | DSTDISPREG +#define TO_DISP16L 15, B30 | DSTDISPREG +#define TO_DISP32B 13, B31 | DSTDISPREG +#define TO_DISP32W 14, B31 | DSTDISPREG +#define TO_DISP32L 15, B31 | DSTDISPREG +#define TO_ABS16 4, B30 | IGNORE +#define TO_ABS32 4, B31 | IGNORE + +/* Source fragment for three-word instruction: */ +#define TFROM_IND 6, 9, B30 | RSIND, 12 +#define TFROM_DISP2 6, 9, B30 | DISPREG, 12 +#define TFROM_ABS16 6, 11, B30 | B20 | B10 | IGNORE, 12, ABS16LIST +#define TFROM_ABS32 6, 11, B30 | B20 | B11 | IGNORE, 12, ABS32LIST +#define TFROM_POSTINC 6, 13, B30 | RSPOSTINC, 12 +#define TFROM_PREINC 6, 13, B30 | RSPREINC, 12 +#define TFROM_POSTDEC 6, 13, B30 | RSPOSTDEC, 12 +#define TFROM_PREDEC 6, 13, B30 | RSPREDEC, 12 +#define TFROM_DISP16 6, 15, B30 | DISPREG, 12, DISP16LIST +#define TFROM_DISP32 6, 11, 2, 12, DISP32LIST +#define TFROM_DISP16B 6, 15, B30 | DISPREG, 12, DISP16LIST +#define TFROM_DISP16W 6, 15, B30 | DISPREG, 12, DISP16LIST +#define TFROM_DISP16L 6, 15, B30 | DISPREG, 12, DISP16LIST +#define TFROM_DISP32B 6, 11, 2, 12, DISP32LIST +#define TFROM_DISP32W 6, 11, 2, 12, DISP32LIST +#define TFROM_DISP32L 6, 11, 2, 12, DISP32LIST +#define TFROM_ABS16W 6, 11, 1, 12, ABS16LIST +#define TFROM_ABS32W 6, 11, 3, 12, ABS32LIST + +/* Source fragment for three-word instruction: */ +#define TFROM_IND_B 6, 8, B30 | RSIND, 12 +#define TFROM_ABS16_B 6, 10, B30 | B20 | B10 | IGNORE, 12, ABS16LIST +#define TFROM_ABS32_B 6, 10, B30 | B20 | B11 | IGNORE, 12, ABS32LIST + +#define TFROM_DISP2_B 6, 8, B30 | DISPREG, 12 +#define TFROM_POSTINC_B 6, 12, B30 | RSPOSTINC, 12 +#define TFROM_PREINC_B 6, 12, B30 | RSPREINC, 12 +#define TFROM_POSTDEC_B 6, 12, B30 | RSPOSTDEC, 12 +#define TFROM_PREDEC_B 6, 12, B30 | RSPREDEC, 12 +#define TFROM_DISP16_B 6, 14, B30 | DISPREG, 12, DISP16LIST +#define TFROM_DISP32_B 6, 10, 2, 12, DISP32LIST +#define TFROM_DISP16B_B 6, 14, B30 | DISPREG, 12, DISP16LIST +#define TFROM_DISP16W_B 6, 14, B30 | DISPREG, 12, DISP16LIST +#define TFROM_DISP16L_B 6, 14, B30 | DISPREG, 12, DISP16LIST +#define TFROM_DISP32B_B 6, 10, 2, 12, DISP32LIST +#define TFROM_DISP32W_B 6, 10, 2, 12, DISP32LIST +#define TFROM_DISP32L_B 6, 10, 2, 12, DISP32LIST + +#define TFROM_ABS16W_B 6, 10, 1, 12, ABS16LIST +#define TFROM_ABS32W_B 6, 10, 3, 12, ABS32LIST + +/* Extended Operand Class Expanders: */ + +#define MOVFROM_STD(CODE, PREFIX, NAME, SRC, SRC_INFIX) \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDIND, E}}, {{PREFIX, SRC_INFIX, TO_IND_MOV, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTINC, E}}, {{PREFIX, SRC_INFIX, TO_POSTINC_MOV, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTDEC, E}}, {{PREFIX, SRC_INFIX, TO_POSTDEC_MOV, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREINC, E}}, {{PREFIX, SRC_INFIX, TO_PREINC_MOV, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREDEC, E}}, {{PREFIX, SRC_INFIX, TO_PREDEC_MOV, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP2DST, E}}, {{PREFIX, SRC_INFIX, TO_DISP2_MOV, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP16DST, E}}, {{PREFIX, SRC_INFIX, TO_DISP16, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP32DST, E}}, {{PREFIX, SRC_INFIX, TO_DISP32, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB16D, E}}, {{PREFIX, SRC_INFIX, TO_DISP16B, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW16D, E}}, {{PREFIX, SRC_INFIX, TO_DISP16W, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL16D, E}}, {{PREFIX, SRC_INFIX, TO_DISP16L, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB32D, E}}, {{PREFIX, SRC_INFIX, TO_DISP32B, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW32D, E}}, {{PREFIX, SRC_INFIX, TO_DISP32W, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL32D, E}}, {{PREFIX, SRC_INFIX, TO_DISP32L, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, ABS16DST, E}}, {{PREFIX, SRC_INFIX, TO_ABS16, DSTABS16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, ABS32DST, E}}, {{PREFIX, SRC_INFIX, TO_ABS32, DSTABS32LIST, E}}} + +#define MOVFROM_AD(CODE, PREFIX, NAME, SRC, SRC_INFIX, SRC_SUFFIX) \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDIND, E}}, {{PREFIX, SRC_INFIX, TO_IND_MOV, SRC_SUFFIX, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTINC, E}}, {{PREFIX, SRC_INFIX, TO_POSTINC_MOV, SRC_SUFFIX, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTDEC, E}}, {{PREFIX, SRC_INFIX, TO_POSTDEC_MOV, SRC_SUFFIX, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREINC, E}}, {{PREFIX, SRC_INFIX, TO_PREINC_MOV, SRC_SUFFIX, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREDEC, E}}, {{PREFIX, SRC_INFIX, TO_PREDEC_MOV, SRC_SUFFIX, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP2DST, E}}, {{PREFIX, SRC_INFIX, TO_DISP2_MOV, SRC_SUFFIX, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP16DST, E}}, {{PREFIX, SRC_INFIX, TO_DISP16, SRC_SUFFIX, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP32DST, E}}, {{PREFIX, SRC_INFIX, TO_DISP32, SRC_SUFFIX, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB16D, E}}, {{PREFIX, SRC_INFIX, TO_DISP16B, SRC_SUFFIX, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW16D, E}}, {{PREFIX, SRC_INFIX, TO_DISP16W, SRC_SUFFIX, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL16D, E}}, {{PREFIX, SRC_INFIX, TO_DISP16L, SRC_SUFFIX, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB32D, E}}, {{PREFIX, SRC_INFIX, TO_DISP32B, SRC_SUFFIX, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW32D, E}}, {{PREFIX, SRC_INFIX, TO_DISP32W, SRC_SUFFIX, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL32D, E}}, {{PREFIX, SRC_INFIX, TO_DISP32L, SRC_SUFFIX, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, ABS16DST, E}}, {{PREFIX, SRC_INFIX, TO_ABS16, SRC_SUFFIX, DSTABS16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, ABS32DST, E}}, {{PREFIX, SRC_INFIX, TO_ABS32, SRC_SUFFIX, DSTABS32LIST, E}}} + +#define MOVFROM_IMM8(CODE, PREFIX, NAME, SRC) \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDIND, E}}, {{PREFIX, 0, RDIND, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTINC, E}}, {{PREFIX, 8, RDPOSTINC, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTDEC, E}}, {{PREFIX, 10, RDPOSTDEC, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREINC, E}}, {{PREFIX, 9, RDPREINC, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREDEC, E}}, {{PREFIX, 11, RDPREDEC, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP2DST, E}}, {{PREFIX, B30 | B20 | DISP2DST, DSTDISPREG, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP16DST, E}}, {{PREFIX, 12, B30 | DSTDISPREG, IMM8LIST, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP32DST, E}}, {{PREFIX, 12, B31 | DSTDISPREG, IMM8LIST, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB16D, E}}, {{PREFIX, 13, B30 | DSTDISPREG, IMM8LIST, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW16D, E}}, {{PREFIX, 14, B30 | DSTDISPREG, IMM8LIST, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL16D, E}}, {{PREFIX, 15, B30 | DSTDISPREG, IMM8LIST, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB32D, E}}, {{PREFIX, 13, B31 | DSTDISPREG, IMM8LIST, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW32D, E}}, {{PREFIX, 14, B31 | DSTDISPREG, IMM8LIST, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL32D, E}}, {{PREFIX, 15, B31 | DSTDISPREG, IMM8LIST, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, ABS16DST, E}}, {{PREFIX, 4, B30 | IGNORE, IMM8LIST, DSTABS16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, ABS32DST, E}}, {{PREFIX, 4, B31 | IGNORE, IMM8LIST, DSTABS32LIST, E}}} + +#define MOVFROM_IMM(CODE, PREFIX, NAME, SRC, LIST) \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDIND, E}}, {{PREFIX, LIST, 0, RDIND, DATA2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTINC, E}}, {{PREFIX, LIST, 8, RDPOSTINC, DATA2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTDEC, E}}, {{PREFIX, LIST, 10, RDPOSTDEC, DATA2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREINC, E}}, {{PREFIX, LIST, 9, RDPREINC, DATA2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREDEC, E}}, {{PREFIX, LIST, 11, RDPREDEC, DATA2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP2DST, E}}, {{PREFIX, LIST, B30 | B20 | DISP2DST, DSTDISPREG, DATA2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP16DST, E}}, {{PREFIX, LIST, 12, B30 | DSTDISPREG, DATA2, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP32DST, E}}, {{PREFIX, LIST, 12, B31 | DSTDISPREG, DATA2, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB16D, E}}, {{PREFIX, LIST, 13, B30 | DSTDISPREG, DATA2, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW16D, E}}, {{PREFIX, LIST, 14, B30 | DSTDISPREG, DATA2, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL16D, E}}, {{PREFIX, LIST, 15, B30 | DSTDISPREG, DATA2, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB32D, E}}, {{PREFIX, LIST, 13, B31 | DSTDISPREG, DATA2, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW32D, E}}, {{PREFIX, LIST, 14, B31 | DSTDISPREG, DATA2, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL32D, E}}, {{PREFIX, LIST, 15, B31 | DSTDISPREG, DATA2, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, ABS16DST, E}}, {{PREFIX, LIST, 4, B30 | IGNORE, DATA2, DSTABS16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, ABS32DST, E}}, {{PREFIX, LIST, 4, B31 | IGNORE, DATA2, DSTABS32LIST, E}}} + +#define MOVFROM_REG_BW(CODE, NAME, SRC, PREFIX, OP1, OP2, OP3, OP4, RELAX16) \ + {CODE, AV_H8, 4, NAME, {{SRC, RDIND, E}}, {{ 6, OP1, B31 | RDIND, SRC, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTINC, E}}, {{PREFIX, 3, 6, OP3, B31 | RDPOSTINC, SRC, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTDEC, E}}, {{PREFIX, 1, 6, OP3, B31 | RDPOSTDEC, SRC, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREINC, E}}, {{PREFIX, 2, 6, OP3, B31 | RDPREINC, SRC, E}}}, \ + {CODE, AV_H8, 6, NAME, {{SRC, RDPREDEC, E}}, {{ 6, OP3, B31 | RDPREDEC, SRC, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP2DST, E}}, {{PREFIX, B30 | B20 | DISP2DST, 6, OP1, B31 | DSTDISPREG, SRC, E}}}, \ + {CODE, AV_H8, 6, NAME, {{SRC, DISP16DST, E}}, {{ 6, OP4, B31 | DSTDISPREG, SRC, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8, 6, NAME, {{SRC, DISP32DST, E}}, {{7, 8, B30 | DSTDISPREG, 0, 6, OP2, 10, SRC, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB16D, E}}, {{PREFIX, 1, 6, OP4, B31 | DSTDISPREG, SRC, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW16D, E}}, {{PREFIX, 2, 6, OP4, B31 | DSTDISPREG, SRC, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL16D, E}}, {{PREFIX, 3, 6, OP4, B31 | DSTDISPREG, SRC, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB32D, E}}, {{7, 8, B30 | DSTDISPREG, 1, 6, OP2, 10, SRC, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW32D, E}}, {{7, 8, B30 | DSTDISPREG, 2, 6, OP2, 10, SRC, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL32D, E}}, {{7, 8, B30 | DSTDISPREG, 3, 6, OP2, 10, SRC, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8, 4, NAME, {{SRC, ABS16DST, E}}, {{ 6, OP2, 8, SRC, RELAX16 | DSTABS16LIST, E}}}, \ + {CODE, AV_H8, 6, NAME, {{SRC, ABS32DST, E}}, {{ 6, OP2, 10, SRC, MEMRELAX | DSTABS32LIST, E}}} + +#define MOVTO_REG_BW(CODE, NAME, DST, PREFIX, OP1, OP2, OP3, OP4, RELAX16) \ + {CODE, AV_H8, 4, NAME, {{RSIND, DST, E}}, {{ 6, OP1, B30 | RSIND, DST, E}}}, \ + {CODE, AV_H8, 6, NAME, {{RSPOSTINC, DST, E}}, {{ 6, OP3, B30 | RSPOSTINC, DST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPOSTDEC, DST, E}}, {{PREFIX, 2, 6, OP3, B30 | RSPOSTDEC, DST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPREINC, DST, E}}, {{PREFIX, 1, 6, OP3, B30 | RSPREINC, DST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPREDEC, DST, E}}, {{PREFIX, 3, 6, OP3, B30 | RSPREDEC, DST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{DISP2SRC, DST, E}}, {{PREFIX, B30 | B20 | DISP2SRC, 6, OP1, B30 | DISPREG, DST, E}}}, \ + {CODE, AV_H8, 6, NAME, {{DISP16SRC, DST, E}}, {{ 6, OP4, B30 | DISPREG, DST, DISP16LIST, E}}}, \ + {CODE, AV_H8, 6, NAME, {{DISP32SRC, DST, E}}, {{7, 8, B30 | DISPREG, 0, 6, OP2, 2, DST, DISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXB16, DST, E}}, {{PREFIX, 1, 6, OP4, B30 | DISPREG, DST, DISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXW16, DST, E}}, {{PREFIX, 2, 6, OP4, B30 | DISPREG, DST, DISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXL16, DST, E}}, {{PREFIX, 3, 6, OP4, B30 | DISPREG, DST, DISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXB32, DST, E}}, {{7, 8, B30 | DISPREG, 1, 6, OP2, 2, DST, DISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXW32, DST, E}}, {{7, 8, B30 | DISPREG, 2, 6, OP2, 2, DST, DISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXL32, DST, E}}, {{7, 8, B30 | DISPREG, 3, 6, OP2, 2, DST, DISP32LIST, E}}}, \ + {CODE, AV_H8, 4, NAME, {{ABS16SRC, DST, E}}, {{ 6, OP2, 0, DST, RELAX16 | ABS16LIST, E}}}, \ + {CODE, AV_H8, 6, NAME, {{ABS32SRC, DST, E}}, {{ 6, OP2, 2, DST, MEMRELAX | ABS32LIST, E}}} + +/* + * Expansion macros for two-word (plus data) instructions. + */ + +/* Expansion from one source to "standard" destinations. */ +#define EXPAND2_STD_SRC(CODE, WEIGHT, NAME, SRC, PREFIX, NIB1, NIB2) \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTINC, E}}, {{PREFIX, TO_POSTINC, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTDEC, E}}, {{PREFIX, TO_POSTDEC, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREINC, E}}, {{PREFIX, TO_PREINC, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREDEC, E}}, {{PREFIX, TO_PREDEC, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP2DST, E}}, {{PREFIX, TO_DISP2, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP16DST, E}}, {{PREFIX, TO_DISP16, NIB1, NIB2, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP32DST, E}}, {{PREFIX, TO_DISP32, NIB1, NIB2, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB16D, E}}, {{PREFIX, TO_DISP16B, NIB1, NIB2, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW16D, E}}, {{PREFIX, TO_DISP16W, NIB1, NIB2, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL16D, E}}, {{PREFIX, TO_DISP16L, NIB1, NIB2, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB32D, E}}, {{PREFIX, TO_DISP32B, NIB1, NIB2, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW32D, E}}, {{PREFIX, TO_DISP32W, NIB1, NIB2, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL32D, E}}, {{PREFIX, TO_DISP32L, NIB1, NIB2, DSTDISP32LIST, E}}} + +/* Expansion from one destination to "standard" sources. */ +#define EXPAND2_STD_DST(CODE, WEIGHT, NAME, DST, PREFIX, NIB1, NIB2) \ + {CODE, AV_H8SX, 0, NAME, {{RSPOSTINC, DST, E}}, {{PREFIX, FROM_POSTINC, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPOSTDEC, DST, E}}, {{PREFIX, FROM_POSTDEC, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPREINC, DST, E}}, {{PREFIX, FROM_PREINC, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPREDEC, DST, E}}, {{PREFIX, FROM_PREDEC, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{DISP2SRC, DST, E}}, {{PREFIX, FROM_DISP2, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{DISP16SRC, DST, E}}, {{PREFIX, FROM_DISP16, NIB1, NIB2, DISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{DISP32SRC, DST, E}}, {{PREFIX, FROM_DISP32, NIB1, NIB2, DISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXB16, DST, E}}, {{PREFIX, FROM_DISP16B, NIB1, NIB2, DISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXW16, DST, E}}, {{PREFIX, FROM_DISP16W, NIB1, NIB2, DISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXL16, DST, E}}, {{PREFIX, FROM_DISP16L, NIB1, NIB2, DISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXB32, DST, E}}, {{PREFIX, FROM_DISP32B, NIB1, NIB2, DISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXW32, DST, E}}, {{PREFIX, FROM_DISP32W, NIB1, NIB2, DISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXL32, DST, E}}, {{PREFIX, FROM_DISP32L, NIB1, NIB2, DISP32LIST, E}}} + +/* Expansion from immediate source to "standard" destinations. */ +#define EXPAND2_STD_IMM(CODE, WEIGHT, NAME, SRC, PREFIX, OPCODE, IGN, IMMLIST) \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTINC, E}}, {{PREFIX, TO_POSTINC, OPCODE, IGN, IMMLIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTDEC, E}}, {{PREFIX, TO_POSTDEC, OPCODE, IGN, IMMLIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREINC, E}}, {{PREFIX, TO_PREINC, OPCODE, IGN, IMMLIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREDEC, E}}, {{PREFIX, TO_PREDEC, OPCODE, IGN, IMMLIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP2DST, E}}, {{PREFIX, TO_DISP2, OPCODE, IGN, IMMLIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP16DST, E}}, {{PREFIX, TO_DISP16, OPCODE, IGN, DSTDISP16LIST, IMMLIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP32DST, E}}, {{PREFIX, TO_DISP32, OPCODE, IGN, DSTDISP32LIST, IMMLIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB16D, E}}, {{PREFIX, TO_DISP16B, OPCODE, IGN, DSTDISP16LIST, IMMLIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW16D, E}}, {{PREFIX, TO_DISP16W, OPCODE, IGN, DSTDISP16LIST, IMMLIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL16D, E}}, {{PREFIX, TO_DISP16L, OPCODE, IGN, DSTDISP16LIST, IMMLIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB32D, E}}, {{PREFIX, TO_DISP32B, OPCODE, IGN, DSTDISP32LIST, IMMLIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW32D, E}}, {{PREFIX, TO_DISP32W, OPCODE, IGN, DSTDISP32LIST, IMMLIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL32D, E}}, {{PREFIX, TO_DISP32L, OPCODE, IGN, DSTDISP32LIST, IMMLIST, E}}} + +/* Expansion from abs/disp source to "standard" destinations. */ +#define EXPAND2_STD_ABSDISP(CODE, WEIGHT, NAME, SRC, PREFIX, DSTLIST, NIB1, NIB2) \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTINC, E}}, {{PREFIX, DSTLIST, TO_POSTINC, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTDEC, E}}, {{PREFIX, DSTLIST, TO_POSTDEC, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREINC, E}}, {{PREFIX, DSTLIST, TO_PREINC, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREDEC, E}}, {{PREFIX, DSTLIST, TO_PREDEC, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP2DST, E}}, {{PREFIX, DSTLIST, TO_DISP2, NIB1, NIB2, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP16DST, E}}, {{PREFIX, DSTLIST, TO_DISP16, NIB1, NIB2, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP32DST, E}}, {{PREFIX, DSTLIST, TO_DISP32, NIB1, NIB2, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB16D, E}}, {{PREFIX, DSTLIST, TO_DISP16B, NIB1, NIB2, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW16D, E}}, {{PREFIX, DSTLIST, TO_DISP16W, NIB1, NIB2, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL16D, E}}, {{PREFIX, DSTLIST, TO_DISP16L, NIB1, NIB2, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB32D, E}}, {{PREFIX, DSTLIST, TO_DISP32B, NIB1, NIB2, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW32D, E}}, {{PREFIX, DSTLIST, TO_DISP32W, NIB1, NIB2, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL32D, E}}, {{PREFIX, DSTLIST, TO_DISP32L, NIB1, NIB2, DSTDISP32LIST, E}}} + +/* Expansion from ind source to "standard" destinations. */ +#define EXPAND2_STD_IND(CODE, WEIGHT, NAME, OPCODE, BIT) \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, RDPOSTINC, E}}, {{0x7, 0xc, BIT | RSIND, 0x5, TO_POSTINC, OPCODE, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, RDPOSTDEC, E}}, {{0x7, 0xc, BIT | RSIND, 0x5, TO_POSTDEC, OPCODE, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, RDPREINC, E}}, {{0x7, 0xc, BIT | RSIND, 0x5, TO_PREINC, OPCODE, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, RDPREDEC, E}}, {{0x7, 0xc, BIT | RSIND, 0x5, TO_PREDEC, OPCODE, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, DISP2DST, E}}, {{0x7, 0xc, BIT | RSIND, 0x5, TO_DISP2, OPCODE, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, DISP16DST, E}}, {{0x7, 0xc, BIT | RSIND, 0x5, TO_DISP16, OPCODE, IGNORE, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, DISP32DST, E}}, {{0x7, 0xc, BIT | RSIND, 0x5, TO_DISP32, OPCODE, IGNORE, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, INDEXB16D, E}}, {{0x7, 0xc, BIT | RSIND, 0x5, TO_DISP16B, OPCODE, IGNORE, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, INDEXW16D, E}}, {{0x7, 0xc, BIT | RSIND, 0x5, TO_DISP16W, OPCODE, IGNORE, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, INDEXL16D, E}}, {{0x7, 0xc, BIT | RSIND, 0x5, TO_DISP16L, OPCODE, IGNORE, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, INDEXB32D, E}}, {{0x7, 0xc, BIT | RSIND, 0x5, TO_DISP32B, OPCODE, IGNORE, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, INDEXW32D, E}}, {{0x7, 0xc, BIT | RSIND, 0x5, TO_DISP32W, OPCODE, IGNORE, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, INDEXL32D, E}}, {{0x7, 0xc, BIT | RSIND, 0x5, TO_DISP32L, OPCODE, IGNORE, DSTDISP32LIST, E}}} + +/* + * Expansion macros for three word (plus data) instructions. + */ + +#define EXPAND3_STD_SRC(CODE, WEIGHT, NAME, SRC, PREFIX, INFIX, OPCODE) \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTINC, E}}, {{PREFIX, INFIX, 8, RDPOSTINC, OPCODE, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTDEC, E}}, {{PREFIX, INFIX, 10, RDPOSTDEC, OPCODE, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREINC, E}}, {{PREFIX, INFIX, 9, RDPREINC, OPCODE, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREDEC, E}}, {{PREFIX, INFIX, 11, RDPREDEC, OPCODE, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP2DST, E}}, {{PREFIX, INFIX, B30 | B20 | DISP2DST, DSTDISPREG, OPCODE, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP16DST, E}}, {{PREFIX, INFIX, 12, B30 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP32DST, E}}, {{PREFIX, INFIX, 12, B31 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB16D, E}}, {{PREFIX, INFIX, 13, B30 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW16D, E}}, {{PREFIX, INFIX, 14, B30 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL16D, E}}, {{PREFIX, INFIX, 15, B30 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB32D, E}}, {{PREFIX, INFIX, 13, B31 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW32D, E}}, {{PREFIX, INFIX, 14, B31 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL32D, E}}, {{PREFIX, INFIX, 15, B31 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP32LIST, E}}} + +#define EXPAND3_L_SRC(CODE, WEIGHT, NAME, SRC, PREFIX, INFIX, OPCODE) \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDIND, E}}, {{PREFIX, INFIX, 0, RDIND, OPCODE, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTINC, E}}, {{PREFIX, INFIX, 8, RDPOSTINC, OPCODE, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPOSTDEC, E}}, {{PREFIX, INFIX, 10, RDPOSTDEC, OPCODE, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREINC, E}}, {{PREFIX, INFIX, 9, RDPREINC, OPCODE, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, RDPREDEC, E}}, {{PREFIX, INFIX, 11, RDPREDEC, OPCODE, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP2DST, E}}, {{PREFIX, INFIX, B30 | B20 | DISP2DST, DSTDISPREG, OPCODE, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP16DST, E}}, {{PREFIX, INFIX, 12, B30 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, DISP32DST, E}}, {{PREFIX, INFIX, 12, B31 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB16D, E}}, {{PREFIX, INFIX, 13, B30 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW16D, E}}, {{PREFIX, INFIX, 14, B30 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL16D, E}}, {{PREFIX, INFIX, 15, B30 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXB32D, E}}, {{PREFIX, INFIX, 13, B31 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXW32D, E}}, {{PREFIX, INFIX, 14, B31 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, INDEXL32D, E}}, {{PREFIX, INFIX, 15, B31 | DSTDISPREG, OPCODE, B30 | IGNORE, DSTDISP32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, ABS16DST, E}}, {{PREFIX, INFIX, 4, B30 | IGNORE, OPCODE, B30 | IGNORE, DSTABS16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{SRC, ABS32DST, E}}, {{PREFIX, INFIX, 4, B31 | IGNORE, OPCODE, B30 | IGNORE, DSTABS32LIST, E}}} + + +#define EXPAND_STD_MATRIX_L(CODE, NAME, OPCODE) \ + EXPAND3_L_SRC (CODE, 6, NAME, RSIND, PREFIX_0104, TFROM_IND, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, RSPOSTINC, PREFIX_0104, TFROM_POSTINC, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, RSPOSTDEC, PREFIX_0106, TFROM_POSTDEC, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, RSPREINC, PREFIX_0105, TFROM_PREINC, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, RSPREDEC, PREFIX_0107, TFROM_PREDEC, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, DISP2SRC, PREFIX_010_D2, TFROM_DISP2, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, DISP16SRC, PREFIX_0104, TFROM_DISP16, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, DISP32SRC, PREFIX_78R4, TFROM_DISP32, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, INDEXB16, PREFIX_0105, TFROM_DISP16B, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, INDEXW16, PREFIX_0106, TFROM_DISP16W, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, INDEXL16, PREFIX_0107, TFROM_DISP16L, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, INDEXB32, PREFIX_78R5, TFROM_DISP32B, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, INDEXW32, PREFIX_78R6, TFROM_DISP32W, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, INDEXL32, PREFIX_78R7, TFROM_DISP32L, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, ABS16SRC, PREFIX_0104, TFROM_ABS16, OPCODE), \ + EXPAND3_L_SRC (CODE, 6, NAME, ABS32SRC, PREFIX_0104, TFROM_ABS32, OPCODE) + + +#define EXPAND_STD_MATRIX_W(CODE, NAME, OPCODE) \ + EXPAND3_L_SRC (CODE, 4, NAME, RSPOSTINC, PREFIX_0154, TFROM_POSTINC, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, RSPOSTDEC, PREFIX_0156, TFROM_POSTDEC, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, RSPREINC, PREFIX_0155, TFROM_PREINC, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, RSPREDEC, PREFIX_0157, TFROM_PREDEC, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, DISP2SRC, PREFIX_015_D2, TFROM_DISP2, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, DISP16SRC, PREFIX_0154, TFROM_DISP16, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, DISP32SRC, PREFIX_78R4W, TFROM_DISP32, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, INDEXB16, PREFIX_0155, TFROM_DISP16B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, INDEXW16, PREFIX_0156, TFROM_DISP16W, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, INDEXL16, PREFIX_0157, TFROM_DISP16L, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, INDEXB32, PREFIX_78R5W, TFROM_DISP32B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, INDEXW32, PREFIX_78R6W, TFROM_DISP32W, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, INDEXL32, PREFIX_78R7W, TFROM_DISP32L, OPCODE) + +#define EXPAND_STD_MATRIX_B(CODE, NAME, OPCODE) \ + EXPAND3_L_SRC (CODE, 4, NAME, RSPOSTINC, PREFIX_0174, TFROM_POSTINC_B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, RSPOSTDEC, PREFIX_0176, TFROM_POSTDEC_B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, RSPREINC, PREFIX_0175, TFROM_PREINC_B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, RSPREDEC, PREFIX_0177, TFROM_PREDEC_B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, DISP2SRC, PREFIX_017_D2S, TFROM_DISP2_B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, DISP16SRC, PREFIX_0174, TFROM_DISP16_B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, DISP32SRC, PREFIX_78R4W, TFROM_DISP32_B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, INDEXB16, PREFIX_0175, TFROM_DISP16B_B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, INDEXW16, PREFIX_0176, TFROM_DISP16W_B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, INDEXL16, PREFIX_0177, TFROM_DISP16L_B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, INDEXB32, PREFIX_78R5W, TFROM_DISP32B_B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, INDEXW32, PREFIX_78R6W, TFROM_DISP32W_B, OPCODE), \ + EXPAND3_L_SRC (CODE, 4, NAME, INDEXL32, PREFIX_78R7W, TFROM_DISP32L_B, OPCODE) + + +/* + * Use the expansion macros to fill out the opcode table. + */ + +#define EXPAND_FROM_REG8(CODE, NAME, OP1, OP2, OP3) \ + {CODE, AV_H8SX, 0, NAME, {{RS8, RDIND, E}}, {{0x7, 0xd, B30 | RDIND, IGNORE, OP1, OP2, RS8, IGNORE, E}}}, \ + EXPAND2_STD_SRC (CODE, 2, NAME, RS8, PREFIX_0179, OP3, RS8), \ + {CODE, AV_H8SX, 0, NAME, {{RS8, ABS8DST, E}}, {{0x7, 0xf, DSTABS8LIST, OP1, OP2, RS8, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RS8, ABS16DST, E}}, {{0x6, 0xa, 0x1, B31 | IGNORE, DSTABS16LIST, OP1, OP2, RS8, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RS8, ABS32DST, E}}, {{0x6, 0xa, 0x3, B31 | IGNORE, DSTABS32LIST, OP1, OP2, RS8, IGNORE, E}}} + +#define EXPAND_TO_REG8(CODE, NAME, OP1, OP2, OP3) \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, RD8, E}}, {{0x7, 0xc, B30 | RSIND, IGNORE, OP1, OP2, IGNORE, RD8, E}}}, \ + EXPAND2_STD_DST (CODE, 2, NAME, RD8, PREFIX_017A, OP3, RD8), \ + {CODE, AV_H8SX, 0, NAME, {{ABS8SRC, RD8, E}}, {{0x7, 0xe, ABS8LIST, OP1, OP2, IGNORE, RD8, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS16SRC, RD8, E}}, {{0x6, 0xa, 0x1, B30 | IGNORE, ABS16LIST, OP1, OP2, IGNORE, RD8, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS32SRC, RD8, E}}, {{0x6, 0xa, 0x3, B30 | IGNORE, ABS32LIST, OP1, OP2, IGNORE, RD8, E}}} + +#define EXPAND_FROM_IND8(CODE, NAME, OPCODE) \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, RDIND, E}}, {{0x7, 0xc, B30 | RSIND, 0x5, TO_IND, OPCODE, IGNORE, E}}}, \ + EXPAND2_STD_IND (CODE, 2, NAME, OPCODE, B30), \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, ABS16DST, E}}, {{0x7, 0xc, B30 | RSIND, 0x5, TO_ABS16, OPCODE, IGNORE, DSTABS16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, ABS32DST, E}}, {{0x7, 0xc, B30 | RSIND, 0x5, TO_ABS32, OPCODE, IGNORE, DSTABS32LIST, E}}} + +#define EXPAND_FROM_ABS16_B(CODE, NAME, OPCODE) \ + {CODE, AV_H8SX, 0, NAME, {{ABS16SRC, RDIND, E}}, {{PREFIX_6A15, ABS16LIST, TO_IND, OPCODE, IGNORE, E}}}, \ + EXPAND2_STD_ABSDISP (CODE, 2, NAME, ABS16SRC, PREFIX_6A15, ABS16LIST, OPCODE, IGNORE), \ + {CODE, AV_H8SX, 0, NAME, {{ABS16SRC, ABS16DST, E}}, {{PREFIX_6A15, ABS16LIST, TO_ABS16, OPCODE, IGNORE, DSTABS16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS16SRC, ABS32DST, E}}, {{PREFIX_6A15, ABS16LIST, TO_ABS32, OPCODE, IGNORE, DSTABS32LIST, E}}} + +#define EXPAND_FROM_ABS32_B(CODE, NAME, OPCODE) \ + {CODE, AV_H8SX, 0, NAME, {{ABS32SRC, RDIND, E}}, {{PREFIX_6A35, ABS32LIST, TO_IND, OPCODE, IGNORE, E}}}, \ + EXPAND2_STD_ABSDISP (CODE, 2, NAME, ABS32SRC, PREFIX_6A35, ABS32LIST, OPCODE, IGNORE), \ + {CODE, AV_H8SX, 0, NAME, {{ABS32SRC, ABS16DST, E}}, {{PREFIX_6A35, ABS32LIST, TO_ABS16, OPCODE, IGNORE, DSTABS16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS32SRC, ABS32DST, E}}, {{PREFIX_6A35, ABS32LIST, TO_ABS32, OPCODE, IGNORE, DSTABS32LIST, E}}} + +#define EXPAND_FROM_IMM16_W(CODE, NAME, OPCODE) \ + {CODE, AV_H8SX, 0, NAME, {{IMM16, RDIND, E}}, {{PREFIX_015E, TO_IND, OPCODE, IGNORE, IMM16LIST, E}}}, \ + EXPAND2_STD_IMM (CODE, 2, NAME, IMM16, PREFIX_015E, OPCODE, IGNORE, IMM16LIST), \ + {CODE, AV_H8SX, 0, NAME, {{IMM16, ABS16DST, E}}, {{PREFIX_015E, TO_ABS16, OPCODE, IGNORE, DSTABS16LIST, IMM16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM16, ABS32DST, E}}, {{PREFIX_015E, TO_ABS32, OPCODE, IGNORE, DSTABS32LIST, IMM16LIST, E}}} + +#define EXPAND_FROM_REG16(CODE, NAME, OP1, OP2, OP3) \ + {CODE, AV_H8, 2, NAME, {{RS16, RDIND, E}}, {{0x7, 0xd, B31 | RDIND, IGNORE, OP1, OP2, RS16, IGNORE, E}}}, \ + EXPAND2_STD_SRC (CODE, 2, NAME, RS16, PREFIX_0159, OP3, RS16), \ + {CODE, AV_H8SX, 0, NAME, {{RS16, ABS16DST, E}}, {{0x6, 0xb, 0x1, B31 | IGNORE, DSTABS16LIST, OP1, OP2, RS16, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RS16, ABS32DST, E}}, {{0x6, 0xb, 0x3, B31 | IGNORE, DSTABS32LIST, OP1, OP2, RS16, IGNORE, E}}} + +#define EXPAND_TO_REG16(CODE, NAME, OP1, OP2, OP3) \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, RD16, E}}, {{0x7, 0xc, B31 | RSIND, IGNORE, OP1, OP2, IGNORE, RD16, E}}}, \ + EXPAND2_STD_DST (CODE, 2, NAME, RD16, PREFIX_015A, OP3, RD16), \ + {CODE, AV_H8SX, 0, NAME, {{ABS16SRC, RD16, E}}, {{0x6, 0xb, 0x1, B30 | IGNORE, ABS16LIST, OP1, OP2, IGNORE, RD16, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS32SRC, RD16, E}}, {{0x6, 0xb, 0x3, B30 | IGNORE, ABS32LIST, OP1, OP2, IGNORE, RD16, E}}} + +#define EXPAND_FROM_IND16(CODE, NAME, OPCODE) \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, RDIND, E}}, {{0x7, 0xc, B31 | RSIND, 0x5, TO_IND, OPCODE, IGNORE, E}}}, \ + EXPAND2_STD_IND (CODE, 2, NAME, OPCODE, B31), \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, ABS16DST, E}}, {{0x7, 0xc, B31 | RSIND, 0x5, TO_ABS16, OPCODE, IGNORE, DSTABS16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, ABS32DST, E}}, {{0x7, 0xc, B31 | RSIND, 0x5, TO_ABS32, OPCODE, IGNORE, DSTABS32LIST, E}}} + +#define EXPAND_FROM_ABS16_W(CODE, NAME, OPCODE) \ + {CODE, AV_H8SX, 0, NAME, {{ABS16SRC, RDIND, E}}, {{PREFIX_6B15, ABS16LIST, TO_IND, OPCODE, IGNORE, E}}}, \ + EXPAND2_STD_ABSDISP (CODE, 2, NAME, ABS16SRC, PREFIX_6B15, ABS16LIST, OPCODE, IGNORE), \ + {CODE, AV_H8SX, 0, NAME, {{ABS16SRC, ABS16DST, E}}, {{PREFIX_6B15, ABS16LIST, TO_ABS16, OPCODE, IGNORE, DSTABS16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS16SRC, ABS32DST, E}}, {{PREFIX_6B15, ABS16LIST, TO_ABS32, OPCODE, IGNORE, DSTABS32LIST, E}}} + +#define EXPAND_FROM_ABS32_W(CODE, NAME, OPCODE) \ + {CODE, AV_H8SX, 0, NAME, {{ABS32SRC, RDIND, E}}, {{PREFIX_6B35, ABS32LIST, TO_IND, OPCODE, IGNORE, E}}}, \ + EXPAND2_STD_ABSDISP (CODE, 2, NAME, ABS32SRC, PREFIX_6B35, ABS32LIST, OPCODE, IGNORE), \ + {CODE, AV_H8SX, 0, NAME, {{ABS32SRC, ABS16DST, E}}, {{PREFIX_6B35, ABS32LIST, TO_ABS16, OPCODE, IGNORE, DSTABS16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS32SRC, ABS32DST, E}}, {{PREFIX_6B35, ABS32LIST, TO_ABS32, OPCODE, IGNORE, DSTABS32LIST, E}}} + +#define EXPAND_FROM_IMM16_L(CODE, NAME, OPCODE) \ + {CODE, AV_H8SX, 0, NAME, {{IMM16U_NS, RDIND, E}}, {{PREFIX_010E, TO_IND, OPCODE, B30 | IGNORE, IMM16ULIST, E}}}, \ + EXPAND2_STD_IMM (CODE, 2, NAME, IMM16U_NS, PREFIX_010E, OPCODE, B30 | IGNORE, IMM16ULIST), \ + {CODE, AV_H8SX, 0, NAME, {{IMM16U_NS, ABS16DST, E}}, {{PREFIX_010E, TO_ABS16, OPCODE, B30 | IGNORE, DSTABS16LIST, IMM16ULIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM16U_NS, ABS32DST, E}}, {{PREFIX_010E, TO_ABS32, OPCODE, B30 | IGNORE, DSTABS32LIST, IMM16ULIST, E}}} + +#define EXPAND_FROM_IMM32_L(CODE, NAME, OPCODE) \ + {CODE, AV_H8SX, 0, NAME, {{IMM32, RDIND, E}}, {{PREFIX_010E, TO_IND, OPCODE, B31 | IGNORE, IMM32LIST, E}}}, \ + EXPAND2_STD_IMM (CODE, 2, NAME, IMM32, PREFIX_010E, OPCODE, B31 | IGNORE, IMM32LIST), \ + {CODE, AV_H8SX, 0, NAME, {{IMM32, ABS16DST, E}}, {{PREFIX_010E, TO_ABS16, OPCODE, B31 | IGNORE, DSTABS16LIST, IMM32LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM32, ABS32DST, E}}, {{PREFIX_010E, TO_ABS32, OPCODE, B31 | IGNORE, DSTABS32LIST, IMM32LIST, E}}} + +#define EXPAND_FROM_REG32(CODE, NAME, OPCODE) \ + {CODE, AV_H8SX, 0, NAME, {{RS32, RDIND, E}}, {{PREFIX_0109, TO_IND, OPCODE, B30 | RS32, E}}}, \ + EXPAND2_STD_SRC (CODE, 2, NAME, RS32, PREFIX_0109, OPCODE, B30 | RS32), \ + {CODE, AV_H8SX, 0, NAME, {{RS32, ABS16DST, E}}, {{PREFIX_0109, TO_ABS16, OPCODE, B30 | RS32, DSTABS16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RS32, ABS32DST, E}}, {{PREFIX_0109, TO_ABS32, OPCODE, B30 | RS32, DSTABS32LIST, E}}} + +#define EXPAND_TO_REG32(CODE, NAME, OPCODE) \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, RD32, E}}, {{PREFIX_010A, FROM_IND, OPCODE, B30 | RD32, E}}}, \ + EXPAND2_STD_DST (CODE, 2, NAME, RD32, PREFIX_010A, OPCODE, B30 | RD32), \ + {CODE, AV_H8SX, 0, NAME, {{ABS16SRC, RD32, E}}, {{PREFIX_010A, FROM_ABS16, OPCODE, B30 | RD32, ABS16LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS32SRC, RD32, E}}, {{PREFIX_010A, FROM_ABS32, OPCODE, B30 | RD32, ABS32LIST, E}}} + + +#define EXPAND_TWOOP_B(CODE, NAME, OP1, OP2, OP3, OP4, BIT) \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, RDIND, E}}, {{0x7, 0xd, B30 | RDIND, IGNORE, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, RDPOSTINC, E}}, {{PREFIX_0174, 0x6, 0xc, B30 | RDPOSTINC, B31 | B20 | IGNORE, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, RDPOSTDEC, E}}, {{PREFIX_0176, 0x6, 0xc, B30 | RDPOSTDEC, B31 | B20 | IGNORE, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, RDPREINC, E}}, {{PREFIX_0175, 0x6, 0xc, B30 | RDPREINC, B31 | B20 | IGNORE, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, RDPREDEC, E}}, {{PREFIX_0177, 0x6, 0xc, B30 | RDPREDEC, B31 | B20 | IGNORE, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, DISP2DST, E}}, {{PREFIX_017_D2D, 0x6, 0x8, B30 | DSTDISPREG, B31 | B20 | IGNORE, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, DISP16DST, E}}, {{PREFIX_0174, 0x6, 0xe, B30 | DSTDISPREG, B31 | B20 | IGNORE, DSTDISP16LIST, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, DISP32DST, E}}, {{PREFIX_78R4WD, 0x6, 0xa, 2, B31 | B20 | IGNORE, DSTDISP32LIST, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, INDEXB16D, E}}, {{PREFIX_0175, 0x6, 0xe, B30 | DSTDISPREG, B31 | B20 | IGNORE, DSTDISP16LIST, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, INDEXW16D, E}}, {{PREFIX_0176, 0x6, 0xe, B30 | DSTDISPREG, B31 | B20 | IGNORE, DSTDISP16LIST, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, INDEXL16D, E}}, {{PREFIX_0177, 0x6, 0xe, B30 | DSTDISPREG, B31 | B20 | IGNORE, DSTDISP16LIST, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, INDEXB32D, E}}, {{PREFIX_78R5WD, 0x6, 0xa, 2, B31 | B20 | IGNORE, DSTDISP32LIST, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, INDEXW32D, E}}, {{PREFIX_78R6WD, 0x6, 0xa, 2, B31 | B20 | IGNORE, DSTDISP32LIST, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, INDEXL32D, E}}, {{PREFIX_78R7WD, 0x6, 0xa, 2, B31 | B20 | IGNORE, DSTDISP32LIST, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, ABS8DST, E}}, {{0x7, 0xf, DSTABS8LIST, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, ABS16DST, E}}, {{0x6, 0xa, 0x1, B31 | B20 | IGNORE, DSTABS16LIST, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{IMM8, ABS32DST, E}}, {{0x6, 0xa, 0x3, B31 | B20 | IGNORE, DSTABS32LIST, OP1, BIT | IGNORE, IMM8LIST, E}}}, \ + {CODE, AV_H8, 2, NAME, {{RS8, RD8, E}}, {{OP2, OP3, RS8, RD8, E}}}, \ + EXPAND_FROM_REG8 (CODE, NAME, OP2, OP3, OP4), \ + EXPAND_TO_REG8 (CODE, NAME, OP2, OP3, OP4), \ + EXPAND_FROM_IND8 (CODE, NAME, OP4), \ + EXPAND_STD_MATRIX_B (CODE, NAME, OP4), \ + EXPAND_FROM_ABS16_B (CODE, NAME, OP4), \ + EXPAND_FROM_ABS32_B (CODE, NAME, OP4) + +#define EXPAND_TWOOP_W(CODE, NAME, OP1, OP2, OP3) \ + {CODE, AV_H8H, 6, NAME, {{IMM16, RD16, E}}, {{0x7, 0x9, OP3, RD16, IMM16LIST, E}}}, \ + EXPAND_FROM_IMM16_W (CODE, NAME, OP3), \ + EXPAND_FROM_REG16 (CODE, NAME, OP1, OP2, OP3), \ + EXPAND_TO_REG16 (CODE, NAME, OP1, OP2, OP3), \ + EXPAND_FROM_IND16 (CODE, NAME, OP3), \ + EXPAND_STD_MATRIX_W (CODE, NAME, OP3), \ + EXPAND_FROM_ABS16_W (CODE, NAME, OP3), \ + EXPAND_FROM_ABS32_W (CODE, NAME, OP3) + +#define EXPAND_TWOOP_L(CODE, NAME, OP1) \ + {CODE, AV_H8SX, 0, NAME, {{IMM16U_NS, RD32, E}}, {{0x7, 0xa, OP1, B31 | RD32, IMM16ULIST, E}}}, \ + {CODE, AV_H8H, 6, NAME, {{IMM32, RD32, E}}, {{0x7, 0xa, OP1, B30 | RD32, IMM32LIST, E}}}, \ + EXPAND_FROM_IMM16_L (CODE, NAME, OP1), \ + EXPAND_FROM_IMM32_L (CODE, NAME, OP1), \ + EXPAND_FROM_REG32 (CODE, NAME, OP1), \ + EXPAND_TO_REG32 (CODE, NAME, OP1), \ + EXPAND_STD_MATRIX_L (CODE, NAME, OP1) + + +/* + * Old expanders: + */ + +#define BITOP(code, imm, name, op00, op01, op10, op11, op20, op21, op30, op4) \ + {code, AV_H8, 2, name, {{imm, RD8, E}}, {{op00, op01, imm, RD8, E}}}, \ + {code, AV_H8, 6, name, {{imm, RDIND, E}}, {{op10, op11, B30 | RDIND, 0, op00, op01, imm, 0, E}}}, \ + {code, AV_H8, 6, name, {{imm, ABS8DST, E}}, {{op20, op21, DSTABS8LIST, op00, op01, imm, 0, E}}}, \ + {code, AV_H8H, 6, name, {{imm, ABS16DST, E}}, {{0x6, 0xa, 0x1, op30, DST | ABS16LIST, op00, op01, imm, op4, E}}}, \ + {code, AV_H8H, 6, name, {{imm, ABS32DST, E}}, {{0x6, 0xa, 0x3, op30, DST | ABS32LIST, op00, op01, imm, op4, E}}} + +#define BITOP_B(code, imm, name, op00, op01, op10, op11, op20, op21, op30, op4) \ + {code, AV_H8SX, 0, name, {{imm, RDIND, E}}, {{op10, op11, B30 | RDIND, 0, op00, op01, imm, op4, E}}}, \ + {code, AV_H8SX, 0, name, {{imm, ABS8DST, E}}, {{op20, op21, DSTABS8LIST, op00, op01, imm, op4, E}}}, \ + {code, AV_H8SX, 0, name, {{imm, ABS16DST, E}}, {{0x6, 0xa, 0x1, op30, DST | ABS16LIST, op00, op01, imm, op4, E}}}, \ + {code, AV_H8SX, 0, name, {{imm, ABS32DST, E}}, {{0x6, 0xa, 0x3, op30, DST | ABS32LIST, op00, op01, imm, op4, E}}} + +#define EBITOP(code, imm, name, op00, op01, op10, op11, op20, op21, op30, op4) \ + BITOP(code, imm, name, op00+1, op01, op10, op11, op20, op21, op30, op4), \ + BITOP(code, RS8, name, op00, op01, op10, op11, op20, op21, op30, op4) + +#define EBITOP_B(code, imm, name, op00, op01, op10, op11, op20, op21, op30, op4) \ + BITOP_B(code, imm, name, op00+1, op01, op10, op11, op20, op21, op30, op4), \ + BITOP_B(code, RS8, name, op00, op01, op10, op11, op20, op21, op30, op4) + +#define WTWOP(code, name, op1, op2) \ + {code, AV_H8, 2, name, {{RS16, RD16, E}}, {{op1, op2, RS16, RD16, E}}} #define BRANCH(code, name, op) \ -{ code, 1, 4,name,{{DISP8,E,0}}, {{ 0x4, op, DISP8, IGNORE, E, 0, 0, 0, 0}}}, \ -{ code, 0, 6,name,{{DISP16,E,0}}, {{ 0x5, 0x8, op, 0x0, DISP16, IGNORE, IGNORE, IGNORE, E,0}}} - -#define SOP(code, x,name) \ -{code, 1, x, name - -#define NEW_SOP(code, in,x,name) \ -{code, in, x, name -#define EOP } - -#define TWOOP(code, name, op1, op2,op3) \ -{ code,1, 2,name, {{IMM8, RD8, E}}, {{ op1, RD8, IMM8, IGNORE, E, 0, 0, 0, 0}}},\ -{ code, 1, 2,name, {{RS8, RD8, E}}, {{ op2, op3, RS8, RD8, E, 0, 0, 0, 0}}} - -#define UNOP(code,name, op1, op2) \ -{ code, 1, 2, name, {{OR8, E, 0}}, {{ op1, op2, 0, OR8, E, 0, 0, 0, 0}}} - -#define UNOP3(code, name, op1, op2, op3) \ -{ O(code,SB), 1, 2, name, {{OR8, E, 0}}, {{op1, op2, op3+0, OR8, E, 0, 0, 0, 0}}}, \ -{ O(code,SW), 0, 2, name, {{OR16, E, 0}}, {{op1, op2, op3+1, OR16, E, 0, 0, 0, 0}}}, \ -{ O(code,SL), 0, 2, name, {{OR32, E, 0}}, {{op1, op2, op3+3, OR32|B30, E, 0, 0, 0, 0}}} \ -,{ O(code,SB), 1, 2, name, {{IMM, OR8 | SRC_IN_DST, E}}, {{op1, op2, op3+4, OR8 | SRC_IN_DST, E, 0, 0, 0, 0}}}, \ -{ O(code,SW), 0, 2, name, {{IMM, OR16 | SRC_IN_DST, E}}, {{op1, op2, op3+5, OR16 | SRC_IN_DST, E, 0, 0, 0, 0}}}, \ -{ O(code,SL), 0, 2, name, {{IMM, OR32 | SRC_IN_DST, E}}, {{op1, op2, op3+7, OR32 | SRC_IN_DST|B30 , E, 0, 0, 0, 0}}} - - -#define IMM32LIST IMM32,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE -#define IMM24LIST IMM24,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE -#define IMM16LIST IMM16,IGNORE,IGNORE,IGNORE -#define A16LIST L_16,IGNORE,IGNORE,IGNORE -#define DISP24LIST DISP|L_24,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE -#define DISP32LIST DISP|L_32,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE -#define ABS24LIST ABS|L_24,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE -#define ABS32LIST ABS|L_32,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE -#define A24LIST L_24,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE -#define A32LIST L_32,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE -#define PREFIX32 0x0,0x1,0x0,0x0 -#define PREFIXLDC 0x0,0x1,0x4,0x0 - - -#define O(op, size) (op * 4 + size) - -#define O_RECOMPILE 0 -#define O_ADD 1 -#define O_ADDX 2 -#define O_AND 3 -#define O_BAND 4 -#define O_BRA 5 -#define O_BRN 6 -#define O_BHI 7 -#define O_BLS 8 -#define O_BCC 9 -#define O_BCS 10 -#define O_BNE 11 -#define O_BVC 12 -#define O_BVS 13 -#define O_BPL 14 -#define O_BMI 15 -#define O_BGE 16 -#define O_BLT 17 -#define O_BGT 18 -#define O_BLE 19 -#define O_ANDC 20 -#define O_BEQ 21 -#define O_BCLR 22 -#define O_BIAND 23 -#define O_BILD 24 -#define O_BIOR 25 -#define O_BIXOR 26 -#define O_BIST 27 -#define O_BLD 28 -#define O_BNOT 29 -#define O_BSET 30 -#define O_BSR 31 -#define O_BXOR 32 -#define O_CMP 33 -#define O_DAA 34 -#define O_DAS 35 -#define O_DEC 36 -#define O_DIVU 37 -#define O_DIVS 38 -#define O_INC 39 -#define O_LDC 40 -#define O_MOV_TO_MEM 41 -#define O_OR 42 -#define O_ROTL 43 -#define O_ROTR 44 -#define O_ROTXL 45 -#define O_ROTXR 46 -#define O_BPT 47 -#define O_SHAL 48 -#define O_SHAR 49 -#define O_SHLL 50 -#define O_SHLR 51 -#define O_SUB 52 -#define O_SUBS 53 -#define O_TRAPA 54 -#define O_XOR 55 -#define O_XORC 56 -#define O_BOR 57 -#define O_BST 58 -#define O_BTST 59 -#define O_EEPMOV 60 -#define O_EXTS 61 -#define O_EXTU 62 -#define O_JMP 63 -#define O_JSR 64 -#define O_MULU 65 -#define O_MULS 66 -#define O_NOP 67 -#define O_NOT 68 -#define O_ORC 69 -#define O_RTE 70 -#define O_STC 71 -#define O_SUBX 72 -#define O_NEG 73 -#define O_RTS 74 -#define O_SLEEP 75 -#define O_ILL 76 -#define O_ADDS 77 -#define O_SYSCALL 78 -#define O_MOV_TO_REG 79 -#define O_TAS 80 -#define O_CLRMAC 82 -#define O_LDMAC 83 -#define O_MAC 84 -#define O_LDM 85 -#define O_STM 86 -#define O_STMAC 87 -#define O_LAST 88 -/* Change made for System Call processing. */ -#define O_SYS_CREAT 100 -#define O_SYS_OPEN 101 -#define O_SYS_READ 102 -#define O_SYS_WRITE 103 -#define O_SYS_LSEEK 104 -#define O_SYS_CLOSE 105 -#define O_SYS_STAT 106 -#define O_SYS_FSTAT 107 + {code, AV_H8H, 6, name, {{PCREL16, E}}, {{0x5, 0x8, op, 0x0, PCREL16, DATA3 | B00, E}}}, \ + {code, AV_H8, 4, name, {{PCREL8, E}}, {{0x4, op, PCREL8, DATA | B00, E}}} + + +#define UNOP(code, name, op1, op2) \ + {code, AV_H8, 2, name, {{OR8, E}}, {{op1, op2, 0, OR8, E}}} + +#define EXPAND_UNOP_STD_B(CODE, NAME, PREFIX, OP1, OP2, OP3) \ + {CODE, AV_H8, 2, NAME, {{OR8, E}}, {{ OP1, OP2, OP3, OR8, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, E}}, {{ 7, 13, B30 | RSIND, IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPOSTINC, E}}, {{PREFIX, 4, 6, 12, B30 | RSPOSTINC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPOSTDEC, E}}, {{PREFIX, 6, 6, 12, B30 | RSPOSTDEC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPREINC, E}}, {{PREFIX, 5, 6, 12, B30 | RSPREINC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPREDEC, E}}, {{PREFIX, 7, 6, 12, B30 | RSPREDEC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{DISP2SRC, E}}, {{PREFIX, B30 | B21 | DISP2SRC, 6, 8, B30 | DISPREG, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{DISP16SRC, E}}, {{PREFIX, 4, 6, 14, B30 | DISPREG, B31 | IGNORE, DISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{DISP32SRC, E}}, {{7, 8, B30 | DISPREG, 4, 6, 10, 2, B31 | IGNORE, DISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXB16, E}}, {{PREFIX, 5, 6, 14, B30 | DISPREG, B31 | IGNORE, DISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXW16, E}}, {{PREFIX, 6, 6, 14, B30 | DISPREG, B31 | IGNORE, DISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXL16, E}}, {{PREFIX, 7, 6, 14, B30 | DISPREG, B31 | IGNORE, DISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXB32, E}}, {{7, 8, B30 | DISPREG, 5, 6, 10, 2, B31 | IGNORE, DISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXW32, E}}, {{7, 8, B30 | DISPREG, 6, 6, 10, 2, B31 | IGNORE, DISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXL32, E}}, {{7, 8, B30 | DISPREG, 7, 6, 10, 2, B31 | IGNORE, DISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS8SRC, E}}, {{ 7, 15, ABS8LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS16SRC, E}}, {{ 6, 10, 1, B31 | IGNORE, ABS16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS32SRC, E}}, {{ 6, 10, 3, B31 | IGNORE, ABS32LIST, OP1, OP2, OP3, IGNORE, E}}} + +#define EXPAND_UNOP_STD_W(CODE, NAME, PREFIX, OP1, OP2, OP3) \ + {CODE, AV_H8H, 2, NAME, {{OR16, E}}, {{ OP1, OP2, OP3, OR16, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, E}}, {{ 7, 13, B31 | RSIND, IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPOSTINC, E}}, {{PREFIX, 4, 6, 13, B30 | RSPOSTINC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPOSTDEC, E}}, {{PREFIX, 6, 6, 13, B30 | RSPOSTDEC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPREINC, E}}, {{PREFIX, 5, 6, 13, B30 | RSPREINC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPREDEC, E}}, {{PREFIX, 7, 6, 13, B30 | RSPREDEC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{DISP2SRC, E}}, {{PREFIX, B30 | B21 | DISP2SRC, 6, 9, B30 | DISPREG, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{DISP16SRC, E}}, {{PREFIX, 4, 6, 15, B30 | DISPREG, B31 | IGNORE, DISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{DISP32SRC, E}}, {{7, 8, B30 | DISPREG, 4, 6, 11, 2, B31 | IGNORE, DISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXB16, E}}, {{PREFIX, 5, 6, 15, B30 | DISPREG, B31 | IGNORE, DISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXW16, E}}, {{PREFIX, 6, 6, 15, B30 | DISPREG, B31 | IGNORE, DISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXL16, E}}, {{PREFIX, 7, 6, 15, B30 | DISPREG, B31 | IGNORE, DISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXB32, E}}, {{7, 8, B30 | DISPREG, 5, 6, 11, 2, B31 | IGNORE, DISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXW32, E}}, {{7, 8, B30 | DISPREG, 6, 6, 11, 2, B31 | IGNORE, DISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXL32, E}}, {{7, 8, B30 | DISPREG, 7, 6, 11, 2, B31 | IGNORE, DISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS16SRC, E}}, {{ 6, 11, 1, B31 | IGNORE, ABS16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS32SRC, E}}, {{ 6, 11, 3, B31 | IGNORE, ABS32LIST, OP1, OP2, OP3, IGNORE, E}}} + +#define EXPAND_UNOP_STD_L(CODE, NAME, PREFIX, OP1, OP2, OP3) \ + {CODE, AV_H8H, 2, NAME, {{OR32, E}}, {{ OP1, OP2, OP3, B30 | OR32, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSIND, E}}, {{PREFIX, 4, 6, 9, B30 | RSIND, B31 | IGNORE, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPOSTINC, E}}, {{PREFIX, 4, 6, 13, B30 | RSPOSTINC, B31 | IGNORE, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPOSTDEC, E}}, {{PREFIX, 6, 6, 13, B30 | RSPOSTDEC, B31 | IGNORE, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPREINC, E}}, {{PREFIX, 5, 6, 13, B30 | RSPREINC, B31 | IGNORE, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{RSPREDEC, E}}, {{PREFIX, 7, 6, 13, B30 | RSPREDEC, B31 | IGNORE, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{DISP2SRC, E}}, {{PREFIX, B30 | B21 | DISP2SRC, 6, 9, B30 | DISPREG, B31 | IGNORE, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{DISP16SRC, E}}, {{PREFIX, 4, 6, 15, B30 | DISPREG, B31 | IGNORE, DISP16LIST, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{DISP32SRC, E}}, {{7, 8, B31 | DISPREG, 4, 6, 11, 2, B31 | IGNORE, DISP32LIST, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXB16, E}}, {{PREFIX, 5, 6, 15, B30 | DISPREG, B31 | IGNORE, DISP16LIST, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXW16, E}}, {{PREFIX, 6, 6, 15, B30 | DISPREG, B31 | IGNORE, DISP16LIST, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXL16, E}}, {{PREFIX, 7, 6, 15, B30 | DISPREG, B31 | IGNORE, DISP16LIST, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXB32, E}}, {{7, 8, B31 | DISPREG, 5, 6, 11, 2, B31 | IGNORE, DISP32LIST, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXW32, E}}, {{7, 8, B31 | DISPREG, 6, 6, 11, 2, B31 | IGNORE, DISP32LIST, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{INDEXL32, E}}, {{7, 8, B31 | DISPREG, 7, 6, 11, 2, B31 | IGNORE, DISP32LIST, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS16SRC, E}}, {{PREFIX, 4, 6, 11, 0, B31 | IGNORE, ABS16LIST, OP1, OP2, OP3, B30 | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{ABS32SRC, E}}, {{PREFIX, 4, 6, 11, 2, B31 | IGNORE, ABS32LIST, OP1, OP2, OP3, B30 | IGNORE, E}}} + +#define EXPAND_UNOP_EXTENDED_B(CODE, NAME, CONST, PREFIX, OP1, OP2, OP3) \ + {CODE, AV_H8, 2, NAME, {{CONST, RD8, E}}, {{ OP1, OP2, OP3, RD8, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDIND, E}}, {{ 7, 13, B30 | RDIND, IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDPOSTINC, E}}, {{PREFIX, 4, 6, 12, B30 | RDPOSTINC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDPOSTDEC, E}}, {{PREFIX, 6, 6, 12, B30 | RDPOSTDEC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDPREINC, E}}, {{PREFIX, 5, 6, 12, B30 | RDPREINC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDPREDEC, E}}, {{PREFIX, 7, 6, 12, B30 | RDPREDEC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, DISP2DST, E}}, {{PREFIX, B30 | B21 | DISP2DST, 6, 8, B30 | DSTDISPREG, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, DISP16DST, E}}, {{PREFIX, 4, 6, 14, B30 | DSTDISPREG, B31 | IGNORE, DSTDISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, DISP32DST, E}}, {{7, 8, B30 | DSTDISPREG, 4, 6, 10, 2, B31 | IGNORE, DSTDISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXB16D, E}}, {{PREFIX, 5, 6, 14, B30 | DSTDISPREG, B31 | IGNORE, DSTDISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXW16D, E}}, {{PREFIX, 6, 6, 14, B30 | DSTDISPREG, B31 | IGNORE, DSTDISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXL16D, E}}, {{PREFIX, 7, 6, 14, B30 | DSTDISPREG, B31 | IGNORE, DSTDISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXB32D, E}}, {{7, 8, B30 | DSTDISPREG, 5, 6, 10, 2, B31 | IGNORE, DSTDISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXW32D, E}}, {{7, 8, B30 | DSTDISPREG, 6, 6, 10, 2, B31 | IGNORE, DSTDISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXL32D, E}}, {{7, 8, B30 | DSTDISPREG, 7, 6, 10, 2, B31 | IGNORE, DSTDISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, ABS8DST, E}}, {{ 7, 15, DSTABS8LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, ABS16DST, E}}, {{ 6, 10, 1, B31 | IGNORE, DSTABS16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, ABS32DST, E}}, {{ 6, 10, 3, B31 | IGNORE, DSTABS32LIST, OP1, OP2, OP3, IGNORE, E}}} + +#define EXPAND_UNOP_EXTENDED_W(CODE, NAME, CONST, PREFIX, OP1, OP2, OP3) \ + {CODE, AV_H8, 2, NAME, {{CONST, RD16, E}}, {{ OP1, OP2, OP3, RD16, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDIND, E}}, {{ 7, 13, B31 | RDIND, IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDPOSTINC, E}}, {{PREFIX, 4, 6, 13, B30 | RDPOSTINC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDPOSTDEC, E}}, {{PREFIX, 6, 6, 13, B30 | RDPOSTDEC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDPREINC, E}}, {{PREFIX, 5, 6, 13, B30 | RDPREINC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDPREDEC, E}}, {{PREFIX, 7, 6, 13, B30 | RDPREDEC, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, DISP2DST, E}}, {{PREFIX, B30 | B21 | DISP2DST, 6, 9, B30 | DSTDISPREG, B31 | IGNORE, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, DISP16DST, E}}, {{PREFIX, 4, 6, 15, B30 | DSTDISPREG, B31 | IGNORE, DSTDISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, DISP32DST, E}}, {{7, 8, B30 | DSTDISPREG, 4, 6, 11, 2, B31 | IGNORE, DSTDISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXB16D, E}}, {{PREFIX, 5, 6, 15, B30 | DSTDISPREG, B31 | IGNORE, DSTDISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXW16D, E}}, {{PREFIX, 6, 6, 15, B30 | DSTDISPREG, B31 | IGNORE, DSTDISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXL16D, E}}, {{PREFIX, 7, 6, 15, B30 | DSTDISPREG, B31 | IGNORE, DSTDISP16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXB32D, E}}, {{7, 8, B30 | DSTDISPREG, 5, 6, 11, 2, B31 | IGNORE, DSTDISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXW32D, E}}, {{7, 8, B30 | DSTDISPREG, 6, 6, 11, 2, B31 | IGNORE, DSTDISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXL32D, E}}, {{7, 8, B30 | DSTDISPREG, 7, 6, 11, 2, B31 | IGNORE, DSTDISP32LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, ABS16DST, E}}, {{ 6, 11, 1, B31 | IGNORE, DSTABS16LIST, OP1, OP2, OP3, IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, ABS32DST, E}}, {{ 6, 11, 3, B31 | IGNORE, DSTABS32LIST, OP1, OP2, OP3, IGNORE, E}}} + +#define EXPAND_UNOP_EXTENDED_L(CODE, NAME, CONST, PREFIX, OP1, OP2, OP3, BIT) \ + {CODE, AV_H8, 2, NAME, {{CONST, RD32, E}}, {{ OP1, OP2, OP3, BIT | RD32, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDIND, E}}, {{PREFIX, 4, 6, 9, B30 | RDIND, B31 | IGNORE, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDPOSTINC, E}}, {{PREFIX, 4, 6, 13, B30 | RDPOSTINC, B31 | IGNORE, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDPOSTDEC, E}}, {{PREFIX, 6, 6, 13, B30 | RDPOSTDEC, B31 | IGNORE, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDPREINC, E}}, {{PREFIX, 5, 6, 13, B30 | RDPREINC, B31 | IGNORE, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, RDPREDEC, E}}, {{PREFIX, 7, 6, 13, B30 | RDPREDEC, B31 | IGNORE, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, DISP2DST, E}}, {{PREFIX, B30 | B21 | DISP2DST, 6, 9, B30 | DSTDISPREG, B31 | IGNORE, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, DISP16DST, E}}, {{PREFIX, 4, 6, 15, B30 | DSTDISPREG, B31 | IGNORE, DSTDISP16LIST, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, DISP32DST, E}}, {{7, 8, B31 | DSTDISPREG, 4, 6, 11, 2, B31 | IGNORE, DSTDISP32LIST, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXB16D, E}}, {{PREFIX, 5, 6, 15, B30 | DSTDISPREG, B31 | IGNORE, DSTDISP16LIST, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXW16D, E}}, {{PREFIX, 6, 6, 15, B30 | DSTDISPREG, B31 | IGNORE, DSTDISP16LIST, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXL16D, E}}, {{PREFIX, 7, 6, 15, B30 | DSTDISPREG, B31 | IGNORE, DSTDISP16LIST, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXB32D, E}}, {{7, 8, B31 | DSTDISPREG, 5, 6, 11, 2, B31 | IGNORE, DSTDISP32LIST, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXW32D, E}}, {{7, 8, B31 | DSTDISPREG, 6, 6, 11, 2, B31 | IGNORE, DSTDISP32LIST, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, INDEXL32D, E}}, {{7, 8, B31 | DSTDISPREG, 7, 6, 11, 2, B31 | IGNORE, DSTDISP32LIST, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, ABS16DST, E}}, {{PREFIX, 4, 6, 11, 0, B31 | IGNORE, DSTABS16LIST, OP1, OP2, OP3, BIT | IGNORE, E}}}, \ + {CODE, AV_H8SX, 0, NAME, {{CONST, ABS32DST, E}}, {{PREFIX, 4, 6, 11, 2, B31 | IGNORE, DSTABS32LIST, OP1, OP2, OP3, BIT | IGNORE, E}}} + +#define PREFIXLDC 0x0, 0x1, 0x4, B30 | CCR_EXR | DST +#define PREFIXSTC 0x0, 0x1, 0x4, B30 | CCR_EXR | SRC + +#define O(op, size) (op*4+size) +#define OP_SIZE(HOW) (HOW % 4) +#define OP_KIND(HOW) (HOW / 4) + +enum h8_asm_codes { + O_RECOMPILE = 0, + O_ADD, + O_ADDX, + O_AND, + O_BAND, + O_BRA, + O_BRAB, + O_BRAW, + O_BRAL, + O_BRAS, + O_BRABC, + O_BRABS, + O_BSRBC, + O_BSRBS, + O_BRN, + O_BHI, + O_BLS, + O_BCC, + O_BCS, + O_BNE, + O_BVC, + O_BVS, + O_BPL, + O_BMI, + O_BGE, + O_BLT, + O_BGT, + O_BLE, + O_ANDC, + O_BEQ, + O_BCLR, + O_BCLREQ, + O_BCLRNE, + O_BSETEQ, + O_BSETNE, + O_BFLD, + O_BFST, + O_BIAND, + O_BILD, + O_BIOR, + O_BIXOR, + O_BIST, + O_BISTZ, + O_BLD, + O_BNOT, + O_BOR, + O_BSET, + O_BSR, + O_BXOR, + O_CMP, + O_DAA, + O_DAS, + O_DEC, + O_DIVU, + O_DIVS, + O_DIVXU, + O_DIVXS, + O_INC, + O_LDC, + O_MOV, + O_MOVAB, + O_MOVAW, + O_MOVAL, + O_MOVMD, + O_MOVSD, + O_OR, + O_ROTL, + O_ROTR, + O_ROTXL, + O_ROTXR, + O_BPT, + O_SHAL, + O_SHAR, + O_SHLL, + O_SHLR, + O_SUB, + O_SUBS, + O_TRAPA, + O_XOR, + O_XORC, + O_BST, + O_BSTZ, + O_BTST, + O_EEPMOV, + O_EXTS, + O_EXTU, + O_JMP, + O_JSR, + O_MULU, + O_MULUU, + O_MULS, + O_MULSU, + O_MULXU, + O_MULXS, + O_NOP, + O_NOT, + O_ORC, + O_RTE, + O_RTEL, + O_STC, + O_SUBX, + O_NEG, + O_RTS, + O_RTSL, + O_SLEEP, + O_ILL, + O_ADDS, + O_SYSCALL, + O_TAS, + O_CLRMAC, + O_LDMAC, + O_MAC, + O_LDM, + O_STM, + O_STMAC, + O_LAST, + /* Change made for System Call processing. */ + O_SYS_CREAT, + O_SYS_OPEN, + O_SYS_READ, + O_SYS_WRITE, + O_SYS_LSEEK, + O_SYS_CLOSE, + O_SYS_STAT, + O_SYS_FSTAT, /* Space reserved for future file I/O system calls. */ -#define O_SYS_CMDLINE 120 -/* End of System Call specific Changes. */ -#define SB 0 -#define SW 1 -#define SL 2 -#define SN 3 + O_SYS_CMDLINE + /* End of System Call specific Changes. */ +}; + +enum h8_size { + SB = 0, + SW = 1, + SL = 2, + 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. */ -const struct h8_opcode h8_opcodes[] = +struct h8_opcode h8_opcodes[] = { - TWOOP(O(O_ADD,SB),"add.b", 0x8, 0x0,0x8), - - NEW_SOP(O(O_ADD,SW),1,2,"add.w"),{{RS16,RD16,E}},{{0x0,0x9,RS16,RD16,E}} EOP, - NEW_SOP(O(O_ADD,SW),0,4,"add.w"),{{IMM16,RD16,E}},{{0x7,0x9,0x1,RD16,IMM16,IGNORE,IGNORE,IGNORE,E}} EOP, - NEW_SOP(O(O_ADD,SL),0,2,"add.l"),{{RS32,RD32,E }}, {{0x0,0xA,B31|RS32,B30|RD32,E}} EOP, - NEW_SOP(O(O_ADD,SL),0,6,"add.l"),{{IMM32,RD32,E }},{{0x7,0xA,0x1,B30|RD32,IMM32LIST,E}} EOP, - NEW_SOP(O(O_ADDS,SL),1,2,"adds"), {{KBIT,RDP,E}}, {{0x0,0xB,KBIT,RDP,E,0,0,0,0}} EOP, - - TWOOP(O(O_ADDX,SB),"addx",0x9,0x0,0xE), - TWOOP(O(O_AND,SB), "and.b",0xE,0x1,0x6), - - NEW_SOP(O(O_AND,SW),0,2,"and.w"),{{RS16,RD16,E }},{{0x6,0x6,RS16,RD16,E}} EOP, - NEW_SOP(O(O_AND,SW),0,4,"and.w"),{{IMM16,RD16,E }},{{0x7,0x9,0x6,RD16,IMM16,IGNORE,IGNORE,IGNORE,E}} EOP, + {O (O_ADD, SB), AV_H8, 2, "add.b", {{IMM8, RD8, E}}, {{0x8, RD8, IMM8LIST, E}}}, + EXPAND_TWOOP_B (O (O_ADD, SB), "add.b", 0x8, 0x0, 0x8, 0x1, 0), + + {O (O_ADD, SW), AV_H8, 6, "add.w", {{RS16, RD16, E}}, {{0x0, 0x9, RS16, RD16, E}}}, + {O (O_ADD, SW), AV_H8SX, 0, "add.w", {{IMM3NZ_NS, RD16, E}}, {{0x0, 0xa, B30 | IMM3NZ, RD16, E}}}, + {O (O_ADD, SW), AV_H8SX, 0, "add.w", {{IMM3NZ_NS, RDIND, E}}, {{0x7, 0xd, B31 | RDIND, IGNORE, 0x0, 0xa, B30 | IMM3NZ, IGNORE, E}}}, + {O (O_ADD, SW), AV_H8SX, 0, "add.w", {{IMM3NZ_NS, ABS16DST, E}}, {{0x6, 0xb, 0x1, B31 | IGNORE, DSTABS16LIST, 0x0, 0xa, B30 | IMM3NZ, IGNORE, E}}}, + {O (O_ADD, SW), AV_H8SX, 0, "add.w", {{IMM3NZ_NS, ABS32DST, E}}, {{0x6, 0xb, 0x3, B31 | IGNORE, DSTABS32LIST, 0x0, 0xa, B30 | IMM3NZ, IGNORE, E}}}, + EXPAND_TWOOP_W (O (O_ADD, SW), "add.w", 0x0, 0x9, 0x1), + + {O (O_ADD, SL), AV_H8H, 6, "add.l", {{RS32, RD32, E}}, {{0x0, 0xa, B31 | RS32, B30 | RD32, E}}}, + {O (O_ADD, SL), AV_H8SX, 0, "add.l", {{IMM3NZ_NS, RD32, E}}, {{0x0, 0xa, B31 | IMM3NZ, B31 | RD32, E}}}, + EXPAND_TWOOP_L (O (O_ADD, SL), "add.l", 0x1), + + {O (O_ADDS, SL), AV_H8, 2, "adds", {{KBIT, RDP, E}}, {{0x0, 0xB,KBIT, RDP, E}}}, + + {O (O_ADDX, SB), AV_H8, 2, "addx", {{IMM8, RD8, E}}, {{0x9, RD8, IMM8LIST, E}}}, + {O (O_ADDX, SB), AV_H8SX, 0, "addx.b", {{IMM8, RDIND, E}}, {{0x7, 0xd, B30 | RDIND, IGNORE, 0x9, IGNORE, IMM8LIST, E}}}, + {O (O_ADDX, SB), AV_H8SX, 0, "addx.b", {{IMM8, RDPOSTDEC, E}}, {{PREFIX_0176, 0x6, 0xc, B30 | RDPOSTDEC, B31 | IGNORE, 0x9, IGNORE, IMM8LIST, E}}}, + {O (O_ADDX, SB), AV_H8, 2, "addx", {{RS8, RD8, E}}, {{0x0, 0xe, RS8, RD8, E}}}, + {O (O_ADDX, SB), AV_H8SX, 0, "addx.b", {{RS8, RDIND, E}}, {{0x7, 0xd, B30 | RDIND, IGNORE, 0x0, 0xe, RS8, IGNORE, E}}}, + {O (O_ADDX, SB), AV_H8SX, 0, "addx.b", {{RS8, RDPOSTDEC, E}}, {{PREFIX_0176, 0x6, 0xc, B30 | RDPOSTDEC, B31 | IGNORE, 0x0, 0xe, RS8, IGNORE, E}}}, + {O (O_ADDX, SB), AV_H8SX, 0, "addx.b", {{RSIND, RD8, E}}, {{0x7, 0xc, B30 | RSIND, IGNORE, 0x0, 0xe, IGNORE, RD8, E}}}, + {O (O_ADDX, SB), AV_H8SX, 0, "addx.b", {{RSPOSTDEC, RD8, E}}, {{PREFIX_0176, 0x6, 0xc, B30 | RSPOSTDEC, B30 | B20 | IGNORE, 0x0, 0xe, IGNORE, RD8, E}}}, + {O (O_ADDX, SB), AV_H8SX, 0, "addx.b", {{RSIND, RDIND, E}}, {{PREFIX_0174, 0x6, 0x8, B30 | RSIND, 0xd, 0x0, RDIND, 0x1, IGNORE, E}}}, + {O (O_ADDX, SB), AV_H8SX, 0, "addx.b", {{RSPOSTDEC, RDPOSTDEC, E}}, {{PREFIX_0176, 0x6, 0xc, B30 | RSPOSTDEC, 0xd, 0xa, RDPOSTDEC, 0x1, IGNORE, E}}}, + + {O (O_ADDX, SW), AV_H8SX, 0, "addx.w", {{IMM16, RD16, E}}, {{PREFIX_0151, 0x7, 0x9, 0x1, RD16, IMM16LIST, E}}}, + {O (O_ADDX, SW), AV_H8SX, 0, "addx.w", {{IMM16, RDIND, E}}, {{0x7, 0xd, B31 | RDIND, B01 | IGNORE, 0x7, 0x9, 0x1, IGNORE, IMM16LIST, E}}}, + {O (O_ADDX, SW), AV_H8SX, 0, "addx.w", {{IMM16, RDPOSTDEC, E}}, {{PREFIX_0156, 0x6, 0xd, B30 | RDPOSTDEC, B31 | B20 | B01 | IGNORE, 0x7, 0x9, 0x1, IGNORE, IMM16LIST, E}}}, + {O (O_ADDX, SW), AV_H8SX, 0, "addx.w", {{RS16, RD16, E}}, {{PREFIX_0151, 0x0, 0x9, RS16, RD16, E}}}, + {O (O_ADDX, SW), AV_H8SX, 0, "addx.w", {{RS16, RDIND, E}}, {{0x7, 0xd, B31 | RDIND, B01 | IGNORE, 0x0, 0x9, RS16, IGNORE, E}}}, + {O (O_ADDX, SW), AV_H8SX, 0, "addx.w", {{RS16, RDPOSTDEC, E}}, {{PREFIX_0156, 0x6, 0xd, B30 | RDPOSTDEC, B31 | B20 | B01 | IGNORE, 0x0, 0x9, RS16, IGNORE, E}}}, + {O (O_ADDX, SW), AV_H8SX, 0, "addx.w", {{RSIND, RD16, E}}, {{0x7, 0xc, B31 | RSIND, B01 | IGNORE, 0x0, 0x9, IGNORE, RD16, E}}}, + {O (O_ADDX, SW), AV_H8SX, 0, "addx.w", {{RSPOSTDEC, RD16, E}}, {{PREFIX_0156, 0x6, 0xd, B30 | RSPOSTDEC, B30 | B20 | B01 | IGNORE, 0x0, 0x9, IGNORE, RD16, E}}}, + {O (O_ADDX, SW), AV_H8SX, 0, "addx.w", {{RSIND, RDIND, E}}, {{PREFIX_0154, 0x6, 0x9, B30 | RSIND, 0xd, 0x0, RDIND, 0x1, IGNORE, E}}}, + {O (O_ADDX, SW), AV_H8SX, 0, "addx.w", {{RSPOSTDEC, RDPOSTDEC, E}}, {{PREFIX_0156, 0x6, 0xd, B30 | RSPOSTDEC, 0xd, 0xa, RDPOSTDEC, 0x1, IGNORE, E}}}, + + {O (O_ADDX, SL), AV_H8SX, 0, "addx.l", {{IMM32, RD32, E}}, {{PREFIX_0101, 0x7, 0xa, 0x1, RD32, IMM32LIST, E}}}, + {O (O_ADDX, SL), AV_H8SX, 0, "addx.l", {{IMM32, RDIND, E}}, {{PREFIX_0104, 0x6, 0x9, B30 | RDIND, B31 | B20 | B01 | IGNORE, 0x7, 0xa, 0x1, IGNORE, IMM32LIST, E}}}, + {O (O_ADDX, SL), AV_H8SX, 0, "addx.l", {{IMM32, RDPOSTDEC, E}}, {{PREFIX_0106, 0x6, 0xd, B30 | RDPOSTDEC, B31 | B20 | B01 | IGNORE, 0x7, 0xa, 0x1, IGNORE, IMM32LIST, E}}}, + {O (O_ADDX, SL), AV_H8SX, 0, "addx.l", {{RS32, RD32, E}}, {{PREFIX_0101, 0x0, 0xa, B31 | RS32, B30 | RD32, E}}}, + {O (O_ADDX, SL), AV_H8SX, 0, "addx.l", {{RS32, RDIND, E}}, {{PREFIX_0104, 0x6, 0x9, B30 | RDIND, B31 | B20 | B01 | IGNORE, 0x0, 0xa, B31 | RS32, B30 | IGNORE, E}}}, + {O (O_ADDX, SL), AV_H8SX, 0, "addx.l", {{RS32, RDPOSTDEC, E}}, {{PREFIX_0106, 0x6, 0xd, B30 | RDPOSTDEC, B31 | B20 | B01 | IGNORE, 0x0, 0xa, B31 | RS32, B30 | IGNORE, E}}}, + {O (O_ADDX, SL), AV_H8SX, 0, "addx.l", {{RSIND, RD32, E}}, {{PREFIX_0104, 0x6, 0x9, B30 | RSIND, B30 | B20 | B01 | IGNORE, 0x0, 0xa, B31 | IGNORE, B30 | RD32, E}}}, + {O (O_ADDX, SL), AV_H8SX, 0, "addx.l", {{RSPOSTDEC, RD32, E}}, {{PREFIX_0106, 0x6, 0xd, B30 | RSPOSTDEC, B30 | B20 | B01 | IGNORE, 0x0, 0xa, B31 | IGNORE, B30 | RD32, E}}}, + {O (O_ADDX, SL), AV_H8SX, 0, "addx.l", {{RSIND, RDIND, E}}, {{PREFIX_0104, 0x6, 0x9, B30 | RSIND, 0xd, 0x0, RDIND, 0x1, IGNORE, E}}}, + {O (O_ADDX, SL), AV_H8SX, 0, "addx.l", {{RSPOSTDEC, RDPOSTDEC, E}}, {{PREFIX_0106, 0x6, 0xd, B30 | RSPOSTDEC, 0xd, 0xa, RDPOSTDEC, 0x1, IGNORE, E}}}, + + {O (O_AND, SB), AV_H8, 2, "and.b", {{IMM8, RD8, E}}, {{0xe, RD8, IMM8LIST, E}}}, + EXPAND_TWOOP_B (O (O_AND, SB), "and.b", 0xe, 0x1, 0x6, 0x6, 0), + + {O (O_AND, SW), AV_H8, 2, "and.w", {{RS16, RD16, E}}, {{0x6, 0x6, RS16, RD16, E}}}, + EXPAND_TWOOP_W (O (O_AND, SW), "and.w", 0x6, 0x6, 0x6), + + {O (O_AND, SL), AV_H8H, 2, "and.l", {{RS32, RD32, E}}, {{0x0, 0x1, 0xF, 0x0, 0x6, 0x6, B30 | RS32, B30 | RD32, E}}}, + EXPAND_TWOOP_L (O (O_AND, SL), "and.l", 0x6), + + {O (O_ANDC, SB), AV_H8, 2, "andc", {{IMM8, CCR | DST, E}}, {{0x0, 0x6, IMM8LIST, E}}}, + {O (O_ANDC, SB), AV_H8S, 2, "andc", {{IMM8, EXR | DST, E}}, {{0x0, 0x1, 0x4, EXR | DST, 0x0, 0x6, IMM8LIST, E}}}, + + BRANCH (O (O_BRA, SB), "bra", 0x0), + + {O (O_BRAB, SB), AV_H8SX, 0, "bra", {{LOWREG | L_8, E}}, {{0x5, 0x9, LOWREG | L_8 | B30, 0x5, E}}}, + {O (O_BRAW, SW), AV_H8SX, 0, "bra", {{LOWREG | L_16, E}}, {{0x5, 0x9, LOWREG | L_16 | B30, 0x6, E}}}, + {O (O_BRAL, SL), AV_H8SX, 0, "bra", {{RS32, E}}, {{0x5, 0x9, RS32 | B30, 0x7, E}}}, + + {O (O_BRABC, SB), AV_H8SX, 0, "bra/bc", {{IMM3, RDIND, OP3PCREL8}}, {{0x7, 0xC, B30 | RDIND, 0x0, 0x4, B30 | IMM3, OP3PCREL8, DATA, E}}}, + {O (O_BRABC, SB), AV_H8SX, 0, "bra/bc", {{IMM3, ABS8DST, OP3PCREL8}}, {{0x7, 0xE, DSTABS8LIST, 0x4, B30 | IMM3, OP3PCREL8, DATA, E}}}, + {O (O_BRABC, SB), AV_H8SX, 0, "bra/bc", {{IMM3, ABS16DST, OP3PCREL8}}, {{0x6, 0xA, 0x1, 0x0, DSTABS16LIST, 0x4, B30 | IMM3, OP3PCREL8, DATA, E}}}, + {O (O_BRABC, SB), AV_H8SX, 0, "bra/bc", {{IMM3, ABS32DST, OP3PCREL8}}, {{0x6, 0xA, 0x3, 0x0, DSTABS32LIST, 0x4, B30 | IMM3, OP3PCREL8, DATA, E}}}, + {O (O_BRABS, SB), AV_H8SX, 0, "bra/bs", {{IMM3, RDIND, OP3PCREL8}}, {{0x7, 0xC, B30 | RDIND, 0x0, 0x4, B31 | IMM3, OP3PCREL8, DATA, E}}}, + {O (O_BRABS, SB), AV_H8SX, 0, "bra/bs", {{IMM3, ABS8DST, OP3PCREL8}}, {{0x7, 0xE, DSTABS8LIST, 0x4, B31 | IMM3, OP3PCREL8, DATA, E}}}, + {O (O_BRABS, SB), AV_H8SX, 0, "bra/bs", {{IMM3, ABS16DST, OP3PCREL8}}, {{0x6, 0xA, 0x1, 0x0, DSTABS16LIST, 0x4, B31 | IMM3, OP3PCREL8, DATA, E}}}, + {O (O_BRABS, SB), AV_H8SX, 0, "bra/bs", {{IMM3, ABS32DST, OP3PCREL8}}, {{0x6, 0xA, 0x3, 0x0, DSTABS32LIST, 0x4, B31 | IMM3, OP3PCREL8, DATA, E}}}, + {O (O_BRABC, SB), AV_H8SX, 0, "bra/bc", {{IMM3, RDIND, OP3PCREL16}}, {{0x7, 0xC, B30 | RDIND, 0x0, 0x5, 0x8, B30 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BRABC, SB), AV_H8SX, 0, "bra/bc", {{IMM3, ABS8DST, OP3PCREL16}}, {{0x7, 0xE, DSTABS8LIST, 0x5, 0x8, B30 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BRABC, SB), AV_H8SX, 0, "bra/bc", {{IMM3, ABS16DST, OP3PCREL16}}, {{0x6, 0xA, 0x1, 0x0, DSTABS16LIST, 0x5, 0x8, B30 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BRABC, SB), AV_H8SX, 0, "bra/bc", {{IMM3, ABS32DST, OP3PCREL16}}, {{0x6, 0xA, 0x3, 0x0, DSTABS32LIST, 0x5, 0x8, B30 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BRABS, SB), AV_H8SX, 0, "bra/bs", {{IMM3, RDIND, OP3PCREL16}}, {{0x7, 0xC, B30 | RDIND, 0x0, 0x5, 0x8, B31 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BRABS, SB), AV_H8SX, 0, "bra/bs", {{IMM3, ABS8DST, OP3PCREL16}}, {{0x7, 0xE, DSTABS8LIST, 0x5, 0x8, B31 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BRABS, SB), AV_H8SX, 0, "bra/bs", {{IMM3, ABS16DST, OP3PCREL16}}, {{0x6, 0xA, 0x1, 0x0, DSTABS16LIST, 0x5, 0x8, B31 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BRABS, SB), AV_H8SX, 0, "bra/bs", {{IMM3, ABS32DST, OP3PCREL16}}, {{0x6, 0xA, 0x3, 0x0, DSTABS32LIST, 0x5, 0x8, B31 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, - NEW_SOP(O(O_AND,SL),0,6,"and.l"),{{IMM32,RD32,E }},{{0x7,0xA,0x6,B30|RD32,IMM32LIST,E}} EOP, - NEW_SOP(O(O_AND,SL),0,2,"and.l") ,{{RS32,RD32,E }},{{0x0,0x1,0xF,0x0,0x6,0x6,B30|RS32,B30|RD32,E}} EOP, - - NEW_SOP(O(O_ANDC,SB),1,2,"andc"), {{IMM8,CCR|DST,E}},{{ 0x0,0x6,IMM8,IGNORE,E,0,0,0,0}} EOP, - NEW_SOP(O(O_ANDC,SB),1,2,"andc"), {{IMM8,EXR|DST,E}},{{ 0x0,0x1,0x4,0x1,0x0,0x6,IMM8,IGNORE,E,0,0,0,0}} EOP, - - BITOP(O(O_BAND,SB), IMM3|B30,"band",0x7,0x6,0x7,0xC,0x7,0xE,0x0), - BRANCH(O(O_BRA,SB),"bra",0x0), - BRANCH(O(O_BRA,SB),"bt",0x0), - BRANCH(O(O_BRN,SB),"brn",0x1), - BRANCH(O(O_BRN,SB),"bf",0x1), - BRANCH(O(O_BHI,SB),"bhi",0x2), - BRANCH(O(O_BLS,SB),"bls",0x3), - BRANCH(O(O_BCC,SB),"bcc",0x4), - BRANCH(O(O_BCC,SB),"bhs",0x4), - BRANCH(O(O_BCS,SB),"bcs",0x5), - BRANCH(O(O_BCS,SB),"blo",0x5), - BRANCH(O(O_BNE,SB),"bne",0x6), - BRANCH(O(O_BEQ,SB),"beq",0x7), - BRANCH(O(O_BVC,SB),"bvc",0x8), - BRANCH(O(O_BVS,SB),"bvs",0x9), - BRANCH(O(O_BPL,SB),"bpl",0xA), - BRANCH(O(O_BMI,SB),"bmi",0xB), - BRANCH(O(O_BGE,SB),"bge",0xC), - BRANCH(O(O_BLT,SB),"blt",0xD), - BRANCH(O(O_BGT,SB),"bgt",0xE), - BRANCH(O(O_BLE,SB),"ble",0xF), - - EBITOP(O(O_BCLR,SB),IMM3|B30,"bclr", 0x6,0x2,0x7,0xD,0x7,0xF,0x8), - BITOP(O(O_BIAND,SB),IMM3|B31,"biand",0x7,0x6,0x7,0xC,0x7,0xE,0x0), - BITOP(O(O_BILD,SB), IMM3|B31,"bild", 0x7,0x7,0x7,0xC,0x7,0xE,0x0), - BITOP(O(O_BIOR,SB), IMM3|B31,"bior", 0x7,0x4,0x7,0xC,0x7,0xE,0x0), - BITOP(O(O_BIST,SB), IMM3|B31,"bist", 0x6,0x7,0x7,0xD,0x7,0xF,0x8), - BITOP(O(O_BIXOR,SB),IMM3|B31,"bixor",0x7,0x5,0x7,0xC,0x7,0xE,0x0), - BITOP(O(O_BLD,SB), IMM3|B30,"bld", 0x7,0x7,0x7,0xC,0x7,0xE,0x0), - EBITOP(O(O_BNOT,SB),IMM3|B30,"bnot", 0x6,0x1,0x7,0xD,0x7,0xF,0x8), - BITOP(O(O_BOR,SB), IMM3|B30,"bor", 0x7,0x4,0x7,0xC,0x7,0xE,0x0), - EBITOP(O(O_BSET,SB),IMM3|B30,"bset", 0x6,0x0,0x7,0xD,0x7,0xF,0x8), - - SOP(O(O_BSR,SB),6,"bsr"),{{DISP8,E,0}},{{ 0x5,0x5,DISP8,IGNORE,E,0,0,0,0}} EOP, - SOP(O(O_BSR,SB),6,"bsr"),{{DISP16,E,0}},{{ 0x5,0xC,0x0,0x0,DISP16,IGNORE,IGNORE,IGNORE,E,0,0,0,0}} EOP, - BITOP(O(O_BST,SB), IMM3|B30,"bst",0x6,0x7,0x7,0xD,0x7,0xF,0x8), - EBITOP(O(O_BTST,SB), IMM3|B30,"btst",0x6,0x3,0x7,0xC,0x7,0xE,0x0), - BITOP(O(O_BXOR,SB), IMM3|B30,"bxor",0x7,0x5,0x7,0xC,0x7,0xE,0x0), - - TWOOP(O(O_CMP,SB), "cmp.b",0xA,0x1,0xC), - WTWOP(O(O_CMP,SW), "cmp.w",0x1,0xD), - - NEW_SOP(O(O_CMP,SW),1,2,"cmp.w"),{{RS16,RD16,E }},{{0x1,0xD,RS16,RD16,E}} EOP, - NEW_SOP(O(O_CMP,SW),0,4,"cmp.w"),{{IMM16,RD16,E }},{{0x7,0x9,0x2,RD16,IMM16,IGNORE,IGNORE,IGNORE,E}} EOP, - - NEW_SOP(O(O_CMP,SL),0,6,"cmp.l"),{{IMM32,RD32,E }},{{0x7,0xA,0x2,B30|RD32,IMM32LIST,E}} EOP, - NEW_SOP(O(O_CMP,SL),0,2,"cmp.l") ,{{RS32,RD32,E }},{{0x1,0xF,B31|RS32,B30|RD32,E}} EOP, - - UNOP(O(O_DAA,SB), "daa",0x0,0xF), - UNOP(O(O_DAS,SB), "das",0x1,0xF), - UNOP(O(O_DEC,SB), "dec.b",0x1,0xA), - - NEW_SOP(O(O_DEC, SW),0,2,"dec.w") ,{{DBIT,RD16,E }},{{0x1,0xB,0x5|DBIT,RD16,E}} EOP, - NEW_SOP(O(O_DEC, SL),0,2,"dec.l") ,{{DBIT,RD32,E }},{{0x1,0xB,0x7|DBIT,RD32|B30,E}} EOP, - - NEW_SOP(O(O_DIVU,SB),1,13,"divxu.b"), {{RS8,RD16,E}}, {{0x5,0x1,RS8,RD16,E,0,0,0,0}}EOP, - NEW_SOP(O(O_DIVU,SW),0,21,"divxu.w"),{{RS16,RD32,E}},{{0x5,0x3,RS16,B30|RD32,E}}EOP, - - NEW_SOP(O(O_DIVS,SB),0,13,"divxs.b") ,{{RS8,RD16,E }},{{0x0,0x1,0xD,0x0,0x5,0x1,RS8,RD16,E}} EOP, - NEW_SOP(O(O_DIVS,SW),0,21,"divxs.w") ,{{RS16,RD32,E }},{{0x0,0x1,0xD,0x0,0x5,0x3,RS16,B30|RD32,E}} EOP, - - NEW_SOP(O(O_EEPMOV,SB),1,4,"eepmov.b"),{{E,0,0}},{{0x7,0xB,0x5,0xC,0x5,0x9,0x8,0xF,E}}EOP, - NEW_SOP(O(O_EEPMOV,SW),0,4,"eepmov.w"),{{E,0,0}},{{0x7,0xB,0xD,0x4,0x5,0x9,0x8,0xF,E}} EOP, - - NEW_SOP(O(O_EXTS,SW),0,2,"exts.w"),{{OR16,E,0}},{{0x1,0x7,0xD,OR16,E }}EOP, - NEW_SOP(O(O_EXTS,SL),0,2,"exts.l"),{{OR32,E,0}},{{0x1,0x7,0xF,OR32|B30,E }}EOP, - - NEW_SOP(O(O_EXTU,SW),0,2,"extu.w"),{{OR16,E,0}},{{0x1,0x7,0x5,OR16,E }}EOP, - NEW_SOP(O(O_EXTU,SL),0,2,"extu.l"),{{OR32,E,0}},{{0x1,0x7,0x7,OR32|B30,E }}EOP, - - UNOP(O(O_INC,SB), "inc",0x0,0xA), - - NEW_SOP(O(O_INC,SW),0,2,"inc.w") ,{{DBIT,RD16,E }},{{0x0,0xB,0x5|DBIT,RD16,E}} EOP, - NEW_SOP(O(O_INC,SL),0,2,"inc.l") ,{{DBIT,RD32,E }},{{0x0,0xB,0x7|DBIT,RD32|B30,E}} EOP, - - SOP(O(O_JMP,SB),4,"jmp"),{{RSIND,E,0}},{{0x5,0x9,B30|RSIND,0x0,E,0,0,0,0}}EOP, - SOP(O(O_JMP,SB),6,"jmp"),{{SRC|ABSJMP,E,0}},{{0x5,0xA,SRC|ABSJMP,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE,E}}EOP, - SOP(O(O_JMP,SB),8,"jmp"),{{SRC|MEMIND,E,0}},{{0x5,0xB,SRC|MEMIND,IGNORE,E,0,0,0,0}}EOP, - - SOP(O(O_JSR,SB),6,"jsr"),{{SRC|RSIND,E,0}}, {{0x5,0xD,B30|RSIND,0x0,E,0,0,0,0}}EOP, - SOP(O(O_JSR,SB),8,"jsr"),{{SRC|ABSJMP,E,0}},{{0x5,0xE,SRC|ABSJMP,IGNORE,IGNORE,IGNORE,IGNORE,IGNORE,E}}EOP, - SOP(O(O_JSR,SB),8,"jsr"),{{SRC|MEMIND,E,0}},{{0x5,0xF,SRC|MEMIND,IGNORE,E,0,0,0,0}}EOP, - - NEW_SOP(O(O_LDC,SB),1,2,"ldc"),{{IMM8,CCR|DST,E}}, {{ 0x0,0x7,IMM8,IGNORE,E,0,0,0,0}}EOP, - NEW_SOP(O(O_LDC,SB),1,2,"ldc"),{{OR8,CCR|DST,E}}, {{ 0x0,0x3,0x0,OR8,E,0,0,0,0}}EOP, - NEW_SOP(O(O_LDC,SB),0,2,"ldc"),{{ABS16SRC,CCR|DST,E}}, {{PREFIXLDC,0x6,0xB,0x0,0x0,ABS16SRC,IGNORE,IGNORE,IGNORE,E}}EOP, - NEW_SOP(O(O_LDC,SB),0,2,"ldc"),{{ABS32SRC,CCR|DST,E}}, {{PREFIXLDC,0x6,0xB,0x2,0x0,SRC|ABS32LIST,E}}EOP, - NEW_SOP(O(O_LDC,SB),0,2,"ldc"),{{DISP|SRC|L_16,CCR|DST,E}},{{PREFIXLDC,0x6,0xF,B30|DISPREG,0,DISP|L_16,IGNORE,IGNORE,IGNORE,E}}EOP, - NEW_SOP(O(O_LDC,SB),0,2,"ldc"),{{DISP|SRC|L_32,CCR|DST,E}},{{PREFIXLDC,0x7,0x8,B30|DISPREG,0,0x6,0xB,0x2,0x0,SRC|DISP32LIST,E}}EOP, - NEW_SOP(O(O_LDC,SB),0,2,"ldc"),{{RSINC,CCR|DST,E}}, {{PREFIXLDC,0x6,0xD,B30|RSINC,0x0,E}}EOP, - NEW_SOP(O(O_LDC,SB),0,2,"ldc"),{{RSIND,CCR|DST,E}}, {{PREFIXLDC,0x6,0x9,B30|RSIND,0x0,E}} EOP, - - NEW_SOP(O(O_LDC,SB),1,2,"ldc"),{{IMM8,EXR|DST,E}}, {{ 0x0,0x1,0x4,0x1,0x0,0x7,IMM8,IGNORE,E,0,0,0,0}}EOP, - NEW_SOP(O(O_LDC,SB),1,2,"ldc"),{{OR8,EXR|DST,E}}, {{ 0x0,0x3,0x1,OR8,E,0,0,0,0}}EOP, - NEW_SOP(O(O_LDC,SB),0,2,"ldc"),{{ABS16SRC,EXR|DST,E}}, {{ 0x0,0x1,0x4,0x1,0x6,0xb,0x0,0x0,ABS16SRC,IGNORE,IGNORE,IGNORE,E}}EOP, - NEW_SOP(O(O_LDC,SB),0,2,"ldc"),{{ABS32SRC,EXR|DST,E}}, {{ 0x0,0x1,0x4,0x1,0x6,0xb,0x2,0x0,SRC|ABS32LIST,E}}EOP, - NEW_SOP(O(O_LDC,SB),0,2,"ldc"),{{DISP|SRC|L_16,EXR|DST,E}},{{ 0x0,0x1,0x4,0x1,0x6,0xf,B30|DISPREG,0,DISP|L_16,IGNORE,IGNORE,IGNORE,E}}EOP, - NEW_SOP(O(O_LDC,SB),0,2,"ldc"),{{DISP|SRC|L_32,EXR|DST,E}},{{ 0x0,0x1,0x4,0x1,0x7,0x8,B30|DISPREG,0,0x6,0xB,0x2,0x0,SRC|DISP32LIST,E}}EOP, - NEW_SOP(O(O_LDC,SB),0,2,"ldc"),{{RSINC,EXR|DST,E}}, {{ 0x0,0x1,0x4,0x1,0x6,0xd,B30|RSINC,0x0,E}}EOP, - NEW_SOP(O(O_LDC,SB),0,2,"ldc"),{{RSIND,EXR|DST,E}}, {{ 0x0,0x1,0x4,0x1,0x6,0x9,B30|RSIND,0x0,E}} EOP, - - SOP(O(O_MOV_TO_REG,SB),4,"mov.b"),{{ABS|SRC|L_16|MEMRELAX,RD8,E}}, {{ 0x6,0xA,0x0,RD8,SRC|ABS|MEMRELAX|A16LIST,E}}EOP, - SOP(O(O_MOV_TO_REG,SB),6,"mov.b"),{{ABS|SRC|L_32|MEMRELAX,RD8,E }}, {{ 0x6,0xA,0x2,RD8,SRC|ABS|MEMRELAX|A32LIST,E }}EOP, - SOP(O(O_MOV_TO_MEM,SB),4,"mov.b"),{{RS8,ABS|L_16|MEMRELAX|DST,E}}, {{ 0x6,0xA,0x8,RS8,DST|ABS|MEMRELAX|A16LIST,E}}EOP, - SOP(O(O_MOV_TO_MEM,SB),6,"mov.b"),{{RS8,ABS|DST|L_32|MEMRELAX,E }}, {{ 0x6,0xA,0xA,RS8,DST|ABS|MEMRELAX|A32LIST,E }}EOP, - - SOP(O(O_MOV_TO_REG,SB),6,"mov.b"),{{DISP|L_32|SRC,RD8,E}}, {{ 0x7,0x8,B30|DISPREG,0x0,0x6,0xA,0x2,RD8,SRC|DISP32LIST,E}}EOP, - SOP(O(O_MOV_TO_MEM,SB),6,"mov.b"),{{RS8,DISP|L_32|DST,E}}, {{ 0x7,0x8,B30|DISPREG,0x0,0x6,0xA,0xA,RS8,DST|DISP32LIST,E}}EOP, - - - - SOP(O(O_MOV_TO_REG,SB),2,"mov.b"),{{RS8,RD8,E}}, {{ 0x0,0xC,RS8,RD8,E,0,0,0,0}}EOP, - SOP(O(O_MOV_TO_REG,SB),2,"mov.b"),{{IMM8,RD8,E}}, {{ 0xF,RD8,IMM8,IGNORE,E,0,0,0,0}}EOP, - SOP(O(O_MOV_TO_REG,SB),4,"mov.b"),{{RSIND,RD8,E}}, {{ 0x6,0x8,B30|RSIND,RD8,E,0,0,0,0}}EOP, - SOP(O(O_MOV_TO_REG,SB),6,"mov.b"),{{DISP16SRC,RD8,E}}, {{ 0x6,0xE,B30|DISPREG,RD8,DISP16SRC,IGNORE,IGNORE,IGNORE,E}}EOP, - SOP(O(O_MOV_TO_REG,SB),6,"mov.b"),{{RSINC,RD8,E}}, {{ 0x6,0xC,B30|RSINC,RD8,E,0,0,0,0}}EOP, - - SOP(O(O_MOV_TO_REG,SB),4,"mov.b"),{{ABS8SRC,RD8,E}}, {{ 0x2,RD8,ABS8SRC,IGNORE,E,0,0,0,0}}EOP, - SOP(O(O_MOV_TO_MEM,SB),4,"mov.b"),{{RS8,RDIND,E}}, {{ 0x6,0x8,RDIND|B31,RS8,E,0,0,0,0}}EOP, - SOP(O(O_MOV_TO_MEM,SB),6,"mov.b"),{{RS8,DISP16DST,E}}, {{ 0x6,0xE,DISPREG|B31,RS8,DISP16DST,IGNORE,IGNORE,IGNORE,E}}EOP, - SOP(O(O_MOV_TO_MEM,SB),6,"mov.b"),{{RS8,RDDEC|B31,E}}, {{ 0x6,0xC,RDDEC|B31,RS8,E,0,0,0,0}}EOP, - - SOP(O(O_MOV_TO_MEM,SB),4,"mov.b"),{{RS8,ABS8DST,E}}, {{ 0x3,RS8,ABS8DST,IGNORE,E,0,0,0,0}}EOP, - - SOP(O(O_MOV_TO_MEM,SW),6,"mov.w"),{{RS16,RDIND,E}}, {{ 0x6,0x9,RDIND|B31,RS16,E,0,0,0,0}}EOP, - SOP(O(O_MOV_TO_REG,SW),6,"mov.w"),{{DISP|L_32|SRC,RD16,E}},{{ 0x7,0x8,B30|DISPREG,0x0,0x6,0xB,0x2,RD16,SRC|DISP32LIST,E}}EOP, - SOP(O(O_MOV_TO_MEM,SW),6,"mov.w"),{{RS16,DISP|L_32|DST,E}},{{ 0x7,0x8,B30|DISPREG,0x0,0x6,0xB,0xA,RS16,DST|DISP32LIST,E}}EOP, - SOP(O(O_MOV_TO_REG,SW),6,"mov.w"),{{ABS|L_32|MEMRELAX|SRC,RD16,E }},{{ 0x6,0xB,0x2,RD16,SRC|MEMRELAX|ABS32LIST,E }}EOP, - SOP(O(O_MOV_TO_MEM,SW),6,"mov.w"),{{RS16,ABS|L_32|MEMRELAX|DST,E }},{{ 0x6,0xB,0xA,RS16,DST|MEMRELAX|ABS32LIST,E }}EOP, - SOP(O(O_MOV_TO_REG,SW),2,"mov.w"),{{RS16,RD16,E}}, {{ 0x0,0xD,RS16, RD16,E,0,0,0,0}}EOP, - SOP(O(O_MOV_TO_REG,SW),4,"mov.w"),{{IMM16,RD16,E}}, {{ 0x7,0x9,0x0,RD16,IMM16,IGNORE,IGNORE,IGNORE,E}}EOP, - SOP(O(O_MOV_TO_REG,SW),4,"mov.w"),{{RSIND,RD16,E}}, {{ 0x6,0x9,B30|RSIND,RD16,E,0,0,0,0}}EOP, - SOP(O(O_MOV_TO_REG,SW),6,"mov.w"),{{DISP16SRC,RD16,E}}, {{ 0x6,0xF,B30|DISPREG,RD16,DISP16SRC,IGNORE,IGNORE,IGNORE,E}}EOP, - SOP(O(O_MOV_TO_REG,SW),6,"mov.w"),{{RSINC,RD16,E}}, {{ 0x6,0xD,B30|RSINC,RD16,E,0,0,0,0}}EOP, - SOP(O(O_MOV_TO_REG,SW),6,"mov.w"),{{ABS16SRC,RD16,E}}, {{ 0x6,0xB,0x0,RD16,ABS16SRC,IGNORE,IGNORE,IGNORE,E}}EOP, - - SOP(O(O_MOV_TO_MEM,SW),6,"mov.w"),{{RS16,DISP16DST,E}}, {{ 0x6,0xF,DISPREG|B31,RS16,DISP16DST,IGNORE,IGNORE,IGNORE,E}}EOP, - SOP(O(O_MOV_TO_MEM,SW),6,"mov.w"),{{RS16,RDDEC,E}}, {{ 0x6,0xD,RDDEC|B31,RS16,E,0,0,0,0}}EOP, - SOP(O(O_MOV_TO_MEM,SW),6,"mov.w"),{{RS16,ABS16DST,E}}, {{ 0x6,0xB,0x8,RS16,ABS16DST,IGNORE,IGNORE,IGNORE,E}}EOP, - - SOP(O(O_MOV_TO_REG,SL),4,"mov.l"),{{IMM32,RD32,E}}, {{ 0x7,0xA,0x0,B30|RD32,IMM32LIST,E}}EOP, - SOP(O(O_MOV_TO_REG,SL),2,"mov.l"),{{RS32,RD32,E}}, {{ 0x0,0xF,B31|RS32,B30|RD32,E,0,0,0,0}}EOP, - - SOP(O(O_MOV_TO_REG,SL),4,"mov.l"),{{RSIND,RD32,E}}, {{ PREFIX32,0x6,0x9,RSIND|B30,B30|RD32,E,0,0,0,0 }}EOP, - SOP(O(O_MOV_TO_REG,SL),6,"mov.l"),{{DISP16SRC,RD32,E}}, {{ PREFIX32,0x6,0xF,DISPREG|B30,B30|RD32,DISP16SRC,IGNORE,IGNORE,IGNORE,E }}EOP, - SOP(O(O_MOV_TO_REG,SL),6,"mov.l"),{{DISP|L_32|SRC,RD32,E}},{{ PREFIX32,0x7,0x8,B30|DISPREG,0x0,0x6,0xB,0x2,B30|RD32,SRC|DISP32LIST,E }}EOP, - SOP(O(O_MOV_TO_REG,SL),6,"mov.l"),{{RSINC,RD32,E}}, {{ PREFIX32,0x6,0xD,B30|RSINC,B30|RD32,E,0,0,0,0 }}EOP, - SOP(O(O_MOV_TO_REG,SL),6,"mov.l"),{{ABS16SRC,RD32,E}}, {{ PREFIX32,0x6,0xB,0x0,B30|RD32,ABS16SRC,IGNORE,IGNORE,IGNORE,E }}EOP, - SOP(O(O_MOV_TO_REG,SL),6,"mov.l"),{{ABS32SRC|MEMRELAX,RD32,E }}, {{ PREFIX32,0x6,0xB,0x2,B30|RD32,SRC|MEMRELAX|ABS32LIST,E }}EOP, - SOP(O(O_MOV_TO_MEM,SL),6,"mov.l"),{{RS32,RDIND,E}}, {{ PREFIX32,0x6,0x9,RDIND|B31,B30|RS32,E,0,0,0,0 }}EOP, - SOP(O(O_MOV_TO_MEM,SL),6,"mov.l"),{{RS32,DISP16DST,E}}, {{ PREFIX32,0x6,0xF,DISPREG|B31,B30|RS32,DISP16DST,IGNORE,IGNORE,IGNORE,E }}EOP, - SOP(O(O_MOV_TO_MEM,SL),6,"mov.l"),{{RS32,DISP|L_32|DST,E}},{{ PREFIX32,0x7,0x8,B31|DISPREG,0x0,0x6,0xB,0xA,B30|RS32,DST|DISP32LIST,E }}EOP, - SOP(O(O_MOV_TO_MEM,SL),6,"mov.l"),{{RS32,RDDEC,E}}, {{ PREFIX32,0x6,0xD,RDDEC|B31,B30|RS32,E,0,0,0,0 }}EOP, - SOP(O(O_MOV_TO_MEM,SL),6,"mov.l"),{{RS32,ABS16DST,E}}, {{ PREFIX32,0x6,0xB,0x8,B30|RS32,ABS16DST,IGNORE,IGNORE,IGNORE,E }}EOP, - SOP(O(O_MOV_TO_MEM,SL),6,"mov.l"),{{RS32,ABS32DST|MEMRELAX,E }}, {{ PREFIX32,0x6,0xB,0xA,B30|RS32,DST|MEMRELAX|ABS32LIST,E }}EOP, - - SOP(O(O_MOV_TO_REG,SB),10,"movfpe"),{{ABS16SRC,RD8,E}},{{ 0x6,0xA,0x4,RD8,ABS16SRC,IGNORE,IGNORE,IGNORE,E}}EOP, - SOP(O(O_MOV_TO_MEM,SB),10,"movtpe"),{{RS8,ABS16DST,E}},{{ 0x6,0xA,0xC,RS8,ABS16DST,IGNORE,IGNORE,IGNORE,E}}EOP, - - NEW_SOP(O(O_MULU,SB),1,14,"mulxu.b"),{{RS8,RD16,E}}, {{ 0x5,0x0,RS8,RD16,E,0,0,0,0}}EOP, - NEW_SOP(O(O_MULU,SW),0,14,"mulxu.w"),{{RS16,RD32,E}},{{ 0x5,0x2,RS16,B30|RD32,E,0,0,0,0}}EOP, - - NEW_SOP(O(O_MULS,SB),0,20,"mulxs.b"),{{RS8,RD16,E}}, {{ 0x0,0x1,0xc,0x0,0x5,0x0,RS8,RD16,E}}EOP, - NEW_SOP(O(O_MULS,SW),0,20,"mulxs.w"),{{RS16,RD32,E}},{{ 0x0,0x1,0xc,0x0,0x5,0x2,RS16,B30|RD32,E}}EOP, - - /* ??? This can use UNOP3. */ - NEW_SOP(O(O_NEG,SB),1,2,"neg.b"),{{ OR8,E, 0}},{{ 0x1,0x7,0x8,OR8,E,0,0,0,0}}EOP, - NEW_SOP(O(O_NEG,SW),0,2,"neg.w"),{{ OR16,E,0}},{{ 0x1,0x7,0x9,OR16,E}}EOP, - NEW_SOP(O(O_NEG,SL),0,2,"neg.l"),{{ OR32,E,0}},{{ 0x1,0x7,0xB,B30|OR32,E}}EOP, - - NEW_SOP(O(O_NOP,SN),1,2,"nop"),{{E,0,0}},{{ 0x0,0x0,0x0,0x0,E,0,0,0,0}}EOP, - - /* ??? This can use UNOP3. */ - NEW_SOP(O(O_NOT,SB),1,2,"not.b"),{{ OR8,E, 0}},{{ 0x1,0x7,0x0,OR8,E,0,0,0,0}}EOP, - NEW_SOP(O(O_NOT,SW),0,2,"not.w"),{{ OR16,E,0}},{{ 0x1,0x7,0x1,OR16,E}}EOP, - NEW_SOP(O(O_NOT,SL),0,2,"not.l"),{{ OR32,E,0}},{{ 0x1,0x7,0x3,B30|OR32,E}}EOP, - - TWOOP(O(O_OR, SB),"or.b",0xC,0x1,0x4), - NEW_SOP(O(O_OR,SW),0,4,"or.w"),{{IMM16,RD16,E }},{{0x7,0x9,0x4,RD16,IMM16,IGNORE,IGNORE,IGNORE,E}} EOP, - NEW_SOP(O(O_OR,SW),0,2,"or.w"),{{RS16,RD16,E }},{{0x6,0x4,RS16,RD16,E}} EOP, - - NEW_SOP(O(O_OR,SL),0,6,"or.l"),{{IMM32,RD32,E }},{{0x7,0xA,0x4,B30|RD32,IMM32LIST,E}} EOP, - NEW_SOP(O(O_OR,SL),0,2,"or.l"),{{RS32,RD32,E }},{{0x0,0x1,0xF,0x0,0x6,0x4,B30|RS32,B30|RD32,E}} EOP, - - NEW_SOP(O(O_ORC,SB),1,2,"orc"),{{IMM8,CCR|DST,E}},{{ 0x0,0x4,IMM8,IGNORE,E,0,0,0,0}}EOP, - NEW_SOP(O(O_ORC,SB),1,2,"orc"),{{IMM8,EXR|DST,E}},{{ 0x0,0x1,0x4,0x1,0x0,0x4,IMM8,IGNORE,E,0,0,0,0}}EOP, - - NEW_SOP(O(O_MOV_TO_REG,SW),1,6,"pop.w"),{{OR16,E,0}},{{ 0x6,0xD,0x7,OR16,E,0,0,0,0}}EOP, - NEW_SOP(O(O_MOV_TO_REG,SL),0,6,"pop.l"),{{OR32,E,0}},{{ PREFIX32,0x6,0xD,0x7,OR32|B30,E,0,0,0,0}}EOP, - NEW_SOP(O(O_MOV_TO_MEM,SW),1,6,"push.w"),{{OR16,E,0}},{{ 0x6,0xD,0xF,OR16,E,0,0,0,0}}EOP, - NEW_SOP(O(O_MOV_TO_MEM,SL),0,6,"push.l"),{{OR32,E,0}},{{ PREFIX32,0x6,0xD,0xF,OR32|B30,E,0,0,0,0}}EOP, - - UNOP3(O_ROTL, "rotl", 0x1,0x2,0x8), - UNOP3(O_ROTR, "rotr", 0x1,0x3,0x8), - UNOP3(O_ROTXL, "rotxl",0x1,0x2,0x0), - UNOP3(O_ROTXR, "rotxr",0x1,0x3,0x0), - - SOP(O(O_BPT,SN), 10,"bpt"),{{E,0,0}},{{ 0x7,0xA,0xF,0xF,E,0,0,0,0}}EOP, - SOP(O(O_RTE,SN), 10,"rte"),{{E,0,0}},{{ 0x5,0x6,0x7,0x0,E,0,0,0,0}}EOP, - SOP(O(O_RTS,SN), 8,"rts"),{{E,0,0}},{{ 0x5,0x4,0x7,0x0,E,0,0,0,0}}EOP, - - UNOP3(O_SHAL, "shal",0x1,0x0,0x8), - UNOP3(O_SHAR, "shar",0x1,0x1,0x8), - UNOP3(O_SHLL, "shll",0x1,0x0,0x0), - UNOP3(O_SHLR, "shlr",0x1,0x1,0x0), - - SOP(O(O_SLEEP,SN),2,"sleep"),{{E,0,0}},{{ 0x0,0x1,0x8,0x0,E,0,0,0,0}} EOP, - - NEW_SOP(O(O_STC,SB), 1,2,"stc"),{{CCR|SRC,RD8,E}},{{ 0x0,0x2,0x0,RD8,E,0,0,0,0}} EOP, - - NEW_SOP(O(O_STC,SB),0,2,"stc"),{{CCR|SRC,RDIND,E}}, {{PREFIXLDC,0x6,0x9,B31|RDIND,0x0,E}} EOP, - NEW_SOP(O(O_STC,SB),0,2,"stc"),{{CCR|SRC,DISP|DST|L_16,E}},{{PREFIXLDC,0x6,0xF,B31|DISPREG,0,DST|DISP|L_16,IGNORE,IGNORE,IGNORE,E}}EOP, - NEW_SOP(O(O_STC,SB),0,2,"stc"),{{CCR|SRC,DISP|DST|L_32,E}},{{PREFIXLDC,0x7,0x8,B30|DISPREG,0,0x6,0xB,0xA,0x0,DST|DISP32LIST,E}}EOP, - NEW_SOP(O(O_STC,SB),0,2,"stc"),{{CCR|SRC,RDDEC,E}}, {{PREFIXLDC,0x6,0xD,B31|RDDEC,0x0,E}}EOP, - - NEW_SOP(O(O_STC,SB),0,2,"stc"),{{CCR|SRC,ABS16DST,E}}, {{PREFIXLDC,0x6,0xB,0x8,0x0,ABS16DST,IGNORE,IGNORE,IGNORE,E}}EOP, - NEW_SOP(O(O_STC,SB),0,2,"stc"),{{CCR|SRC,ABS32DST,E}}, {{PREFIXLDC,0x6,0xB,0xA,0x0,DST|ABS32LIST,E}}EOP, - - NEW_SOP(O(O_STC,SB), 1,2,"stc"),{{EXR|SRC,RD8,E}},{{ 0x0,0x2,0x1,RD8,E,0,0,0,0}} EOP, - - NEW_SOP(O(O_STC,SB),0,2,"stc"),{{EXR|SRC,RDIND,E}}, {{0x0,0x1,0x4,0x1,0x6,0x9,B31|RDIND,0x0,E}} EOP, - NEW_SOP(O(O_STC,SB),0,2,"stc"),{{EXR|SRC,DISP|DST|L_16,E}},{{0x0,0x1,0x4,0x1,0x6,0xF,B31|DISPREG,0,DST|DISP|L_16,IGNORE,IGNORE,IGNORE,E}}EOP, - NEW_SOP(O(O_STC,SB),0,2,"stc"),{{EXR|SRC,DISP|DST|L_32,E}},{{0x0,0x1,0x4,0x1,0x7,0x8,B30|DISPREG,0,0x6,0xB,0xA,0x0,DST|DISP32LIST,E}}EOP, - NEW_SOP(O(O_STC,SB),0,2,"stc"),{{EXR|SRC,RDDEC,E}}, {{0x0,0x1,0x4,0x1,0x6,0xD,B31|RDDEC,0x0,E}}EOP, - - NEW_SOP(O(O_STC,SB),0,2,"stc"),{{EXR|SRC,ABS16DST,E}}, {{0x0,0x1,0x4,0x1,0x6,0xB,0x8,0x0,ABS16DST,IGNORE,IGNORE,IGNORE,E}}EOP, - NEW_SOP(O(O_STC,SB),0,2,"stc"),{{EXR|SRC,ABS32DST,E}}, {{0x0,0x1,0x4,0x1,0x6,0xB,0xA,0x0,DST|ABS32LIST,E}}EOP, - - SOP(O(O_SUB,SB),2,"sub.b"),{{RS8,RD8,E}},{{ 0x1,0x8,RS8,RD8,E,0,0,0,0}}EOP, - - NEW_SOP(O(O_SUB,SW),1,2,"sub.w"),{{RS16,RD16,E }}, {{0x1,0x9,RS16,RD16,E}} EOP, - NEW_SOP(O(O_SUB,SW),0,4,"sub.w"),{{IMM16,RD16,E }}, {{0x7,0x9,0x3,RD16,IMM16,IGNORE,IGNORE,IGNORE,E}} EOP, - NEW_SOP(O(O_SUB,SL),0,2,"sub.l") ,{{RS32,RD32,E }}, {{0x1,0xA,B31|RS32,B30|RD32,E}} EOP, - NEW_SOP(O(O_SUB,SL),0,6,"sub.l"), {{IMM32,RD32,E }},{{0x7,0xA,0x3,B30|RD32,IMM32LIST,E}} EOP, - - SOP(O(O_SUBS,SL),2,"subs"),{{KBIT,RDP,E}},{{ 0x1,0xB,KBIT,RDP,E,0,0,0,0}}EOP, - TWOOP(O(O_SUBX,SB),"subx",0xB,0x1,0xE), - - NEW_SOP(O(O_TRAPA,SB),0,2,"trapa"),{{ IMM2,E}}, {{0x5,0x7,IMM2,IGNORE,E }}EOP, - NEW_SOP(O(O_TAS,SB),0,2,"tas"),{{RSIND,E}}, {{0x0,0x1,0xe,0x0,0x7,0xb,B30|RSIND,0xc,E }}EOP, - - TWOOP(O(O_XOR, SB),"xor",0xD,0x1,0x5), - - NEW_SOP(O(O_XOR,SW),0,4,"xor.w"),{{IMM16,RD16,E }},{{0x7,0x9,0x5,RD16,IMM16,IGNORE,IGNORE,IGNORE,E}} EOP, - NEW_SOP(O(O_XOR,SW),0,2,"xor.w"),{{RS16,RD16,E }},{{0x6,0x5,RS16,RD16,E}} EOP, - - NEW_SOP(O(O_XOR,SL),0,6,"xor.l"),{{IMM32,RD32,E }},{{0x7,0xA,0x5,B30|RD32,IMM32LIST,E}} EOP, - NEW_SOP(O(O_XOR,SL),0,2,"xor.l") ,{{RS32,RD32,E }},{{0x0,0x1,0xF,0x0,0x6,0x5,B30|RS32,B30|RD32,E}} EOP, - - SOP(O(O_XORC,SB),2,"xorc"),{{IMM8,CCR|DST,E}},{{ 0x0,0x5,IMM8,IGNORE,E,0,0,0,0}}EOP, - SOP(O(O_XORC,SB),2,"xorc"),{{IMM8,EXR|DST,E}},{{ 0x0,0x1,0x4,0x1,0x0,0x5,IMM8,IGNORE,E,0,0,0,0}}EOP, - - 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,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}}} + {O (O_BRAS, SB), AV_H8SX, 0, "bra/s", {{PCREL8, E}}, {{0x4, 0x0, PCREL8, DATA | B01, E}}}, + + {O (O_BSRBC, SB), AV_H8SX, 0, "bsr/bc", {{IMM3, RDIND, OP3PCREL16}}, {{0x7, 0xC, B30 | RDIND, 0x0, 0x5, 0xC, B30 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BSRBC, SB), AV_H8SX, 0, "bsr/bc", {{IMM3, ABS8DST, OP3PCREL16}}, {{0x7, 0xE, DSTABS8LIST, 0x5, 0xC, B30 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BSRBC, SB), AV_H8SX, 0, "bsr/bc", {{IMM3, ABS16DST, OP3PCREL16}}, {{0x6, 0xA, 0x1, 0x0, DSTABS16LIST, 0x5, 0xC, B30 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BSRBC, SB), AV_H8SX, 0, "bsr/bc", {{IMM3, ABS32DST, OP3PCREL16}}, {{0x6, 0xA, 0x3, 0x0, DSTABS32LIST, 0x5, 0xC, B30 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BSRBS, SB), AV_H8SX, 0, "bsr/bs", {{IMM3, RDIND, OP3PCREL16}}, {{0x7, 0xC, B30 | RDIND, 0x0, 0x5, 0xC, B31 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BSRBS, SB), AV_H8SX, 0, "bsr/bs", {{IMM3, ABS8DST, OP3PCREL16}}, {{0x7, 0xE, DSTABS8LIST, 0x5, 0xC, B31 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BSRBS, SB), AV_H8SX, 0, "bsr/bs", {{IMM3, ABS16DST, OP3PCREL16}}, {{0x6, 0xA, 0x1, 0x0, DSTABS16LIST, 0x5, 0xC, B31 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + {O (O_BSRBS, SB), AV_H8SX, 0, "bsr/bs", {{IMM3, ABS32DST, OP3PCREL16}}, {{0x6, 0xA, 0x3, 0x0, DSTABS32LIST, 0x5, 0xC, B31 | IMM3, 0x0, OP3PCREL16, DATA3, E}}}, + + BRANCH (O (O_BRA, SB), "bt", 0x0), + BRANCH (O (O_BRN, SB), "brn", 0x1), + BRANCH (O (O_BRN, SB), "bf", 0x1), + BRANCH (O (O_BHI, SB), "bhi", 0x2), + BRANCH (O (O_BLS, SB), "bls", 0x3), + BRANCH (O (O_BCC, SB), "bcc", 0x4), + BRANCH (O (O_BCC, SB), "bhs", 0x4), + BRANCH (O (O_BCS, SB), "bcs", 0x5), + BRANCH (O (O_BCS, SB), "blo", 0x5), + BRANCH (O (O_BNE, SB), "bne", 0x6), + BRANCH (O (O_BEQ, SB), "beq", 0x7), + BRANCH (O (O_BVC, SB), "bvc", 0x8), + BRANCH (O (O_BVS, SB), "bvs", 0x9), + BRANCH (O (O_BPL, SB), "bpl", 0xA), + BRANCH (O (O_BMI, SB), "bmi", 0xB), + BRANCH (O (O_BGE, SB), "bge", 0xC), + BRANCH (O (O_BLT, SB), "blt", 0xD), + BRANCH (O (O_BGT, SB), "bgt", 0xE), + BRANCH (O (O_BLE, SB), "ble", 0xF), + + EBITOP (O (O_BCLR, SB), IMM3 | B30, "bclr", 0x6, 0x2, 0x7, 0xD, 0x7, 0xF, 0x8, 0), + BITOP (O (O_BAND, SB), IMM3 | B30, "band", 0x7, 0x6, 0x7, 0xC, 0x7, 0xE, 0x0, 0), + BITOP (O (O_BIAND, SB), IMM3 | B31, "biand", 0x7, 0x6, 0x7, 0xC, 0x7, 0xE, 0x0, 0), + BITOP (O (O_BILD, SB), IMM3 | B31, "bild", 0x7, 0x7, 0x7, 0xC, 0x7, 0xE, 0x0, 0), + BITOP (O (O_BIOR, SB), IMM3 | B31, "bior", 0x7, 0x4, 0x7, 0xC, 0x7, 0xE, 0x0, 0), + BITOP (O (O_BIST, SB), IMM3 | B31, "bist", 0x6, 0x7, 0x7, 0xD, 0x7, 0xF, 0x8, 0), + BITOP (O (O_BIXOR, SB), IMM3 | B31, "bixor", 0x7, 0x5, 0x7, 0xC, 0x7, 0xE, 0x0, 0), + BITOP (O (O_BLD, SB), IMM3 | B30, "bld", 0x7, 0x7, 0x7, 0xC, 0x7, 0xE, 0x0, 0), + EBITOP (O (O_BNOT, SB), IMM3 | B30, "bnot", 0x6, 0x1, 0x7, 0xD, 0x7, 0xF, 0x8, 0), + BITOP (O (O_BOR, SB), IMM3 | B30, "bor", 0x7, 0x4, 0x7, 0xC, 0x7, 0xE, 0x0, 0), + EBITOP (O (O_BSET, SB), IMM3 | B30, "bset", 0x6, 0x0, 0x7, 0xD, 0x7, 0xF, 0x8, 0), + BITOP (O (O_BST, SB), IMM3 | B30, "bst", 0x6, 0x7, 0x7, 0xD, 0x7, 0xF, 0x8, 0), + EBITOP (O (O_BTST, SB), IMM3 | B30, "btst", 0x6, 0x3, 0x7, 0xC, 0x7, 0xE, 0x0, 0), + BITOP (O (O_BXOR, SB), IMM3 | B30, "bxor", 0x7, 0x5, 0x7, 0xC, 0x7, 0xE, 0x0, 0), + + EBITOP_B (O (O_BCLREQ, SB), IMM3 | B30, "bclr/eq", 0x6, 0x2, 0x7, 0xD, 0x7, 0xF, 0x8, 0x7), + EBITOP_B (O (O_BCLRNE, SB), IMM3 | B30, "bclr/ne", 0x6, 0x2, 0x7, 0xD, 0x7, 0xF, 0x8, 0x6), + EBITOP_B (O (O_BSETEQ, SB), IMM3 | B30, "bset/eq", 0x6, 0x0, 0x7, 0xD, 0x7, 0xF, 0x8, 0x7), + EBITOP_B (O (O_BSETNE, SB), IMM3 | B30, "bset/ne", 0x6, 0x0, 0x7, 0xD, 0x7, 0xF, 0x8, 0x6), + BITOP_B (O (O_BISTZ, SB), IMM3 | B31, "bistz", 0x6, 0x7, 0x7, 0xD, 0x7, 0xF, 0x8, 0x7), + BITOP_B (O (O_BSTZ, SB), IMM3 | B30, "bstz", 0x6, 0x7, 0x7, 0xD, 0x7, 0xF, 0x8, 0x7), + + {O (O_BFLD, SB), AV_H8SX, 0, "bfld", {{IMM8, RDIND, R3_8}}, {{0x7, 0xC, B30 | RDIND, 0x0, 0xF, R3_8, IMM8LIST, E}}}, + {O (O_BFLD, SB), AV_H8SX, 0, "bfld", {{IMM8, ABS8DST, R3_8}}, {{0x7, 0xE, DSTABS8LIST, 0xF, R3_8, IMM8LIST, E}}}, + {O (O_BFLD, SB), AV_H8SX, 0, "bfld", {{IMM8, ABS16DST, R3_8}}, {{0x6, 0xA, 0x1, 0x0, DSTABS16LIST, 0xF, R3_8, IMM8LIST, E}}}, + {O (O_BFLD, SB), AV_H8SX, 0, "bfld", {{IMM8, ABS32DST, R3_8}}, {{0x6, 0xA, 0x3, 0x0, DSTABS32LIST, 0xF, R3_8, IMM8LIST, E}}}, + + /* Because the assembler treats SRC, DST and OP3 as ordinals, + I must designate the second argument, an immediate value, as DST. + May God have mercy on my soul. */ + {O (O_BFST, SB), AV_H8SX, 0, "bfst", {{RS8, DST | IMM8, R3_IND}}, {{0x7, 0xD, B30 | R3_IND, 0x0, 0xF, RS8, DST | IMM8LIST, E}}}, + {O (O_BFST, SB), AV_H8SX, 0, "bfst", {{RS8, DST | IMM8, ABS8OP3}}, {{0x7, 0xF, OP3ABS8LIST, 0xF, RS8, DST | IMM8LIST, E}}}, + {O (O_BFST, SB), AV_H8SX, 0, "bfst", {{RS8, DST | IMM8, ABS16OP3}}, {{0x6, 0xA, 0x1, 0x8, OP3ABS16LIST, 0xF, RS8, DST | IMM8LIST, E}}}, + {O (O_BFST, SB), AV_H8SX, 0, "bfst", {{RS8, DST | IMM8, ABS32OP3}}, {{0x6, 0xA, 0x3, 0x8, OP3ABS32LIST, 0xF, RS8, DST | IMM8LIST, E}}}, + + {O (O_BSR, SB), AV_H8, 6, "bsr", {{PCREL8, E}}, {{0x5, 0x5, PCREL8, DATA, E}}}, + {O (O_BSR, SB), AV_H8, 6, "bsr", {{PCREL16, E}}, {{0x5, 0xC, 0x0, 0x0, PCREL16, DATA3, E}}}, + {O (O_BSR, SB), AV_H8SX, 0, "bsr", {{LOWREG | L_8, E}}, {{0x5, 0xd, B30 | LOWREG | L_8, 0x5, E}}}, + {O (O_BSR, SW), AV_H8SX, 0, "bsr", {{LOWREG | L_16, E}}, {{0x5, 0xd, B30 | LOWREG | L_16, 0x6, E}}}, + {O (O_BSR, SL), AV_H8SX, 0, "bsr", {{OR32, E}}, {{0x5, 0xd, B30 | OR32, 0x7, E}}}, + + {O (O_CMP, SB), AV_H8, 2, "cmp.b", {{IMM8, RD8, E}}, {{0xa, RD8, IMM8LIST, E}}}, + EXPAND_TWOOP_B (O (O_CMP, SB), "cmp.b", 0xa, 0x1, 0xc, 0x2, B00), + + {O (O_CMP, SW), AV_H8, 2, "cmp.w", {{RS16, RD16, E}}, {{0x1, 0xd, RS16, RD16, E}}}, + {O (O_CMP, SW), AV_H8SX, 0, "cmp.w", {{IMM3NZ_NS, RD16, E}}, {{0x1, 0xf, B30 | IMM3NZ, RD16, E}}}, + {O (O_CMP, SW), AV_H8SX, 0, "cmp.w", {{IMM3NZ_NS, RDIND, E}}, {{0x7, 0xd, B31 | RDIND, IGNORE, 0x1, 0xf, B30 | IMM3NZ, IGNORE, E}}}, + {O (O_CMP, SW), AV_H8SX, 0, "cmp.w", {{IMM3NZ_NS, ABS16DST, E}}, {{0x6, 0xb, 0x1, B31 | IGNORE, DSTABS16LIST, 0x1, 0xf, B30 | IMM3NZ, IGNORE, E}}}, + {O (O_CMP, SW), AV_H8SX, 0, "cmp.w", {{IMM3NZ_NS, ABS32DST, E}}, {{0x6, 0xb, 0x3, B31 | IGNORE, DSTABS32LIST, 0x1, 0xf, B30 | IMM3NZ, IGNORE, E}}}, + EXPAND_TWOOP_W (O (O_CMP, SW), "cmp.w", 0x1, 0xd, 0x2), + + {O (O_CMP, SL), AV_H8H, 6, "cmp.l", {{RS32, RD32, E}}, {{0x1, 0xf, B31 | RS32, B30 | RD32, E}}}, + {O (O_CMP, SL), AV_H8SX, 0, "cmp.l", {{IMM3NZ_NS, RD32, E}}, {{0x1, 0xf, B31 | IMM3NZ, B31 | RD32, E}}}, + EXPAND_TWOOP_L (O (O_CMP, SL), "cmp.l", 0x2), + + UNOP (O (O_DAA, SB), "daa", 0x0, 0xF), + UNOP (O (O_DAS, SB), "das", 0x1, 0xF), + UNOP (O (O_DEC, SB), "dec.b", 0x1, 0xA), + + {O (O_DEC, SW), AV_H8H, 2, "dec.w", {{DBIT, RD16, E}}, {{0x1, 0xB, 0x5 | DBIT, RD16, E}}}, + {O (O_DEC, SL), AV_H8H, 2, "dec.l", {{DBIT, RD32, E}}, {{0x1, 0xB, 0x7 | DBIT, RD32 | B30, E}}}, + + {O (O_DIVS, SW), AV_H8SX, 0, "divs.w", {{IMM4, RD16, E}}, {{0x0, 0x1, 0xd, 0x6, 0x5, 0x1, IMM4, RD16, E}}}, + {O (O_DIVS, SW), AV_H8SX, 0, "divs.w", {{RS16, RD16, E}}, {{0x0, 0x1, 0xd, 0x2, 0x5, 0x1, RS16, RD16, E}}}, + {O (O_DIVS, SL), AV_H8SX, 0, "divs.l", {{IMM4, RD32, E}}, {{0x0, 0x1, 0xd, 0x6, 0x5, 0x3, IMM4, B30 | RD32, E}}}, + {O (O_DIVS, SL), AV_H8SX, 0, "divs.l", {{RS32, RD32, E}}, {{0x0, 0x1, 0xd, 0x2, 0x5, 0x3, B30 | RS32, B30 | RD32, E}}}, + + {O (O_DIVU, SW), AV_H8SX, 0, "divu.w", {{IMM4, RD16, E}}, {{0x0, 0x1, 0xd, 0xe, 0x5, 0x1, IMM4, RD16, E}}}, + {O (O_DIVU, SW), AV_H8SX, 0, "divu.w", {{RS16, RD16, E}}, {{0x0, 0x1, 0xd, 0xa, 0x5, 0x1, RS16, RD16, E}}}, + {O (O_DIVU, SL), AV_H8SX, 0, "divu.l", {{IMM4, RD32, E}}, {{0x0, 0x1, 0xd, 0xe, 0x5, 0x3, IMM4, B30 | RD32, E}}}, + {O (O_DIVU, SL), AV_H8SX, 0, "divu.l", {{RS32, RD32, E}}, {{0x0, 0x1, 0xd, 0xa, 0x5, 0x3, B30 | RS32, B30 | RD32, E}}}, + + {O (O_DIVXS, SB), AV_H8SX, 0, "divxs.b", {{IMM4, RD16, E}}, {{0x0, 0x1, 0xD, 0x4, 0x5, 0x1, IMM4, RD16, E}}}, + {O (O_DIVXS, SB), AV_H8H, 13, "divxs.b", {{RS8, RD16, E}}, {{0x0, 0x1, 0xD, 0x0, 0x5, 0x1, RS8, RD16, E}}}, + {O (O_DIVXS, SW), AV_H8SX, 0, "divxs.w", {{IMM4, RD32, E}}, {{0x0, 0x1, 0xD, 0x4, 0x5, 0x3, IMM4, B30 | RD32, E}}}, + {O (O_DIVXS, SW), AV_H8H, 21, "divxs.w", {{RS16, RD32, E}}, {{0x0, 0x1, 0xD, 0x0, 0x5, 0x3, RS16, B30 | RD32, E}}}, + + {O (O_DIVXU, SB), AV_H8SX, 0, "divxu.b", {{IMM4, RD16, E}}, {{0x0, 0x1, 0xD, 0xC, 0x5, 0x1, IMM4, RD16, E}}}, + {O (O_DIVXU, SB), AV_H8, 13, "divxu.b", {{RS8, RD16, E}}, {{0x5, 0x1, RS8, RD16, E}}}, + {O (O_DIVXU, SW), AV_H8SX, 0, "divxu.w", {{IMM4, RD32, E}}, {{0x0, 0x1, 0xD, 0xC, 0x5, 0x3, IMM4, B30 | RD32, E}}}, + {O (O_DIVXU, SW), AV_H8H, 21, "divxu.w", {{RS16, RD32, E}}, {{0x5, 0x3, RS16, B30 | RD32, E}}}, + + {O (O_EEPMOV, SB), AV_H8, 4, "eepmov.b", {{E}}, {{0x7, 0xB, 0x5, 0xC, 0x5, 0x9, 0x8, 0xF, E}}}, + {O (O_EEPMOV, SW), AV_H8H, 4, "eepmov.w", {{E}}, {{0x7, 0xB, 0xD, 0x4, 0x5, 0x9, 0x8, 0xF, E}}}, + + EXPAND_UNOP_STD_W (O (O_EXTS, SW), "exts.w", PREFIX_015, 0x1, 0x7, 0xd), + EXPAND_UNOP_STD_L (O (O_EXTS, SL), "exts.l", PREFIX_010, 0x1, 0x7, 0xf), + EXPAND_UNOP_EXTENDED_L (O (O_EXTS, SL), "exts.l", CONST_2, PREFIX_010, 0x1, 0x7, 0xe, 0), + EXPAND_UNOP_STD_W (O (O_EXTU, SW), "extu.w", PREFIX_015, 0x1, 0x7, 0x5), + EXPAND_UNOP_STD_L (O (O_EXTU, SL), "extu.l", PREFIX_010, 0x1, 0x7, 0x7), + EXPAND_UNOP_EXTENDED_L (O (O_EXTU, SL), "extu.l", CONST_2, PREFIX_010, 0x1, 0x7, 0x6, 0), + + UNOP (O (O_INC, SB), "inc", 0x0, 0xA), + + {O (O_INC, SW), AV_H8H, 2, "inc.w", {{DBIT, RD16, E}}, {{0x0, 0xB, 0x5 | DBIT, RD16, E}}}, + {O (O_INC, SL), AV_H8H, 2, "inc.l", {{DBIT, RD32, E}}, {{0x0, 0xB, 0x7 | DBIT, RD32 | B30, E}}}, + + {O (O_JMP, SN), AV_H8, 4, "jmp", {{RSIND, E}}, {{0x5, 0x9, B30 | RSIND, 0x0, E}}}, + {O (O_JMP, SN), AV_H8, 6, "jmp", {{ABSJMP | L_24, E}}, {{0x5, 0xA, SRC | ABSJMP | L_24, DATA5, E}}}, + + {O (O_JMP, SN), AV_H8SX, 0, "jmp", {{ABSJMP | L_32, E}}, {{0x5, 0x9, 0x0, 0x8, ABSJMP | L_32, DATA7, E}}}, + + {O (O_JMP, SN), AV_H8, 8, "jmp", {{MEMIND, E}}, {{0x5, 0xB, SRC | MEMIND, DATA, E}}}, + {O (O_JMP, SN), AV_H8SX, 0, "jmp", {{VECIND, E}}, {{0x5, 0x9, B31 | SRC | VECIND, DATA, E}}}, + + {O (O_JSR, SN), AV_H8, 6, "jsr", {{RSIND, E}}, {{0x5, 0xD, B30 | RSIND, 0x0, E}}}, + {O (O_JSR, SN), AV_H8, 8, "jsr", {{ABSJMP | L_24, E}}, {{0x5, 0xE, SRC | ABSJMP | L_24, DATA5, E}}}, + + {O (O_JSR, SN), AV_H8SX, 0, "jsr", {{ABSJMP | L_32, E}}, {{0x5, 0xD, 0x0, 0x8, ABSJMP | L_32, DATA7, E}}}, + + {O (O_JSR, SN), AV_H8, 8, "jsr", {{MEMIND, E}}, {{0x5, 0xF, SRC | MEMIND, DATA, E}}}, + {O (O_JSR, SN), AV_H8, 8, "jsr", {{VECIND, E}}, {{0x5, 0xD, SRC | VECIND, DATA, E}}}, + + {O (O_LDC, SB), AV_H8, 2, "ldc", {{IMM8, CCR | DST, E}}, {{ 0x0, 0x7, IMM8LIST, E}}}, + {O (O_LDC, SB), AV_H8S, 2, "ldc", {{IMM8, EXR | DST, E}}, {{0x0, 0x1, 0x4, EXR | DST, 0x0, 0x7, IMM8LIST, E}}}, + {O (O_LDC, SB), AV_H8, 2, "ldc", {{RS8, CCR | DST, E}}, {{0x0, 0x3, B30 | CCR | DST, RS8, E}}}, + {O (O_LDC, SB), AV_H8S, 2, "ldc", {{RS8, EXR | DST, E}}, {{0x0, 0x3, B30 | EXR | DST, RS8, E}}}, + {O (O_LDC, SW), AV_H8H, 2, "ldc", {{RSIND, CCR | DST, E}}, {{PREFIXLDC, 0x6, 0x9, B30 | RSIND, IGNORE, E}}}, + {O (O_LDC, SW), AV_H8S, 2, "ldc", {{RSIND, EXR | DST, E}}, {{PREFIXLDC, 0x6, 0x9, B30 | RSIND, IGNORE, E}}}, + {O (O_LDC, SW), AV_H8H, 2, "ldc", {{RSPOSTINC, CCR | DST, E}}, {{PREFIXLDC, 0x6, 0xD, B30 | RSPOSTINC, IGNORE, E}}}, + {O (O_LDC, SW), AV_H8S, 2, "ldc", {{RSPOSTINC, EXR | DST, E}}, {{PREFIXLDC, 0x6, 0xD, B30 | RSPOSTINC, IGNORE, E}}}, + {O (O_LDC, SW), AV_H8H, 2, "ldc", {{DISP16SRC, CCR | DST, E}}, {{PREFIXLDC, 0x6, 0xF, B30 | DISPREG, IGNORE, SRC | DISP16LIST, E}}}, + {O (O_LDC, SW), AV_H8S, 2, "ldc", {{DISP16SRC, EXR | DST, E}}, {{PREFIXLDC, 0x6, 0xF, B30 | DISPREG, IGNORE, SRC | DISP16LIST, E}}}, + {O (O_LDC, SW), AV_H8H, 2, "ldc", {{DISP32SRC, CCR | DST, E}}, {{PREFIXLDC, 0x7, 0x8, B30 | DISPREG, 0x0, 0x6, 0xB, 0x2, IGNORE, SRC | DISP32LIST, E}}}, + {O (O_LDC, SW), AV_H8S, 2, "ldc", {{DISP32SRC, EXR | DST, E}}, {{PREFIXLDC, 0x7, 0x8, B30 | DISPREG, 0x0, 0x6, 0xB, 0x2, IGNORE, SRC | DISP32LIST, E}}}, + {O (O_LDC, SW), AV_H8H, 2, "ldc", {{ABS16SRC, CCR | DST, E}}, {{PREFIXLDC, 0x6, 0xB, 0x0, IGNORE, SRC | ABS16LIST, E}}}, + {O (O_LDC, SW), AV_H8S, 2, "ldc", {{ABS16SRC, EXR | DST, E}}, {{PREFIXLDC, 0x6, 0xB, 0x0, IGNORE, SRC | ABS16LIST, E}}}, + {O (O_LDC, SW), AV_H8H, 2, "ldc", {{ABS32SRC, CCR | DST, E}}, {{PREFIXLDC, 0x6, 0xB, 0x2, IGNORE, SRC | ABS32LIST, E}}}, + {O (O_LDC, SW), AV_H8S, 2, "ldc", {{ABS32SRC, EXR | DST, E}}, {{PREFIXLDC, 0x6, 0xB, 0x2, IGNORE, SRC | ABS32LIST, E}}}, + {O (O_LDC, SL), AV_H8SX, 0, "ldc", {{RS32, B30 | VBR_SBR | DST, E}}, {{0x0, 0x3, B30 | VBR_SBR | DST, RS32, E}}}, + + + {O (O_MOV, SB), AV_H8, 2, "mov.b", {{IMM8, RD8, E}}, {{0xF, RD8, IMM8LIST, E}}}, + {O (O_MOV, SB), AV_H8SX, 0, "mov.b", {{IMM4_NS, ABS16DST, E}}, {{0x6, 0xa, 0xd, IMM4, DSTABS16LIST, E}}}, + {O (O_MOV, SB), AV_H8SX, 0, "mov.b", {{IMM4_NS, ABS32DST, E}}, {{0x6, 0xa, 0xf, IMM4, DSTABS32LIST, E}}}, + MOVFROM_IMM8 (O (O_MOV, SB), PREFIX_017D, "mov.b", IMM8), + + {O (O_MOV, SB), AV_H8, 2, "mov.b", {{RS8, RD8, E}}, {{0x0, 0xC, RS8, RD8, E}}}, + MOVFROM_REG_BW (O (O_MOV, SB), "mov.b", RS8, PREFIX_017, 8, 10, 12, 14, MEMRELAX), + {O (O_MOV, SB), AV_H8, 4, "mov.b", {{RS8, ABS8DST, E}}, {{0x3, RS8, DSTABS8LIST, E}}}, + MOVTO_REG_BW (O (O_MOV, SB), "mov.b", RD8, PREFIX_017, 8, 10, 12, 14, MEMRELAX), + {O (O_MOV, SB), AV_H8, 4, "mov.b", {{ABS8SRC, RD8, E}}, {{0x2, RD8, ABS8LIST, E}}}, + + MOVFROM_STD (O (O_MOV, SB), PREFIX_0178, "mov.b", RSIND, FROM_IND), + MOVFROM_STD (O (O_MOV, SB), PREFIX_0178, "mov.b", RSPOSTINC, FROM_POSTINC), + MOVFROM_STD (O (O_MOV, SB), PREFIX_0178, "mov.b", RSPOSTDEC, FROM_POSTDEC), + MOVFROM_STD (O (O_MOV, SB), PREFIX_0178, "mov.b", RSPREINC, FROM_PREINC), + MOVFROM_STD (O (O_MOV, SB), PREFIX_0178, "mov.b", RSPREDEC, FROM_PREDEC), + MOVFROM_STD (O (O_MOV, SB), PREFIX_0178, "mov.b", DISP2SRC, FROM_DISP2), + MOVFROM_AD (O (O_MOV, SB), PREFIX_0178, "mov.b", DISP16SRC, FROM_DISP16, DISP16LIST), + MOVFROM_AD (O (O_MOV, SB), PREFIX_0178, "mov.b", DISP32SRC, FROM_DISP32, DISP32LIST), + MOVFROM_AD (O (O_MOV, SB), PREFIX_0178, "mov.b", INDEXB16, FROM_DISP16B, DISP16LIST), + MOVFROM_AD (O (O_MOV, SB), PREFIX_0178, "mov.b", INDEXW16, FROM_DISP16W, DISP16LIST), + MOVFROM_AD (O (O_MOV, SB), PREFIX_0178, "mov.b", INDEXL16, FROM_DISP16L, DISP16LIST), + MOVFROM_AD (O (O_MOV, SB), PREFIX_0178, "mov.b", INDEXB32, FROM_DISP32B, DISP32LIST), + MOVFROM_AD (O (O_MOV, SB), PREFIX_0178, "mov.b", INDEXW32, FROM_DISP32W, DISP32LIST), + MOVFROM_AD (O (O_MOV, SB), PREFIX_0178, "mov.b", INDEXL32, FROM_DISP32L, DISP32LIST), + MOVFROM_AD (O (O_MOV, SB), PREFIX_0178, "mov.b", ABS16SRC, FROM_ABS16, ABS16LIST), + MOVFROM_AD (O (O_MOV, SB), PREFIX_0178, "mov.b", ABS32SRC, FROM_ABS32, ABS32LIST), + + {O (O_MOV, SW), AV_H8SX, 0, "mov.w", {{IMM3NZ_NS, RD16, E}}, {{0x0, 0xf, B30 | IMM3NZ, RD16, E}}}, + {O (O_MOV, SW), AV_H8, 4, "mov.w", {{IMM16, RD16, E}}, {{0x7, 0x9, 0x0, RD16, IMM16LIST, E}}}, + {O (O_MOV, SW), AV_H8SX, 0, "mov.w", {{IMM4_NS, ABS16DST, E}}, {{0x6, 0xb, 0xd, IMM4, DSTABS16LIST, E}}}, + {O (O_MOV, SW), AV_H8SX, 0, "mov.w", {{IMM4_NS, ABS32DST, E}}, {{0x6, 0xb, 0xf, IMM4, DSTABS32LIST, E}}}, + + MOVFROM_IMM8 (O (O_MOV, SW), PREFIX_015D, "mov.w", IMM8U_NS), + MOVFROM_IMM (O (O_MOV, SW), PREFIX_7974, "mov.w", IMM16, IMM16LIST), + + {O (O_MOV, SW), AV_H8, 2, "mov.w", {{RS16, RD16, E}}, {{0x0, 0xD, RS16, RD16, E}}}, + MOVFROM_REG_BW (O (O_MOV, SW), "mov.w", RS16, PREFIX_015, 9, 11, 13, 15, 0), + MOVTO_REG_BW (O (O_MOV, SW), "mov.w", RD16, PREFIX_015, 9, 11, 13, 15, 0), + + MOVFROM_STD (O (O_MOV, SW), PREFIX_0158, "mov.w", RSIND, FROM_IND), + MOVFROM_STD (O (O_MOV, SW), PREFIX_0158, "mov.w", RSPOSTINC, FROM_POSTINC), + MOVFROM_STD (O (O_MOV, SW), PREFIX_0158, "mov.w", RSPOSTDEC, FROM_POSTDEC), + MOVFROM_STD (O (O_MOV, SW), PREFIX_0158, "mov.w", RSPREINC, FROM_PREINC), + MOVFROM_STD (O (O_MOV, SW), PREFIX_0158, "mov.w", RSPREDEC, FROM_PREDEC), + MOVFROM_STD (O (O_MOV, SW), PREFIX_0158, "mov.w", DISP2SRC, FROM_DISP2), + MOVFROM_AD (O (O_MOV, SW), PREFIX_0158, "mov.w", DISP16SRC, FROM_DISP16, DISP16LIST), + MOVFROM_AD (O (O_MOV, SW), PREFIX_0158, "mov.w", DISP32SRC, FROM_DISP32, DISP32LIST), + MOVFROM_AD (O (O_MOV, SW), PREFIX_0158, "mov.w", INDEXB16, FROM_DISP16B, DISP16LIST), + MOVFROM_AD (O (O_MOV, SW), PREFIX_0158, "mov.w", INDEXW16, FROM_DISP16W, DISP16LIST), + MOVFROM_AD (O (O_MOV, SW), PREFIX_0158, "mov.w", INDEXL16, FROM_DISP16L, DISP16LIST), + MOVFROM_AD (O (O_MOV, SW), PREFIX_0158, "mov.w", INDEXB32, FROM_DISP32B, DISP32LIST), + MOVFROM_AD (O (O_MOV, SW), PREFIX_0158, "mov.w", INDEXW32, FROM_DISP32W, DISP32LIST), + MOVFROM_AD (O (O_MOV, SW), PREFIX_0158, "mov.w", INDEXL32, FROM_DISP32L, DISP32LIST), + MOVFROM_AD (O (O_MOV, SW), PREFIX_0158, "mov.w", ABS16SRC, FROM_ABS16, ABS16LIST), + MOVFROM_AD (O (O_MOV, SW), PREFIX_0158, "mov.w", ABS32SRC, FROM_ABS32, ABS32LIST), + + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{IMM3NZ_NS, RD32, E}}, {{0x0, 0xf, B31 | IMM3NZ, B31 | RD32, E}}}, + + MOVFROM_IMM8 (O (O_MOV, SL), PREFIX_010D, "mov.l", IMM8U_NS), + MOVFROM_IMM (O (O_MOV, SL), PREFIX_7A7C, "mov.l", IMM16U_NS, IMM16ULIST), + + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{IMM16U_NS, RD32, E}}, {{0x7, 0xa, 0x0, B31 | RD32, IMM16ULIST, E}}}, + {O (O_MOV, SL), AV_H8H, 4, "mov.l", {{IMM32, RD32, E}}, {{0x7, 0xa, 0x0, B30 | RD32, IMM32LIST, E}}}, + + MOVFROM_IMM (O (O_MOV, SL), PREFIX_7A74, "mov.l", IMM32, IMM32LIST), + + {O (O_MOV, SL), AV_H8H, 2, "mov.l", {{RS32, RD32, E}}, {{0x0, 0xf, B31 | RS32, B30 | RD32, E}}}, + + {O (O_MOV, SL), AV_H8H, 6, "mov.l", {{RS32, RDIND, E}}, {{PREFIX_0100, 0x6, 0x9, B31 | RDIND, B30 | RS32, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{RS32, RDPOSTINC, E}}, {{PREFIX_0103, 0x6, 0xd, B31 | RDPOSTINC, RS32, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{RS32, RDPOSTDEC, E}}, {{PREFIX_0101, 0x6, 0xd, B31 | RDPOSTDEC, RS32, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{RS32, RDPREINC, E}}, {{PREFIX_0102, 0x6, 0xd, B31 | RDPREINC, RS32, E}}}, + {O (O_MOV, SL), AV_H8H, 6, "mov.l", {{RS32, RDPREDEC, E}}, {{PREFIX_0100, 0x6, 0xd, B31 | RDPREDEC, RS32, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{RS32, DISP2DST, E}}, {{PREFIX_010, B30 | B20 | DISP2DST, 0x6, 0x9, B31 | DSTDISPREG, RS32, E}}}, + {O (O_MOV, SL), AV_H8H, 6, "mov.l", {{RS32, DISP16DST, E}}, {{PREFIX_0100, 0x6, 0xf, B31 | DSTDISPREG, RS32, DSTDISP16LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 6, "mov.l", {{RS32, DISP32DST, E}}, {{0x7, 0x8, B31 | DSTDISPREG, 0x0, 0x6, 0xb, 0xa, RS32, DSTDISP32LIST, E}}}, + {O (O_MOV, SL), AV_H8H, 6, "mov.l", {{RS32, DISP32DST, E}}, {{PREFIX_0100, 0x7, 0x8, B31 | DSTDISPREG, 0x0, 0x6, 0xb, 0xa, RS32, DSTDISP32LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{RS32, INDEXB16D, E}}, {{PREFIX_0101, 0x6, 0xf, B31 | DSTDISPREG, RS32, DSTDISP16LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{RS32, INDEXW16D, E}}, {{PREFIX_0102, 0x6, 0xf, B31 | DSTDISPREG, RS32, DSTDISP16LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{RS32, INDEXL16D, E}}, {{PREFIX_0103, 0x6, 0xf, B31 | DSTDISPREG, RS32, DSTDISP16LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{RS32, INDEXB32D, E}}, {{0x7, 0x8, B31 | DSTDISPREG, 0x1, 0x6, 0xb, 0xa, RS32, DSTDISP32LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{RS32, INDEXW32D, E}}, {{0x7, 0x8, B31 | DSTDISPREG, 0x2, 0x6, 0xb, 0xa, RS32, DSTDISP32LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{RS32, INDEXL32D, E}}, {{0x7, 0x8, B31 | DSTDISPREG, 0x3, 0x6, 0xb, 0xa, RS32, DSTDISP32LIST, E}}}, + {O (O_MOV, SL), AV_H8H, 6, "mov.l", {{RS32, ABS16DST, E}}, {{PREFIX_0100, 0x6, 0xb, 0x8, RS32, DSTABS16LIST, E}}}, + {O (O_MOV, SL), AV_H8H, 6, "mov.l", {{RS32, ABS32DST, E}}, {{PREFIX_0100, 0x6, 0xb, 0xa, RS32, MEMRELAX | DSTABS32LIST, E}}}, + + {O (O_MOV, SL), AV_H8H, 4, "mov.l", {{RSIND, RD32, E}}, {{PREFIX_0100, 0x6, 0x9, B30 | RSIND, RD32, E}}}, + {O (O_MOV, SL), AV_H8H, 6, "mov.l", {{RSPOSTINC, RD32, E}}, {{PREFIX_0100, 0x6, 0xd, B30 | RSPOSTINC, RD32, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{RSPOSTDEC, RD32, E}}, {{PREFIX_0102, 0x6, 0xd, B30 | RSPOSTDEC, RD32, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{RSPREINC, RD32, E}}, {{PREFIX_0101, 0x6, 0xd, B30 | RSPREINC, RD32, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{RSPREDEC, RD32, E}}, {{PREFIX_0103, 0x6, 0xd, B30 | RSPREDEC, RD32, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{DISP2SRC, RD32, E}}, {{PREFIX_010, B30 | B20 | DISP2SRC, 0x6, 0x9, B30 | DISPREG, RD32, E}}}, + {O (O_MOV, SL), AV_H8H, 6, "mov.l", {{DISP16SRC, RD32, E}}, {{PREFIX_0100, 0x6, 0xf, B30 | DISPREG, RD32, SRC | DISP16LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 6, "mov.l", {{DISP32SRC, RD32, E}}, {{0x7, 0x8, B31 | DISPREG, 0x0, 0x6, 0xb, 0x2, RD32, SRC | DISP32LIST, E}}}, + {O (O_MOV, SL), AV_H8H, 6, "mov.l", {{DISP32SRC, RD32, E}}, {{PREFIX_0100, 0x7, 0x8, B30 | DISPREG, 0x0, 0x6, 0xb, 0x2, RD32, SRC | DISP32LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{INDEXB16, RD32, E}}, {{PREFIX_0101, 0x6, 0xf, B30 | DISPREG, RD32, SRC | DISP16LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{INDEXW16, RD32, E}}, {{PREFIX_0102, 0x6, 0xf, B30 | DISPREG, RD32, SRC | DISP16LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{INDEXL16, RD32, E}}, {{PREFIX_0103, 0x6, 0xf, B30 | DISPREG, RD32, SRC | DISP16LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{INDEXB32, RD32, E}}, {{0x7, 0x8, B31 | DISPREG, 0x1, 0x6, 0xb, 0x2, RD32, SRC | DISP32LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{INDEXW32, RD32, E}}, {{0x7, 0x8, B31 | DISPREG, 0x2, 0x6, 0xb, 0x2, RD32, SRC | DISP32LIST, E}}}, + {O (O_MOV, SL), AV_H8SX, 0, "mov.l", {{INDEXL32, RD32, E}}, {{0x7, 0x8, B31 | DISPREG, 0x3, 0x6, 0xb, 0x2, RD32, SRC | DISP32LIST, E}}}, + {O (O_MOV, SL), AV_H8H, 6, "mov.l", {{ABS16SRC, RD32, E}}, {{PREFIX_0100, 0x6, 0xb, 0x0, RD32, SRC | ABS16LIST, E}}}, + {O (O_MOV, SL), AV_H8H, 6, "mov.l", {{ABS32SRC, RD32, E}}, {{PREFIX_0100, 0x6, 0xb, 0x2, RD32, SRC | MEMRELAX | ABS32LIST, E}}}, + + MOVFROM_STD (O (O_MOV, SL), PREFIX_0108, "mov.l", RSIND, FROM_IND), + MOVFROM_STD (O (O_MOV, SL), PREFIX_0108, "mov.l", RSPOSTINC, FROM_POSTINC), + MOVFROM_STD (O (O_MOV, SL), PREFIX_0108, "mov.l", RSPOSTDEC, FROM_POSTDEC), + MOVFROM_STD (O (O_MOV, SL), PREFIX_0108, "mov.l", RSPREINC, FROM_PREINC), + MOVFROM_STD (O (O_MOV, SL), PREFIX_0108, "mov.l", RSPREDEC, FROM_PREDEC), + MOVFROM_STD (O (O_MOV, SL), PREFIX_0108, "mov.l", DISP2SRC, FROM_DISP2), + MOVFROM_AD (O (O_MOV, SL), PREFIX_0108, "mov.l", DISP16SRC, FROM_DISP16, DISP16LIST), + MOVFROM_AD (O (O_MOV, SL), PREFIX_0108, "mov.l", DISP32SRC, FROM_DISP32, DISP32LIST), + MOVFROM_AD (O (O_MOV, SL), PREFIX_0108, "mov.l", INDEXB16, FROM_DISP16B, DISP16LIST), + MOVFROM_AD (O (O_MOV, SL), PREFIX_0108, "mov.l", INDEXW16, FROM_DISP16W, DISP16LIST), + MOVFROM_AD (O (O_MOV, SL), PREFIX_0108, "mov.l", INDEXL16, FROM_DISP16L, DISP16LIST), + MOVFROM_AD (O (O_MOV, SL), PREFIX_0108, "mov.l", INDEXB32, FROM_DISP32B, DISP32LIST), + MOVFROM_AD (O (O_MOV, SL), PREFIX_0108, "mov.l", INDEXW32, FROM_DISP32W, DISP32LIST), + MOVFROM_AD (O (O_MOV, SL), PREFIX_0108, "mov.l", INDEXL32, FROM_DISP32L, DISP32LIST), + MOVFROM_AD (O (O_MOV, SL), PREFIX_0108, "mov.l", ABS16SRC, FROM_ABS16, ABS16LIST), + MOVFROM_AD (O (O_MOV, SL), PREFIX_0108, "mov.l", ABS32SRC, FROM_ABS32, ABS32LIST), + +#define DO_MOVA1(TYPE, OP0, OP1) \ + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXB16, TYPE, R3_32}}, {{PREFIX_017F, OP0, OP1, 0x8, B30 | R3_32, DISP16LIST, E}}}, \ + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXW16, TYPE, R3_32}}, {{PREFIX_015F, OP0, OP1, 0x9, B30 | R3_32, DISP16LIST, E}}}, \ + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXB16, TYPE, R3_32}}, {{PREFIX_017F, OP0, OP1, 0xA, B30 | R3_32, DISP16LIST, E}}}, \ + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXW16, TYPE, R3_32}}, {{PREFIX_015F, OP0, OP1, 0xB, B30 | R3_32, DISP16LIST, E}}}, \ + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXB16, TYPE, R3_32}}, {{PREFIX_017F, OP0, OP1, 0xC, B30 | R3_32, DISP16LIST, E}}}, \ + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXW16, TYPE, R3_32}}, {{PREFIX_015F, OP0, OP1, 0xD, B30 | R3_32, DISP16LIST, E}}}, \ +\ + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXB32, TYPE, R3_32}}, {{PREFIX_017F, OP0, OP1, 0x8, B31 | R3_32, DISP32LIST, E}}}, \ + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXW32, TYPE, R3_32}}, {{PREFIX_015F, OP0, OP1, 0x9, B31 | R3_32, DISP32LIST, E}}}, \ + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXB32, TYPE, R3_32}}, {{PREFIX_017F, OP0, OP1, 0xA, B31 | R3_32, DISP32LIST, E}}}, \ + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXW32, TYPE, R3_32}}, {{PREFIX_015F, OP0, OP1, 0xB, B31 | R3_32, DISP32LIST, E}}}, \ + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXB32, TYPE, R3_32}}, {{PREFIX_017F, OP0, OP1, 0xC, B31 | R3_32, DISP32LIST, E}}}, \ + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXW32, TYPE, R3_32}}, {{PREFIX_015F, OP0, OP1, 0xD, B31 | R3_32, DISP32LIST, E}}} + +#define DO_MOVA2(TYPE, OP0, OP1, OP2) \ + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXB16, TYPE, R3_32}}, {{PREFIX_017F, OP0, OP1, 0x8, B30 | R3_32, OP2, DISP16LIST, E}}}, \ + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXW16, TYPE, R3_32}}, {{PREFIX_015F, OP0, OP1, 0x9, B30 | R3_32, OP2, DISP16LIST, E}}}, \ + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXB16, TYPE, R3_32}}, {{PREFIX_017F, OP0, OP1, 0xA, B30 | R3_32, OP2, DISP16LIST, E}}}, \ + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXW16, TYPE, R3_32}}, {{PREFIX_015F, OP0, OP1, 0xB, B30 | R3_32, OP2, DISP16LIST, E}}}, \ + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXB16, TYPE, R3_32}}, {{PREFIX_017F, OP0, OP1, 0xC, B30 | R3_32, OP2, DISP16LIST, E}}}, \ + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXW16, TYPE, R3_32}}, {{PREFIX_015F, OP0, OP1, 0xD, B30 | R3_32, OP2, DISP16LIST, E}}}, \ +\ + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXB32, TYPE, R3_32}}, {{PREFIX_017F, OP0, OP1, 0x8, B31 | R3_32, OP2, DISP32LIST, E}}}, \ + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXW32, TYPE, R3_32}}, {{PREFIX_015F, OP0, OP1, 0x9, B31 | R3_32, OP2, DISP32LIST, E}}}, \ + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXB32, TYPE, R3_32}}, {{PREFIX_017F, OP0, OP1, 0xA, B31 | R3_32, OP2, DISP32LIST, E}}}, \ + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXW32, TYPE, R3_32}}, {{PREFIX_015F, OP0, OP1, 0xB, B31 | R3_32, OP2, DISP32LIST, E}}}, \ + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXB32, TYPE, R3_32}}, {{PREFIX_017F, OP0, OP1, 0xC, B31 | R3_32, OP2, DISP32LIST, E}}}, \ + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXW32, TYPE, R3_32}}, {{PREFIX_015F, OP0, OP1, 0xD, B31 | R3_32, OP2, DISP32LIST, E}}} + + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXB16, E}}, {{0x7, 0xA, 0x8, B31 | DISPREG, DISP16LIST, E}}}, + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXW16, E}}, {{0x7, 0xA, 0x9, B31 | DISPREG, DISP16LIST, E}}}, + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXB16, E}}, {{0x7, 0xA, 0xA, B31 | DISPREG, DISP16LIST, E}}}, + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXW16, E}}, {{0x7, 0xA, 0xB, B31 | DISPREG, DISP16LIST, E}}}, + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXB16, E}}, {{0x7, 0xA, 0xC, B31 | DISPREG, DISP16LIST, E}}}, + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXW16, E}}, {{0x7, 0xA, 0xD, B31 | DISPREG, DISP16LIST, E}}}, + + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXB32, E}}, {{0x7, 0xA, 0x8, B30 | DISPREG, DISP32LIST, E}}}, + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXW32, E}}, {{0x7, 0xA, 0x9, B30 | DISPREG, DISP32LIST, E}}}, + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXB32, E}}, {{0x7, 0xA, 0xA, B30 | DISPREG, DISP32LIST, E}}}, + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXW32, E}}, {{0x7, 0xA, 0xB, B30 | DISPREG, DISP32LIST, E}}}, + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXB32, E}}, {{0x7, 0xA, 0xC, B30 | DISPREG, DISP32LIST, E}}}, + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXW32, E}}, {{0x7, 0xA, 0xD, B30 | DISPREG, DISP32LIST, E}}}, + + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXB16, RD8, R3_32}}, {{0x7, 0x8, RD8, 0x8, 0x7, 0xA, 0x8, B31 | R3_32, DISP16LIST, E}}}, + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXW16, RD16, R3_32}}, {{0x7, 0x8, RD16, 0x9, 0x7, 0xA, 0x9, B31 | R3_32, DISP16LIST, E}}}, + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXB16, RD8, R3_32}}, {{0x7, 0x8, RD8, 0x8, 0x7, 0xA, 0xA, B31 | R3_32, DISP16LIST, E}}}, + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXW16, RD16, R3_32}}, {{0x7, 0x8, RD16, 0x9, 0x7, 0xA, 0xB, B31 | R3_32, DISP16LIST, E}}}, + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXB16, RD8, R3_32}}, {{0x7, 0x8, RD8, 0x8, 0x7, 0xA, 0xC, B31 | R3_32, DISP16LIST, E}}}, + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXW16, RD16, R3_32}}, {{0x7, 0x8, RD16, 0x9, 0x7, 0xA, 0xD, B31 | R3_32, DISP16LIST, E}}}, + + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXB32, RD8, R3_32}}, {{0x7, 0x8, RD8, 0x8, 0x7, 0xA, 0x8, B30 | R3_32, DISP32LIST, E}}}, + {O (O_MOVAB, SL), AV_H8SX, 0, "mova/b.l", {{INDEXW32, RD16, R3_32}}, {{0x7, 0x8, RD16, 0x9, 0x7, 0xA, 0x9, B30 | R3_32, DISP32LIST, E}}}, + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXB32, RD8, R3_32}}, {{0x7, 0x8, RD8, 0x8, 0x7, 0xA, 0xA, B30 | R3_32, DISP32LIST, E}}}, + {O (O_MOVAW, SL), AV_H8SX, 0, "mova/w.l", {{INDEXW32, RD16, R3_32}}, {{0x7, 0x8, RD16, 0x9, 0x7, 0xA, 0xB, B30 | R3_32, DISP32LIST, E}}}, + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXB32, RD8, R3_32}}, {{0x7, 0x8, RD8, 0x8, 0x7, 0xA, 0xC, B30 | R3_32, DISP32LIST, E}}}, + {O (O_MOVAL, SL), AV_H8SX, 0, "mova/l.l", {{INDEXW32, RD16, R3_32}}, {{0x7, 0x8, RD16, 0x9, 0x7, 0xA, 0xD, B30 | R3_32, DISP32LIST, E}}}, + + DO_MOVA1 (RDIND, 0x0, B30 | RDIND), + DO_MOVA1 (RDPOSTINC, 0x8, B30 | RDPOSTINC), + DO_MOVA1 (RDPOSTDEC, 0xA, B30 | RDPOSTDEC), + DO_MOVA1 (RDPREINC, 0x9, B30 | RDPREINC), + DO_MOVA1 (RDPREDEC, 0xB, B30 | RDPREDEC), + DO_MOVA1 (DISP2DST, B30 | B20 | DISP2DST, B30 | DSTDISPREG), + DO_MOVA2 (DISP16DST, 0xC, B30 | DSTDISPREG, DSTDISP16LIST), + DO_MOVA2 (DISP32DST, 0xC, B31 | DSTDISPREG, DSTDISP32LIST), + DO_MOVA2 (INDEXB16 | DST, 0xD, B30 | DSTDISPREG, DSTDISP16LIST), + DO_MOVA2 (INDEXW16 | DST, 0xE, B30 | DSTDISPREG, DSTDISP16LIST), + DO_MOVA2 (INDEXL16 | DST, 0xF, B30 | DSTDISPREG, DSTDISP16LIST), + DO_MOVA2 (INDEXB32 | DST, 0xD, B31 | DSTDISPREG, DSTDISP32LIST), + DO_MOVA2 (INDEXW32 | DST, 0xE, B31 | DSTDISPREG, DSTDISP32LIST), + DO_MOVA2 (INDEXL32 | DST, 0xF, B31 | DSTDISPREG, DSTDISP32LIST), + DO_MOVA2 (ABS16DST | DST, 0x4, 0x0, DSTABS16LIST), + DO_MOVA2 (ABS32DST | DST, 0x4, 0x8, DSTABS32LIST), + + {O (O_MOV, SB), AV_H8, 10, "movfpe", {{ABS16SRC, RD8, E}}, {{0x6, 0xA, 0x4, RD8, ABS16SRC, DATA3, E}}}, + {O (O_MOV, SB), AV_H8, 10, "movtpe", {{RS8, ABS16DST, E}}, {{0x6, 0xA, 0xC, RS8, ABS16DST, DATA3, E}}}, + + {O (O_MOVMD, SB), AV_H8SX, 0, "movmd.b", {{E}}, {{0x7, 0xb, 0x9, 0x4, E}}}, + {O (O_MOVMD, SW), AV_H8SX, 0, "movmd.w", {{E}}, {{0x7, 0xb, 0xa, 0x4, E}}}, + {O (O_MOVMD, SL), AV_H8SX, 0, "movmd.l", {{E}}, {{0x7, 0xb, 0xb, 0x4, E}}}, + {O (O_MOVSD, SB), AV_H8SX, 0, "movsd.b", {{PCREL16, E}}, {{0x7, 0xb, 0x8, 0x4, PCREL16, DATA3, E}}}, + + {O (O_MULS, SW), AV_H8SX, 0, "muls.w", {{IMM4, RD16, E}}, {{0x0, 0x1, 0xc, 0x6, 0x5, 0x0, IMM4, RD16, E}}}, + {O (O_MULS, SW), AV_H8SX, 0, "muls.w", {{RS16, RD16, E}}, {{0x0, 0x1, 0xc, 0x2, 0x5, 0x0, RS16, RD16, E}}}, + {O (O_MULS, SL), AV_H8SX, 0, "muls.l", {{IMM4, RD32, E}}, {{0x0, 0x1, 0xc, 0x6, 0x5, 0x2, IMM4, B30 | RD32, E}}}, + {O (O_MULS, SL), AV_H8SX, 0, "muls.l", {{RS32, RD32, E}}, {{0x0, 0x1, 0xc, 0x2, 0x5, 0x2, B30 | RS32, B30 | RD32, E}}}, + + {O (O_MULU, SW), AV_H8SX, 0, "mulu.w", {{IMM4, RD16, E}}, {{0x0, 0x1, 0xc, 0xe, 0x5, 0x0, IMM4, RD16, E}}}, + {O (O_MULU, SW), AV_H8SX, 0, "mulu.w", {{RS16, RD16, E}}, {{0x0, 0x1, 0xc, 0xa, 0x5, 0x0, RS16, RD16, E}}}, + {O (O_MULU, SL), AV_H8SX, 0, "mulu.l", {{IMM4, RD32, E}}, {{0x0, 0x1, 0xc, 0xe, 0x5, 0x2, IMM4, B30 | RD32, E}}}, + {O (O_MULU, SL), AV_H8SX, 0, "mulu.l", {{RS32, RD32, E}}, {{0x0, 0x1, 0xc, 0xa, 0x5, 0x2, B30 | RS32, B30 | RD32, E}}}, + + {O (O_MULSU, SL), AV_H8SX, 0, "muls/u.l", {{IMM4, RD32, E}}, {{0x0, 0x1, 0xc, 0x7, 0x5, 0x2, IMM4, B30 | RD32, E}}}, + {O (O_MULSU, SL), AV_H8SX, 0, "muls/u.l", {{RS32, RD32, E}}, {{0x0, 0x1, 0xc, 0x3, 0x5, 0x2, B30 | RS32, B30 | RD32, E}}}, + {O (O_MULUU, SL), AV_H8SX, 0, "mulu/u.l", {{IMM4, RD32, E}}, {{0x0, 0x1, 0xc, 0xf, 0x5, 0x2, IMM4, B30 | RD32, E}}}, + {O (O_MULUU, SL), AV_H8SX, 0, "mulu/u.l", {{RS32, RD32, E}}, {{0x0, 0x1, 0xc, 0xb, 0x5, 0x2, B30 | RS32, B30 | RD32, E}}}, + + {O (O_MULXS, SB), AV_H8SX, 0, "mulxs.b", {{IMM4, RD16, E}}, {{0x0, 0x1, 0xc, 0x4, 0x5, 0x0, IMM4, RD16, E}}}, + {O (O_MULXS, SB), AV_H8H, 20, "mulxs.b", {{RS8, RD16, E}}, {{0x0, 0x1, 0xc, 0x0, 0x5, 0x0, RS8, RD16, E}}}, + {O (O_MULXS, SW), AV_H8SX, 0, "mulxs.w", {{IMM4, RD32, E}}, {{0x0, 0x1, 0xc, 0x4, 0x5, 0x2, IMM4, B30 | RD32, E}}}, + {O (O_MULXS, SW), AV_H8H, 20, "mulxs.w", {{RS16, RD32, E}}, {{0x0, 0x1, 0xc, 0x0, 0x5, 0x2, RS16, B30 | RD32, E}}}, + + {O (O_MULXU, SB), AV_H8SX, 0, "mulxu.b", {{IMM4, RD16, E}}, {{0x0, 0x1, 0xc, 0xc, 0x5, 0x0, IMM4, RD16, E}}}, + {O (O_MULXU, SB), AV_H8, 14, "mulxu.b", {{RS8, RD16, E}}, {{0x5, 0x0, RS8, RD16, E}}}, + {O (O_MULXU, SW), AV_H8SX, 0, "mulxu.w", {{IMM4, RD32, E}}, {{0x0, 0x1, 0xc, 0xc, 0x5, 0x2, IMM4, B30 | RD32, E}}}, + {O (O_MULXU, SW), AV_H8H, 14, "mulxu.w", {{RS16, RD32, E}}, {{0x5, 0x2, RS16, B30 | RD32, E}}}, + + EXPAND_UNOP_STD_B (O (O_NEG, SB), "neg.b", PREFIX_017, 0x1, 0x7, 0x8), + EXPAND_UNOP_STD_W (O (O_NEG, SW), "neg.w", PREFIX_015, 0x1, 0x7, 0x9), + EXPAND_UNOP_STD_L (O (O_NEG, SL), "neg.l", PREFIX_010, 0x1, 0x7, 0xb), + + {O (O_NOP, SN), AV_H8, 2, "nop", {{E}}, {{0x0, 0x0, 0x0, 0x0, E}}}, + + EXPAND_UNOP_STD_B (O (O_NOT, SB), "not.b", PREFIX_017, 0x1, 0x7, 0x0), + EXPAND_UNOP_STD_W (O (O_NOT, SW), "not.w", PREFIX_015, 0x1, 0x7, 0x1), + EXPAND_UNOP_STD_L (O (O_NOT, SL), "not.l", PREFIX_010, 0x1, 0x7, 0x3), + + {O (O_OR, SB), AV_H8, 2, "or.b", {{IMM8, RD8, E}}, {{0xc, RD8, IMM8LIST, E}}}, + EXPAND_TWOOP_B (O (O_OR, SB), "or.b", 0xc, 0x1, 0x4, 0x4, 0), + + {O (O_OR, SW), AV_H8, 2, "or.w", {{RS16, RD16, E}}, {{0x6, 0x4, RS16, RD16, E}}}, + EXPAND_TWOOP_W (O (O_OR, SW), "or.w", 0x6, 0x4, 0x4), + + {O (O_OR, SL), AV_H8H, 2, "or.l", {{RS32, RD32, E}}, {{0x0, 0x1, 0xF, 0x0, 0x6, 0x4, B30 | RS32, B30 | RD32, E}}}, + EXPAND_TWOOP_L (O (O_OR, SL), "or.l", 0x4), + + {O (O_ORC, SB), AV_H8, 2, "orc", {{IMM8, CCR | DST, E}}, {{0x0, 0x4, IMM8LIST, E}}}, + {O (O_ORC, SB), AV_H8S, 2, "orc", {{IMM8, EXR | DST, E}}, {{0x0, 0x1, 0x4, EXR | DST, 0x0, 0x4, IMM8LIST, E}}}, + + {O (O_MOV, SW), AV_H8, 6, "pop.w", {{OR16, E}}, {{0x6, 0xD, 0x7, OR16, E}}}, + {O (O_MOV, SL), AV_H8H, 6, "pop.l", {{OR32, E}}, {{PREFIX_0100, 0x6, 0xD, 0x7, OR32 | B30, E}}}, + {O (O_MOV, SW), AV_H8, 6, "push.w", {{OR16, E}}, {{0x6, 0xD, 0xF, OR16, E}}}, + {O (O_MOV, SL), AV_H8H, 6, "push.l", {{OR32, E}}, {{PREFIX_0100, 0x6, 0xD, 0xF, OR32 | B30, E}}}, + + EXPAND_UNOP_STD_B (O (O_ROTL, SB), "rotl.b", PREFIX_017, 0x1, 0x2, 0x8), + EXPAND_UNOP_EXTENDED_B (O (O_ROTL, SB), "rotl.b", CONST_2, PREFIX_017, 0x1, 0x2, 0xc), + EXPAND_UNOP_STD_W (O (O_ROTL, SW), "rotl.w", PREFIX_015, 0x1, 0x2, 0x9), + EXPAND_UNOP_EXTENDED_W (O (O_ROTL, SW), "rotl.w", CONST_2, PREFIX_015, 0x1, 0x2, 0xd), + EXPAND_UNOP_STD_L (O (O_ROTL, SL), "rotl.l", PREFIX_010, 0x1, 0x2, 0xb), + EXPAND_UNOP_EXTENDED_L (O (O_ROTL, SL), "rotl.l", CONST_2, PREFIX_010, 0x1, 0x2, 0xf, B30), + EXPAND_UNOP_STD_B (O (O_ROTR, SB), "rotr.b", PREFIX_017, 0x1, 0x3, 0x8), + EXPAND_UNOP_EXTENDED_B (O (O_ROTR, SB), "rotr.b", CONST_2, PREFIX_017, 0x1, 0x3, 0xc), + EXPAND_UNOP_STD_W (O (O_ROTR, SW), "rotr.w", PREFIX_015, 0x1, 0x3, 0x9), + EXPAND_UNOP_EXTENDED_W (O (O_ROTR, SW), "rotr.w", CONST_2, PREFIX_015, 0x1, 0x3, 0xd), + EXPAND_UNOP_STD_L (O (O_ROTR, SL), "rotr.l", PREFIX_010, 0x1, 0x3, 0xb), + EXPAND_UNOP_EXTENDED_L (O (O_ROTR, SL), "rotr.l", CONST_2, PREFIX_010, 0x1, 0x3, 0xf, B30), + EXPAND_UNOP_STD_B (O (O_ROTXL, SB), "rotxl.b", PREFIX_017, 0x1, 0x2, 0x0), + EXPAND_UNOP_EXTENDED_B (O (O_ROTXL, SB), "rotxl.b", CONST_2, PREFIX_017, 0x1, 0x2, 0x4), + EXPAND_UNOP_STD_W (O (O_ROTXL, SW), "rotxl.w", PREFIX_015, 0x1, 0x2, 0x1), + EXPAND_UNOP_EXTENDED_W (O (O_ROTXL, SW), "rotxl.w", CONST_2, PREFIX_015, 0x1, 0x2, 0x5), + EXPAND_UNOP_STD_L (O (O_ROTXL, SL), "rotxl.l", PREFIX_010, 0x1, 0x2, 0x3), + EXPAND_UNOP_EXTENDED_L (O (O_ROTXL, SL), "rotxl.l", CONST_2, PREFIX_010, 0x1, 0x2, 0x7, B30), + EXPAND_UNOP_STD_B (O (O_ROTXR, SB), "rotxr.b", PREFIX_017, 0x1, 0x3, 0x0), + EXPAND_UNOP_EXTENDED_B (O (O_ROTXR, SB), "rotxr.b", CONST_2, PREFIX_017, 0x1, 0x3, 0x4), + EXPAND_UNOP_STD_W (O (O_ROTXR, SW), "rotxr.w", PREFIX_015, 0x1, 0x3, 0x1), + EXPAND_UNOP_EXTENDED_W (O (O_ROTXR, SW), "rotxr.w", CONST_2, PREFIX_015, 0x1, 0x3, 0x5), + EXPAND_UNOP_STD_L (O (O_ROTXR, SL), "rotxr.l", PREFIX_010, 0x1, 0x3, 0x3), + EXPAND_UNOP_EXTENDED_L (O (O_ROTXR, SL), "rotxr.l", CONST_2, PREFIX_010, 0x1, 0x3, 0x7, B30), + + + {O (O_BPT, SN), AV_H8, 10, "bpt", {{E}}, {{0x7, 0xA, 0xF, 0xF, E}}}, + {O (O_RTE, SN), AV_H8, 10, "rte", {{E}}, {{0x5, 0x6, 0x7, 0x0, E}}}, + {O (O_RTS, SN), AV_H8, 8, "rts", {{E}}, {{0x5, 0x4, 0x7, 0x0, E}}}, + {O (O_RTEL, SN), AV_H8SX, 0, "rte/l", {{RS32, RD32, E}}, {{0x5, 0x6, RS32 | B30, RD32 | B30, E}}}, + {O (O_RTSL, SN), AV_H8SX, 0, "rts/l", {{RS32, RD32, E}}, {{0x5, 0x4, RS32 | B30, RD32 | B30, E}}}, + + EXPAND_UNOP_STD_B (O (O_SHAL, SB), "shal.b", PREFIX_017, 0x1, 0x0, 0x8), + EXPAND_UNOP_EXTENDED_B (O (O_SHAL, SB), "shal.b", CONST_2, PREFIX_017, 0x1, 0x0, 0xc), + EXPAND_UNOP_STD_W (O (O_SHAL, SW), "shal.w", PREFIX_015, 0x1, 0x0, 0x9), + EXPAND_UNOP_EXTENDED_W (O (O_SHAL, SW), "shal.w", CONST_2, PREFIX_015, 0x1, 0x0, 0xd), + EXPAND_UNOP_STD_L (O (O_SHAL, SL), "shal.l", PREFIX_010, 0x1, 0x0, 0xb), + EXPAND_UNOP_EXTENDED_L (O (O_SHAL, SL), "shal.l", CONST_2, PREFIX_010, 0x1, 0x0, 0xf, B30), + EXPAND_UNOP_STD_B (O (O_SHAR, SB), "shar.b", PREFIX_017, 0x1, 0x1, 0x8), + EXPAND_UNOP_EXTENDED_B (O (O_SHAR, SB), "shar.b", CONST_2, PREFIX_017, 0x1, 0x1, 0xc), + EXPAND_UNOP_STD_W (O (O_SHAR, SW), "shar.w", PREFIX_015, 0x1, 0x1, 0x9), + EXPAND_UNOP_EXTENDED_W (O (O_SHAR, SW), "shar.w", CONST_2, PREFIX_015, 0x1, 0x1, 0xd), + EXPAND_UNOP_STD_L (O (O_SHAR, SL), "shar.l", PREFIX_010, 0x1, 0x1, 0xb), + EXPAND_UNOP_EXTENDED_L (O (O_SHAR, SL), "shar.l", CONST_2, PREFIX_010, 0x1, 0x1, 0xf, B30), + + EXPAND_UNOP_STD_B (O (O_SHLL, SB), "shll.b", PREFIX_017, 0x1, 0x0, 0x0), + + {O (O_SHLL, SB), AV_H8SX, 0, "shll.b", {{RS8, RD8, E}}, {{0x7, 0x8, RS8, 0x8, 0x1, 0x0, 0x0, RD8, E}}}, + + EXPAND_UNOP_EXTENDED_B (O (O_SHLL, SB), "shll.b", CONST_2, PREFIX_017, 0x1, 0x0, 0x4), + EXPAND_UNOP_EXTENDED_B (O (O_SHLL, SB), "shll.b", CONST_4, PREFIX_017, 0x1, 0x0, 0xa), + {O (O_SHLL, SB), AV_H8SX, 0, "shll.b", {{IMM5, RD8, E}}, {{0x0, 0x3, B31 | IMM5, DATA, 0x1, 0x0, 0x0, RD8, E}}}, + + EXPAND_UNOP_STD_W (O (O_SHLL, SW), "shll.w", PREFIX_015, 0x1, 0x0, 0x1), + + {O (O_SHLL, SW), AV_H8SX, 0, "shll.w", {{RS8, RD16, E}}, {{0x7, 0x8, RS8, 0x8, 0x1, 0x0, 0x1, RD16, E}}}, + + EXPAND_UNOP_EXTENDED_W (O (O_SHLL, SW), "shll.w", CONST_2, PREFIX_015, 0x1, 0x0, 0x5), + EXPAND_UNOP_EXTENDED_W (O (O_SHLL, SW), "shll.w", CONST_4, PREFIX_015, 0x1, 0x0, 0x2), + EXPAND_UNOP_EXTENDED_W (O (O_SHLL, SW), "shll.w", CONST_8, PREFIX_015, 0x1, 0x0, 0x6), + {O (O_SHLL, SW), AV_H8SX, 0, "shll.w", {{IMM5, RD16, E}}, {{0x0, 0x3, B31 | IMM5, DATA, 0x1, 0x0, 0x1, RD16, E}}}, + + EXPAND_UNOP_STD_L (O (O_SHLL, SL), "shll.l", PREFIX_010, 0x1, 0x0, 0x3), + + {O (O_SHLL, SL), AV_H8SX, 0, "shll.l", {{RS8, RD32, E}}, {{0x7, 0x8, RS8, 0x8, 0x1, 0x0, 0x3, B30 | RD32, E}}}, + + EXPAND_UNOP_EXTENDED_L (O (O_SHLL, SL), "shll.l", CONST_2, PREFIX_010, 0x1, 0x0, 0x7, B30), + EXPAND_UNOP_EXTENDED_L (O (O_SHLL, SL), "shll.l", CONST_4, PREFIX_010, 0x1, 0x0, 0x3, B31), + EXPAND_UNOP_EXTENDED_L (O (O_SHLL, SL), "shll.l", CONST_8, PREFIX_010, 0x1, 0x0, 0x7, B31), + EXPAND_UNOP_EXTENDED_L (O (O_SHLL, SL), "shll.l", CONST_16, PREFIX_010, 0x1, 0x0, 0xf, B31), + {O (O_SHLL, SL), AV_H8SX, 0, "shll.l", {{IMM5, RD32, E}}, {{0x0, 0x3, B31 | IMM5, DATA, 0x1, 0x0, 0x3, B30 | RD32, E}}}, + + EXPAND_UNOP_STD_B (O (O_SHLR, SB), "shlr.b", PREFIX_017, 0x1, 0x1, 0x0), + + {O (O_SHLR, SB), AV_H8SX, 0, "shlr.b", {{RS8, RD8, E}}, {{0x7, 0x8, RS8, 0x8, 0x1, 0x1, 0x0, RD8, E}}}, + + EXPAND_UNOP_EXTENDED_B (O (O_SHLR, SB), "shlr.b", CONST_2, PREFIX_017, 0x1, 0x1, 0x4), + EXPAND_UNOP_EXTENDED_B (O (O_SHLR, SB), "shlr.b", CONST_4, PREFIX_017, 0x1, 0x1, 0xa), + {O (O_SHLR, SB), AV_H8SX, 0, "shlr.b", {{IMM5, RD8, E}}, {{0x0, 0x3, B31 | IMM5, DATA, 0x1, 0x1, 0x0, RD8, E}}}, + + EXPAND_UNOP_STD_W (O (O_SHLR, SW), "shlr.w", PREFIX_015, 0x1, 0x1, 0x1), + + {O (O_SHLR, SW), AV_H8SX, 0, "shlr.w", {{RS8, RD16, E}}, {{0x7, 0x8, RS8, 0x8, 0x1, 0x1, 0x1, RD16, E}}}, + + EXPAND_UNOP_EXTENDED_W (O (O_SHLR, SW), "shlr.w", CONST_2, PREFIX_015, 0x1, 0x1, 0x5), + EXPAND_UNOP_EXTENDED_W (O (O_SHLR, SW), "shlr.w", CONST_4, PREFIX_015, 0x1, 0x1, 0x2), + EXPAND_UNOP_EXTENDED_W (O (O_SHLR, SW), "shlr.w", CONST_8, PREFIX_015, 0x1, 0x1, 0x6), + {O (O_SHLR, SW), AV_H8SX, 0, "shlr.w", {{IMM5, RD16, E}}, {{0x0, 0x3, B31 | IMM5, DATA, 0x1, 0x1, 0x1, RD16, E}}}, + + EXPAND_UNOP_STD_L (O (O_SHLR, SL), "shlr.l", PREFIX_010, 0x1, 0x1, 0x3), + + {O (O_SHLR, SL), AV_H8SX, 0, "shlr.l", {{RS8, RD32, E}}, {{0x7, 0x8, RS8, 0x8, 0x1, 0x1, 0x3, B30 | RD32, E}}}, + + EXPAND_UNOP_EXTENDED_L (O (O_SHLR, SL), "shlr.l", CONST_2, PREFIX_010, 0x1, 0x1, 0x7, B30), + EXPAND_UNOP_EXTENDED_L (O (O_SHLR, SL), "shlr.l", CONST_4, PREFIX_010, 0x1, 0x1, 0x3, B31), + EXPAND_UNOP_EXTENDED_L (O (O_SHLR, SL), "shlr.l", CONST_8, PREFIX_010, 0x1, 0x1, 0x7, B31), + EXPAND_UNOP_EXTENDED_L (O (O_SHLR, SL), "shlr.l", CONST_16, PREFIX_010, 0x1, 0x1, 0xf, B31), + {O (O_SHLR, SL), AV_H8SX, 0, "shlr.l", {{IMM5, RD32, E}}, {{0x0, 0x3, B31 | IMM5, DATA, 0x1, 0x1, 0x3, B30 | RD32, E}}}, + + {O (O_SLEEP, SN), AV_H8, 2, "sleep", {{E}}, {{0x0, 0x1, 0x8, 0x0, E}}}, + + {O (O_STC, SB), AV_H8, 2, "stc", {{CCR | SRC, RD8, E}}, {{0x0, 0x2, B30 | CCR | SRC, RD8, E}}}, + {O (O_STC, SB), AV_H8S, 2, "stc", {{EXR | SRC, RD8, E}}, {{0x0, 0x2, B30 | EXR | SRC, RD8, E}}}, + {O (O_STC, SW), AV_H8H, 2, "stc", {{CCR | SRC, RDIND, E}}, {{PREFIXSTC, 0x6, 0x9, B31 | RDIND, IGNORE, E}}}, + {O (O_STC, SW), AV_H8S, 2, "stc", {{EXR | SRC, RDIND, E}}, {{PREFIXSTC, 0x6, 0x9, B31 | RDIND, IGNORE, E}}}, + {O (O_STC, SW), AV_H8H, 2, "stc", {{CCR | SRC, RDPREDEC, E}}, {{PREFIXSTC, 0x6, 0xD, B31 | RDPREDEC, IGNORE, E}}}, + {O (O_STC, SW), AV_H8S, 2, "stc", {{EXR | SRC, RDPREDEC, E}}, {{PREFIXSTC, 0x6, 0xD, B31 | RDPREDEC, IGNORE, E}}}, + {O (O_STC, SW), AV_H8H, 2, "stc", {{CCR | SRC, DISP16DST, E}}, {{PREFIXSTC, 0x6, 0xF, B31 | DSTDISPREG, IGNORE, DSTDISP16LIST, E}}}, + {O (O_STC, SW), AV_H8S, 2, "stc", {{EXR | SRC, DISP16DST, E}}, {{PREFIXSTC, 0x6, 0xF, B31 | DSTDISPREG, IGNORE, DSTDISP16LIST, E}}}, + {O (O_STC, SW), AV_H8H, 2, "stc", {{CCR | SRC, DISP32DST, E}}, {{PREFIXSTC, 0x7, 0x8, B30 | DSTDISPREG, 0, 0x6, 0xB, 0xA, IGNORE, DSTDISP32LIST, E}}}, + {O (O_STC, SW), AV_H8S, 2, "stc", {{EXR | SRC, DISP32DST, E}}, {{PREFIXSTC, 0x7, 0x8, B30 | DSTDISPREG, 0, 0x6, 0xB, 0xA, IGNORE, DSTDISP32LIST, E}}}, + {O (O_STC, SW), AV_H8H, 2, "stc", {{CCR | SRC, ABS16DST, E}}, {{PREFIXSTC, 0x6, 0xB, 0x8, IGNORE, DST | ABS16LIST, E}}}, + {O (O_STC, SW), AV_H8S, 2, "stc", {{EXR | SRC, ABS16DST, E}}, {{PREFIXSTC, 0x6, 0xB, 0x8, IGNORE, DST | ABS16LIST, E}}}, + {O (O_STC, SW), AV_H8H, 2, "stc", {{CCR | SRC, ABS32DST, E}}, {{PREFIXSTC, 0x6, 0xB, 0xA, IGNORE, DST | ABS32LIST, E}}}, + {O (O_STC, SW), AV_H8S, 2, "stc", {{EXR | SRC, ABS32DST, E}}, {{PREFIXSTC, 0x6, 0xB, 0xA, IGNORE, DST | ABS32LIST, E}}}, + {O (O_STC, SL), AV_H8SX, 0, "stc", {{B30 | VBR_SBR | SRC, RD32, E}}, {{0x0, 0x2, B30 | VBR_SBR | SRC, RD32, E}}}, + + + EXPAND_TWOOP_B (O (O_SUB, SB), "sub.b", 0xa, 0x1, 0x8, 0x3, B01), + + {O (O_SUB, SW), AV_H8, 2, "sub.w", {{RS16, RD16, E}}, {{0x1, 0x9, RS16, RD16, E}}}, + {O (O_SUB, SW), AV_H8SX, 0, "sub.w", {{IMM3NZ_NS, RD16, E}}, {{0x1, 0xa, B30 | IMM3NZ, RD16, E}}}, + {O (O_SUB, SW), AV_H8SX, 0, "sub.w", {{IMM3NZ_NS, RDIND, E}}, {{0x7, 0xd, B31 | RDIND, IGNORE, 0x1, 0xa, B30 | IMM3NZ, IGNORE, E}}}, + {O (O_SUB, SW), AV_H8SX, 0, "sub.w", {{IMM3NZ_NS, ABS16DST, E}}, {{0x6, 0xb, 0x1, B31 | IGNORE, DSTABS16LIST, 0x1, 0xa, B30 | IMM3NZ, IGNORE, E}}}, + {O (O_SUB, SW), AV_H8SX, 0, "sub.w", {{IMM3NZ_NS, ABS32DST, E}}, {{0x6, 0xb, 0x3, B31 | IGNORE, DSTABS32LIST, 0x1, 0xa, B30 | IMM3NZ, IGNORE, E}}}, + EXPAND_TWOOP_W (O (O_SUB, SW), "sub.w", 0x1, 0x9, 0x3), + + {O (O_SUB, SL), AV_H8H, 6, "sub.l", {{RS32, RD32, E}}, {{0x1, 0xa, B31 | RS32, B30 | RD32, E}}}, + {O (O_SUB, SL), AV_H8SX, 0, "sub.l", {{IMM3NZ_NS, RD32, E}}, {{0x1, 0xa, B31 | IMM3NZ, B31 | RD32, E}}}, + EXPAND_TWOOP_L (O (O_SUB, SL), "sub.l", 0x3), + + {O (O_SUBS, SL), AV_H8, 2, "subs", {{KBIT, RDP, E}}, {{0x1, 0xB,KBIT, RDP, E}}}, + + {O (O_SUBX, SB), AV_H8, 2, "subx", {{IMM8, RD8, E}}, {{0xb, RD8, IMM8LIST, E}}}, + {O (O_SUBX, SB), AV_H8SX, 0, "subx.b", {{IMM8, RDIND, E}}, {{0x7, 0xd, B30 | RDIND, IGNORE, 0xb, IGNORE, IMM8LIST, E}}}, + {O (O_SUBX, SB), AV_H8SX, 0, "subx.b", {{IMM8, RDPOSTDEC, E}}, {{PREFIX_0176, 0x6, 0xc, B30 | RDPOSTDEC, B31 | IGNORE, 0xb, IGNORE, IMM8LIST, E}}}, + {O (O_SUBX, SB), AV_H8, 2, "subx", {{RS8, RD8, E}}, {{0x1, 0xe, RS8, RD8, E}}}, + {O (O_SUBX, SB), AV_H8SX, 0, "subx.b", {{RS8, RDIND, E}}, {{0x7, 0xd, B30 | RDIND, IGNORE, 0x1, 0xe, RS8, IGNORE, E}}}, + {O (O_SUBX, SB), AV_H8SX, 0, "subx.b", {{RS8, RDPOSTDEC, E}}, {{PREFIX_0176, 0x6, 0xc, B30 | RDPOSTDEC, B31 | IGNORE, 0x1, 0xe, RS8, IGNORE, E}}}, + {O (O_SUBX, SB), AV_H8SX, 0, "subx.b", {{RSIND, RD8, E}}, {{0x7, 0xc, B30 | RSIND, IGNORE, 0x1, 0xe, IGNORE, RD8, E}}}, + {O (O_SUBX, SB), AV_H8SX, 0, "subx.b", {{RSPOSTDEC, RD8, E}}, {{PREFIX_0176, 0x6, 0xc, B30 | RSPOSTDEC, B30 | B20 | IGNORE, 0x1, 0xe, IGNORE, RD8, E}}}, + {O (O_SUBX, SB), AV_H8SX, 0, "subx.b", {{RSIND, RDIND, E}}, {{PREFIX_0174, 0x6, 0x8, B30 | RSIND, 0xd, 0x0, RDIND, 0x3, IGNORE, E}}}, + {O (O_SUBX, SB), AV_H8SX, 0, "subx.b", {{RSPOSTDEC, RDPOSTDEC, E}}, {{PREFIX_0176, 0x6, 0xc, B30 | RSPOSTDEC, 0xd, 0xa, RDPOSTDEC, 0x3, IGNORE, E}}}, + + {O (O_SUBX, SW), AV_H8SX, 0, "subx.w", {{IMM16, RD16, E}}, {{PREFIX_0151, 0x7, 0x9, 0x3, RD16, IMM16LIST, E}}}, + {O (O_SUBX, SW), AV_H8SX, 0, "subx.w", {{IMM16, RDIND, E}}, {{0x7, 0xd, B31 | RDIND, B01 | IGNORE, 0x7, 0x9, 0x3, IGNORE, IMM16LIST, E}}}, + {O (O_SUBX, SW), AV_H8SX, 0, "subx.w", {{IMM16, RDPOSTDEC, E}}, {{PREFIX_0156, 0x6, 0xd, B30 | RDPOSTDEC, B31 | B20 | B01 | IGNORE, 0x7, 0x9, 0x3, IGNORE, IMM16LIST, E}}}, + {O (O_SUBX, SW), AV_H8SX, 0, "subx.w", {{RS16, RD16, E}}, {{PREFIX_0151, 0x1, 0x9, RS16, RD16, E}}}, + {O (O_SUBX, SW), AV_H8SX, 0, "subx.w", {{RS16, RDIND, E}}, {{0x7, 0xd, B31 | RDIND, B01 | IGNORE, 0x1, 0x9, RS16, IGNORE, E}}}, + {O (O_SUBX, SW), AV_H8SX, 0, "subx.w", {{RS16, RDPOSTDEC, E}}, {{PREFIX_0156, 0x6, 0xd, B30 | RDPOSTDEC, B31 | B20 | B01 | IGNORE, 0x1, 0x9, RS16, IGNORE, E}}}, + {O (O_SUBX, SW), AV_H8SX, 0, "subx.w", {{RSIND, RD16, E}}, {{0x7, 0xc, B31 | RSIND, B01 | IGNORE, 0x1, 0x9, IGNORE, RD16, E}}}, + {O (O_SUBX, SW), AV_H8SX, 0, "subx.w", {{RSPOSTDEC, RD16, E}}, {{PREFIX_0156, 0x6, 0xd, B30 | RSPOSTDEC, B30 | B20 | B01 | IGNORE, 0x1, 0x9, IGNORE, RD16, E}}}, + {O (O_SUBX, SW), AV_H8SX, 0, "subx.w", {{RSIND, RDIND, E}}, {{PREFIX_0154, 0x6, 0x9, B30 | RSIND, 0xd, 0x0, RDIND, 0x3, IGNORE, E}}}, + {O (O_SUBX, SW), AV_H8SX, 0, "subx.w", {{RSPOSTDEC, RDPOSTDEC, E}}, {{PREFIX_0156, 0x6, 0xd, B30 | RSPOSTDEC, 0xd, 0xa, RDPOSTDEC, 0x3, IGNORE, E}}}, + + {O (O_SUBX, SL), AV_H8SX, 0, "subx.l", {{IMM32, RD32, E}}, {{PREFIX_0101, 0x7, 0xa, 0x3, RD32, IMM32LIST, E}}}, + {O (O_SUBX, SL), AV_H8SX, 0, "subx.l", {{IMM32, RDIND, E}}, {{PREFIX_0104, 0x6, 0x9, B30 | RDIND, B31 | B20 | B01 | IGNORE, 0x7, 0xa, 0x3, IGNORE, IMM32LIST, E}}}, + {O (O_SUBX, SL), AV_H8SX, 0, "subx.l", {{IMM32, RDPOSTDEC, E}}, {{PREFIX_0106, 0x6, 0xd, B30 | RDPOSTDEC, B31 | B20 | B01 | IGNORE, 0x7, 0xa, 0x3, IGNORE, IMM32LIST, E}}}, + {O (O_SUBX, SL), AV_H8SX, 0, "subx.l", {{RS32, RD32, E}}, {{PREFIX_0101, 0x1, 0xa, B31 | RS32, B30 | RD32, E}}}, + {O (O_SUBX, SL), AV_H8SX, 0, "subx.l", {{RS32, RDIND, E}}, {{PREFIX_0104, 0x6, 0x9, B30 | RDIND, B31 | B20 | B01 | IGNORE, 0x1, 0xa, B31 | RS32, B30 | IGNORE, E}}}, + {O (O_SUBX, SL), AV_H8SX, 0, "subx.l", {{RS32, RDPOSTDEC, E}}, {{PREFIX_0106, 0x6, 0xd, B30 | RDPOSTDEC, B31 | B20 | B01 | IGNORE, 0x1, 0xa, B31 | RS32, B30 | IGNORE, E}}}, + {O (O_SUBX, SL), AV_H8SX, 0, "subx.l", {{RSIND, RD32, E}}, {{PREFIX_0104, 0x6, 0x9, B30 | RSIND, B30 | B20 | B01 | IGNORE, 0x1, 0xa, B31 | IGNORE, B30 | RD32, E}}}, + {O (O_SUBX, SL), AV_H8SX, 0, "subx.l", {{RSPOSTDEC, RD32, E}}, {{PREFIX_0106, 0x6, 0xd, B30 | RSPOSTDEC, B30 | B20 | B01 | IGNORE, 0x1, 0xa, B31 | IGNORE, B30 | RD32, E}}}, + {O (O_SUBX, SL), AV_H8SX, 0, "subx.l", {{RSIND, RDIND, E}}, {{PREFIX_0104, 0x6, 0x9, B30 | RSIND, 0xd, 0x0, RDIND, 0x3, IGNORE, E}}}, + {O (O_SUBX, SL), AV_H8SX, 0, "subx.l", {{RSPOSTDEC, RDPOSTDEC, E}}, {{PREFIX_0106, 0x6, 0xd, B30 | RSPOSTDEC, 0xd, 0xa, RDPOSTDEC, 0x3, IGNORE, E}}}, + + {O (O_TRAPA, SB), AV_H8H, 2, "trapa", {{IMM2, E}}, {{0x5, 0x7, IMM2, IGNORE, E}}}, + {O (O_TAS, SB), AV_H8H, 2, "tas", {{RSIND, E}}, {{0x0, 0x1, 0xe, 0x0, 0x7, 0xb, B30 | RSIND, 0xc, E}}}, + + {O (O_XOR, SB), AV_H8, 2, "xor.b", {{IMM8, RD8, E}}, {{0xd, RD8, IMM8LIST, E}}}, + EXPAND_TWOOP_B (O (O_XOR, SB), "xor.b", 0xd, 0x1, 0x5, 0x5, 0), + + {O (O_XOR, SW), AV_H8, 2, "xor.w", {{RS16, RD16, E}}, {{0x6, 0x5, RS16, RD16, E}}}, + EXPAND_TWOOP_W (O (O_XOR, SW), "xor.w", 0x6, 0x5, 0x5), + + {O (O_XOR, SL), AV_H8H, 2, "xor.l", {{RS32, RD32, E}}, {{0x0, 0x1, 0xF, 0x0, 0x6, 0x5, B30 | RS32, B30 | RD32, E}}}, + EXPAND_TWOOP_L (O (O_XOR, SL), "xor.l", 0x5), + + {O (O_XORC, SB), AV_H8, 2, "xorc", {{IMM8, CCR | DST, E}}, {{0x0, 0x5, IMM8LIST, E}}}, + {O (O_XORC, SB), AV_H8S, 2, "xorc", {{IMM8, EXR | DST, E}}, {{0x0, 0x1, 0x4, EXR | DST, 0x0, 0x5, IMM8LIST, E}}}, + + {O (O_CLRMAC, SN), AV_H8S, 2, "clrmac", {{E}}, {{0x0, 0x1, 0xa, 0x0, E}}}, + {O (O_MAC, SW), AV_H8S, 2, "mac", {{RSPOSTINC, RDPOSTINC, E}}, {{0x0, 0x1, 0x6, 0x0, 0x6, 0xd, B30 | RSPOSTINC, B30 | RDPOSTINC, E}}}, + {O (O_LDMAC, SL), AV_H8S, 2, "ldmac", {{RS32, MD32, E}}, {{0x0, 0x3, MD32, RS32, E}}}, + {O (O_STMAC, SL), AV_H8S, 2, "stmac", {{MS32, RD32, E}}, {{0x0, 0x2, MS32, RD32, E}}}, + {O (O_LDM, SL), AV_H8H, 6, "ldm.l", {{RSPOSTINC, RD32, E}}, {{0x0, 0x1, DATA, 0x0, 0x6, 0xD, 0x7, B30 | RD32, E}}}, + {O (O_STM, SL), AV_H8H, 6, "stm.l", {{RS32, RDPREDEC, E}}, {{0x0, 0x1, DATA, 0x0, 0x6, 0xD, 0xF, B30 | RS32, E}}}, + {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}}} }; #else extern const struct h8_opcode h8_opcodes[]; #endif + diff --git a/include/opcode/i386.h b/include/opcode/i386.h index 71c204c81f5..cb3a99a4e6f 100644 --- a/include/opcode/i386.h +++ b/include/opcode/i386.h @@ -1302,6 +1302,30 @@ static const template i386_optab[] = { {"punpckhqdq",2, 0x660f6d, X, CpuSSE2, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, {"punpcklqdq",2, 0x660f6c, X, CpuSSE2, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +/* Prescott New Instructions. */ + +{"addsubpd", 2, 0x660fd0, X, CpuPNI, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"addsubps", 2, 0xf20fd0, X, CpuPNI, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"fisttp", 1, 0xdf, 1, CpuPNI, sl_FP|FloatMF|Modrm, { ShortMem|LongMem, 0, 0} }, +/* Intel Syntax */ +{"fisttpd", 1, 0xdd, 1, CpuPNI, FP|Modrm, { LLongMem, 0, 0} }, +{"fisttpq", 1, 0xdd, 1, CpuPNI, FP|Modrm, { LLongMem, 0, 0} }, +{"fisttpll", 1, 0xdd, 1, CpuPNI, FP|Modrm, { LLongMem, 0, 0} }, +{"haddpd", 2, 0x660f7c, X, CpuPNI, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"haddps", 2, 0xf20f7c, X, CpuPNI, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"hsubpd", 2, 0x660f7d, X, CpuPNI, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"hsubps", 2, 0xf20f7d, X, CpuPNI, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"lddqu", 2, 0xf20ff0, X, CpuPNI, FP|Modrm, { LLongMem, RegXMM, 0 } }, +{"monitor", 0, 0x0f01, 0xc8, CpuPNI, FP|ImmExt, { 0, 0, 0} }, +/* Need to ensure only "monitor %eax,%ecx,%edx" is accepted. */ +{"monitor", 3, 0x0f01, 0xc8, CpuPNI, FP|ImmExt, { Reg32, Reg32, Reg32} }, +{"movddup", 2, 0xf20f12, X, CpuPNI, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"movshdup", 2, 0xf30f16, X, CpuPNI, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"movsldup", 2, 0xf30f12, X, CpuPNI, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"mwait", 0, 0x0f01, 0xc9, CpuPNI, FP|ImmExt, { 0, 0, 0} }, +/* Need to ensure only "mwait %eax,%ecx" is accepted. */ +{"mwait", 2, 0x0f01, 0xc9, CpuPNI, FP|ImmExt, { Reg32, Reg32, 0} }, + /* AMD 3DNow! instructions. */ {"prefetch", 1, 0x0f0d, 0, Cpu3dnow, FP|Modrm, { ByteMem, 0, 0 } }, diff --git a/include/opcode/i860.h b/include/opcode/i860.h index 6fdcdba6ecc..6e2a683a499 100644 --- a/include/opcode/i860.h +++ b/include/opcode/i860.h @@ -40,7 +40,7 @@ struct i860_opcode enum expand_type { - E_MOV = 1, E_ADDR, E_U32, E_AND, E_S32, E_DELAY + E_MOV = 1, E_ADDR, E_U32, E_AND, E_S32, E_DELAY, XP_ONLY }; @@ -135,6 +135,10 @@ static const struct i860_opcode i860_opcodes[] = { "pfld.d", 0x64000000, 0x98000007, "L(2),g", E_ADDR }, /* pfld.d #const(isrc2),fdest */ { "pfld.d", 0x60000001, 0x9c000006, "1(2)++,g", 0 }, /* pfld.d isrc1(isrc2)++,fdest */ { "pfld.d", 0x64000001, 0x98000006, "L(2)++,g", E_ADDR }, /* pfld.d #const(isrc2)++,fdest */ +{ "pfld.q", 0x60000004, 0x9c000003, "1(2),g", XP_ONLY }, /* pfld.q isrc1(isrc2),fdest */ +{ "pfld.q", 0x64000004, 0x98000003, "L(2),g", XP_ONLY }, /* pfld.q #const(isrc2),fdest */ +{ "pfld.q", 0x60000005, 0x9c000002, "1(2)++,g", XP_ONLY }, /* pfld.q isrc1(isrc2)++,fdest */ +{ "pfld.q", 0x64000005, 0x98000002, "L(2)++,g", XP_ONLY }, /* pfld.q #const(isrc2)++,fdest */ { "fst.l", 0x28000002, 0xd4000001, "g,1(2)", 0 }, /* fst.l fdest,isrc1(isrc2) */ { "fst.l", 0x2c000002, 0xd0000001, "g,K(2)", E_ADDR }, /* fst.l fdest,#const(isrc2) */ @@ -204,6 +208,16 @@ static const struct i860_opcode i860_opcodes[] = { "calli", 0x4c000002, 0xb000001d, "1", E_DELAY }, /* calli isrc1ni */ { "intovr", 0x4c000004, 0xb000001b, "", 0 }, /* intovr trap on integer overflow */ { "unlock", 0x4c000007, 0xb0000018, "", 0 }, /* unlock clear BL in dirbase */ +{ "ldio.l", 0x4c000408, 0xb00003f7, "2,d", XP_ONLY }, /* ldio.l isrc2,idest */ +{ "ldio.s", 0x4c000208, 0xb00005f7, "2,d", XP_ONLY }, /* ldio.s isrc2,idest */ +{ "ldio.b", 0x4c000008, 0xb00007f7, "2,d", XP_ONLY }, /* ldio.b isrc2,idest */ +{ "stio.l", 0x4c000409, 0xb00003f6, "1,2", XP_ONLY }, /* stio.l isrc1ni,isrc2 */ +{ "stio.s", 0x4c000209, 0xb00005f6, "1,2", XP_ONLY }, /* stio.s isrc1ni,isrc2 */ +{ "stio.b", 0x4c000009, 0xb00007f6, "1,2", XP_ONLY }, /* stio.b isrc1ni,isrc2 */ +{ "ldint.l", 0x4c00040a, 0xb00003f5, "2,d", XP_ONLY }, /* ldint.l isrc2,idest */ +{ "ldint.s", 0x4c00020a, 0xb00005f5, "2,d", XP_ONLY }, /* ldint.s isrc2,idest */ +{ "ldint.b", 0x4c00000a, 0xb00007f5, "2,d", XP_ONLY }, /* ldint.b isrc2,idest */ +{ "scyc.b", 0x4c00000b, 0xb00007f4, "2", XP_ONLY }, /* scyc.b isrc2 */ /* CTRL-Format Instructions */ { "br", 0x68000000, 0x94000000, "l", E_DELAY }, /* br lbroff */ diff --git a/include/opcode/ppc.h b/include/opcode/ppc.h index ffd313acd52..c4adf712b75 100644 --- a/include/opcode/ppc.h +++ b/include/opcode/ppc.h @@ -1,5 +1,5 @@ /* ppc.h -- Header file for PowerPC opcode table - Copyright 1994, 1995, 1999, 2000, 2001, 2002 + Copyright 1994, 1995, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support @@ -273,6 +273,9 @@ extern const struct powerpc_operand powerpc_operands[]; /* This operand is for the DS field in a DS form instruction. */ #define PPC_OPERAND_DS (020000) + +/* This operand is for the DQ field in a DQ form instruction. */ +#define PPC_OPERAND_DQ (040000) /* The POWER and PowerPC assemblers use a few macros. We keep them with the operands table for simplicity. The macro table is an diff --git a/include/safe-ctype.h b/include/safe-ctype.h index b2ad8490bd0..69a3f74cc6f 100644 --- a/include/safe-ctype.h +++ b/include/safe-ctype.h @@ -37,7 +37,24 @@ Boston, MA 02111-1307, USA. */ #ifdef isalpha #error "safe-ctype.h and ctype.h may not be used simultaneously" +#endif + +/* Determine host character set. */ +#define HOST_CHARSET_UNKNOWN 0 +#define HOST_CHARSET_ASCII 1 +#define HOST_CHARSET_EBCDIC 2 + +#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \ + && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21 +# define HOST_CHARSET HOST_CHARSET_ASCII #else +# if '\n' == 0x15 && ' ' == 0x40 && '0' == 0xF0 \ + && 'A' == 0xC1 && 'a' == 0x81 && '!' == 0x5A +# define HOST_CHARSET HOST_CHARSET_EBCDIC +# else +# define HOST_CHARSET HOST_CHARSET_UNKNOWN +# endif +#endif /* Categories. */ @@ -99,5 +116,4 @@ extern const unsigned char _sch_tolower[256]; #define TOUPPER(c) _sch_toupper[(c) & 0xff] #define TOLOWER(c) _sch_tolower[(c) & 0xff] -#endif /* no ctype.h */ #endif /* SAFE_CTYPE_H */ diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index d26d5ef3e07..99f2f0a695a 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,51 @@ +2003-06-26 H.J. Lu + + * testsuite/demangle-expected: Add more GNU V3 testcases. + +2003-06-22 Zack Weinberg + + * safe-ctype.c: Use HOST_CHARSET_ASCII and HOST_CHARSET_EBCDIC, + not HC_ASCII and HC_EBCDIC. + Add documentation in form expected by gather-docs. + * hex.c: Use HOST_CHARSET, not hand-coded check of character set. + * Makefile.in, functions.texi: Regenerate. + +2003-06-21 Zack Weinberg + + * safe-ctype.c: Separate out EOF==-1 check. Use HOST_CHARSET + for charset determination. + +2003-06-19 Dara Hazeghi + + * configure.in: Add check for malloc.h needed by + m68k for function free(). + * configure: Regenerated. + * config.in: Add HAVE_MALLOC_H. + * hashtab.c: include malloc.h were available for + free(). + +2003-06-09 Albert Chin-A-Young + + PR bootstrap/10974 + * physmem.c: Update comment. + * configure.in: Modify test for _system_configuration for older + AIX systems. + + * config.in, configure: Regenerated. + +2003-06-05 John David Anglin + + PR other/10810 + * test-demangle.c (getline): Fix fence-post error. + +2003-06-03 Nick Clifton + + * asprintf.c: Change comment to note that -1 is returned upon + error. + * vasprintf.c: Likewise. + (vasprintf): Return -1 upon error. + * functions.texi: Document changes to asprintf and vasprintf. + 2003-05-19 Kelley Cook * config.table: Accept i[345867]86 variant. @@ -78,7 +126,7 @@ ANSI_PROTOTYPES. * vsprintf.c: Include "ansidecl.h" earlier, rely on ANSI_PROTOTYPES and possibly include . - + * Makefile.in: Regenerate dependencies. 2003-04-15 DJ Delorie @@ -176,7 +224,7 @@ 2003-02-22 Kaveh R. Ghazi Richard Earnshaw Geoffrey Keating - + * configure.in: Check for sys/sysctl.h and sysctl. * physmem.c: Add support for *bsd and darwin. * Makefile.in: Generate depedency for physmem.o. @@ -205,7 +253,7 @@ * 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 * Makefile.in (CFILES): Add physmem.c. diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in index d73ab2fef77..5d2dc3cbf8d 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in @@ -447,7 +447,8 @@ getpwd.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h getruntime.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h hashtab.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/hashtab.h \ $(INCDIR)/libiberty.h -hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ + $(INCDIR)/safe-ctype.h lbasename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h lrealpath.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h diff --git a/libiberty/asprintf.c b/libiberty/asprintf.c index 5de775616d0..cd0543aa7ad 100644 --- a/libiberty/asprintf.c +++ b/libiberty/asprintf.c @@ -1,6 +1,6 @@ /* Like sprintf but provides a pointer to malloc'd storage, which must be freed by the caller. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 2003 Free Software Foundation, Inc. Contributed by Cygnus Solutions. This file is part of the libiberty library. @@ -37,7 +37,7 @@ pass a pointer to a pointer. This function will compute the size of the buffer needed, allocate memory with @code{malloc}, and store a pointer to the allocated memory in @code{*@var{resptr}}. The value returned is the same as @code{sprintf} would return. If memory could -not be allocated, zero is returned and @code{NULL} is stored in +not be allocated, minus one is returned and @code{NULL} is stored in @code{*@var{resptr}}. @end deftypefn diff --git a/libiberty/config.in b/libiberty/config.in index 14ab3793c5c..50ed3266852 100644 --- a/libiberty/config.in +++ b/libiberty/config.in @@ -291,6 +291,9 @@ /* Define if you have the header file. */ #undef HAVE_UNISTD_H +/* Define if you have the header file. */ +#undef HAVE_MALLOC_H + /* whether byteorder is bigendian */ #undef WORDS_BIGENDIAN @@ -316,9 +319,6 @@ /* 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. */ @@ -331,6 +331,9 @@ STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION +/* Define if you have the _system_configuration variable. */ +#undef HAVE__SYSTEM_CONFIGURATION + /* 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 d0899a2dcbb..77d5170a877 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -1492,7 +1492,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 sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h +for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h malloc.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 @@ -1875,7 +1875,7 @@ funcs="$funcs waitpid" # Also in the old function.def file: alloca, vfork, getopt. -vars="sys_errlist sys_nerr sys_siglist _system_configuration" +vars="sys_errlist sys_nerr sys_siglist" checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday" checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp" @@ -1957,10 +1957,6 @@ EOF cat >> confdefs.h <<\EOF #define HAVE_SYS_SIGLIST 1 -EOF - - cat >> confdefs.h <<\EOF -#define HAVE__SYSTEM_CONFIGURATION 1 EOF fi @@ -2157,7 +2153,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:2161: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2157: 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. @@ -2168,12 +2164,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2172 "configure" +#line 2168 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2173: \"$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 @@ -2199,19 +2195,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:2203: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2199: 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:2210: checking for $ac_func" >&5 +echo "configure:2206: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2234: \"$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 @@ -2261,12 +2257,12 @@ done echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2265: checking whether alloca needs Cray hooks" >&5 +echo "configure:2261: 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 <&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:2295: checking for $ac_func" >&5 +echo "configure:2291: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2319: \"$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 @@ -2345,7 +2341,7 @@ fi fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2349: checking stack direction for C alloca" >&5 +echo "configure:2345: 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 @@ -2353,7 +2349,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2372: \"$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 @@ -2394,17 +2390,17 @@ EOF ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2398: checking for vfork.h" >&5 +echo "configure:2394: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2404: \"$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* @@ -2429,18 +2425,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2433: checking for working vfork" >&5 +echo "configure:2429: 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:2439: checking for vfork" >&5 +echo "configure:2435: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2463: \"$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 @@ -2485,7 +2481,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -2580,7 +2576,7 @@ main() { } } EOF -if { (eval echo configure:2584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2580: \"$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 @@ -2612,12 +2608,12 @@ fi for ac_func in _doprnt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2616: checking for $ac_func" >&5 +echo "configure:2612: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2640: \"$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 @@ -2670,12 +2666,12 @@ done for ac_func in _doprnt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2674: checking for $ac_func" >&5 +echo "configure:2670: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2698: \"$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 @@ -2726,19 +2722,19 @@ done for v in $vars; do echo $ac_n "checking for $v""... $ac_c" 1>&6 -echo "configure:2730: checking for $v" >&5 +echo "configure:2726: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2738: \"$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 @@ -2761,15 +2757,43 @@ EOF echo "$ac_t""no" 1>&6 fi done + + # special check for _system_configuration because AIX <4.3.2 do not + # contain the `physmem' member. + echo $ac_n "checking for external symbol _system_configuration""... $ac_c" 1>&6 +echo "configure:2765: checking for external symbol _system_configuration" >&5 + cat > conftest.$ac_ext < +int main() { +double x = _system_configuration.physmem; +; return 0; } +EOF +if { (eval echo configure:2774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE__SYSTEM_CONFIGURATION 1 +EOF + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + for ac_func in $checkfuncs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2768: checking for $ac_func" >&5 +echo "configure:2792: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2820: \"$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 @@ -2817,12 +2841,12 @@ fi done echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6 -echo "configure:2821: checking whether canonicalize_file_name must be declared" >&5 +echo "configure:2845: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libiberty_cv_decl_needed_canonicalize_file_name=no else @@ -2876,21 +2900,21 @@ case "${host}" in esac -for ac_hdr in unistd.h +for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2884: checking for $ac_hdr" >&5 +echo "configure:2908: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2918: \"$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* @@ -2919,12 +2943,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2923: checking for $ac_func" >&5 +echo "configure:2947: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2975: \"$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 @@ -2972,7 +2996,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2976: checking for working mmap" >&5 +echo "configure:3000: 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 @@ -2980,7 +3004,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include +#if HAVE_SYS_TYPES_H +# include +#endif + +#if HAVE_STDLIB_H +# include +#endif + +#if HAVE_SYS_STAT_H +# include +#endif + +#if HAVE_UNISTD_H +# include +#endif + /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -3120,7 +3157,7 @@ main() } EOF -if { (eval echo configure:3124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3161: \"$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 @@ -3144,7 +3181,7 @@ fi echo $ac_n "checking for working strncmp""... $ac_c" 1>&6 -echo "configure:3148: checking for working strncmp" >&5 +echo "configure:3185: 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 @@ -3152,7 +3189,7 @@ else ac_cv_func_strncmp_works=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3257: \"$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 diff --git a/libiberty/configure.in b/libiberty/configure.in index 4a704e8cec2..5dca13ed6f6 100644 --- a/libiberty/configure.in +++ b/libiberty/configure.in @@ -143,7 +143,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 sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h) +AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h malloc.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 @@ -209,7 +209,7 @@ funcs="$funcs waitpid" # Also in the old function.def file: alloca, vfork, getopt. -vars="sys_errlist sys_nerr sys_siglist _system_configuration" +vars="sys_errlist sys_nerr sys_siglist" checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday" checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp" @@ -230,7 +230,6 @@ if test "x" = "y"; then 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 @@ -433,6 +432,17 @@ if test -z "${setobjs}"; then AC_MSG_RESULT(no) fi done + + # special check for _system_configuration because AIX <4.3.2 do not + # contain the `physmem' member. + AC_MSG_CHECKING([for external symbol _system_configuration]) + AC_TRY_COMPILE([#include ], + [double x = _system_configuration.physmem;], + [AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, + [Define if you have the _system_configuration variable.])], + [AC_MSG_RESULT([no])]) + AC_CHECK_FUNCS($checkfuncs) libiberty_NEED_DECLARATION(canonicalize_file_name) fi diff --git a/libiberty/functions.texi b/libiberty/functions.texi index b34c20409e3..aac4424fd8f 100644 --- a/libiberty/functions.texi +++ b/libiberty/functions.texi @@ -3,6 +3,28 @@ @c Edit the *.c files, configure with --enable-maintainer-mode, @c and let gather-docs build you a new copy. +@c safe-ctype.c:24 +@defvr Extension HOST_CHARSET +This macro indicates the basic character set and encoding used by the +host: more precisely, the encoding used for character constants in +preprocessor @samp{#if} statements (the C "execution character set"). +It is defined by @file{safe-ctype.h}, and will be an integer constant +with one of the following values: + +@ftable @code +@item HOST_CHARSET_UNKNOWN +The host character set is unknown - that is, not one of the next two +possibilities. + +@item HOST_CHARSET_ASCII +The host character set is ASCII. + +@item HOST_CHARSET_EBCDIC +The host character set is some variant of EBCDIC. (Only one of the +nineteen EBCDIC varying characters is tested; exercise caution.) +@end ftable +@end defvr + @c alloca.c:26 @deftypefn Replacement void* alloca (size_t @var{size}) @@ -29,7 +51,7 @@ pass a pointer to a pointer. This function will compute the size of the buffer needed, allocate memory with @code{malloc}, and store a pointer to the allocated memory in @code{*@var{resptr}}. The value returned is the same as @code{sprintf} would return. If memory could -not be allocated, zero is returned and @code{NULL} is stored in +not be allocated, minus one is returned and @code{NULL} is stored in @code{*@var{resptr}}. @end deftypefn @@ -317,7 +339,7 @@ between calls to @code{getpwd}. @end deftypefn -@c hex.c:25 +@c hex.c:30 @deftypefn Extension void hex_init (void) Initializes the array mapping the current character set to @@ -327,7 +349,7 @@ default ASCII-based table will normally be used on ASCII systems. @end deftypefn -@c hex.c:34 +@c hex.c:39 @deftypefn Extension int hex_p (int @var{c}) Evaluates to non-zero if the given character is a valid hex character, @@ -336,7 +358,7 @@ or zero if it is not. Note that the value you pass will be cast to @end deftypefn -@c hex.c:42 +@c hex.c:47 @deftypefn Extension unsigned int hex_value (int @var{c}) Returns the numeric equivalent of the given character when interpreted @@ -382,6 +404,78 @@ struct qelem @{ @end deftypefn +@c safe-ctype.c:45 +@deffn Extension ISALPHA (@var{c}) +@deffnx Extension ISALNUM (@var{c}) +@deffnx Extension ISBLANK (@var{c}) +@deffnx Extension ISCNTRL (@var{c}) +@deffnx Extension ISDIGIT (@var{c}) +@deffnx Extension ISGRAPH (@var{c}) +@deffnx Extension ISLOWER (@var{c}) +@deffnx Extension ISPRINT (@var{c}) +@deffnx Extension ISPUNCT (@var{c}) +@deffnx Extension ISSPACE (@var{c}) +@deffnx Extension ISUPPER (@var{c}) +@deffnx Extension ISXDIGIT (@var{c}) + +These twelve macros are defined by @file{safe-ctype.h}. Each has the +same meaning as the corresponding macro (with name in lowercase) +defined by the standard header @file{ctype.h}. For example, +@code{ISALPHA} returns true for alphabetic characters and false for +others. However, there are two differences between these macros and +those provided by @file{ctype.h}: + +@itemize @bullet +@item These macros are guaranteed to have well-defined behavior for all +values representable by @code{signed char} and @code{unsigned char}, and +for @code{EOF}. + +@item These macros ignore the current locale; they are true for these +fixed sets of characters: +@multitable {@code{XDIGIT}} {yada yada yada yada yada yada yada yada} +@item @code{ALPHA} @tab @kbd{A-Za-z} +@item @code{ALNUM} @tab @kbd{A-Za-z0-9} +@item @code{BLANK} @tab @kbd{space tab} +@item @code{CNTRL} @tab @code{!PRINT} +@item @code{DIGIT} @tab @kbd{0-9} +@item @code{GRAPH} @tab @code{ALNUM || PUNCT} +@item @code{LOWER} @tab @kbd{a-z} +@item @code{PRINT} @tab @code{GRAPH ||} @kbd{space} +@item @code{PUNCT} @tab @kbd{`~!@@#$%^&*()_-=+[@{]@}\|;:'",<.>/?} +@item @code{SPACE} @tab @kbd{space tab \n \r \f \v} +@item @code{UPPER} @tab @kbd{A-Z} +@item @code{XDIGIT} @tab @kbd{0-9A-Fa-f} +@end multitable + +Note that, if the host character set is ASCII or a superset thereof, +all these macros will return false for all values of @code{char} outside +the range of 7-bit ASCII. In particular, both ISPRINT and ISCNTRL return +false for characters with numeric values from 128 to 255. +@end itemize +@end deffn + +@c safe-ctype.c:94 +@deffn Extension ISIDNUM (@var{c}) +@deffnx Extension ISIDST (@var{c}) +@deffnx Extension IS_VSPACE (@var{c}) +@deffnx Extension IS_NVSPACE (@var{c}) +@deffnx Extension IS_SPACE_OR_NUL (@var{c}) +@deffnx Extension IS_ISOBASIC (@var{c}) +These six macros are defined by @file{safe-ctype.h} and provide +additional character classes which are useful when doing lexical +analysis of C or similar languages. They are true for the following +sets of characters: + +@multitable {@code{SPACE_OR_NUL}} {yada yada yada yada yada yada yada yada} +@item @code{IDNUM} @tab @kbd{A-Za-z0-9_} +@item @code{IDST} @tab @kbd{A-Za-z_} +@item @code{VSPACE} @tab @kbd{\r \n} +@item @code{NVSPACE} @tab @kbd{space tab \f \v \0} +@item @code{SPACE_OR_NUL} @tab @code{VSPACE || NVSPACE} +@item @code{ISOBASIC} @tab @code{VSPACE || NVSPACE || PRINT} +@end multitable +@end deffn + @c lbasename.c:23 @deftypefn Replacement {const char*} lbasename (const char *@var{name}) @@ -922,7 +1016,7 @@ you pass a pointer to a pointer. This function will compute the size of the buffer needed, allocate memory with @code{malloc}, and store a pointer to the allocated memory in @code{*@var{resptr}}. The value returned is the same as @code{vsprintf} would return. If memory could -not be allocated, zero is returned and @code{NULL} is stored in +not be allocated, minus one is returned and @code{NULL} is stored in @code{*@var{resptr}}. @end deftypefn diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index 3896328717a..cbf82592be1 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -45,6 +45,10 @@ Boston, MA 02111-1307, USA. */ #include #endif +#ifdef HAVE_MALLOC_H +#include +#endif + #include #include "libiberty.h" diff --git a/libiberty/hex.c b/libiberty/hex.c index f425509be75..e4c5dfa2f1d 100644 --- a/libiberty/hex.c +++ b/libiberty/hex.c @@ -19,6 +19,11 @@ Boston, MA 02111-1307, USA. */ #include /* for EOF */ #include "libiberty.h" +#include "safe-ctype.h" /* for HOST_CHARSET_ASCII */ + +#if EOF != -1 + #error "hex.c requires EOF == -1" +#endif /* @@ -62,9 +67,7 @@ systems. /* Are we ASCII? */ -#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \ - && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21 \ - && EOF == -1 +#if HOST_CHARSET == HOST_CHARSET_ASCII const unsigned char _hex_value[_hex_array_size] = { diff --git a/libiberty/physmem.c b/libiberty/physmem.c index 9185c1224e8..f64e07c74d4 100644 --- a/libiberty/physmem.c +++ b/libiberty/physmem.c @@ -145,7 +145,7 @@ physmem_total () #endif #if HAVE__SYSTEM_CONFIGURATION - /* This works on AIX. */ + /* This works on AIX 4.3.3+. */ return _system_configuration.physmem; #endif diff --git a/libiberty/safe-ctype.c b/libiberty/safe-ctype.c index 3bac84bf68a..91a0e9a2589 100644 --- a/libiberty/safe-ctype.c +++ b/libiberty/safe-ctype.c @@ -19,20 +19,109 @@ License along with libiberty; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* This is a compatible replacement of the standard C library's - with the following properties: - - - Implements all isxxx() macros required by C99. - - Also implements some character classes useful when - parsing C-like languages. - - Does not change behavior depending on the current locale. - - Behaves properly for all values in the range of a signed or - unsigned char. */ +/* + +@defvr Extension HOST_CHARSET +This macro indicates the basic character set and encoding used by the +host: more precisely, the encoding used for character constants in +preprocessor @samp{#if} statements (the C "execution character set"). +It is defined by @file{safe-ctype.h}, and will be an integer constant +with one of the following values: + +@ftable @code +@item HOST_CHARSET_UNKNOWN +The host character set is unknown - that is, not one of the next two +possibilities. + +@item HOST_CHARSET_ASCII +The host character set is ASCII. + +@item HOST_CHARSET_EBCDIC +The host character set is some variant of EBCDIC. (Only one of the +nineteen EBCDIC varying characters is tested; exercise caution.) +@end ftable +@end defvr + +@deffn Extension ISALPHA (@var{c}) +@deffnx Extension ISALNUM (@var{c}) +@deffnx Extension ISBLANK (@var{c}) +@deffnx Extension ISCNTRL (@var{c}) +@deffnx Extension ISDIGIT (@var{c}) +@deffnx Extension ISGRAPH (@var{c}) +@deffnx Extension ISLOWER (@var{c}) +@deffnx Extension ISPRINT (@var{c}) +@deffnx Extension ISPUNCT (@var{c}) +@deffnx Extension ISSPACE (@var{c}) +@deffnx Extension ISUPPER (@var{c}) +@deffnx Extension ISXDIGIT (@var{c}) + +These twelve macros are defined by @file{safe-ctype.h}. Each has the +same meaning as the corresponding macro (with name in lowercase) +defined by the standard header @file{ctype.h}. For example, +@code{ISALPHA} returns true for alphabetic characters and false for +others. However, there are two differences between these macros and +those provided by @file{ctype.h}: + +@itemize @bullet +@item These macros are guaranteed to have well-defined behavior for all +values representable by @code{signed char} and @code{unsigned char}, and +for @code{EOF}. + +@item These macros ignore the current locale; they are true for these +fixed sets of characters: +@multitable {@code{XDIGIT}} {yada yada yada yada yada yada yada yada} +@item @code{ALPHA} @tab @kbd{A-Za-z} +@item @code{ALNUM} @tab @kbd{A-Za-z0-9} +@item @code{BLANK} @tab @kbd{space tab} +@item @code{CNTRL} @tab @code{!PRINT} +@item @code{DIGIT} @tab @kbd{0-9} +@item @code{GRAPH} @tab @code{ALNUM || PUNCT} +@item @code{LOWER} @tab @kbd{a-z} +@item @code{PRINT} @tab @code{GRAPH ||} @kbd{space} +@item @code{PUNCT} @tab @kbd{`~!@@#$%^&*()_-=+[@{]@}\|;:'",<.>/?} +@item @code{SPACE} @tab @kbd{space tab \n \r \f \v} +@item @code{UPPER} @tab @kbd{A-Z} +@item @code{XDIGIT} @tab @kbd{0-9A-Fa-f} +@end multitable + +Note that, if the host character set is ASCII or a superset thereof, +all these macros will return false for all values of @code{char} outside +the range of 7-bit ASCII. In particular, both ISPRINT and ISCNTRL return +false for characters with numeric values from 128 to 255. +@end itemize +@end deffn + +@deffn Extension ISIDNUM (@var{c}) +@deffnx Extension ISIDST (@var{c}) +@deffnx Extension IS_VSPACE (@var{c}) +@deffnx Extension IS_NVSPACE (@var{c}) +@deffnx Extension IS_SPACE_OR_NUL (@var{c}) +@deffnx Extension IS_ISOBASIC (@var{c}) +These six macros are defined by @file{safe-ctype.h} and provide +additional character classes which are useful when doing lexical +analysis of C or similar languages. They are true for the following +sets of characters: + +@multitable {@code{SPACE_OR_NUL}} {yada yada yada yada yada yada yada yada} +@item @code{IDNUM} @tab @kbd{A-Za-z0-9_} +@item @code{IDST} @tab @kbd{A-Za-z_} +@item @code{VSPACE} @tab @kbd{\r \n} +@item @code{NVSPACE} @tab @kbd{space tab \f \v \0} +@item @code{SPACE_OR_NUL} @tab @code{VSPACE || NVSPACE} +@item @code{ISOBASIC} @tab @code{VSPACE || NVSPACE || PRINT} +@end multitable +@end deffn + +*/ #include "ansidecl.h" #include #include /* for EOF */ +#if EOF != -1 + #error " requires EOF == -1" +#endif + /* Shorthand */ #define bl _sch_isblank #define cn _sch_iscntrl @@ -64,9 +153,7 @@ Boston, MA 02111-1307, USA. */ #define S (const unsigned short) (nv|sp|bl|pr) /* space */ /* Are we ASCII? */ -#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \ - && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21 \ - && EOF == -1 +#if HOST_CHARSET == HOST_CHARSET_ASCII const unsigned short _sch_istable[256] = { @@ -159,5 +246,9 @@ const unsigned char _sch_toupper[256] = }; #else - #error "Unsupported host character set" -#endif /* not ASCII */ +# if HOST_CHARSET == HOST_CHARSET_EBCDIC + #error "FIXME: write tables for EBCDIC" +# else + #error "Unrecognized host character set" +# endif +#endif diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index c0483188239..6be66e10b48 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -2598,9 +2598,269 @@ _Utf58_0_1__1_2147483647__2147483648 --format=gnu-v3 St9bad_alloc std::bad_alloc +# +--format=gnu-v3 +_ZN1f1fE +f::f +# +--format=gnu-v3 +_Z1fv +f() +# +--format=gnu-v3 +_Z1fi +f(int) +# +--format=gnu-v3 +_Z3foo3bar +foo(bar) +# +--format=gnu-v3 +_Zrm1XS_ +operator%(X, X) +# +--format=gnu-v3 +_ZplR1XS0_ +operator+(X&, X&) +# +--format=gnu-v3 +_ZlsRK1XS1_ +operator<<(X const&, X const&) +# +--format=gnu-v3 +_ZN3FooIA4_iE3barE +Foo::bar +# +--format=gnu-v3 +_Z1fIiEvi +void f(int) +# +--format=gnu-v3 +_Z5firstI3DuoEvS0_ +void first(Duo) +# +--format=gnu-v3 +_Z5firstI3DuoEvT_ +void first(Duo) +# +--format=gnu-v3 +_Z3fooIiFvdEiEvv +void foo() +# +--format=gnu-v3 +_ZN1N1fE +N::f +# +--format=gnu-v3 +_ZN6System5Sound4beepEv +System::Sound::beep() +# +--format=gnu-v3 +_ZN5Arena5levelE +Arena::level +# +--format=gnu-v3 +_ZN5StackIiiE5levelE +Stack::level +# +--format=gnu-v3 +_Z1fI1XEvPVN1AIT_E1TE +void f(A::T volatile*) +# +--format=gnu-v3 +_ZngILi42EEvN1AIXplT_Li2EEE1TE +void operator-<42>(A<(42) + (2)>::T) +# +--format=gnu-v3 +_Z4makeI7FactoryiET_IT0_Ev +Factory make() +# +--format=gnu-v3 +_Z4makeI7FactoryiET_IT0_Ev +Factory make() +# +--format=gnu-v3 +_Z3foo5Hello5WorldS0_S_ +foo(Hello, World, World, Hello) +# +--format=gnu-v3 +_Z3fooPM2ABi +foo(int AB::**) +# +--format=gnu-v3 +_ZlsRSoRKSs +operator<<(std::ostream&, std::string const&) +# +--format=gnu-v3 +_ZTI7a_class +typeinfo for a_class +# +--format=gnu-v3 +U4_farrVKPi +int* restrict volatile const _far +# +--format=gnu-v3 +_Z3fooILi2EEvRAplT_Li1E_i +void foo<2>(int (&) [(2) + (1)]) +# +--format=gnu-v3 +_Z1fM1AKFvvE +f(void (A::*)() const) +# +--format=gnu-v3 +_Z3fooc +foo(char) +# +--format=gnu-v3 +2CBIL_Z3foocEE +CB +# +--format=gnu-v3 +2CBIL_Z7IsEmptyEE +CB +# +--format=gnu-v3 +_ZZN1N1fEiE1p +N::f(int)::p +# +--format=gnu-v3 +_ZZN1N1fEiEs +N::f(int)::string literal +# +--format=gnu-v3 +_Z1fPFvvEM1SFvvE +f(void (*)(), void (S::*)()) +# +--format=gnu-v3 +_ZN1N1TIiiE2mfES0_IddE +N::T::mf(N::T) +# +--format=gnu-v3 +_ZSt5state +std::state +# +--format=gnu-v3 +_ZNSt3_In4wardE +std::_In::ward +# +--format=gnu-v3 +_Z1fKPFiiE +f(int (* const)(int)) +# +--format=gnu-v3 +_Z1fAszL_ZZNK1N1A1fEvE3foo_0E_i +f(int[sizeof(N::A::f() const::foo)]) +# +--format=gnu-v3 +_Z1fA37_iPS_ +f(int[37], int (*) [37]) +# +--format=gnu-v3 +_Z1fM1AFivEPS0_ +f(int (A::*)(), int (*)()) +# +--format=gnu-v3 +_Z1fPFPA1_ivE +f(int (*(*)()) [1]) +# +--format=gnu-v3 +_Z1fPKM1AFivE +f(int (A::* const*)()) +# +--format=gnu-v3 +_Z1jM1AFivEPS1_ +j(int (A::*)(), int (A::**)()) +# +--format=gnu-v3 +_Z1sPA37_iPS0_ +s(int (*) [37], int (**) [37]) +# +--format=gnu-v3 +_Z3fooA30_A_i +foo(int[30][]) +# +--format=gnu-v3 +_Z3kooPA28_A30_i +koo(int (*) [28][30]) +# +--format=gnu-v3 +_ZlsRKU3fooU4bart1XS0_ +operator<<(X bart foo const&, X bart) +# +--format=gnu-v3 +_ZlsRKU3fooU4bart1XS2_ +operator<<(X bart foo const&, X bart foo const) +# +--format=gnu-v3 +_Z1fM1AKFivE +f(int (A::*)() const) +# +--format=gnu-v3 +_Z3absILi11EEvv +void abs<11>() +# +--format=gnu-v3 +_ZN1AIfEcvT_IiEEv +A::operator int() +# +--format=gnu-v3 +_ZN12libcw_app_ct10add_optionIS_EEvMT_FvPKcES3_cS3_S3_ +void libcw_app_ct::add_option(void (libcw_app_ct::*)(char const*), char const*, char, char const*, char const*) +# +--format=gnu-v3 +_ZGVN5libcw24_GLOBAL__N_cbll.cc0ZhUKa23compiler_bug_workaroundISt6vectorINS_13omanip_id_tctINS_5debug32memblk_types_manipulator_data_ctEEESaIS6_EEE3idsE +guard variable for libcw::(anonymous namespace)::compiler_bug_workaround, std::allocator > > >::ids +# +--format=gnu-v3 +_ZN5libcw5debug13cwprint_usingINS_9_private_12GlobalObjectEEENS0_17cwprint_using_tctIT_EERKS5_MS5_KFvRSt7ostreamE +libcw::debug::cwprint_using_tct libcw::debug::cwprint_using(libcw::_private_::GlobalObject const&, void (libcw::_private_::GlobalObject::*)(std::ostream&) const) +# +--format=gnu-v3 +_ZNKSt14priority_queueIP27timer_event_request_base_ctSt5dequeIS1_SaIS1_EE13timer_greaterE3topEv +std::priority_queue >, timer_greater>::top() const +# +--format=gnu-v3 +_ZNKSt15_Deque_iteratorIP15memory_block_stRKS1_PS2_EeqERKS5_ +std::_Deque_iterator::operator==(std::_Deque_iterator const&) const +# +--format=gnu-v3 +_ZNKSt17__normal_iteratorIPK6optionSt6vectorIS0_SaIS0_EEEmiERKS6_ +std::__normal_iterator