diff options
334 files changed, 12488 insertions, 8094 deletions
@@ -1,3 +1,76 @@ +2003-05-21 DJ Delorie <dj@redhat.com> + + * Makefile.tpl (configure-target-libiberty): Depend only on gcc, not + newlib or libgloss. + * Makefile.in: Regenerate. + +2003-05-21 DJ Delorie <dj@redhat.com> + + * Makefile.tpl: Add missing empty maybe-check-gcc target. + * Makefile.in: Regenerate. + +2003-05-20 Maciej W. Rozycki <macro@ds2.pg.gda.pl> + + * configure.in: Use curly braces in the definition of tooldir. + * configure: Regenerate. + +2003-05-19 Nathanael Nerode <neroden@gcc.gnu.org> + + * configure.in: Switch more things to use maybe dependencies. + * Makefile.tpl: Switch more things to use maybe dependencies. + Factor out common code from autogen IF statements. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2003-05-14 Kelley Cook <kelleycook@wideopenwest.com> + + * configure.in: Accept i[3456789]86 for machine type. + * configure: Regenerate. + +2003-05-18 Nathanael Nerode <neroden@gcc.gnu.org> + + * configure.in: Switch more things to use maybe dependencies. + Rearrange a little. Use GCC_TOPLEV_SUBDIRS. + * configure: Regenerate. + * Makefile.tpl: Switch more things to use maybe dependencies. + * Makefile.in: Regenerate. + +2003-05-16 Andreas Schwab <schwab@suse.de> + + * Makefile.tpl (install-opcodes): Define. + * Makefile.in: Rebuild. + +2003-05-13 Andreas Jaeger <aj@suse.de> + + * config.guess: Update to 2003-05-09 version. + * config.sub: Update to 2003-05-09 version. + +2003-05-13 Michael Eager <eager@mvista.com> + + * configure.in: Correct sed script so that options in quotes are not + deleted. + * configure: Rebuild. + +2003-05-12 Corinna Vinschen <corinna@vinschen.de> + + * configure.in (FLAGS_FOR_TARGET): Remove $$s/newlib/libc/sys/cygwin + and $$s/newlib/libc/sys/cygwin32 include paths. + * configure: Ditto. + +2003-05-05 H.J. Lu <hjl@gnu.org> + + * config-ml.in: Restored from gcc repository. + +2003-05-02 Chris Demetriou <cgd@broadcom.com> + + * Makefile.tpl: Require "makeinfo" from texinfo 4.2 or later. + * Makefile.in: Regenerate. + +2003-04-27 Daniel Jacobowitz <drow@mvista.com> + + * src-release (DEVO_SUPPORT): Add src-release, Makefile.tpl, + and Makefile.def. + 2003-04-30 David Carlton <carlton@bactrian.org> * Merge with mainline; tag is carlton_dictionary-20030430-merge. @@ -69,7 +142,7 @@ * Merge with mainline. Tag is carlton_dictionary-20030305-merge. 2003-03-04 Daniel Jacobowitz <drow@mvista.com> - + * configure.in: Include $(build_tooldir)/sys-include in FLAGS_FOR_TARGET. * configure: Regenerated. @@ -258,7 +331,7 @@ * configure.in (GDB_TK): Add tcl directories conditional on gdb/gdbtk directory being present. * configure: Regenerate. - + 2003-01-04 John David Anglin <dave.anglin@nrc.ca> * configure.in (LD): Improve test for gcc. Try to set LD to the ld used @@ -342,10 +415,10 @@ 2002-12-27 Nathanael Nerode <neroden@gcc.gnu.org> - * configure: Remove unneeded 'export's. Make CC_FOR_TARGET, + * configure: Remove unneeded 'export's. Make CC_FOR_TARGET, CXX_FOR_TARGET, GCJ_FOR_TARGET substituted in configure.in only. - * ChangeLog: Move a couple of entries from here to winsup/cygwin, + * ChangeLog: Move a couple of entries from here to winsup/cygwin, where they belong. 2002-12-24 Andreas Schwab <schwab@suse.de> @@ -519,7 +592,7 @@ * Makefile.tpl: Strip out useless setting of 'dir'. * Makefile.in: Regenerate. - + 2002-12-02 Nathanael Nerode <neroden@gcc.gnu.org> (finishing slow-motion replay) @@ -538,12 +611,12 @@ * Makefile.tpl: Remove unnecessary ifs. * Makefile.in: Regenerate. - * Makefile.tpl: Implement soft dependency machinery. Maybe-ize + * Makefile.tpl: Implement soft dependency machinery. Maybe-ize dependencies. Maybe-ize build-libiberty. Create dummy install targets for 'no_install' modules. - * configure: Move GDB_TK substitution to configure.in. Move + * configure: Move GDB_TK substitution to configure.in. Move build_modules stuff to configure.in. - * configure.in: Implement soft dependency machinery. Maybe-ize + * configure.in: Implement soft dependency machinery. Maybe-ize GDB_TK, rearrange slightly. Move build_modules stuff from configure. * Makefile.in: Regenerate. @@ -561,12 +634,12 @@ * ltcf-c.sh, ltcf-gcj.sh, Makefile.tpl: Correct BUILD/HOST confusion. - * configure.in: Produce lists of subdir targets we're actually + * configure.in: Produce lists of subdir targets we're actually configuring. Remove references to "dosrel". * Makefile.tpl: Let configure set which subdir targets are hit. - Remove install-cross; clean up install; remove ALL. Remove + Remove install-cross; clean up install; remove ALL. Remove references to "dosrel". Remove "EXTRA_TARGET_HOST" hackery. - Autogenerate host module targets. Remove empty dependency lines + Autogenerate host module targets. Remove empty dependency lines and redundant dependency; rearrange slightly. * Makefile.def: Add host-side libtermcap, utils. @@ -852,7 +925,7 @@ 2002-07-03 Nick Clifton <nickc@cambridge.redhat.com> * contrib: New directory. Created to contain a copy of the - texi2pod.pl script so that it is in the same place as the version in + texi2pod.pl script so that it is in the same place as the version in the FSF GCC sources. 2002-07-02 Nathanael Nerode <neroden@gcc.gnu.org> @@ -1068,7 +1141,7 @@ * configure.in (target_libs): Remove target-libchill. Do not compute CHILL_FOR_TARGET. * libchill: Remove directory. - + 2002-04-15 DJ Delorie <dj@redhat.com> * Makefile.in, configure.in, configure: Sync with gcc, entries @@ -1431,7 +1504,7 @@ Wed Sep 13 11:11:29 2000 Jeffrey A Law (law@cygnus.com) * configure.in: Re-enable all references to libg++ and librx. 2002-04-09 Loren James Rittle <rittle@labs.mot.com> - + * configure.in: Add *-*-freebsd* configurations. 2002-04-07 Andrew Cagney <ac131313@redhat.com> @@ -1583,7 +1656,7 @@ Wed Sep 13 11:11:29 2000 Jeffrey A Law (law@cygnus.com) libiberty. Import this patch from gcc: - + 2000-12-09 Laurynas Biveinis <lauras@softhome.net> * symlink-tree: handle DOS-style absolute paths. @@ -1733,7 +1806,7 @@ Wed Sep 13 11:11:29 2000 Jeffrey A Law (law@cygnus.com) Fri Jun 8 11:14:02 2001 Andrew Cagney <cagney@b1.cygnus.com> * Makefile.in (VER): When present, extract the version number from - the file version.in. + the file version.in. 2001-06-08 Alexandre Oliva <aoliva@redhat.com>, Jeff Sturm <jsturm@one-point.com> diff --git a/MAINTAINERS b/MAINTAINERS index a2e155b..718d374 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9,7 +9,7 @@ Makefile.in; configure; configure.in binutils@sources.redhat.com gdb-patches@sources.redhat.com -bfd/; binutils/; gas/; gprof/; ld/; opcodes/; BFD's part of include/ +bfd/; binutils/; gas/; gprof/; ld/; opcodes/; cpu/; BFD's part of include/ binutils: http://sources.redhat.com/binutils/ Patches to binutils@sources.redhat.com. Please notify the following of any interface changes: diff --git a/Makefile.in b/Makefile.in index 754329e..7511bc0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -191,13 +191,13 @@ M4 = `if [ -f $$r/m4/m4 ] ; \ then echo $$r/m4/m4 ; \ else echo ${DEFAULT_M4} ; fi` -# For an installed makeinfo, we require it to be from texinfo 4 or +# For an installed makeinfo, we require it to be from texinfo 4.2 or # higher, else we use the "missing" dummy. MAKEINFO=@MAKEINFO@ USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \ then echo $$r/texinfo/makeinfo/makeinfo ; \ else if (makeinfo --version \ - | egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \ + | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \ then echo makeinfo; else echo $$s/missing makeinfo; fi; fi` # This just becomes part of the MAKEINFO definition passed down to @@ -551,8 +551,90 @@ EXTRA_GCC_FLAGS = \ GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) -configure-host: @configure_host_modules@ -configure-target: @configure_target_modules@ +.PHONY: configure-host +configure-host: maybe-configure-gcc \ + maybe-configure-ash \ + maybe-configure-autoconf \ + maybe-configure-automake \ + maybe-configure-bash \ + maybe-configure-bfd \ + maybe-configure-opcodes \ + maybe-configure-binutils \ + maybe-configure-bison \ + maybe-configure-byacc \ + maybe-configure-bzip2 \ + maybe-configure-dejagnu \ + maybe-configure-diff \ + maybe-configure-dosutils \ + maybe-configure-etc \ + maybe-configure-fastjar \ + maybe-configure-fileutils \ + maybe-configure-findutils \ + maybe-configure-find \ + maybe-configure-flex \ + maybe-configure-gas \ + maybe-configure-gawk \ + maybe-configure-gettext \ + maybe-configure-gnuserv \ + maybe-configure-gprof \ + maybe-configure-gzip \ + maybe-configure-hello \ + maybe-configure-indent \ + maybe-configure-intl \ + maybe-configure-tcl \ + maybe-configure-itcl \ + maybe-configure-ld \ + maybe-configure-libgui \ + maybe-configure-libiberty \ + maybe-configure-libtool \ + maybe-configure-m4 \ + maybe-configure-make \ + maybe-configure-mmalloc \ + maybe-configure-patch \ + maybe-configure-perl \ + maybe-configure-prms \ + maybe-configure-rcs \ + maybe-configure-readline \ + maybe-configure-release \ + maybe-configure-recode \ + maybe-configure-sed \ + maybe-configure-send-pr \ + maybe-configure-shellutils \ + maybe-configure-sid \ + maybe-configure-sim \ + maybe-configure-tar \ + maybe-configure-texinfo \ + maybe-configure-textutils \ + maybe-configure-time \ + maybe-configure-uudecode \ + maybe-configure-wdiff \ + maybe-configure-zip \ + maybe-configure-zlib \ + maybe-configure-gdb \ + maybe-configure-expect \ + maybe-configure-guile \ + maybe-configure-tk \ + maybe-configure-tix \ + maybe-configure-libtermcap \ + maybe-configure-utils +.PHONY: configure-target +configure-target: \ + maybe-configure-target-libstdc++-v3 \ + maybe-configure-target-newlib \ + maybe-configure-target-libf2c \ + maybe-configure-target-libobjc \ + maybe-configure-target-libtermcap \ + maybe-configure-target-winsup \ + maybe-configure-target-libgloss \ + maybe-configure-target-libiberty \ + maybe-configure-target-gperf \ + maybe-configure-target-examples \ + maybe-configure-target-libffi \ + maybe-configure-target-libjava \ + maybe-configure-target-zlib \ + maybe-configure-target-boehm-gc \ + 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 = \ @@ -642,14 +724,93 @@ CLEAN_X11_MODULES = \ clean-tix # The target built for a native build. -# This list only includes modules actually being configured and built. .PHONY: all.normal -all.normal: @all_build_modules@ \ - @all_host_modules@ \ - @all_target_modules@ - -all-host: @all_host_modules@ -all-target: @all_target_modules@ +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 @@ -1170,8 +1331,87 @@ check: $(MAKE) do-check NOTPARALLEL=parallel-ok # Only include modules actually being configured and built. -do-check: @check_host_modules@ \ - @check_target_modules@ +do-check: maybe-check-gcc \ + maybe-check-ash \ + maybe-check-autoconf \ + maybe-check-automake \ + maybe-check-bash \ + maybe-check-bfd \ + maybe-check-opcodes \ + maybe-check-binutils \ + maybe-check-bison \ + maybe-check-byacc \ + maybe-check-bzip2 \ + maybe-check-dejagnu \ + maybe-check-diff \ + maybe-check-dosutils \ + maybe-check-etc \ + maybe-check-fastjar \ + maybe-check-fileutils \ + maybe-check-findutils \ + maybe-check-find \ + maybe-check-flex \ + maybe-check-gas \ + maybe-check-gawk \ + maybe-check-gettext \ + maybe-check-gnuserv \ + maybe-check-gprof \ + maybe-check-gzip \ + maybe-check-hello \ + maybe-check-indent \ + maybe-check-intl \ + maybe-check-tcl \ + maybe-check-itcl \ + maybe-check-ld \ + maybe-check-libgui \ + maybe-check-libiberty \ + maybe-check-libtool \ + maybe-check-m4 \ + maybe-check-make \ + maybe-check-mmalloc \ + maybe-check-patch \ + maybe-check-perl \ + maybe-check-prms \ + maybe-check-rcs \ + maybe-check-readline \ + maybe-check-release \ + maybe-check-recode \ + maybe-check-sed \ + maybe-check-send-pr \ + maybe-check-shellutils \ + maybe-check-sid \ + maybe-check-sim \ + maybe-check-tar \ + maybe-check-texinfo \ + maybe-check-textutils \ + maybe-check-time \ + maybe-check-uudecode \ + maybe-check-wdiff \ + maybe-check-zip \ + maybe-check-zlib \ + maybe-check-gdb \ + maybe-check-expect \ + maybe-check-guile \ + maybe-check-tk \ + maybe-check-tix \ + maybe-check-libtermcap \ + maybe-check-utils \ + maybe-check-target-libstdc++-v3 \ + maybe-check-target-newlib \ + maybe-check-target-libf2c \ + maybe-check-target-libobjc \ + maybe-check-target-libtermcap \ + maybe-check-target-winsup \ + maybe-check-target-libgloss \ + maybe-check-target-libiberty \ + maybe-check-target-gperf \ + maybe-check-target-examples \ + maybe-check-target-libffi \ + maybe-check-target-libjava \ + maybe-check-target-zlib \ + maybe-check-target-boehm-gc \ + maybe-check-target-qthreads \ + maybe-check-target-rda # Automated reporting of test results. @@ -1197,9 +1437,160 @@ mail-report-with-warnings.log: warning.log # Installation targets. .PHONY: install uninstall -install: installdirs @install_host_modules@ @install_target_modules@ - -install-target: @install_target_modules@ +install: installdirs install-host install-target + +.PHONY: install-host-nogcc +install-host-nogcc: \ + maybe-install-ash \ + maybe-install-autoconf \ + maybe-install-automake \ + maybe-install-bash \ + maybe-install-bfd \ + maybe-install-opcodes \ + maybe-install-binutils \ + maybe-install-bison \ + maybe-install-byacc \ + maybe-install-bzip2 \ + maybe-install-dejagnu \ + maybe-install-diff \ + maybe-install-dosutils \ + maybe-install-etc \ + maybe-install-fastjar \ + maybe-install-fileutils \ + maybe-install-findutils \ + maybe-install-find \ + maybe-install-flex \ + maybe-install-gas \ + maybe-install-gawk \ + maybe-install-gettext \ + maybe-install-gnuserv \ + maybe-install-gprof \ + maybe-install-gzip \ + maybe-install-hello \ + maybe-install-indent \ + maybe-install-intl \ + maybe-install-tcl \ + maybe-install-itcl \ + maybe-install-ld \ + maybe-install-libgui \ + maybe-install-libiberty \ + maybe-install-libtool \ + maybe-install-m4 \ + maybe-install-make \ + maybe-install-mmalloc \ + maybe-install-patch \ + maybe-install-perl \ + maybe-install-prms \ + maybe-install-rcs \ + maybe-install-readline \ + maybe-install-release \ + maybe-install-recode \ + maybe-install-sed \ + maybe-install-send-pr \ + maybe-install-shellutils \ + maybe-install-sid \ + maybe-install-sim \ + maybe-install-tar \ + maybe-install-texinfo \ + maybe-install-textutils \ + maybe-install-time \ + maybe-install-uudecode \ + maybe-install-wdiff \ + maybe-install-zip \ + maybe-install-zlib \ + maybe-install-gdb \ + maybe-install-expect \ + maybe-install-guile \ + maybe-install-tk \ + maybe-install-tix \ + maybe-install-libtermcap \ + maybe-install-utils + +.PHONY: install-host +install-host: maybe-install-gcc \ + maybe-install-ash \ + maybe-install-autoconf \ + maybe-install-automake \ + maybe-install-bash \ + maybe-install-bfd \ + maybe-install-opcodes \ + maybe-install-binutils \ + maybe-install-bison \ + maybe-install-byacc \ + maybe-install-bzip2 \ + maybe-install-dejagnu \ + maybe-install-diff \ + maybe-install-dosutils \ + maybe-install-etc \ + maybe-install-fastjar \ + maybe-install-fileutils \ + maybe-install-findutils \ + maybe-install-find \ + maybe-install-flex \ + maybe-install-gas \ + maybe-install-gawk \ + maybe-install-gettext \ + maybe-install-gnuserv \ + maybe-install-gprof \ + maybe-install-gzip \ + maybe-install-hello \ + maybe-install-indent \ + maybe-install-intl \ + maybe-install-tcl \ + maybe-install-itcl \ + maybe-install-ld \ + maybe-install-libgui \ + maybe-install-libiberty \ + maybe-install-libtool \ + maybe-install-m4 \ + maybe-install-make \ + maybe-install-mmalloc \ + maybe-install-patch \ + maybe-install-perl \ + maybe-install-prms \ + maybe-install-rcs \ + maybe-install-readline \ + maybe-install-release \ + maybe-install-recode \ + maybe-install-sed \ + maybe-install-send-pr \ + maybe-install-shellutils \ + maybe-install-sid \ + maybe-install-sim \ + maybe-install-tar \ + maybe-install-texinfo \ + maybe-install-textutils \ + maybe-install-time \ + maybe-install-uudecode \ + maybe-install-wdiff \ + maybe-install-zip \ + maybe-install-zlib \ + maybe-install-gdb \ + maybe-install-expect \ + maybe-install-guile \ + maybe-install-tk \ + maybe-install-tix \ + maybe-install-libtermcap \ + maybe-install-utils + +.PHONY: install-target +install-target: \ + maybe-install-target-libstdc++-v3 \ + maybe-install-target-newlib \ + maybe-install-target-libf2c \ + maybe-install-target-libobjc \ + maybe-install-target-libtermcap \ + maybe-install-target-winsup \ + maybe-install-target-libgloss \ + maybe-install-target-libiberty \ + maybe-install-target-gperf \ + maybe-install-target-examples \ + maybe-install-target-libffi \ + maybe-install-target-libjava \ + maybe-install-target-zlib \ + maybe-install-target-boehm-gc \ + maybe-install-target-qthreads \ + maybe-install-target-rda uninstall: @echo "the uninstall target is not supported in this tree" @@ -1218,8 +1609,8 @@ install.all: install-no-fixedincludes # install-no-fixedincludes is used because Cygnus can not distribute # the fixed header files. .PHONY: install-no-fixedincludes -install-no-fixedincludes: installdirs @install_host_modules_nogcc@ \ - @install_target_modules@ gcc-no-fixedincludes +install-no-fixedincludes: installdirs install-host-nogcc \ + install-target gcc-no-fixedincludes ### other supporting targets @@ -1377,8 +1768,9 @@ all-ash: configure-ash $(SET_LIB_PATH) \ (cd ash && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-ash maybe-check-ash +maybe-check-ash: -.PHONY: check-ash check-ash: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1386,9 +1778,9 @@ check-ash: (cd ash && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-ash maybe-install-ash maybe-install-ash: + install-ash: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1444,8 +1836,9 @@ all-autoconf: configure-autoconf $(SET_LIB_PATH) \ (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-autoconf maybe-check-autoconf +maybe-check-autoconf: -.PHONY: check-autoconf check-autoconf: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1453,9 +1846,9 @@ check-autoconf: (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-autoconf maybe-install-autoconf maybe-install-autoconf: + install-autoconf: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1511,8 +1904,9 @@ all-automake: configure-automake $(SET_LIB_PATH) \ (cd automake && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-automake maybe-check-automake +maybe-check-automake: -.PHONY: check-automake check-automake: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1520,9 +1914,9 @@ check-automake: (cd automake && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-automake maybe-install-automake maybe-install-automake: + install-automake: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1578,8 +1972,9 @@ all-bash: configure-bash $(SET_LIB_PATH) \ (cd bash && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-bash maybe-check-bash +maybe-check-bash: -.PHONY: check-bash check-bash: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1587,9 +1982,9 @@ check-bash: (cd bash && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-bash maybe-install-bash maybe-install-bash: + install-bash: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1645,8 +2040,9 @@ all-bfd: configure-bfd $(SET_LIB_PATH) \ (cd bfd && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-bfd maybe-check-bfd +maybe-check-bfd: -.PHONY: check-bfd check-bfd: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1654,9 +2050,9 @@ check-bfd: (cd bfd && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-bfd maybe-install-bfd maybe-install-bfd: + install-bfd: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1712,8 +2108,9 @@ all-opcodes: configure-opcodes $(SET_LIB_PATH) \ (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-opcodes maybe-check-opcodes +maybe-check-opcodes: -.PHONY: check-opcodes check-opcodes: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1721,9 +2118,9 @@ check-opcodes: (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-opcodes maybe-install-opcodes maybe-install-opcodes: + install-opcodes: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1779,8 +2176,9 @@ all-binutils: configure-binutils $(SET_LIB_PATH) \ (cd binutils && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-binutils maybe-check-binutils +maybe-check-binutils: -.PHONY: check-binutils check-binutils: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1788,9 +2186,9 @@ check-binutils: (cd binutils && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-binutils maybe-install-binutils maybe-install-binutils: + install-binutils: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1846,8 +2244,9 @@ all-bison: configure-bison $(SET_LIB_PATH) \ (cd bison && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-bison maybe-check-bison +maybe-check-bison: -.PHONY: check-bison # This module is only tested in a native toolchain. check-bison: @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ @@ -1858,9 +2257,9 @@ check-bison: fi - .PHONY: install-bison maybe-install-bison maybe-install-bison: + install-bison: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1916,8 +2315,9 @@ all-byacc: configure-byacc $(SET_LIB_PATH) \ (cd byacc && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-byacc maybe-check-byacc +maybe-check-byacc: -.PHONY: check-byacc # This module is only tested in a native toolchain. check-byacc: @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ @@ -1928,9 +2328,9 @@ check-byacc: fi - .PHONY: install-byacc maybe-install-byacc maybe-install-byacc: + install-byacc: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1986,8 +2386,9 @@ all-bzip2: configure-bzip2 $(SET_LIB_PATH) \ (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-bzip2 maybe-check-bzip2 +maybe-check-bzip2: -.PHONY: check-bzip2 check-bzip2: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -1995,9 +2396,9 @@ check-bzip2: (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-bzip2 maybe-install-bzip2 maybe-install-bzip2: + install-bzip2: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2053,8 +2454,9 @@ all-dejagnu: configure-dejagnu $(SET_LIB_PATH) \ (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-dejagnu maybe-check-dejagnu +maybe-check-dejagnu: -.PHONY: check-dejagnu check-dejagnu: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2062,9 +2464,9 @@ check-dejagnu: (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-dejagnu maybe-install-dejagnu maybe-install-dejagnu: + install-dejagnu: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2120,8 +2522,9 @@ all-diff: configure-diff $(SET_LIB_PATH) \ (cd diff && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-diff maybe-check-diff +maybe-check-diff: -.PHONY: check-diff check-diff: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2129,9 +2532,9 @@ check-diff: (cd diff && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-diff maybe-install-diff maybe-install-diff: + install-diff: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2187,14 +2590,15 @@ all-dosutils: configure-dosutils $(SET_LIB_PATH) \ (cd dosutils && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-dosutils maybe-check-dosutils +maybe-check-dosutils: -.PHONY: check-dosutils check-dosutils: - .PHONY: install-dosutils maybe-install-dosutils maybe-install-dosutils: + install-dosutils: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2250,8 +2654,9 @@ all-etc: configure-etc $(SET_LIB_PATH) \ (cd etc && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-etc maybe-check-etc +maybe-check-etc: -.PHONY: check-etc check-etc: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2259,9 +2664,9 @@ check-etc: (cd etc && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-etc maybe-install-etc maybe-install-etc: + install-etc: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2317,8 +2722,9 @@ all-fastjar: configure-fastjar $(SET_LIB_PATH) \ (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-fastjar maybe-check-fastjar +maybe-check-fastjar: -.PHONY: check-fastjar # This module is only tested in a native toolchain. check-fastjar: @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ @@ -2329,9 +2735,9 @@ check-fastjar: fi - .PHONY: install-fastjar maybe-install-fastjar maybe-install-fastjar: + install-fastjar: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2387,8 +2793,9 @@ all-fileutils: configure-fileutils $(SET_LIB_PATH) \ (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-fileutils maybe-check-fileutils +maybe-check-fileutils: -.PHONY: check-fileutils check-fileutils: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2396,9 +2803,9 @@ check-fileutils: (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-fileutils maybe-install-fileutils maybe-install-fileutils: + install-fileutils: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2454,8 +2861,9 @@ all-findutils: configure-findutils $(SET_LIB_PATH) \ (cd findutils && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-findutils maybe-check-findutils +maybe-check-findutils: -.PHONY: check-findutils check-findutils: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2463,9 +2871,9 @@ check-findutils: (cd findutils && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-findutils maybe-install-findutils maybe-install-findutils: + install-findutils: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2521,8 +2929,9 @@ all-find: configure-find $(SET_LIB_PATH) \ (cd find && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-find maybe-check-find +maybe-check-find: -.PHONY: check-find check-find: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2530,9 +2939,9 @@ check-find: (cd find && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-find maybe-install-find maybe-install-find: + install-find: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2588,8 +2997,9 @@ all-flex: configure-flex $(SET_LIB_PATH) \ (cd flex && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-flex maybe-check-flex +maybe-check-flex: -.PHONY: check-flex # This module is only tested in a native toolchain. check-flex: @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ @@ -2600,9 +3010,9 @@ check-flex: fi - .PHONY: install-flex maybe-install-flex maybe-install-flex: + install-flex: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2658,8 +3068,9 @@ all-gas: configure-gas $(SET_LIB_PATH) \ (cd gas && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-gas maybe-check-gas +maybe-check-gas: -.PHONY: check-gas check-gas: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2667,9 +3078,9 @@ check-gas: (cd gas && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-gas maybe-install-gas maybe-install-gas: + install-gas: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2725,8 +3136,9 @@ all-gawk: configure-gawk $(SET_LIB_PATH) \ (cd gawk && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-gawk maybe-check-gawk +maybe-check-gawk: -.PHONY: check-gawk check-gawk: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2734,9 +3146,9 @@ check-gawk: (cd gawk && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-gawk maybe-install-gawk maybe-install-gawk: + install-gawk: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2792,8 +3204,9 @@ all-gettext: configure-gettext $(SET_LIB_PATH) \ (cd gettext && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-gettext maybe-check-gettext +maybe-check-gettext: -.PHONY: check-gettext check-gettext: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2801,9 +3214,9 @@ check-gettext: (cd gettext && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-gettext maybe-install-gettext maybe-install-gettext: + install-gettext: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2859,8 +3272,9 @@ all-gnuserv: configure-gnuserv $(SET_LIB_PATH) \ (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-gnuserv maybe-check-gnuserv +maybe-check-gnuserv: -.PHONY: check-gnuserv check-gnuserv: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2868,9 +3282,9 @@ check-gnuserv: (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-gnuserv maybe-install-gnuserv maybe-install-gnuserv: + install-gnuserv: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2926,8 +3340,9 @@ all-gprof: configure-gprof $(SET_LIB_PATH) \ (cd gprof && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-gprof maybe-check-gprof +maybe-check-gprof: -.PHONY: check-gprof check-gprof: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2935,9 +3350,9 @@ check-gprof: (cd gprof && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-gprof maybe-install-gprof maybe-install-gprof: + install-gprof: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -2993,8 +3408,9 @@ all-gzip: configure-gzip $(SET_LIB_PATH) \ (cd gzip && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-gzip maybe-check-gzip +maybe-check-gzip: -.PHONY: check-gzip check-gzip: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3002,9 +3418,9 @@ check-gzip: (cd gzip && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-gzip maybe-install-gzip maybe-install-gzip: + install-gzip: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3060,8 +3476,9 @@ all-hello: configure-hello $(SET_LIB_PATH) \ (cd hello && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-hello maybe-check-hello +maybe-check-hello: -.PHONY: check-hello check-hello: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3069,9 +3486,9 @@ check-hello: (cd hello && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-hello maybe-install-hello maybe-install-hello: + install-hello: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3127,8 +3544,9 @@ all-indent: configure-indent $(SET_LIB_PATH) \ (cd indent && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-indent maybe-check-indent +maybe-check-indent: -.PHONY: check-indent check-indent: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3136,9 +3554,9 @@ check-indent: (cd indent && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-indent maybe-install-indent maybe-install-indent: + install-indent: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3194,8 +3612,9 @@ all-intl: configure-intl $(SET_LIB_PATH) \ (cd intl && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-intl maybe-check-intl +maybe-check-intl: -.PHONY: check-intl check-intl: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3203,9 +3622,9 @@ check-intl: (cd intl && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-intl maybe-install-intl maybe-install-intl: + install-intl: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3261,8 +3680,9 @@ all-tcl: configure-tcl $(SET_LIB_PATH) \ (cd tcl && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-tcl maybe-check-tcl +maybe-check-tcl: -.PHONY: check-tcl check-tcl: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3270,9 +3690,9 @@ check-tcl: (cd tcl && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-tcl maybe-install-tcl maybe-install-tcl: + install-tcl: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3328,8 +3748,9 @@ all-itcl: configure-itcl $(SET_LIB_PATH) \ (cd itcl && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-itcl maybe-check-itcl +maybe-check-itcl: -.PHONY: check-itcl check-itcl: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3337,9 +3758,9 @@ check-itcl: (cd itcl && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-itcl maybe-install-itcl maybe-install-itcl: + install-itcl: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3395,8 +3816,9 @@ all-ld: configure-ld $(SET_LIB_PATH) \ (cd ld && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-ld maybe-check-ld +maybe-check-ld: -.PHONY: check-ld check-ld: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3404,9 +3826,9 @@ check-ld: (cd ld && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-ld maybe-install-ld maybe-install-ld: + install-ld: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3462,8 +3884,9 @@ all-libgui: configure-libgui $(SET_LIB_PATH) \ (cd libgui && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-libgui maybe-check-libgui +maybe-check-libgui: -.PHONY: check-libgui check-libgui: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3471,9 +3894,9 @@ check-libgui: (cd libgui && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-libgui maybe-install-libgui maybe-install-libgui: + install-libgui: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3529,8 +3952,9 @@ all-libiberty: configure-libiberty $(SET_LIB_PATH) \ (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-libiberty maybe-check-libiberty +maybe-check-libiberty: -.PHONY: check-libiberty check-libiberty: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3538,9 +3962,9 @@ check-libiberty: (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-libiberty maybe-install-libiberty maybe-install-libiberty: + install-libiberty: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3596,8 +4020,9 @@ all-libtool: configure-libtool $(SET_LIB_PATH) \ (cd libtool && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-libtool maybe-check-libtool +maybe-check-libtool: -.PHONY: check-libtool check-libtool: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3605,9 +4030,9 @@ check-libtool: (cd libtool && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-libtool maybe-install-libtool maybe-install-libtool: + install-libtool: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3663,8 +4088,9 @@ all-m4: configure-m4 $(SET_LIB_PATH) \ (cd m4 && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-m4 maybe-check-m4 +maybe-check-m4: -.PHONY: check-m4 check-m4: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3672,9 +4098,9 @@ check-m4: (cd m4 && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-m4 maybe-install-m4 maybe-install-m4: + install-m4: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3730,8 +4156,9 @@ all-make: configure-make $(SET_LIB_PATH) \ (cd make && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-make maybe-check-make +maybe-check-make: -.PHONY: check-make check-make: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3739,9 +4166,9 @@ check-make: (cd make && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-make maybe-install-make maybe-install-make: + install-make: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3797,14 +4224,15 @@ all-mmalloc: configure-mmalloc $(SET_LIB_PATH) \ (cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-mmalloc maybe-check-mmalloc +maybe-check-mmalloc: -.PHONY: check-mmalloc check-mmalloc: - .PHONY: install-mmalloc maybe-install-mmalloc maybe-install-mmalloc: + install-mmalloc: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3860,8 +4288,9 @@ all-patch: configure-patch $(SET_LIB_PATH) \ (cd patch && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-patch maybe-check-patch +maybe-check-patch: -.PHONY: check-patch check-patch: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3869,9 +4298,9 @@ check-patch: (cd patch && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-patch maybe-install-patch maybe-install-patch: + install-patch: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3927,8 +4356,9 @@ all-perl: configure-perl $(SET_LIB_PATH) \ (cd perl && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-perl maybe-check-perl +maybe-check-perl: -.PHONY: check-perl check-perl: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3936,9 +4366,9 @@ check-perl: (cd perl && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-perl maybe-install-perl maybe-install-perl: + install-perl: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -3994,8 +4424,9 @@ all-prms: configure-prms $(SET_LIB_PATH) \ (cd prms && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-prms maybe-check-prms +maybe-check-prms: -.PHONY: check-prms check-prms: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4003,9 +4434,9 @@ check-prms: (cd prms && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-prms maybe-install-prms maybe-install-prms: + install-prms: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4061,8 +4492,9 @@ all-rcs: configure-rcs $(SET_LIB_PATH) \ (cd rcs && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-rcs maybe-check-rcs +maybe-check-rcs: -.PHONY: check-rcs check-rcs: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4070,9 +4502,9 @@ check-rcs: (cd rcs && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-rcs maybe-install-rcs maybe-install-rcs: + install-rcs: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4128,8 +4560,9 @@ all-readline: configure-readline $(SET_LIB_PATH) \ (cd readline && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-readline maybe-check-readline +maybe-check-readline: -.PHONY: check-readline check-readline: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4137,9 +4570,9 @@ check-readline: (cd readline && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-readline maybe-install-readline maybe-install-readline: + install-readline: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4195,14 +4628,15 @@ all-release: configure-release $(SET_LIB_PATH) \ (cd release && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-release maybe-check-release +maybe-check-release: -.PHONY: check-release check-release: - .PHONY: install-release maybe-install-release maybe-install-release: + install-release: @@ -4254,8 +4688,9 @@ all-recode: configure-recode $(SET_LIB_PATH) \ (cd recode && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-recode maybe-check-recode +maybe-check-recode: -.PHONY: check-recode check-recode: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4263,9 +4698,9 @@ check-recode: (cd recode && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-recode maybe-install-recode maybe-install-recode: + install-recode: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4321,8 +4756,9 @@ all-sed: configure-sed $(SET_LIB_PATH) \ (cd sed && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-sed maybe-check-sed +maybe-check-sed: -.PHONY: check-sed check-sed: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4330,9 +4766,9 @@ check-sed: (cd sed && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-sed maybe-install-sed maybe-install-sed: + install-sed: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4388,8 +4824,9 @@ all-send-pr: configure-send-pr $(SET_LIB_PATH) \ (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-send-pr maybe-check-send-pr +maybe-check-send-pr: -.PHONY: check-send-pr check-send-pr: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4397,9 +4834,9 @@ check-send-pr: (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-send-pr maybe-install-send-pr maybe-install-send-pr: + install-send-pr: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4455,8 +4892,9 @@ all-shellutils: configure-shellutils $(SET_LIB_PATH) \ (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-shellutils maybe-check-shellutils +maybe-check-shellutils: -.PHONY: check-shellutils check-shellutils: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4464,9 +4902,9 @@ check-shellutils: (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-shellutils maybe-install-shellutils maybe-install-shellutils: + install-shellutils: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4522,8 +4960,9 @@ all-sid: configure-sid $(SET_LIB_PATH) \ (cd sid && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-sid maybe-check-sid +maybe-check-sid: -.PHONY: check-sid check-sid: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4531,9 +4970,9 @@ check-sid: (cd sid && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-sid maybe-install-sid maybe-install-sid: + install-sid: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4589,8 +5028,9 @@ all-sim: configure-sim $(SET_LIB_PATH) \ (cd sim && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-sim maybe-check-sim +maybe-check-sim: -.PHONY: check-sim check-sim: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4598,9 +5038,9 @@ check-sim: (cd sim && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-sim maybe-install-sim maybe-install-sim: + install-sim: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4656,8 +5096,9 @@ all-tar: configure-tar $(SET_LIB_PATH) \ (cd tar && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-tar maybe-check-tar +maybe-check-tar: -.PHONY: check-tar check-tar: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4665,9 +5106,9 @@ check-tar: (cd tar && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-tar maybe-install-tar maybe-install-tar: + install-tar: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4723,8 +5164,9 @@ all-texinfo: configure-texinfo $(SET_LIB_PATH) \ (cd texinfo && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-texinfo maybe-check-texinfo +maybe-check-texinfo: -.PHONY: check-texinfo check-texinfo: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4732,9 +5174,9 @@ check-texinfo: (cd texinfo && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-texinfo maybe-install-texinfo maybe-install-texinfo: + install-texinfo: @@ -4786,8 +5228,9 @@ all-textutils: configure-textutils $(SET_LIB_PATH) \ (cd textutils && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-textutils maybe-check-textutils +maybe-check-textutils: -.PHONY: check-textutils check-textutils: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4795,9 +5238,9 @@ check-textutils: (cd textutils && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-textutils maybe-install-textutils maybe-install-textutils: + install-textutils: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4853,8 +5296,9 @@ all-time: configure-time $(SET_LIB_PATH) \ (cd time && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-time maybe-check-time +maybe-check-time: -.PHONY: check-time check-time: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4862,9 +5306,9 @@ check-time: (cd time && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-time maybe-install-time maybe-install-time: + install-time: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4920,8 +5364,9 @@ all-uudecode: configure-uudecode $(SET_LIB_PATH) \ (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-uudecode maybe-check-uudecode +maybe-check-uudecode: -.PHONY: check-uudecode check-uudecode: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4929,9 +5374,9 @@ check-uudecode: (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-uudecode maybe-install-uudecode maybe-install-uudecode: + install-uudecode: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4987,8 +5432,9 @@ all-wdiff: configure-wdiff $(SET_LIB_PATH) \ (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-wdiff maybe-check-wdiff +maybe-check-wdiff: -.PHONY: check-wdiff check-wdiff: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -4996,9 +5442,9 @@ check-wdiff: (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) check) - .PHONY: install-wdiff maybe-install-wdiff maybe-install-wdiff: + install-wdiff: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5054,8 +5500,9 @@ all-zip: configure-zip $(SET_LIB_PATH) \ (cd zip && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-zip maybe-check-zip +maybe-check-zip: -.PHONY: check-zip # This module is only tested in a native toolchain. check-zip: @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ @@ -5066,9 +5513,9 @@ check-zip: fi - .PHONY: install-zip maybe-install-zip maybe-install-zip: + install-zip: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5124,14 +5571,15 @@ all-zlib: configure-zlib $(SET_LIB_PATH) \ (cd zlib && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-zlib maybe-check-zlib +maybe-check-zlib: -.PHONY: check-zlib check-zlib: - .PHONY: install-zlib maybe-install-zlib maybe-install-zlib: + install-zlib: @@ -5183,8 +5631,9 @@ all-gdb: configure-gdb $(SET_LIB_PATH) \ (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) +.PHONY: check-gdb maybe-check-gdb +maybe-check-gdb: -.PHONY: check-gdb check-gdb: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5192,9 +5641,9 @@ check-gdb: (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) - .PHONY: install-gdb maybe-install-gdb maybe-install-gdb: + install-gdb: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5250,8 +5699,9 @@ all-expect: configure-expect $(SET_LIB_PATH) \ (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) +.PHONY: check-expect maybe-check-expect +maybe-check-expect: -.PHONY: check-expect check-expect: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5259,9 +5709,9 @@ check-expect: (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) - .PHONY: install-expect maybe-install-expect maybe-install-expect: + install-expect: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5317,8 +5767,9 @@ all-guile: configure-guile $(SET_LIB_PATH) \ (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) +.PHONY: check-guile maybe-check-guile +maybe-check-guile: -.PHONY: check-guile check-guile: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5326,9 +5777,9 @@ check-guile: (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) - .PHONY: install-guile maybe-install-guile maybe-install-guile: + install-guile: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5384,8 +5835,9 @@ all-tk: configure-tk $(SET_LIB_PATH) \ (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) +.PHONY: check-tk maybe-check-tk +maybe-check-tk: -.PHONY: check-tk check-tk: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5393,9 +5845,9 @@ check-tk: (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) - .PHONY: install-tk maybe-install-tk maybe-install-tk: + install-tk: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5451,8 +5903,9 @@ all-tix: configure-tix $(SET_LIB_PATH) \ (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) +.PHONY: check-tix maybe-check-tix +maybe-check-tix: -.PHONY: check-tix check-tix: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5460,9 +5913,9 @@ check-tix: (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) - .PHONY: install-tix maybe-install-tix maybe-install-tix: + install-tix: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5518,14 +5971,15 @@ all-libtermcap: configure-libtermcap $(SET_LIB_PATH) \ (cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-libtermcap maybe-check-libtermcap +maybe-check-libtermcap: -.PHONY: check-libtermcap check-libtermcap: - .PHONY: install-libtermcap maybe-install-libtermcap maybe-install-libtermcap: + install-libtermcap: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5581,14 +6035,15 @@ all-utils: configure-utils $(SET_LIB_PATH) \ (cd utils && $(MAKE) $(FLAGS_TO_PASS) all) +.PHONY: check-utils maybe-check-utils +maybe-check-utils: -.PHONY: check-utils check-utils: - .PHONY: install-utils maybe-install-utils maybe-install-utils: + install-utils: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5683,7 +6138,9 @@ all-target-libstdc++-v3: configure-target-libstdc++-v3 (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' all) -.PHONY: check-target-libstdc++-v3 +.PHONY: check-target-libstdc++-v3 maybe-check-target-libstdc++-v3 +maybe-check-target-libstdc++-v3: + check-target-libstdc++-v3: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5694,6 +6151,7 @@ check-target-libstdc++-v3: .PHONY: install-target-libstdc++-v3 maybe-install-target-libstdc++-v3 maybe-install-target-libstdc++-v3: + install-target-libstdc++-v3: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5783,7 +6241,9 @@ all-target-newlib: configure-target-newlib (cd $(TARGET_SUBDIR)/newlib && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -.PHONY: check-target-newlib +.PHONY: check-target-newlib maybe-check-target-newlib +maybe-check-target-newlib: + check-target-newlib: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5794,6 +6254,7 @@ check-target-newlib: .PHONY: install-target-newlib maybe-install-target-newlib maybe-install-target-newlib: + install-target-newlib: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5883,7 +6344,9 @@ all-target-libf2c: configure-target-libf2c (cd $(TARGET_SUBDIR)/libf2c && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -.PHONY: check-target-libf2c +.PHONY: check-target-libf2c maybe-check-target-libf2c +maybe-check-target-libf2c: + check-target-libf2c: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5894,6 +6357,7 @@ check-target-libf2c: .PHONY: install-target-libf2c maybe-install-target-libf2c maybe-install-target-libf2c: + install-target-libf2c: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5983,7 +6447,9 @@ all-target-libobjc: configure-target-libobjc (cd $(TARGET_SUBDIR)/libobjc && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -.PHONY: check-target-libobjc +.PHONY: check-target-libobjc maybe-check-target-libobjc +maybe-check-target-libobjc: + check-target-libobjc: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -5994,6 +6460,7 @@ check-target-libobjc: .PHONY: install-target-libobjc maybe-install-target-libobjc maybe-install-target-libobjc: + install-target-libobjc: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6083,13 +6550,16 @@ all-target-libtermcap: configure-target-libtermcap (cd $(TARGET_SUBDIR)/libtermcap && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) +.PHONY: check-target-libtermcap maybe-check-target-libtermcap +maybe-check-target-libtermcap: + # Dummy target for uncheckable module. -.PHONY: check-target-libtermcap check-target-libtermcap: .PHONY: install-target-libtermcap maybe-install-target-libtermcap maybe-install-target-libtermcap: + install-target-libtermcap: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6179,7 +6649,9 @@ all-target-winsup: configure-target-winsup (cd $(TARGET_SUBDIR)/winsup && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -.PHONY: check-target-winsup +.PHONY: check-target-winsup maybe-check-target-winsup +maybe-check-target-winsup: + check-target-winsup: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6190,6 +6662,7 @@ check-target-winsup: .PHONY: install-target-winsup maybe-install-target-winsup maybe-install-target-winsup: + install-target-winsup: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6279,13 +6752,16 @@ all-target-libgloss: configure-target-libgloss (cd $(TARGET_SUBDIR)/libgloss && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) +.PHONY: check-target-libgloss maybe-check-target-libgloss +maybe-check-target-libgloss: + # Dummy target for uncheckable module. -.PHONY: check-target-libgloss check-target-libgloss: .PHONY: install-target-libgloss maybe-install-target-libgloss maybe-install-target-libgloss: + install-target-libgloss: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6375,7 +6851,9 @@ all-target-libiberty: configure-target-libiberty (cd $(TARGET_SUBDIR)/libiberty && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -.PHONY: check-target-libiberty +.PHONY: check-target-libiberty maybe-check-target-libiberty +maybe-check-target-libiberty: + check-target-libiberty: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6386,6 +6864,7 @@ check-target-libiberty: .PHONY: install-target-libiberty maybe-install-target-libiberty maybe-install-target-libiberty: + install-target-libiberty: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6475,7 +6954,9 @@ all-target-gperf: configure-target-gperf (cd $(TARGET_SUBDIR)/gperf && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -.PHONY: check-target-gperf +.PHONY: check-target-gperf maybe-check-target-gperf +maybe-check-target-gperf: + check-target-gperf: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6486,6 +6967,7 @@ check-target-gperf: .PHONY: install-target-gperf maybe-install-target-gperf maybe-install-target-gperf: + install-target-gperf: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6575,13 +7057,16 @@ all-target-examples: configure-target-examples (cd $(TARGET_SUBDIR)/examples && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) +.PHONY: check-target-examples maybe-check-target-examples +maybe-check-target-examples: + # Dummy target for uncheckable module. -.PHONY: check-target-examples check-target-examples: .PHONY: install-target-examples maybe-install-target-examples maybe-install-target-examples: + # Dummy target for uninstallable. install-target-examples: @@ -6667,7 +7152,9 @@ all-target-libffi: configure-target-libffi (cd $(TARGET_SUBDIR)/libffi && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -.PHONY: check-target-libffi +.PHONY: check-target-libffi maybe-check-target-libffi +maybe-check-target-libffi: + check-target-libffi: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6678,6 +7165,7 @@ check-target-libffi: .PHONY: install-target-libffi maybe-install-target-libffi maybe-install-target-libffi: + install-target-libffi: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6768,7 +7256,9 @@ all-target-libjava: configure-target-libjava (cd $(TARGET_SUBDIR)/libjava && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' all) -.PHONY: check-target-libjava +.PHONY: check-target-libjava maybe-check-target-libjava +maybe-check-target-libjava: + check-target-libjava: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6779,6 +7269,7 @@ check-target-libjava: .PHONY: install-target-libjava maybe-install-target-libjava maybe-install-target-libjava: + install-target-libjava: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6868,7 +7359,9 @@ all-target-zlib: configure-target-zlib (cd $(TARGET_SUBDIR)/zlib && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -.PHONY: check-target-zlib +.PHONY: check-target-zlib maybe-check-target-zlib +maybe-check-target-zlib: + check-target-zlib: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6879,6 +7372,7 @@ check-target-zlib: .PHONY: install-target-zlib maybe-install-target-zlib maybe-install-target-zlib: + install-target-zlib: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6968,7 +7462,9 @@ all-target-boehm-gc: configure-target-boehm-gc (cd $(TARGET_SUBDIR)/boehm-gc && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -.PHONY: check-target-boehm-gc +.PHONY: check-target-boehm-gc maybe-check-target-boehm-gc +maybe-check-target-boehm-gc: + check-target-boehm-gc: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -6979,6 +7475,7 @@ check-target-boehm-gc: .PHONY: install-target-boehm-gc maybe-install-target-boehm-gc maybe-install-target-boehm-gc: + install-target-boehm-gc: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -7068,7 +7565,9 @@ all-target-qthreads: configure-target-qthreads (cd $(TARGET_SUBDIR)/qthreads && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -.PHONY: check-target-qthreads +.PHONY: check-target-qthreads maybe-check-target-qthreads +maybe-check-target-qthreads: + check-target-qthreads: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -7079,6 +7578,7 @@ check-target-qthreads: .PHONY: install-target-qthreads maybe-install-target-qthreads maybe-install-target-qthreads: + install-target-qthreads: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -7168,7 +7668,9 @@ all-target-rda: configure-target-rda (cd $(TARGET_SUBDIR)/rda && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -.PHONY: check-target-rda +.PHONY: check-target-rda maybe-check-target-rda +maybe-check-target-rda: + check-target-rda: @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -7179,6 +7681,7 @@ check-target-rda: .PHONY: install-target-rda maybe-install-target-rda maybe-install-target-rda: + install-target-rda: installdirs @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ @@ -7314,6 +7817,7 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld LANGUAGES="c c++" all .PHONY: check-gcc +maybe-check-gcc: check-gcc: @if [ -f ./gcc/Makefile ] ; then \ r=`${PWD}`; export r; \ @@ -7409,6 +7913,8 @@ all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex # binutils might be on PATH, and they might need the shared opcodes # library. install-binutils: maybe-install-opcodes +# libopcodes depends on libbfd +install-opcodes: maybe-install-bfd all-gas: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-intl all-gprof: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-intl all-ld: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-intl @@ -7475,7 +7981,7 @@ configure-target-zlib: $(ALL_GCC_C) configure-target-examples: $(ALL_GCC_C) configure-target-libgloss: $(ALL_GCC) all-target-libgloss: maybe-configure-target-newlib -configure-target-libiberty: $(ALL_GCC_C) +configure-target-libiberty: $(ALL_GCC) configure-target-libtermcap: $(ALL_GCC_C) configure-target-newlib: $(ALL_GCC) configure-target-rda: $(ALL_GCC_C) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 34883f6..14f90db 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,7 +1,450 @@ -2003-04-30 Nick Clifton <nickc@redhat.com> +2003-05-22 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> - * elf32-h8300.c (elf32_h8_relax_section): Do not crash when - encountering relocs against the *ABS* section. + * elf64-mips.c (elf_mips_gnu_rel16_s2): Add internally used + R_MIPS_GNU_REL16_S2 support. + (bfd_elf64_bfd_reloc_type_lookup): Use it. + (mips_elf64_rtype_to_howto): Use it. + * elfn32-mips.c (elf_mips_gnu_rel16_s2): Add internally used + R_MIPS_GNU_REL16_S2 support. + (bfd_elf32_bfd_reloc_type_lookup): Use it. + (mips_elf_n32_rtype_to_howto): Use it. + +2003-05-21 Stuart F. Downing <sdowning@fame.com> + + * som.h: Define PA_2_0 before including a.out.h + +2003-05-07 Eric Christopher <echristo@redhat.com> + Alexandre Oliva <aoliva@redhat.com> + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Adjust + pic tests, change to warning. + (_bfd_mips_elf_final_link): Remove EF_MIPS_CPIC flag setting. + +2003-05-21 Marcus Comstedt <marcus@mc.pp.se> + + * config.bfd: Check for a target triplet of shl-...-netbsdelf as + well as shle-...-netbsdelf. Remove duplicate entry. + +2003-05-21 Nick Clifton <nickc@redhat.com> + + * elf32-xstormy16.c (xstormy16_elf_howto_table): Fix dst_mask + 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. + (bfd_elf_get_runpath_list): Likewise. + +2003-05-19 Roland McGrath <roland@redhat.com> + + * elf.c (bfd_elf_bfd_from_remote_memory): New function. + * bfd-in.h: Declare it. + * bfd-in2.h: Regenerated. + * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): New function. + * elf-bfd.h (struct elf_backend_data): New function pointer member + elf_backend_bfd_from_remote_memory. + (_bfd_elf32_bfd_from_remote_memory, _bfd_elf64_bfd_from_remote_memory): + Declare them. + * elfxx-target.h (elf_backend_bfd_from_remote_memory): New macro. + (elfNN_bed): Add that to the initializer. + +2003-05-15 Roland McGrath <roland@redhat.com> + + * elf.c (elfcore_grok_note): Grok NT_AUXV note, make ".auxv" section. + +2003-05-20 Jakub Jelinek <jakub@redhat.com> + + * elflink.h (elf_link_output_extsym): Only issue error about != + STV_DEFAULT symbols if they are bfd_link_hash_undefined. + +2003-05-20 H.J. Lu <hongjiu.lu@intel.com> + + * elflink.c (_bfd_elf_merge_symbol): Check ELF_LINK_DYNAMIC_DEF + when removing the old definition for symbols with non-default + visibility. + +2003-05-18 Jason Eckhardt <jle@rice.edu> + + * elf32-i860.c (elf32_i860_relocate_highadj): Simplify calculation. + +2003-05-17 Andreas Schwab <schwab@suse.de> + + * elf32-m68k.c (elf_m68k_check_relocs): Cache reloc section in + elf_section_data during processing of pc-relative and absolute + relocations. + (elf_m68k_relocate_section): Use the cached reloc section instead + of computing it again. Fix handling of visibility. Don't modify + addend when copying over a relocation into the output. + +2003-05-17 Alan Modra <amodra@bigpond.net.au> + + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL + to trim plt entries. Move undefweak non-default visibility test.. + (allocate_dynrelocs): ..from here. + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't test + dynamic_sections_created here. Update comment. Move undefweak + non-default visibility test.. + (allocate_dynrelocs): ..from here. Fix comment. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL + to trim plt entries. Move undefweak non-default visibility test.. + (allocate_dynrelocs): ..from here. Fix comment. + * elflink.h (elf_link_output_extsym): Compare ELF_ST_VISIBILITY with + STV_DEFAULT rather than comparing with zero. + * elflink.c (_bfd_elf_merge_symbol): Likewise. + (_bfd_elf_fix_symbol_flags): Likewise. Format comment. + +2003-05-17 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null + pointers. + (_bfd_set_gp_value): Likewise. + +2003-05-16 Michael Snyder <msnyder@redhat.com> + From Bernd Schmidt <bernds@redhat.com> + * archures.c (bfd_mach_h8300sx): New. + * bfd-in2.h: Regenerate. + * cpu-h8300.c (h8300_scan)): Add support for h8300sx. + (h8300sx_info_struct): New. + (h8300s_info_struct): Link to it. + * elf32-h8300.c (elf32_h8_mach): Add support for h8300sx. + (elf32_h8_final_write_processing): Likewise. + (elf32_h8_relax_section): Likewise. + +2003-05-16 Kelley Cook <kelleycook@wideopenwest.com> + + * config.bfd: Accept i[3-7]86 variants. + * configure.host: Likewise. + * configure.in: Likewise. + * configure: Regenerate. + +2003-05-15 H.J. Lu <hongjiu.lu@intel.com> + + * elflink.c (_bfd_elf_fix_symbol_flags): Also hide protected + symbol. + +2003-05-15 H.J. Lu <hongjiu.lu@intel.com> + + * elflink.h (elf_link_check_versioned_symbol): Also allow + the base version. + +2003-05-15 Alan Modra <amodra@bigpond.net.au> + H.J. Lu <hongjiu.lu@intel.com> + + * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL. + (elf_i386_relocate_section): Likewise. + * elf32-ppc.c (allocate_dynrelocs): Likewise. + (ppc_elf_relocate_section): Likewise. + * elf64-ppc.c (allocate_dynrelocs): Likewise. + (ppc64_elf_relocate_section): Likewise. + +2003-05-15 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * elf32-mips.c (gprel32_with_gp): Remove useless N64 ABI case. + +2003-05-13 Stephane Carrez <stcarrez@nerim.fr> + + * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Check for + processor capability, allow merge of HC12 and HCS12 in some cases. + (m68hc11_elf_hash_table_create): Use bfd_malloc instead of bfd_zalloc. + * cpu-m68hc12.c (bfd_m68hc12s_arch): New struct. + (bfd_m68hc12_arch): Link it. + (scan_mach): New function. + +2003-05-13 Andrew Haley <aph@redhat.com> + + * elf.c (bfd_elf_hash): Mask lower 32 bits of hash. + +2003-05-13 Alan Modra <amodra@bigpond.net.au> + H.J. Lu <hongjiu.lu@intel.com> + + * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Move from + elf32-ppc.c. Add ELF_LINK_FORCED_LOCAL check. + * elf32-ppc.c: (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Delete. + (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for dynreloc check. + (ppc_elf_relocate_section): Likewise. + * elf64-ppc.c (allocate_dynrelocs): Likewise. + (ppc64_elf_relocate_section): Likewise. Use for .got relocs too. + (ppc64_elf_adjust_dynamic_symbol): Don't assume symbols with .plt + relocs need no other types. + * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for + dynreloc check. + (elf_i386_relocate_section): Likewise. Use for .got relocs too. + (elf_i386_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL for + .got relocs. + +2003-05-13 Kaz Kojima <kkojima@rr.iij4u.or.jp> + + * 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 + 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_copy_indirect_symbol): Don't copy ELF_LINK_NON_GOT_REF + for weakdefs when symbol already adjusted. + +2003-05-12 Nick Clifton <nickc@redhat.com> + + * elf32-xstormy16.c (xstormy16_elf_howto_table): use 'bitfield' + overflow detection for R_XSTORMY16_16 reloc. + +2003-05-12 Paul Clarke <paulc@senet.com.au> + + * elf32-h8300.c: Fix typo in name of R_H8_DIR8 reloc. + +2003-05-11 Jason Eckhardt <jle@rice.edu> + + * elf32-i860.c (elf32_i860_relocate_highadj): Properly + adjust upper bits. + (elf32_i860_relocate_splitn): Obtain upper 5 bits from the + proper place. + (elf32_i860_relocate_pc16): Obtain upper 5 bits from the + proper place. + +2003-05-11 Andreas Schwab <schwab@suse.de> + + * elf32-m68k.c (elf_m68k_relocate_section): Replace ugly + complicated tests for unresolvable relocs with a simple direct + scheme using "unresolved_reloc" var. Report some detail on + bfd_reloc_outofrange and similar errors. + +2003-05-09 Martin Schwidefsky <schwidefsky@de.ibm.com> + + * elf32-s390.c (allocate_dynrelocs, elf_s390_relocate_section): + Fix WILL_CALL_FINISH_DYNAMIC_SYMBOL call. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. + * elf64-s390.c: Likewise. + +2003-05-09 Martin Schwidefsky <schwidefsky@de.ibm.com> + + * elf32-s390.c (ELIMINATE_COPY_RELOCS): Define as one. + (elf_s390_adjust_dynamic_symbol): For weak symbols, copy + ELF_LINK_NON_GOT_REF from weakdef. + (elf_s390_copy_indirect_symbol): Test whether the weakdef sym has + already been adjusted before treating it specially. + * el64-s390.c: Likwise. + +2003-05-09 Martin Schwidefsky <schwidefsky@de.ibm.com> + + * elf32-s390.c (allocate_dynrelocs): For undef weak syms with + non-default visibility, a) don't make them dynamic, b) discard + space for dynamic relocs. + (elf_s390_relocate_section): Initialize the GOT entries and skip + R_390_{8,16,32}/R_390_PC{16,16DBL,32DBL,32} for weak undefined + symbols with non-default visibility. + * elf64-s390.c: Likewise. + +2003-05-09 Alan Modra <amodra@bigpond.net.au> + + * cpu-arm.c (arm_check_note): Warning fix. + * elf32-iq2000.c (iq2000_elf_check_relocs): Warning fixes. Arrange + to keep relocs if edited. + (iq2000_elf_print_private_bfd_data): Return TRUE. + * elfxx-ia64.c (elfNN_ia64_relax_section): Use ELFNN_R_SYM, not + ELF64_R_SYM. + (elfNN_ia64_relax_ldxmov): Warning fix. + * xtensa-isa.c (xtensa_add_isa): Warning fix. + * xtensa-modules.c (get_num_opcodes): Warning fix. + +2003-05-09 Andrey Petrov <petrov@netbsd.org> + + * elf.c (elf_fake_sections): Use correct cast for sh_name. + +2003-05-09 Alan Modra <amodra@bigpond.net.au> + + * elflink.c (_bfd_elf_link_create_dynamic_sections): Move from + elflink.h. Replace LOG_FILE_ALIGN with bed->s->log_file_align. + (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align. + (bfd_elf_record_link_assignment): Move from elflink.h. + (_bfd_elf_merge_symbol): Likewise. + (_bfd_elf_add_default_symbol): Likewise. + (_bfd_elf_export_symbol): Likewise. + (_bfd_elf_link_find_version_dependencies): Likewise. + (_bfd_elf_link_assign_sym_version): Likewise. + (_bfd_elf_link_read_relocs): Likewise. + (_bfd_elf_link_size_reloc_section): Likewise. + (_bfd_elf_fix_symbol_flags): Likewise. + (_bfd_elf_adjust_dynamic_symbol): Likewise. + (_bfd_elf_link_sec_merge_syms): Likewise. + (elf_link_read_relocs_from_section): Likewise. Use bed->s->sizeof_rel + and bed->s->sizeof_rela. + (_bfd_elf_link_output_relocs): Likewise. + * elf-bfd.h (struct elf_size_info): Rename file_align to + log_file_align. + (struct elf_info_failed): Move from elflink.h. + (struct elf_assign_sym_version_info): Likewise. + (struct elf_find_verdep_info): Likewise. + (_bfd_elf_create_dynamic_sections): Delete duplicate declaration. + (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol, + _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, + _bfd_elf_link_assign_sym_version, + _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs, + _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs, + _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol, + _bfd_elf_link_sec_merge_syms): Declare. + (bfd_elf32_link_create_dynamic_sections): Don't declare. + (_bfd_elf32_link_read_relocs): Likewise. + (bfd_elf64_link_create_dynamic_sections): Likewise. + (_bfd_elf64_link_read_relocs): Likewise. + * elflink.h: Move lots o' stuff elsewhere. + * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare. + (bfd_elf64_record_link_assignment): Likewise. + (bfd_elf_record_link_assignment): Declare. + * bfd-in2.h: Regenerate. + * elfcode.h (elf_link_create_dynamic_sections): Don't declare. + (NAME(_bfd_elf,size_info)): Adjust for log_file_align. + * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align. + (assign_file_positions_for_segments): Likewise. + (assign_file_positions_except_relocs): Likewise. + (swap_out_syms, elfcore_write_note): Likewise. + * elf-m10200.c: Adjust for changed function names. + * elf-m10300.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-h8300.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-sh64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align. + * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align. + * elf64-hppa.c (hppa64_elf_size_info): Likewise. + * elf64-mips.c (mips_elf64_size_info): Likewise. + * elf64-s390.c (s390_elf64_size_info): Likewise. + * elf64-sparc.c (sparc64_elf_size_info): Likewise. + +2003-05-08 H.J. Lu <hongjiu.lu@intel.com> + + * elflink.h (elf_add_default_symbol): After skipping the + unversioned symbol, go to non-default one. + +2003-05-07 H.J. Lu <hongjiu.lu@intel.com> + + * elfxx-ia64.c (_bfd_elf_link_hash_hide_symbol): Also clear the + want_plt field. + (elfNN_ia64_relocate_section): Don't do dynamic symbol lookup + for symbols with non-default visibility. + +2003-05-07 H.J. Lu <hongjiu.lu@intel.com> + + * elflink.h (elf_link_check_versioned_symbol): Also handle the + case that a DSO references a hidden symbol which may be + satisfied by a versioned symbol in another DSO. + (elf_link_output_extsym): Check versioned definition for hidden + symbol referenced by a DSO. + +2003-05-07 Nick Clifton <nickc@redhat.com> + + * elf32-xstormy16.c (xstormy16_elf_howto_table): Reset + R_XSTORMY16_16 reloc to ignore overflows. + +2003-05-06 Alexandre Oliva <aoliva@redhat.com> + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Improve + error message for mixing different-endian files. Check for ABI + compatibility of input files with the selected emulation. + +2003-05-05 Alan Modra <amodra@bigpond.net.au> + + * elf32-i386.c (allocate_dynrelocs): For undef weak syms with + non-default visibility, a) don't make them dynamic, b) discard + space for dynamic relocs. + * elf64-x86-64.c (allocate_dynrelocs): Likewise. + + * elf32-ppc.c (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, + (ppc_elf_relocate_section): d) don't generate .got relocs, e) + don't generate dynamic relocs. + * elf64-ppc.c (allocate_dynrelocs): As above. + (ppc64_elf_relocate_section): As above. + +2003-05-05 Andreas Jaeger <aj@suse.de> + + * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic + relocation entries for weak undefined symbols with non-default + visibility. + (elf64_x86_64_relocate_section): Initialize the GOT entries and + skip R_386_32/R_386_PC32 for weak undefined symbols with + non-default visibility. + +2003-05-04 H.J. Lu <hjl@gnu.org> + + * elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic + relocation entries for weak undefined symbols with non-default + visibility. + (elf_i386_relocate_section): Initialize the GOT entries and + skip R_386_32/R_386_PC32 for weak undefined symbols with + non-default visibility. + + * elfxx-ia64.c (allocate_fptr): Don't allocate function + descriptors for weak undefined symbols with non-default + visibility. + (allocate_dynrel_entries): Don't allocate relocation entries + for symbols resolved to 0. + (set_got_entry): Don't install dynamic relocation for weak + undefined symbols with non-default visibility. + (set_pltoff_entry): Likewise. + + * elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols + with non-default visibility. + (elf_link_output_extsym): Don't make weak undefined symbols + with non-default visibility dynamic. + +2003-05-04 H.J. Lu <hjl@gnu.org> + + * elflink.h (elf_merge_symbol): Correctly handle weak definiton. + +2003-05-04 H.J. Lu <hjl@gnu.org> + + * elflink.h (elf_merge_symbol): Don't record a hidden/internal + symbol dynamic. Check indirection when removing the old + definition for symbols with non-default visibility. + (elf_add_default_symbol): Skip when told by elf_merge_symbol. + +2003-05-02 Nick Clifton <nickc@redhat.com> + + * elf32-xstormy16.c (xstormy16_elf_howto_table): Make the + R_XSTORMY16_8 and R_XSTORMY16_16 relocs detect and complain about + unsigned overflow. + +2003-05-02 Andreas Jaeger <aj@suse.de> + + * elf64-x86-64.c (elf_x86_64_copy_indirect_symbol): Don't copy + ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted. + (ELIMINATE_COPY_RELOCS): Define as one. Use throughout. + (elf_x86_64_adjust_dynamic_symbol): For weak symbols, copy + ELF_LINK_NON_GOT_REF from weakdef. + +2003-05-02 Charles Lepple <clepple@ghz.cc> + Nick Clifton <nickc@redhat.com> + + * acinclude.m4: Fix name of --enable-install-libbfd switch. + * aclocal.m4: Regenerate. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2003-05-01 Alan Modra <amodra@bigpond.net.au> + + * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Test whether the + weakdef sym has already been adjusted before treating it specially. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Don't copy + ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + (ppc64_elf_check_relocs): Set ELF_LINK_NON_GOT_REF. 2003-04-28 H.J. Lu <hjl@gnu.org> @@ -1320,7 +1763,7 @@ * libbfd.h: Regenerate. * reloc.c: Add s390 TLS relocations. -2003-01-24 Charles Lepple clepple.ghz.cc +2003-01-24 Charles Lepple <clepple@ghz.cc> * aclocal.m4: Fix name of --enable-install-libbfd switch. diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 87c96ed..d8fc69f 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -1748,10 +1748,9 @@ elf32-m68hc12.lo: elf32-m68hc12.c $(INCDIR)/filenames.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/m68hc11.h \ elf32-target.h elf32-m68hc1x.h elf32-m68hc1x.lo: elf32-m68hc1x.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 $(INCDIR)/elf/m68hc11.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m68hc1x.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 diff --git a/bfd/acinclude.m4 b/bfd/acinclude.m4 index 7c2902c..bf328db 100644 --- a/bfd/acinclude.m4 +++ b/bfd/acinclude.m4 @@ -127,7 +127,7 @@ AC_SUBST(INTLLIBS) AC_DEFUN([AM_INSTALL_LIBBFD], [AC_MSG_CHECKING([whether to install libbfd]) AC_ARG_ENABLE(install-libbfd, -[ --install-libbfd controls installation of libbfd and related headers], +[ --enable-install-libbfd controls installation of libbfd and related headers], install_libbfd_p=$enableval, if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then install_libbfd_p=yes diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4 index 9e739ea..3673e07 100644 --- a/bfd/aclocal.m4 +++ b/bfd/aclocal.m4 @@ -173,6 +173,24 @@ else $1_FALSE= fi]) +#serial 1 +# This test replaces the one in autoconf. +# Currently this macro should have the same name as the autoconf macro +# because gettext's gettext.m4 (distributed in the automake package) +# still uses it. Otherwise, the use in gettext.m4 makes autoheader +# give these diagnostics: +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX + +undefine([AC_ISC_POSIX]) + +AC_DEFUN([AC_ISC_POSIX], + [ + dnl This test replaces the obsolescent AC_ISC_POSIX kludge. + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) + ] +) + # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. diff --git a/bfd/archures.c b/bfd/archures.c index 3d473c3..250892c 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -169,6 +169,7 @@ DESCRIPTION .#define bfd_mach_h8300s 3 .#define bfd_mach_h8300hn 4 .#define bfd_mach_h8300sn 5 +.#define bfd_mach_h8300sx 6 . 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 c39bfedd..fdf5f1c 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -651,9 +651,7 @@ struct bfd_link_needed_list const char *name; }; -extern bfd_boolean bfd_elf32_record_link_assignment - PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean)); -extern bfd_boolean bfd_elf64_record_link_assignment +extern bfd_boolean bfd_elf_record_link_assignment PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean)); extern struct bfd_link_needed_list *bfd_elf_get_needed_list PARAMS ((bfd *, struct bfd_link_info *)); @@ -696,6 +694,22 @@ extern long bfd_get_elf_phdr_upper_bound extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs)); +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote memory + based on the ELF file header at EHDR_VMA and the ELF program headers it + points to. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs the + file headers (and hence BFD's idea of each section's VMA) put them at. + + The function TARGET_READ_MEMORY is called to copy LEN bytes from the + remote memory at target address VMA into the local buffer at MYADDR; it + should return zero on success or an `errno' code on failure. TEMPL must + be a BFD for an ELF target with the word size and byte order found in + the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + PARAMS ((bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, char *myaddr, int len))); + /* Return the arch_size field of an elf bfd, or -1 if not elf. */ extern int bfd_get_arch_size PARAMS ((bfd *)); diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 9b6b5a3..8df80a0 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. */ @@ -658,9 +658,7 @@ struct bfd_link_needed_list const char *name; }; -extern bfd_boolean bfd_elf32_record_link_assignment - PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean)); -extern bfd_boolean bfd_elf64_record_link_assignment +extern bfd_boolean bfd_elf_record_link_assignment PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean)); extern struct bfd_link_needed_list *bfd_elf_get_needed_list PARAMS ((bfd *, struct bfd_link_info *)); @@ -703,6 +701,22 @@ extern long bfd_get_elf_phdr_upper_bound extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs)); +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote memory + based on the ELF file header at EHDR_VMA and the ELF program headers it + points to. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs the + file headers (and hence BFD's idea of each section's VMA) put them at. + + The function TARGET_READ_MEMORY is called to copy LEN bytes from the + remote memory at target address VMA into the local buffer at MYADDR; it + should return zero on success or an `errno' code on failure. TEMPL must + be a BFD for an ELF target with the word size and byte order found in + the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + PARAMS ((bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, char *myaddr, int len))); + /* Return the arch_size field of an elf bfd, or -1 if not elf. */ extern int bfd_get_arch_size PARAMS ((bfd *)); @@ -1637,6 +1651,7 @@ enum bfd_architecture #define bfd_mach_h8300s 3 #define bfd_mach_h8300hn 4 #define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 bfd_arch_pdp11, /* DEC PDP-11 */ bfd_arch_powerpc, /* PowerPC */ #define bfd_mach_ppc 32 @@ -1777,7 +1792,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 @@ -3465,14 +3480,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 }; @@ -894,6 +894,8 @@ bfd_vma _bfd_get_gp_value (abfd) bfd *abfd; { + if (! abfd) + return 0; if (abfd->format != bfd_object) return 0; @@ -912,6 +914,8 @@ _bfd_set_gp_value (abfd, v) bfd *abfd; bfd_vma v; { + if (! abfd) + BFD_FAIL (); if (abfd->format != bfd_object) return; diff --git a/bfd/config.bfd b/bfd/config.bfd index d034ce8..d93b071 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -38,7 +38,7 @@ c4x*) targ_archs=bfd_tic4x_arch ;; c54x*) targ_archs=bfd_tic54x_arch ;; dlx*) targ_archs=bfd_dlx_arch ;; hppa*) targ_archs=bfd_hppa_arch ;; -i[3456]86) targ_archs=bfd_i386_arch ;; +i[3-7]86) targ_archs=bfd_i386_arch ;; i370) targ_archs=bfd_i370_arch ;; m6811*|m68hc11*) targ_archs="bfd_m68hc11_arch bfd_m68hc12_arch" ;; m6812*|m68hc12*) targ_archs="bfd_m68hc12_arch bfd_m68hc11_arch" ;; @@ -365,97 +365,97 @@ case "${targ}" in targ_defvec=bfd_elf32_i370_vec targ_selvecs="bfd_elf32_i370_vec" ;; - i[3456]86-*-sco3.2v5*coff) + i[3-7]86-*-sco3.2v5*coff) targ_defvec=i386coff_vec targ_selvecs=bfd_elf32_i386_vec ;; - i[3456]86-*-sysv4* | i[3456]86-*-unixware* | i[3456]86-*-solaris2* | \ - i[3456]86-*-elf | i[3456]86-*-sco3.2v5* | \ - i[3456]86-*-dgux* | i[3456]86-*-sysv5*) + i[3-7]86-*-sysv4* | i[3-7]86-*-unixware* | i[3-7]86-*-solaris2* | \ + i[3-7]86-*-elf | i[3-7]86-*-sco3.2v5* | \ + i[3-7]86-*-dgux* | i[3-7]86-*-sysv5*) targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; - i[3456]86-*-kaos*) + i[3-7]86-*-kaos*) targ_defvec=bfd_elf32_i386_vec targ_selvecs=bfd_elf32_i386_vec ;; - i[3456]86-*-nto*) + i[3-7]86-*-nto*) targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; - i[3456]86-*-aros*) + i[3-7]86-*-aros*) targ_defvec=bfd_elf32_i386_vec ;; - i[3456]86-*-chorus*) + i[3-7]86-*-chorus*) targ_defvec=bfd_elf32_i386_vec ;; *-*-msdosdjgpp* | *-*-go32* | *-go32-rtems* ) targ_defvec=go32coff_vec targ_selvecs="go32stubbedcoff_vec i386aout_vec" ;; - i[3456]86-*-sysv* | i[3456]86-*-isc* | i[3456]86-*-sco* | i[3456]86-*-coff | \ - i[3456]86-*-aix*) + i[3-7]86-*-sysv* | i[3-7]86-*-isc* | i[3-7]86-*-sco* | i[3-7]86-*-coff | \ + i[3-7]86-*-aix*) targ_defvec=i386coff_vec ;; - i[3456]86*-*-rtemscoff*) + i[3-7]86*-*-rtemscoff*) targ_defvec=i386coff_vec targ_selvecs="bfd_elf32_i386_vec i386aout_vec" ;; - i[3456]86-*-rtemself* | i[3456]86-*-rtems*) + i[3-7]86-*-rtemself* | i[3-7]86-*-rtems*) targ_defvec=bfd_elf32_i386_vec targ_selvecs="i386coff_vec i386aout_vec" ;; - i[3456]86-*-darwin* | i[3456]86-*-macos10* | i[3456]86-*-rhapsody*) + i[3-7]86-*-darwin* | i[3-7]86-*-macos10* | i[3-7]86-*-rhapsody*) targ_defvec=mach_o_le_vec targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec" targ_archs="bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch" ;; - i[3456]86-sequent-bsd*) + i[3-7]86-sequent-bsd*) targ_defvec=i386dynix_vec targ_underscore=yes ;; - i[3456]86-*-bsd*) + i[3-7]86-*-bsd*) targ_defvec=i386bsd_vec targ_underscore=yes ;; - i[3456]86-*-freebsdaout* | i[3456]86-*-freebsd[12].* | \ - i[3456]86-*-freebsd[12]) + i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | \ + i[3-7]86-*-freebsd[12]) targ_defvec=i386freebsd_vec targ_selvecs=i386bsd_vec targ_underscore=yes ;; - i[3456]86-*-freebsd*) + i[3-7]86-*-freebsd*) targ_defvec=bfd_elf32_i386_freebsd_vec targ_selvecs=i386coff_vec # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling. case "${targ}" in - i[3456]86-*-freebsd3* | i[3456]86-*-freebsd4 | i[3456]86-*-freebsd4.0*) + i[3-7]86-*-freebsd3* | i[3-7]86-*-freebsd4 | i[3-7]86-*-freebsd4.0*) targ_cflags=-DOLD_FREEBSD_ABI_LABEL ;; esac ;; - i[3456]86-*-netbsdelf*) + i[3-7]86-*-netbsdelf*) targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386netbsd_vec ;; - i[3456]86-*-netbsdpe*) + i[3-7]86-*-netbsdpe*) targ_defvec=i386pe_vec targ_selvecs="i386pe_vec i386pei_vec bfd_elf32_i386_vec" ;; - i[3456]86-*-netbsdaout* | i[3456]86-*-netbsd* | i[3456]86-*-openbsd*) + i[3-7]86-*-netbsdaout* | i[3-7]86-*-netbsd* | i[3-7]86-*-openbsd*) targ_defvec=i386netbsd_vec targ_selvecs="bfd_elf32_i386_vec i386bsd_vec" targ_underscore=yes ;; - i[3456]86-*-netware*) + i[3-7]86-*-netware*) targ_defvec=bfd_elf32_i386_vec targ_selvecs="nlm32_i386_vec i386coff_vec i386aout_vec" ;; - i[3456]86-*-linux*aout*) + i[3-7]86-*-linux*aout*) targ_defvec=i386linux_vec targ_selvecs=bfd_elf32_i386_vec targ_underscore=yes ;; - i[3456]86-*-linux-gnu*) + i[3-7]86-*-linux-gnu*) targ_defvec=bfd_elf32_i386_vec targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" targ64_selvecs=bfd_elf64_x86_64_vec @@ -474,58 +474,58 @@ case "${targ}" in targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" ;; #endif - i[3456]86-*-lynxos*) + i[3-7]86-*-lynxos*) targ_defvec=i386lynx_coff_vec targ_selvecs=i386lynx_aout_vec ;; - i[3456]86-*-gnu*) + i[3-7]86-*-gnu*) targ_defvec=bfd_elf32_i386_vec ;; - i[3456]86-*-mach* | i[3456]86-*-osf1mk*) + i[3-7]86-*-mach* | i[3-7]86-*-osf1mk*) targ_defvec=i386mach3_vec targ_cflags=-DSTAT_FOR_EXEC targ_underscore=yes ;; - i[3456]86-*-os9k) + i[3-7]86-*-os9k) targ_defvec=i386os9k_vec ;; - i[3456]86-*-msdos*) + i[3-7]86-*-msdos*) targ_defvec=i386aout_vec targ_selvecs=i386msdos_vec ;; - i[3456]86-*-moss*) + i[3-7]86-*-moss*) targ_defvec=bfd_elf32_i386_vec targ_selvecs="i386msdos_vec i386aout_vec" ;; - i[3456]86-*-beospe*) + i[3-7]86-*-beospe*) targ_defvec=i386pe_vec targ_selvecs="i386pe_vec i386pei_vec" ;; - i[3456]86-*-beoself* | i[3456]86-*-beos*) + i[3-7]86-*-beoself* | i[3-7]86-*-beos*) targ_defvec=bfd_elf32_i386_vec targ_selvecs="i386pe_vec i386pei_vec" ;; - i[3456]86-*-interix*) + i[3-7]86-*-interix*) targ_defvec=i386pei_vec targ_selvecs="i386pe_vec" # FIXME: This should eventually be checked at runtime. targ_cflags=-DSTRICT_PE_FORMAT ;; - i[3456]86-*-mingw32* | i[3456]86-*-cygwin* | i[3456]86-*-winnt | i[3456]86-*-pe) + i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe) targ_defvec=i386pe_vec targ_selvecs="i386pe_vec i386pei_vec bfd_elf32_i386_vec" ;; - i[3456]86-none-*) + i[3-7]86-none-*) targ_defvec=i386coff_vec ;; - i[3456]86-*-aout* | i[3456]86*-*-vsta*) + i[3-7]86-*-aout* | i[3-7]86*-*-vsta*) targ_defvec=i386aout_vec ;; - i[3456]86-*-vxworks*) + i[3-7]86-*-vxworks*) targ_defvec=i386aout_vec targ_underscore=yes ;; - i[3456]86-*-chaos) + i[3-7]86-*-chaos) targ_defvec=bfd_elf32_i386_vec targ_selfvecs=i386chaos_vec ;; @@ -1016,17 +1016,13 @@ case "${targ}" in ;; #endif - shle-*-netbsdelf*) + sh*l*-*-netbsdelf*) targ_defvec=bfd_elf32_shlnbsd_vec targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec" #ifdef BFD64 targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" #endif ;; - sh*le-*-netbsdelf*) - targ_defvec=bfd_elf32_shlnbsd_vec - targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec" - ;; sh-*-netbsdelf*) targ_defvec=bfd_elf32_shnbsd_vec targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" diff --git a/bfd/configure b/bfd/configure index a3a9671..df2d7ff 100755 --- a/bfd/configure +++ b/bfd/configure @@ -734,249 +734,49 @@ test "$host_alias" != "$target_alias" && NONENONEs,x,x, && program_prefix=${target_alias}- -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:741: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:771: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:822: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 +echo "configure:740: checking for strerror in -lcposix" >&5 +ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:854: 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. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 865 "configure" + ac_save_LIBS="$LIBS" +LIBS="-lcposix $LIBS" +cat > conftest.$ac_ext <<EOF +#line 748 "configure" #include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror(); -main(){return(0);} +int main() { +strerror() +; return 0; } EOF -if { (eval echo configure:870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi +if { (eval echo configure:759: \"$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 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:896: 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 - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:901: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <<EOF -#ifdef __GNUC__ - yes; -#endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:929: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* +LIBS="$ac_save_LIBS" fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:961: checking for POSIXized ISC" >&5 -if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 -then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi + LIBS="$LIBS -lcposix" else echo "$ac_t""no" 1>&6 - ISC= fi + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -990,7 +790,7 @@ fi # 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:994: checking for a BSD compatible install" >&5 +echo "configure:794: 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 @@ -1043,7 +843,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:1047: checking whether build environment is sane" >&5 +echo "configure:847: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -1100,7 +900,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1104: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:904: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1146,7 +946,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1150: checking for working aclocal" >&5 +echo "configure:950: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1159,7 +959,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1163: checking for working autoconf" >&5 +echo "configure:963: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1172,7 +972,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1176: checking for working automake" >&5 +echo "configure:976: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1185,7 +985,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1189: checking for working autoheader" >&5 +echo "configure:989: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1198,7 +998,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1202: checking for working makeinfo" >&5 +echo "configure:1002: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1233,7 +1033,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1237: checking for $ac_word" >&5 +echo "configure:1037: 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 @@ -1265,7 +1065,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1269: checking for $ac_word" >&5 +echo "configure:1069: 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 @@ -1297,7 +1097,7 @@ if test -n "$ac_tool_prefix"; 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:1301: checking for $ac_word" >&5 +echo "configure:1101: 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 @@ -1400,6 +1200,228 @@ else enable_fast_install=yes fi +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1207: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1237: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1288: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:1320: 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. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 1331 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:1336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1362: 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 + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1367: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1395: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" @@ -1412,7 +1434,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1416: checking for ld used by GCC" >&5 +echo "configure:1438: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1442,10 +1464,10 @@ echo "configure:1416: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1446: checking for GNU ld" >&5 +echo "configure:1468: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1449: checking for non-GNU ld" >&5 +echo "configure:1471: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1480,7 +1502,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1484: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1506: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1497,7 +1519,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1501: checking for $LD option to reload object files" >&5 +echo "configure:1523: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1509,7 +1531,7 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1513: checking for BSD-compatible nm" >&5 +echo "configure:1535: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1547,7 +1569,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1551: checking whether ln -s works" >&5 +echo "configure:1573: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1568,7 +1590,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1572: checking how to recognise dependant libraries" >&5 +echo "configure:1594: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1678,7 +1700,7 @@ irix5* | irix6*) # This must be Linux ELF. linux-gnu*) case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) + alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM @@ -1741,13 +1763,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1745: checking for object suffix" >&5 +echo "configure:1767: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1767,7 +1789,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1771: checking for executable suffix" >&5 +echo "configure:1793: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1777,7 +1799,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -1804,7 +1826,7 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:1808: checking for ${ac_tool_prefix}file" >&5 +echo "configure:1830: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1866,7 +1888,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:1870: checking for file" >&5 +echo "configure:1892: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1937,7 +1959,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1941: checking for $ac_word" >&5 +echo "configure:1963: 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 @@ -1969,7 +1991,7 @@ if test -n "$ac_tool_prefix"; 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:1973: checking for $ac_word" >&5 +echo "configure:1995: 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 @@ -2004,7 +2026,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2008: checking for $ac_word" >&5 +echo "configure:2030: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2036,7 +2058,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2040: checking for $ac_word" >&5 +echo "configure:2062: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2103,8 +2125,8 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2107 "configure"' > conftest.$ac_ext - if { (eval echo configure:2108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2129 "configure"' > conftest.$ac_ext + if { (eval echo configure:2130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) @@ -2137,7 +2159,7 @@ case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo configure:2141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:2163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *ELF-32*) HPUX_IA64_MODE="32" @@ -2155,7 +2177,7 @@ ia64-*-hpux*) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2159: checking whether the C compiler needs -belf" >&5 +echo "configure:2181: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2168,14 +2190,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <<EOF -#line 2172 "configure" +#line 2194 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:2179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2365,7 +2387,7 @@ if test -z "$target" ; then fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:2369: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:2391: 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" @@ -2388,7 +2410,7 @@ fi echo $ac_n "checking whether to install libbfd""... $ac_c" 1>&6 -echo "configure:2392: checking whether to install libbfd" >&5 +echo "configure:2414: checking whether to install libbfd" >&5 # Check whether --enable-install-libbfd or --disable-install-libbfd was given. if test "${enable_install_libbfd+set}" = set; then enableval="$enable_install_libbfd" @@ -2425,7 +2447,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:2429: checking for executable suffix" >&5 +echo "configure:2451: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2435,7 +2457,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:2439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:2461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -2465,7 +2487,7 @@ bfd_default_target_size=32 # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2469: checking for $ac_word" >&5 +echo "configure:2491: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2495,7 +2517,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2499: checking for $ac_word" >&5 +echo "configure:2521: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2546,7 +2568,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2550: checking for $ac_word" >&5 +echo "configure:2572: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2578,7 +2600,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2582: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2604: 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. @@ -2589,12 +2611,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2593 "configure" +#line 2615 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2620: \"$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 @@ -2620,12 +2642,12 @@ 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:2624: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2646: 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 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2629: checking whether we are using GNU C" >&5 +echo "configure:2651: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2634,7 +2656,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2653,7 +2675,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2657: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2679: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2687,7 +2709,7 @@ fi ALL_LINGUAS="fr tr ja es sv da zh_CN" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2691: checking how to run the C preprocessor" >&5 +echo "configure:2713: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2702,13 +2724,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 2706 "configure" +#line 2728 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2734: \"$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 : @@ -2719,13 +2741,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 2723 "configure" +#line 2745 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2751: \"$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 : @@ -2736,13 +2758,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 2740 "configure" +#line 2762 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2768: \"$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 : @@ -2769,7 +2791,7 @@ echo "$ac_t""$CPP" 1>&6 # 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:2773: checking for $ac_word" >&5 +echo "configure:2795: 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 @@ -2797,12 +2819,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2801: checking for ANSI C header files" >&5 +echo "configure:2823: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2806 "configure" +#line 2828 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -2810,7 +2832,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2836: \"$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* @@ -2827,7 +2849,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2831 "configure" +#line 2853 "configure" #include "confdefs.h" #include <string.h> EOF @@ -2845,7 +2867,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2849 "configure" +#line 2871 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -2866,7 +2888,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 2870 "configure" +#line 2892 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2877,7 +2899,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2901,12 +2923,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2905: checking for working const" >&5 +echo "configure:2927: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2910 "configure" +#line 2932 "configure" #include "confdefs.h" int main() { @@ -2955,7 +2977,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:2959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2976,21 +2998,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2980: checking for inline" >&5 +echo "configure:3002: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 2987 "configure" +#line 3009 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:2994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -3016,12 +3038,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3020: checking for off_t" >&5 +echo "configure:3042: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3025 "configure" +#line 3047 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3049,12 +3071,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3053: checking for size_t" >&5 +echo "configure:3075: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3058 "configure" +#line 3080 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3084,19 +3106,19 @@ fi # 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:3088: checking for working alloca.h" >&5 +echo "configure:3110: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3093 "configure" +#line 3115 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3122: \"$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 @@ -3117,12 +3139,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3121: checking for alloca" >&5 +echo "configure:3143: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3126 "configure" +#line 3148 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -3150,7 +3172,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3176: \"$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 @@ -3182,12 +3204,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3186: checking whether alloca needs Cray hooks" >&5 +echo "configure:3208: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3191 "configure" +#line 3213 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -3212,12 +3234,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3216: checking for $ac_func" >&5 +echo "configure:3238: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3221 "configure" +#line 3243 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3240,7 +3262,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3266: \"$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 @@ -3267,7 +3289,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3271: checking stack direction for C alloca" >&5 +echo "configure:3293: 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 @@ -3275,7 +3297,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 3279 "configure" +#line 3301 "configure" #include "confdefs.h" find_stack_direction () { @@ -3294,7 +3316,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:3298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3320: \"$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 @@ -3319,17 +3341,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:3323: checking for $ac_hdr" >&5 +echo "configure:3345: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3328 "configure" +#line 3350 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3355: \"$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* @@ -3358,12 +3380,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3362: checking for $ac_func" >&5 +echo "configure:3384: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3367 "configure" +#line 3389 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3386,7 +3408,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3412: \"$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 @@ -3411,7 +3433,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3415: checking for working mmap" >&5 +echo "configure:3437: 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 @@ -3419,7 +3441,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 3423 "configure" +#line 3445 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -3559,7 +3581,7 @@ main() } EOF -if { (eval echo configure:3563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3585: \"$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 @@ -3587,17 +3609,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3591: checking for $ac_hdr" >&5 +echo "configure:3613: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3596 "configure" +#line 3618 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3623: \"$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* @@ -3627,12 +3649,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3631: checking for $ac_func" >&5 +echo "configure:3653: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3636 "configure" +#line 3658 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3655,7 +3677,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3681: \"$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 @@ -3684,12 +3706,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3688: checking for $ac_func" >&5 +echo "configure:3710: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3693 "configure" +#line 3715 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3712,7 +3734,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3738: \"$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 @@ -3746,19 +3768,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3750: checking for LC_MESSAGES" >&5 +echo "configure:3772: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3755 "configure" +#line 3777 "configure" #include "confdefs.h" #include <locale.h> int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3779,7 +3801,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3783: checking whether NLS is requested" >&5 +echo "configure:3805: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3799,7 +3821,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3803: checking whether included gettext is requested" >&5 +echo "configure:3825: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3818,17 +3840,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3822: checking for libintl.h" >&5 +echo "configure:3844: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3827 "configure" +#line 3849 "configure" #include "confdefs.h" #include <libintl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3854: \"$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* @@ -3845,19 +3867,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3849: checking for gettext in libc" >&5 +echo "configure:3871: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3854 "configure" +#line 3876 "configure" #include "confdefs.h" #include <libintl.h> int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3873,7 +3895,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3877: checking for bindtextdomain in -lintl" >&5 +echo "configure:3899: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3881,7 +3903,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 3885 "configure" +#line 3907 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3892,7 +3914,7 @@ int main() { bindtextdomain() ; return 0; } EOF -if { (eval echo configure:3896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3918: \"$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 @@ -3908,19 +3930,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3912: checking for gettext in libintl" >&5 +echo "configure:3934: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3917 "configure" +#line 3939 "configure" #include "confdefs.h" int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3948,7 +3970,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3952: checking for $ac_word" >&5 +echo "configure:3974: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3982,12 +4004,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3986: checking for $ac_func" >&5 +echo "configure:4008: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3991 "configure" +#line 4013 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4010,7 +4032,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4036: \"$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 @@ -4037,7 +4059,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4041: checking for $ac_word" >&5 +echo "configure:4063: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4073,7 +4095,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4077: checking for $ac_word" >&5 +echo "configure:4099: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4105,7 +4127,7 @@ else fi cat > conftest.$ac_ext <<EOF -#line 4109 "configure" +#line 4131 "configure" #include "confdefs.h" int main() { @@ -4113,7 +4135,7 @@ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:4117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4145,7 +4167,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4149: checking for $ac_word" >&5 +echo "configure:4171: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4179,7 +4201,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4183: checking for $ac_word" >&5 +echo "configure:4205: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4215,7 +4237,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4219: checking for $ac_word" >&5 +echo "configure:4241: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4305,7 +4327,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4309: checking for catalogs to be installed" >&5 +echo "configure:4331: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4333,17 +4355,17 @@ echo "configure:4309: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4337: checking for linux/version.h" >&5 +echo "configure:4359: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4342 "configure" +#line 4364 "configure" #include "confdefs.h" #include <linux/version.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4369: \"$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* @@ -4421,7 +4443,7 @@ fi # 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:4425: checking for a BSD compatible install" >&5 +echo "configure:4447: 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 @@ -4504,7 +4526,7 @@ if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' else echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6 -echo "configure:4508: checking for build system executable suffix" >&5 +echo "configure:4530: checking for build system executable suffix" >&5 if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4532,17 +4554,17 @@ for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4536: checking for $ac_hdr" >&5 +echo "configure:4558: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4541 "configure" +#line 4563 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4568: \"$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* @@ -4572,17 +4594,17 @@ for ac_hdr in fcntl.h sys/file.h sys/time.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4576: checking for $ac_hdr" >&5 +echo "configure:4598: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4581 "configure" +#line 4603 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4608: \"$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* @@ -4609,12 +4631,12 @@ fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:4613: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:4635: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4618 "configure" +#line 4640 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -4623,7 +4645,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:4627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -4648,12 +4670,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:4652: checking for $ac_hdr that defines DIR" >&5 +echo "configure:4674: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4657 "configure" +#line 4679 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> @@ -4661,7 +4683,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4686,7 +4708,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:4690: checking for opendir in -ldir" >&5 +echo "configure:4712: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4694,7 +4716,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF -#line 4698 "configure" +#line 4720 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4705,7 +4727,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4731: \"$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 @@ -4727,7 +4749,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4731: checking for opendir in -lx" >&5 +echo "configure:4753: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4735,7 +4757,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF -#line 4739 "configure" +#line 4761 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4746,7 +4768,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4772: \"$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 @@ -4771,12 +4793,12 @@ fi for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4775: checking for $ac_func" >&5 +echo "configure:4797: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4780 "configure" +#line 4802 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4799,7 +4821,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4825: \"$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 @@ -4834,12 +4856,12 @@ EOF esac echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4838: checking whether strstr must be declared" >&5 +echo "configure:4860: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4843 "configure" +#line 4865 "configure" #include "confdefs.h" #include <stdio.h> @@ -4860,7 +4882,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4881,12 +4903,12 @@ EOF fi echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:4885: checking whether malloc must be declared" >&5 +echo "configure:4907: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4890 "configure" +#line 4912 "configure" #include "confdefs.h" #include <stdio.h> @@ -4907,7 +4929,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:4911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -4928,12 +4950,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:4932: checking whether realloc must be declared" >&5 +echo "configure:4954: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4937 "configure" +#line 4959 "configure" #include "confdefs.h" #include <stdio.h> @@ -4954,7 +4976,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:4958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -4975,12 +4997,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4979: checking whether free must be declared" >&5 +echo "configure:5001: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4984 "configure" +#line 5006 "configure" #include "confdefs.h" #include <stdio.h> @@ -5001,7 +5023,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:5005: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -5022,12 +5044,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:5026: checking whether getenv must be declared" >&5 +echo "configure:5048: checking whether getenv must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5031 "configure" +#line 5053 "configure" #include "confdefs.h" #include <stdio.h> @@ -5048,7 +5070,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:5052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -5099,50 +5121,50 @@ if test "${target}" = "${host}"; then TRAD_HEADER='"hosts/i370linux.h"' ;; - i[3456]86-sequent-bsd*) + i[3-7]86-sequent-bsd*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/symmetry.h"' ;; - i[3456]86-sequent-sysv4*) ;; - i[3456]86-sequent-sysv*) + i[3-7]86-sequent-sysv4*) ;; + i[3-7]86-sequent-sysv*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/symmetry.h"' ;; - i[3456]86-*-bsdi) + i[3-7]86-*-bsdi) COREFILE= ;; - i[3456]86-*-bsd* | i[34567]86-*-freebsd[123] | i[34567]86-*-freebsd[123]\.* | i[34567]86-*-freebsd4\.[01234]* | i[34567]86-*-freebsd*aout*) + i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[123] | i[3-7]86-*-freebsd[123]\.* | i[3-7]86-*-freebsd4\.[01234]* | i[3-7]86-*-freebsd*aout*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386bsd.h"' ;; - i[3456]86-*-freebsd*) + i[3-7]86-*-freebsd*) COREFILE='' TRAD_HEADER='"hosts/i386bsd.h"' ;; - i[3456]86-*-netbsd* | i[3456]86-*-openbsd*) + i[3-7]86-*-netbsd* | i[3-7]86-*-openbsd*) COREFILE=netbsd-core.lo ;; - i[3456]86-esix-sysv3*) + i[3-7]86-esix-sysv3*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/esix.h"' ;; - i[3456]86-*-sco3.2v5*) + i[3-7]86-*-sco3.2v5*) COREFILE=sco5-core.lo ;; - i[3456]86-*-sco* | i[3456]86-*-isc*) + i[3-7]86-*-sco* | i[3-7]86-*-isc*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386sco.h"' ;; - i[3456]86-*-mach3*) + i[3-7]86-*-mach3*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386mach3.h"' ;; - i[3456]86-*-linux-gnu*) + i[3-7]86-*-linux-gnu*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386linux.h"' ;; - i[3456]86-*-isc*) COREFILE=trad-core.lo ;; - i[3456]86-*-aix*) COREFILE=aix386-core.lo ;; + i[3-7]86-*-isc*) COREFILE=trad-core.lo ;; + i[3-7]86-*-aix*) COREFILE=aix386-core.lo ;; i860-*-mach3* | i860-*-osf1*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i860mach3.h"' @@ -5235,16 +5257,16 @@ if test "${target}" = "${host}"; then # Not all versions of AIX with -DAIX_CORE_DUMPX_CORE # have c_impl as a member of struct core_dumpx echo $ac_n "checking for c_impl in struct core_dumpx""... $ac_c" 1>&6 -echo "configure:5239: checking for c_impl in struct core_dumpx" >&5 +echo "configure:5261: checking for c_impl in struct core_dumpx" >&5 cat > conftest.$ac_ext <<EOF -#line 5241 "configure" +#line 5263 "configure" #include "confdefs.h" #include <core.h> int main() { struct core_dumpx c; c.c_impl = 0; ; return 0; } EOF -if { (eval echo configure:5248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_ST_C_IMPL 1 @@ -5312,17 +5334,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:5316: checking for $ac_hdr" >&5 +echo "configure:5338: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5321 "configure" +#line 5343 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5326: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5348: \"$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* @@ -5350,12 +5372,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:5354: checking for prstatus_t in sys/procfs.h" >&5 +echo "configure:5376: 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 <<EOF -#line 5359 "configure" +#line 5381 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5364,7 +5386,7 @@ int main() { prstatus_t avar ; return 0; } EOF -if { (eval echo configure:5368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus_t=yes else @@ -5386,12 +5408,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:5390: checking for prstatus32_t in sys/procfs.h" >&5 +echo "configure:5412: 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 <<EOF -#line 5395 "configure" +#line 5417 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5400,7 +5422,7 @@ int main() { prstatus32_t avar ; return 0; } EOF -if { (eval echo configure:5404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus32_t=yes else @@ -5422,12 +5444,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:5426: checking for prstatus_t.pr_who in sys/procfs.h" >&5 +echo "configure:5448: 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 <<EOF -#line 5431 "configure" +#line 5453 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5436,7 +5458,7 @@ int main() { prstatus_t avar; void* aref = (void*) &avar.pr_who ; return 0; } EOF -if { (eval echo configure:5440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5462: \"$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 @@ -5458,12 +5480,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:5462: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 +echo "configure:5484: 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 <<EOF -#line 5467 "configure" +#line 5489 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5472,7 +5494,7 @@ int main() { prstatus32_t avar; void* aref = (void*) &avar.pr_who ; return 0; } EOF -if { (eval echo configure:5476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5498: \"$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 @@ -5494,12 +5516,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:5498: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:5520: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5503 "configure" +#line 5525 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5508,7 +5530,7 @@ int main() { pstatus_t avar ; return 0; } EOF -if { (eval echo configure:5512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -5530,12 +5552,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:5534: checking for pxstatus_t in sys/procfs.h" >&5 +echo "configure:5556: 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 <<EOF -#line 5539 "configure" +#line 5561 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5544,7 +5566,7 @@ int main() { pxstatus_t avar ; return 0; } EOF -if { (eval echo configure:5548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pxstatus_t=yes else @@ -5566,12 +5588,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:5570: checking for pstatus32_t in sys/procfs.h" >&5 +echo "configure:5592: 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 <<EOF -#line 5575 "configure" +#line 5597 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5580,7 +5602,7 @@ int main() { pstatus32_t avar ; return 0; } EOF -if { (eval echo configure:5584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus32_t=yes else @@ -5602,12 +5624,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:5606: checking for prpsinfo_t in sys/procfs.h" >&5 +echo "configure:5628: 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 <<EOF -#line 5611 "configure" +#line 5633 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5616,7 +5638,7 @@ int main() { prpsinfo_t avar ; return 0; } EOF -if { (eval echo configure:5620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo_t=yes else @@ -5638,12 +5660,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:5642: checking for prpsinfo32_t in sys/procfs.h" >&5 +echo "configure:5664: 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 <<EOF -#line 5647 "configure" +#line 5669 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5652,7 +5674,7 @@ int main() { prpsinfo32_t avar ; return 0; } EOF -if { (eval echo configure:5656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes else @@ -5674,12 +5696,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:5678: checking for psinfo_t in sys/procfs.h" >&5 +echo "configure:5700: 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 <<EOF -#line 5683 "configure" +#line 5705 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5688,7 +5710,7 @@ int main() { psinfo_t avar ; return 0; } EOF -if { (eval echo configure:5692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo_t=yes else @@ -5710,12 +5732,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:5714: checking for psinfo32_t in sys/procfs.h" >&5 +echo "configure:5736: 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 <<EOF -#line 5719 "configure" +#line 5741 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5724,7 +5746,7 @@ int main() { psinfo32_t avar ; return 0; } EOF -if { (eval echo configure:5728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo32_t=yes else @@ -5746,12 +5768,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:5750: checking for lwpstatus_t in sys/procfs.h" >&5 +echo "configure:5772: 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 <<EOF -#line 5755 "configure" +#line 5777 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5760,7 +5782,7 @@ int main() { lwpstatus_t avar ; return 0; } EOF -if { (eval echo configure:5764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpstatus_t=yes else @@ -5782,12 +5804,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:5786: checking for lwpxstatus_t in sys/procfs.h" >&5 +echo "configure:5808: 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 <<EOF -#line 5791 "configure" +#line 5813 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5796,7 +5818,7 @@ int main() { lwpxstatus_t avar ; return 0; } EOF -if { (eval echo configure:5800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes else @@ -5818,12 +5840,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:5822: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 +echo "configure:5844: 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 <<EOF -#line 5827 "configure" +#line 5849 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5832,7 +5854,7 @@ int main() { lwpstatus_t avar; void* aref = (void*) &avar.pr_context ; return 0; } EOF -if { (eval echo configure:5836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5858: \"$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 @@ -5854,12 +5876,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:5858: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 +echo "configure:5880: 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 <<EOF -#line 5863 "configure" +#line 5885 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5868,7 +5890,7 @@ int main() { lwpstatus_t avar; void* aref = (void*) &avar.pr_reg ; return 0; } EOF -if { (eval echo configure:5872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5894: \"$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 @@ -5890,12 +5912,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:5894: checking for win32_pstatus_t in sys/procfs.h" >&5 +echo "configure:5916: 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 <<EOF -#line 5899 "configure" +#line 5921 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5904,7 +5926,7 @@ int main() { win32_pstatus_t avar ; return 0; } EOF -if { (eval echo configure:5908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5930: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes else @@ -6374,10 +6396,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:6378: checking for gcc version with buggy 64-bit support" >&5 +echo "configure:6400: 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 <<EOF -#line 6381 "configure" +#line 6403 "configure" #include "confdefs.h" :__GNUC__:__GNUC_MINOR__:__i386__: EOF @@ -6423,17 +6445,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:6427: checking for $ac_hdr" >&5 +echo "configure:6449: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6432 "configure" +#line 6454 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6437: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6459: \"$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* @@ -6462,12 +6484,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6466: checking for $ac_func" >&5 +echo "configure:6488: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6471 "configure" +#line 6493 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6490,7 +6512,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6516: \"$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 @@ -6515,7 +6537,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6519: checking for working mmap" >&5 +echo "configure:6541: 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 @@ -6523,7 +6545,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 6527 "configure" +#line 6549 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -6663,7 +6685,7 @@ main() } EOF -if { (eval echo configure:6667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6689: \"$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 @@ -6688,12 +6710,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6692: checking for $ac_func" >&5 +echo "configure:6714: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6697 "configure" +#line 6719 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6716,7 +6738,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6742: \"$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 @@ -6896,7 +6918,6 @@ s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g -s%@CC@%$CC%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g @@ -6912,6 +6933,7 @@ s%@bfd_version@%$bfd_version%g s%@bfd_version_string@%$bfd_version_string%g s%@AR@%$AR%g s%@RANLIB@%$RANLIB%g +s%@CC@%$CC%g s%@LN_S@%$LN_S%g s%@OBJEXT@%$OBJEXT%g s%@EXEEXT@%$EXEEXT%g diff --git a/bfd/configure.host b/bfd/configure.host index 634b0b1..b690fb9 100644 --- a/bfd/configure.host +++ b/bfd/configure.host @@ -37,9 +37,9 @@ ia64-*-hpux*) host64=true HOST_U_64BIT_TYPE="unsigned long long"; ;; -i[3456]86-sequent-bsd*) HDEFINES=-Dshared=genshared ;; -i[3456]86-sequent-sysv4*) ;; -i[3456]86-sequent-sysv*) HDEFINES=-Dshared=genshared ;; +i[3-7]86-sequent-bsd*) HDEFINES=-Dshared=genshared ;; +i[3-7]86-sequent-sysv4*) ;; +i[3-7]86-sequent-sysv*) HDEFINES=-Dshared=genshared ;; mips*-*-netbsd*) ;; mips*-*-openbsd*) ;; diff --git a/bfd/configure.in b/bfd/configure.in index a2b56d2..b708145 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -175,72 +175,72 @@ if test "${target}" = "${host}"; then ;; changequote(,)dnl - i[3456]86-sequent-bsd*) + i[3-7]86-sequent-bsd*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/symmetry.h"' ;; changequote(,)dnl - i[3456]86-sequent-sysv4*) ;; - i[3456]86-sequent-sysv*) + i[3-7]86-sequent-sysv4*) ;; + i[3-7]86-sequent-sysv*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/symmetry.h"' ;; changequote(,)dnl - i[3456]86-*-bsdi) + i[3-7]86-*-bsdi) changequote([,])dnl COREFILE= ;; changequote(,)dnl - i[3456]86-*-bsd* | i[34567]86-*-freebsd[123] | i[34567]86-*-freebsd[123]\.* | i[34567]86-*-freebsd4\.[01234]* | i[34567]86-*-freebsd*aout*) + i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[123] | i[3-7]86-*-freebsd[123]\.* | i[3-7]86-*-freebsd4\.[01234]* | i[3-7]86-*-freebsd*aout*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386bsd.h"' ;; changequote(,)dnl - i[3456]86-*-freebsd*) + i[3-7]86-*-freebsd*) changequote([,])dnl COREFILE='' TRAD_HEADER='"hosts/i386bsd.h"' ;; changequote(,)dnl - i[3456]86-*-netbsd* | i[3456]86-*-openbsd*) + i[3-7]86-*-netbsd* | i[3-7]86-*-openbsd*) changequote([,])dnl COREFILE=netbsd-core.lo ;; changequote(,)dnl - i[3456]86-esix-sysv3*) + i[3-7]86-esix-sysv3*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/esix.h"' ;; changequote(,)dnl - i[3456]86-*-sco3.2v5*) + i[3-7]86-*-sco3.2v5*) changequote([,])dnl COREFILE=sco5-core.lo ;; changequote(,)dnl - i[3456]86-*-sco* | i[3456]86-*-isc*) + i[3-7]86-*-sco* | i[3-7]86-*-isc*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386sco.h"' ;; changequote(,)dnl - i[3456]86-*-mach3*) + i[3-7]86-*-mach3*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386mach3.h"' ;; changequote(,)dnl - i[3456]86-*-linux-gnu*) + i[3-7]86-*-linux-gnu*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386linux.h"' ;; changequote(,)dnl - i[3456]86-*-isc*) COREFILE=trad-core.lo ;; - i[3456]86-*-aix*) COREFILE=aix386-core.lo ;; + i[3-7]86-*-isc*) COREFILE=trad-core.lo ;; + i[3-7]86-*-aix*) COREFILE=aix386-core.lo ;; changequote([,])dnl i860-*-mach3* | i860-*-osf1*) COREFILE=trad-core.lo diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c index 66c3a46..9ef527c 100644 --- a/bfd/cpu-arm.c +++ b/bfd/cpu-arm.c @@ -260,7 +260,7 @@ arm_check_note (abfd, buffer, buffer_size, expected_name, description_return) } else { - if (namesz != (strlen (expected_name) + 1 + 3) & ~3) + if (namesz != ((strlen (expected_name) + 1 + 3) & ~3)) return FALSE; if (strcmp (descr, expected_name) != 0) diff --git a/bfd/cpu-h8300.c b/bfd/cpu-h8300.c index 2a5c604..f61e757 100644 --- a/bfd/cpu-h8300.c +++ b/bfd/cpu-h8300.c @@ -81,6 +81,9 @@ h8300_scan (info, string) if (*string == 'n' || *string == 'N') return (info->mach == bfd_mach_h8300sn); + if (*string == 'x' || *string == 'X') + return (info->mach == bfd_mach_h8300sx); + return (info->mach == bfd_mach_h8300s); } else @@ -103,6 +106,22 @@ compatible (in, out) return in; } +static const bfd_arch_info_type h8300sx_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_h8300sx, + "h8300sx", /* arch_name */ + "h8300sx", /* printable name */ + 1, + FALSE, /* the default machine */ + compatible, + h8300_scan, + 0 +}; + static const bfd_arch_info_type h8300sn_info_struct = { 32, /* 32 bits in a word. */ @@ -116,7 +135,7 @@ static const bfd_arch_info_type h8300sn_info_struct = FALSE, /* The default machine. */ compatible, h8300_scan, - 0 + &h8300sx_info_struct }; diff --git a/bfd/cpu-m68hc12.c b/bfd/cpu-m68hc12.c index d43eb95..f4c8c9e 100644 --- a/bfd/cpu-m68hc12.c +++ b/bfd/cpu-m68hc12.c @@ -1,5 +1,5 @@ /* BFD support for the Motorola 68HC12 processor - Copyright 1999, 2000, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -21,10 +21,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" +const bfd_arch_info_type bfd_m68hc12s_arch = +{ + 16, /* 16 bits in a word */ + 32, /* 16 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_m68hc12, + bfd_mach_m6812s, + "m68hc12:HCS12", + "m68hc12", + 4, /* section alignment power */ + TRUE, + bfd_default_compatible, + bfd_default_scan, + 0, +}; + const bfd_arch_info_type bfd_m68hc12_arch = { 16, /* 16 bits in a word */ - 16, /* 16 bits in an address */ + 32, /* 16 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_m68hc12, 0, @@ -34,5 +50,5 @@ const bfd_arch_info_type bfd_m68hc12_arch = TRUE, bfd_default_compatible, bfd_default_scan, - 0, + &bfd_m68hc12s_arch, }; diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index f15353c..1da6055 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -210,6 +210,30 @@ struct elf_link_hash_entry #define ELF_LINK_DYNAMIC_WEAK 040000 }; +/* Will references to this symbol always reference the symbol + in this object? STV_PROTECTED is excluded from the visibility test + here so that function pointer comparisons work properly. Since + function symbols not defined in an app are set to their .plt entry, + it's necessary for shared libs to also reference the .plt even + though the symbol is really local to the shared lib. */ +#define SYMBOL_REFERENCES_LOCAL(INFO, H) \ + ((! (INFO)->shared \ + || (INFO)->symbolic \ + || (H)->dynindx == -1 \ + || ELF_ST_VISIBILITY ((H)->other) == STV_INTERNAL \ + || ELF_ST_VISIBILITY ((H)->other) == STV_HIDDEN \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) \ + && ((H)->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) + +/* Will _calls_ to this symbol always call the version in this object? */ +#define SYMBOL_CALLS_LOCAL(INFO, H) \ + ((! (INFO)->shared \ + || (INFO)->symbolic \ + || (H)->dynindx == -1 \ + || ELF_ST_VISIBILITY ((H)->other) != STV_DEFAULT \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) \ + && ((H)->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) + /* Records local symbols to be emitted in the dynamic symbol table. */ struct elf_link_local_dynamic_entry @@ -428,7 +452,7 @@ struct elf_size_info { handle all back-ends. */ #define MAX_INT_RELS_PER_EXT_REL 3 - unsigned char arch_size, file_align; + unsigned char arch_size, log_file_align; unsigned char elfclass, ev_current; int (*write_out_phdrs) PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int)); @@ -851,6 +875,12 @@ struct elf_backend_data Used for the MIPS ELF .mdebug section. */ const struct ecoff_debug_swap *elf_backend_ecoff_debug_swap; + /* This function implements `bfd_elf_bfd_from_remote_memory'; + see elf.c, elfcode.h. */ + bfd *(*elf_backend_bfd_from_remote_memory) + PARAMS ((bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, char *myaddr, int len))); + /* Alternate EM_xxxx machine codes for this backend. */ int elf_machine_alt1; int elf_machine_alt2; @@ -1052,6 +1082,46 @@ typedef struct elf_linker_section_pointers bfd_boolean written_address_p; /* whether address was written yet */ } elf_linker_section_pointers_t; +/* This struct is used to pass information to routines called via + elf_link_hash_traverse which must return failure. */ + +struct elf_info_failed +{ + bfd_boolean failed; + struct bfd_link_info *info; + struct bfd_elf_version_tree *verdefs; +}; + +/* This structure is used to pass information to + _bfd_elf_link_assign_sym_version. */ + +struct elf_assign_sym_version_info +{ + /* Output BFD. */ + bfd *output_bfd; + /* General link information. */ + struct bfd_link_info *info; + /* Version tree. */ + struct bfd_elf_version_tree *verdefs; + /* Whether we had a failure. */ + bfd_boolean failed; +}; + +/* This structure is used to pass information to + _bfd_elf_link_find_version_dependencies. */ + +struct elf_find_verdep_info +{ + /* Output BFD. */ + bfd *output_bfd; + /* General link information. */ + struct bfd_link_info *info; + /* The number of dependencies. */ + unsigned int vers; + /* Whether we had a failure. */ + bfd_boolean failed; +}; + /* Some private data is stashed away for future use using the tdata pointer in the bfd structure. */ @@ -1395,8 +1465,6 @@ extern asection *bfd_section_from_r_symndx PARAMS ((bfd *, struct sym_sec_cache *, asection *, unsigned long)); extern asection *bfd_section_from_elf_index PARAMS ((bfd *, unsigned int)); -extern bfd_boolean _bfd_elf_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); extern struct bfd_strtab_hash *_bfd_elf_stringtab_init PARAMS ((void)); @@ -1435,6 +1503,26 @@ extern bfd_boolean _bfd_elf_write_section_eh_frame_hdr extern bfd_boolean _bfd_elf_maybe_strip_eh_frame_hdr PARAMS ((struct bfd_link_info *)); +extern bfd_boolean _bfd_elf_merge_symbol + PARAMS ((bfd *, struct bfd_link_info *, const char *, + Elf_Internal_Sym *, asection **, bfd_vma *, + struct elf_link_hash_entry **, bfd_boolean *, bfd_boolean *, + bfd_boolean *, bfd_boolean *, bfd_boolean)); + +extern bfd_boolean _bfd_elf_add_default_symbol + PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + const char *, Elf_Internal_Sym *, asection **, bfd_vma *, + bfd_boolean *, bfd_boolean, bfd_boolean)); + +extern bfd_boolean _bfd_elf_export_symbol + PARAMS ((struct elf_link_hash_entry *, PTR)); + +extern bfd_boolean _bfd_elf_link_find_version_dependencies + PARAMS ((struct elf_link_hash_entry *, PTR)); + +extern bfd_boolean _bfd_elf_link_assign_sym_version + PARAMS ((struct elf_link_hash_entry *, PTR)); + extern bfd_boolean _bfd_elf_link_record_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); extern long _bfd_elf_link_lookup_local_dynindx @@ -1449,6 +1537,8 @@ extern file_ptr _bfd_elf_assign_file_position_for_section extern bfd_boolean _bfd_elf_validate_reloc PARAMS ((bfd *, arelent *)); +extern bfd_boolean _bfd_elf_link_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); extern bfd_boolean _bfd_elf_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); extern bfd_boolean _bfd_elf_create_got_section @@ -1490,6 +1580,24 @@ extern bfd_vma bfd_elf64_finish_pointer_linker_section extern bfd_boolean _bfd_elf_make_linker_section_rela PARAMS ((bfd *, elf_linker_section_t *, int)); +extern Elf_Internal_Rela *_bfd_elf_link_read_relocs + PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean)); + +extern bfd_boolean _bfd_elf_link_size_reloc_section + PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); + +extern bfd_boolean _bfd_elf_link_output_relocs + PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *)); + +extern bfd_boolean _bfd_elf_fix_symbol_flags + PARAMS ((struct elf_link_hash_entry *, struct elf_info_failed *)); + +extern bfd_boolean _bfd_elf_adjust_dynamic_symbol + PARAMS ((struct elf_link_hash_entry *, PTR)); + +extern bfd_boolean _bfd_elf_link_sec_merge_syms + PARAMS ((struct elf_link_hash_entry *, PTR)); + extern const bfd_target *bfd_elf32_object_p PARAMS ((bfd *)); extern const bfd_target *bfd_elf32_core_file_p @@ -1538,10 +1646,6 @@ extern bfd_boolean bfd_elf32_slurp_reloc_table PARAMS ((bfd *, asection *, asymbol **, bfd_boolean)); extern bfd_boolean bfd_elf32_add_dynamic_entry PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma)); -extern bfd_boolean bfd_elf32_link_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -extern Elf_Internal_Rela *_bfd_elf32_link_read_relocs - PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean)); extern const bfd_target *bfd_elf64_object_p PARAMS ((bfd *)); @@ -1590,10 +1694,6 @@ extern bfd_boolean bfd_elf64_slurp_reloc_table PARAMS ((bfd *, asection *, asymbol **, bfd_boolean)); extern bfd_boolean bfd_elf64_add_dynamic_entry PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma)); -extern bfd_boolean bfd_elf64_link_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -extern Elf_Internal_Rela *_bfd_elf64_link_read_relocs - PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean)); #define bfd_elf32_link_record_dynamic_symbol \ _bfd_elf_link_record_dynamic_symbol @@ -1656,6 +1756,13 @@ extern char *elfcore_write_prxfpreg extern char *elfcore_write_lwpstatus PARAMS ((bfd *, char *, int *, long, int, const PTR)); +extern bfd *_bfd_elf32_bfd_from_remote_memory + PARAMS ((bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma, char *, int))); +extern bfd *_bfd_elf64_bfd_from_remote_memory + PARAMS ((bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma, char *, int))); + /* SH ELF specific routine. */ extern bfd_boolean _sh_elf_set_mach_from_flags diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c index f5f2789..c35adcb 100644 --- a/bfd/elf-m10200.c +++ b/bfd/elf-m10200.c @@ -1,5 +1,5 @@ /* Matsushita 10200 specific support for 32-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -529,7 +529,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* Get a copy of the native relocations. */ - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) @@ -1342,7 +1342,7 @@ mn10200_elf_get_relocated_section_contents (output_bfd, link_info, link_order, asection **secpp; bfd_size_type amt; - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (input_bfd, input_section, (PTR) NULL, (Elf_Internal_Rela *) NULL, FALSE)); if (internal_relocs == NULL) diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 2f0cd90..cad2b9c 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -1,5 +1,5 @@ /* Matsushita 10300 specific support for 32-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -859,7 +859,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) { /* Get a copy of the native relocations. */ - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (input_bfd, section, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); @@ -1125,7 +1125,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) if (section->reloc_count != 0) { /* Get a copy of the native relocations. */ - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (input_bfd, section, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); @@ -1351,7 +1351,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* Get a copy of the native relocations. */ - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) @@ -2577,7 +2577,7 @@ mn10300_elf_get_relocated_section_contents (output_bfd, link_info, link_order, Elf_Internal_Sym *isym, *isymend; bfd_size_type amt; - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (input_bfd, input_section, (PTR) NULL, (Elf_Internal_Rela *) NULL, FALSE)); if (internal_relocs == NULL) @@ -271,7 +271,7 @@ bfd_elf_hash (namearg) h ^= g; } } - return h; + return h & 0xffffffff; } /* Read a specified number of bytes at a specified offset in an ELF @@ -1616,7 +1616,7 @@ bfd_elf_get_needed_list (abfd, info) bfd *abfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { - if (info->hash->creator->flavour != bfd_target_elf_flavour) + if (! is_elf_hash_table (info)) return NULL; return elf_hash_table (info)->needed; } @@ -1629,7 +1629,7 @@ bfd_elf_get_runpath_list (abfd, info) bfd *abfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { - if (info->hash->creator->flavour != bfd_target_elf_flavour) + if (! is_elf_hash_table (info)) return NULL; return elf_hash_table (info)->runpath; } @@ -2335,7 +2335,7 @@ _bfd_elf_init_reloc_shdr (abfd, rel_hdr, asect, use_rela_p) rel_hdr->sh_entsize = (use_rela_p ? bed->s->sizeof_rela : bed->s->sizeof_rel); - rel_hdr->sh_addralign = bed->s->file_align; + rel_hdr->sh_addralign = 1 << bed->s->log_file_align; rel_hdr->sh_flags = 0; rel_hdr->sh_addr = 0; rel_hdr->sh_size = 0; @@ -2365,9 +2365,9 @@ elf_fake_sections (abfd, asect, failedptrarg) this_hdr = &elf_section_data (asect)->this_hdr; - this_hdr->sh_name = (unsigned long) _bfd_elf_strtab_add (elf_shstrtab (abfd), - asect->name, FALSE); - if (this_hdr->sh_name == (unsigned long) -1) + this_hdr->sh_name = (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd), + asect->name, FALSE); + if (this_hdr->sh_name == (unsigned int) -1) { *failedptr = TRUE; return; @@ -3748,7 +3748,7 @@ assign_file_positions_for_segments (abfd) && (abfd->flags & D_PAGED) != 0) p->p_align = bed->maxpagesize; else if (m->count == 0) - p->p_align = bed->s->file_align; + p->p_align = 1 << bed->s->log_file_align; else p->p_align = 0; @@ -4245,7 +4245,7 @@ assign_file_positions_except_relocs (abfd) } /* Place the section headers. */ - off = align_file_position (off, bed->s->file_align); + off = align_file_position (off, 1 << bed->s->log_file_align); i_ehdrp->e_shoff = off; off += i_ehdrp->e_shnum * i_ehdrp->e_shentsize; @@ -5302,7 +5302,7 @@ swap_out_syms (abfd, sttp, relocatable_p) symtab_hdr->sh_entsize = bed->s->sizeof_sym; symtab_hdr->sh_size = symtab_hdr->sh_entsize * (symcount + 1); symtab_hdr->sh_info = elf_num_locals (abfd) + 1; - symtab_hdr->sh_addralign = bed->s->file_align; + symtab_hdr->sh_addralign = 1 << bed->s->log_file_align; symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr; symstrtab_hdr->sh_type = SHT_STRTAB; @@ -6884,6 +6884,20 @@ elfcore_grok_note (abfd, note) #else return TRUE; #endif + + case NT_AUXV: + { + asection *sect = bfd_make_section (abfd, ".auxv"); + + if (sect == NULL) + return FALSE; + sect->_raw_size = note->descsz; + sect->filepos = note->descpos; + sect->flags = SEC_HAS_CONTENTS; + sect->alignment_power = 1 + bfd_get_arch_size (abfd) / 32; + + return TRUE; + } } } @@ -7125,7 +7139,7 @@ elfcore_write_note (abfd, buf, bufsiz, name, type, input, size) namesz = strlen (name) + 1; bed = get_elf_backend_data (abfd); - pad = -namesz & (bed->s->file_align - 1); + pad = -namesz & ((1 << bed->s->log_file_align) - 1); } newspace = sizeof (Elf_External_Note) - 1 + namesz + pad + size; @@ -7535,3 +7549,27 @@ _bfd_elf_section_offset (abfd, info, sec, offset) return offset; } } + +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote memory + based on the ELF file header at EHDR_VMA and the ELF program headers it + points to. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs the + file headers (and hence BFD's idea of each section's VMA) put them at. + + The function TARGET_READ_MEMORY is called to copy LEN bytes from the + remote memory at target address VMA into the local buffer at MYADDR; it + should return zero on success or an `errno' code on failure. TEMPL must + be a BFD for an ELF target with the word size and byte order found in + the remote memory. */ + +bfd * +bfd_elf_bfd_from_remote_memory (templ, ehdr_vma, loadbasep, target_read_memory) + bfd *templ; + bfd_vma ehdr_vma; + bfd_vma *loadbasep; + int (*target_read_memory) PARAMS ((bfd_vma vma, char *myaddr, int len)); +{ + return (*get_elf_backend_data (templ)->elf_backend_bfd_from_remote_memory) + (templ, ehdr_vma, loadbasep, target_read_memory); +} diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index 631b2b9..ba286b1 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -679,8 +679,8 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) /* Load the relocs. */ internal_relocs - = _bfd_elf32_link_read_relocs (abfd, sec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, FALSE); + = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, FALSE); if (internal_relocs == NULL) goto error_return; diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c index e43ed9d..f272dc8 100644 --- a/bfd/elf32-h8300.c +++ b/bfd/elf32-h8300.c @@ -69,8 +69,8 @@ static reloc_howto_type h8_elf_howto_table[] = { 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - special, /* special_function */ + complain_overflow_dont,/* complain_on_overflow */ + special, /* special_function */ "R_H8_NONE", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ @@ -83,8 +83,8 @@ static reloc_howto_type h8_elf_howto_table[] = { 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - special, /* special_function */ + complain_overflow_dont,/* complain_on_overflow */ + special, /* special_function */ "R_H8_DIR32", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ @@ -97,8 +97,8 @@ static reloc_howto_type h8_elf_howto_table[] = { 16, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - special, /* special_function */ + complain_overflow_dont,/* complain_on_overflow */ + special, /* special_function */ "R_H8_DIR16", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ @@ -111,9 +111,9 @@ static reloc_howto_type h8_elf_howto_table[] = { 8, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - special, /* special_function */ - "R_H8_DIR16", /* name */ + complain_overflow_dont,/* complain_on_overflow */ + special, /* special_function */ + "R_H8_DIR8", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x000000ff, /* dst_mask */ @@ -126,7 +126,7 @@ static reloc_howto_type h8_elf_howto_table[] = { FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - special, /* special_function */ + special, /* special_function */ "R_H8_DIR16A8", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ @@ -140,7 +140,7 @@ static reloc_howto_type h8_elf_howto_table[] = { FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - special, /* special_function */ + special, /* special_function */ "R_H8_DIR16R8", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ @@ -154,7 +154,7 @@ static reloc_howto_type h8_elf_howto_table[] = { FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - special, /* special_function */ + special, /* special_function */ "R_H8_DIR24A8", /* name */ TRUE, /* partial_inplace */ 0xff000000, /* src_mask */ @@ -168,7 +168,7 @@ static reloc_howto_type h8_elf_howto_table[] = { FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - special, /* special_function */ + special, /* special_function */ "R_H8_DIR24R8", /* name */ TRUE, /* partial_inplace */ 0xff000000, /* src_mask */ @@ -181,8 +181,8 @@ static reloc_howto_type h8_elf_howto_table[] = { 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - special, /* special_function */ + complain_overflow_dont,/* complain_on_overflow */ + special, /* special_function */ "R_H8_DIR32", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ @@ -195,8 +195,8 @@ static reloc_howto_type h8_elf_howto_table[] = { 16, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - special, /* special_function */ + complain_overflow_signed,/* complain_on_overflow */ + special, /* special_function */ "R_H8_PCREL16", /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ @@ -209,8 +209,8 @@ static reloc_howto_type h8_elf_howto_table[] = { 8, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - special, /* special_function */ + complain_overflow_signed,/* complain_on_overflow */ + special, /* special_function */ "R_H8_PCREL8", /* name */ FALSE, /* partial_inplace */ 0xff, /* src_mask */ @@ -579,6 +579,9 @@ elf32_h8_mach (flags) case E_H8_MACH_H8300SN: return bfd_mach_h8300sn; + + case E_H8_MACH_H8300SX: + return bfd_mach_h8300sx; } } @@ -615,6 +618,10 @@ elf32_h8_final_write_processing (abfd, linker) case bfd_mach_h8300sn: val = E_H8_MACH_H8300SN; break; + + case bfd_mach_h8300sx: + val = E_H8_MACH_H8300SX; + break; } elf_elfheader (abfd)->e_flags &= ~ (EF_H8_MACH); @@ -709,7 +716,7 @@ elf32_h8_relax_section (abfd, sec, link_info, again) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* Get a copy of the native relocations. */ - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) @@ -1023,7 +1030,10 @@ elf32_h8_relax_section (abfd, sec, link_info, again) && value >= 0xff00 && value <= 0xffff) || ((bfd_get_mach (abfd) == bfd_mach_h8300h - || bfd_get_mach (abfd) == bfd_mach_h8300s) + /* FIXME: h8300hn? */ + || bfd_get_mach (abfd) == bfd_mach_h8300s + /* FIXME: h8300sn? */ + || bfd_get_mach (abfd) == bfd_mach_h8300sx) && value >= 0xffff00 && value <= 0xffffff)) { @@ -1081,7 +1091,10 @@ elf32_h8_relax_section (abfd, sec, link_info, again) && value >= 0xff00 && value <= 0xffff) || ((bfd_get_mach (abfd) == bfd_mach_h8300h - || bfd_get_mach (abfd) == bfd_mach_h8300s) + /* FIXME: h8300hn? */ + || bfd_get_mach (abfd) == bfd_mach_h8300s + /* FIXME: h8300sn? */ + || bfd_get_mach (abfd) == bfd_mach_h8300sx) && value >= 0xffff00 && value <= 0xffffff)) { @@ -1394,7 +1407,7 @@ elf32_h8_get_relocated_section_contents (output_bfd, link_info, link_order, Elf_Internal_Sym *isym, *isymend; bfd_size_type amt; - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (input_bfd, input_section, (PTR) NULL, (Elf_Internal_Rela *) NULL, FALSE)); if (internal_relocs == NULL) diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index b204c57..becfb73 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -2950,9 +2950,9 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size, /* Get the relocs. */ internal_relocs - = _bfd_elf32_link_read_relocs (input_bfd, section, NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory); + = _bfd_elf_link_read_relocs (input_bfd, section, NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (internal_relocs == NULL) goto error_ret_free_local; diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 4f6bd80..cfcb7b3 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -838,7 +838,19 @@ elf_i386_copy_indirect_symbol (bed, dir, ind) edir->tls_type = eind->tls_type; eind->tls_type = GOT_UNKNOWN; } - _bfd_elf_link_hash_copy_indirect (bed, dir, ind); + + if (ELIMINATE_COPY_RELOCS + && ind->root.type != bfd_link_hash_indirect + && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + /* If called to transfer flags for a weakdef during processing + of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF. + We clear it ourselves for ELIMINATE_COPY_RELOCS. */ + dir->elf_link_hash_flags |= + (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK)); + else + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } static int @@ -1378,11 +1390,9 @@ elf_i386_adjust_dynamic_symbol (info, h) || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { if (h->plt.refcount <= 0 - || (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0 - && h->root.type != bfd_link_hash_undefweak - && h->root.type != bfd_link_hash_undefined)) + || SYMBOL_CALLS_LOCAL (info, h) + || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak)) { /* This case can occur if we saw a PLT32 reloc in an input file, but the symbol was never referred to by a dynamic @@ -1644,8 +1654,10 @@ allocate_dynrelocs (h, inf) htab->srelgot->_raw_size += sizeof (Elf32_External_Rel); else if (tls_type == GOT_TLS_GD) htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rel); - else if (info->shared - || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)) + else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))) htab->srelgot->_raw_size += sizeof (Elf32_External_Rel); } else @@ -1663,9 +1675,13 @@ allocate_dynrelocs (h, inf) if (info->shared) { - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 - && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 - || info->symbolic)) + /* The only reloc that uses pc_count is R_386_PC32, which will + appear on a call or on something like ".long foo - .". We + want calls to protected symbols to resolve directly to the + function rather than going via the plt. If people want + function pointer comparisons to work as expected then they + should avoid writing assembly like ".long foo - .". */ + if (SYMBOL_CALLS_LOCAL (info, h)) { struct elf_i386_dyn_relocs **pp; @@ -1679,6 +1695,12 @@ allocate_dynrelocs (h, inf) pp = &p->next; } } + + /* Also discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->dyn_relocs = NULL; } else if (ELIMINATE_COPY_RELOCS) { @@ -2283,10 +2305,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, dyn = htab->elf.dynamic_sections_created; if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared - && (info->symbolic - || h->dynindx == -1 - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + && SYMBOL_REFERENCES_LOCAL (info, h)) + || (ELF_ST_VISIBILITY (h->other) + && h->root.type == bfd_link_hash_undefweak)) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined @@ -2410,12 +2431,12 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, break; if ((info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) && (r_type != R_386_PC32 || (h != NULL - && h->dynindx != -1 - && (! info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + && !SYMBOL_CALLS_LOCAL (info, h)))) || (ELIMINATE_COPY_RELOCS && !info->shared && h != NULL @@ -3145,10 +3166,7 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) The entry in the global offset table will already have been initialized in the relocate_section function. */ if (info->shared - && (info->symbolic - || h->dynindx == -1 - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + && SYMBOL_REFERENCES_LOCAL (info, h)) { BFD_ASSERT((h->got.offset & 1) != 0); rel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); diff --git a/bfd/elf32-i860.c b/bfd/elf32-i860.c index d24a29d..74112f1 100644 --- a/bfd/elf32-i860.c +++ b/bfd/elf32-i860.c @@ -718,7 +718,7 @@ elf32_i860_relocate_splitn (input_bfd, rello, contents, value) value += rello->r_addend; /* Separate the fields and insert. */ - value = (((value & 0xf8) << 5) | (value & 0x7ff)) & howto->dst_mask; + value = (((value & 0xf800) << 5) | (value & 0x7ff)) & howto->dst_mask; insn = (insn & ~howto->dst_mask) | value; bfd_put_32 (input_bfd, insn, contents + rello->r_offset); @@ -750,7 +750,7 @@ elf32_i860_relocate_pc16 (input_bfd, input_section, rello, contents, value) value += rello->r_addend; /* Separate the fields and insert. */ - value = (((value & 0xf8) << 5) | (value & 0x7ff)) & howto->dst_mask; + value = (((value & 0xf800) << 5) | (value & 0x7ff)) & howto->dst_mask; insn = (insn & ~howto->dst_mask) | value; bfd_put_32 (input_bfd, insn, contents + rello->r_offset); @@ -802,8 +802,8 @@ elf32_i860_relocate_highadj (input_bfd, rel, contents, value) insn = bfd_get_32 (input_bfd, contents + rel->r_offset); - value += ((rel->r_addend & 0x8000) << 1); value += rel->r_addend; + value += 0x8000; value = ((value >> 16) & 0xffff); insn = (insn & 0xffff0000) | value; diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c index cd2b970..e10e941 100644 --- a/bfd/elf32-ip2k.c +++ b/bfd/elf32-ip2k.c @@ -847,9 +847,9 @@ ip2k_elf_relax_section (abfd, sec, link_info, again) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - internal_relocs = _bfd_elf32_link_read_relocs (abfd, sec, NULL, - (Elf_Internal_Rela *)NULL, - link_info->keep_memory); + internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, + (Elf_Internal_Rela *)NULL, + link_info->keep_memory); if (internal_relocs == NULL) goto error_return; @@ -861,9 +861,9 @@ ip2k_elf_relax_section (abfd, sec, link_info, again) /* So stab does exits. */ Elf_Internal_Rela * irelbase; - irelbase = _bfd_elf32_link_read_relocs (abfd, stab, NULL, - (Elf_Internal_Rela *)NULL, - link_info->keep_memory); + irelbase = _bfd_elf_link_read_relocs (abfd, stab, NULL, + (Elf_Internal_Rela *)NULL, + link_info->keep_memory); } /* Get section contents cached copy if it exists. */ diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c index c4261bf..ebdd303 100644 --- a/bfd/elf32-iq2000.c +++ b/bfd/elf32-iq2000.c @@ -454,8 +454,9 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; - Elf_Internal_Rela *rel; - Elf_Internal_Rela *rel_end; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; + bfd_boolean changed = FALSE; if (info->relocateable) return TRUE; @@ -499,10 +500,20 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs) if (memcmp (sec->name, ".debug", 6) == 0 || memcmp (sec->name, ".stab", 5) == 0 || memcmp (sec->name, ".eh_frame", 9) == 0) - rel->r_info = ELF32_R_INFO (ELF32_R_SYM (rel->r_info), R_IQ2000_32_DEBUG); + { + ((Elf_Internal_Rela *) rel)->r_info + = ELF32_R_INFO (ELF32_R_SYM (rel->r_info), R_IQ2000_32_DEBUG); + changed = TRUE; + } break; } } + + if (changed) + /* Note that we've changed relocs, otherwise if !info->keep_memory + we'll free the relocs and lose our changes. */ + (const Elf_Internal_Rela *) (elf_section_data (sec)->relocs) = relocs; + return TRUE; } @@ -929,6 +940,7 @@ iq2000_elf_print_private_bfd_data (abfd, ptr) } fputc ('\n', file); + return TRUE; } static diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index b53f50a..3116ace 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -1,5 +1,5 @@ /* M32R-specific support for 32-bit ELF. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -1340,7 +1340,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again) { Elf_Internal_Shdr *symtab_hdr; /* The Rela structures are used here because that's what - _bfd_elf32_link_read_relocs uses [for convenience - it sets the addend + _bfd_elf_link_read_relocs uses [for convenience - it sets the addend field to 0]. */ Elf_Internal_Rela *internal_relocs = NULL; Elf_Internal_Rela *irel, *irelend; @@ -1368,7 +1368,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* Get a copy of the native relocations. */ - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) @@ -1781,7 +1781,7 @@ m32r_elf_get_relocated_section_contents (output_bfd, link_info, link_order, asection **secpp; Elf32_External_Sym *esym, *esymend; - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (input_bfd, input_section, (PTR) NULL, (Elf_Internal_Rela *) NULL, FALSE)); if (internal_relocs == NULL) diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c index bb0f9e9..1b95105 100644 --- a/bfd/elf32-m68hc11.c +++ b/bfd/elf32-m68hc11.c @@ -705,7 +705,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again) shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; /* Get a copy of the native relocations. */ - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c index 0696a36..176a256 100644 --- a/bfd/elf32-m68hc1x.c +++ b/bfd/elf32-m68hc1x.c @@ -75,14 +75,15 @@ m68hc11_elf_hash_table_create (abfd) struct m68hc11_elf_link_hash_table *ret; bfd_size_type amt = sizeof (struct m68hc11_elf_link_hash_table); - ret = (struct m68hc11_elf_link_hash_table *) bfd_zalloc (abfd, amt); + ret = (struct m68hc11_elf_link_hash_table *) bfd_malloc (amt); if (ret == (struct m68hc11_elf_link_hash_table *) NULL) return NULL; + memset (ret, 0, amt); if (! _bfd_elf_link_hash_table_init (&ret->root, abfd, _bfd_elf_link_hash_newfunc)) { - bfd_release (abfd, ret); + free (ret); return NULL; } @@ -91,7 +92,7 @@ m68hc11_elf_hash_table_create (abfd) ret->stub_hash_table = (struct bfd_hash_table*) bfd_malloc (amt); if (ret->stub_hash_table == NULL) { - bfd_release (abfd, ret); + free (ret); return NULL; } if (!bfd_hash_table_init (ret->stub_hash_table, stub_hash_newfunc)) @@ -476,9 +477,9 @@ elf32_m68hc11_size_stubs (output_bfd, stub_bfd, info, add_stub_section) /* Get the relocs. */ internal_relocs - = _bfd_elf32_link_read_relocs (input_bfd, section, NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory); + = _bfd_elf_link_read_relocs (input_bfd, section, NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (internal_relocs == NULL) goto error_ret_free_local; @@ -1405,6 +1406,21 @@ _bfd_m68hc11_elf_merge_private_bfd_data (ibfd, obfd) bfd_archive_filename (ibfd)); ok = FALSE; } + + /* Processor compatibility. */ + if (!EF_M68HC11_CAN_MERGE_MACH (new_flags, old_flags)) + { + (*_bfd_error_handler) + (_("%s: linking files compiled for HCS12 with " + "others compiled for HC12"), + bfd_archive_filename (ibfd)); + ok = FALSE; + } + new_flags = ((new_flags & ~EF_M68HC11_MACH_MASK) + | (EF_M68HC11_MERGE_MACH (new_flags, old_flags))); + + elf_elfheader (obfd)->e_flags = new_flags; + new_flags &= ~EF_M68HC11_ABI; old_flags &= ~EF_M68HC11_ABI; diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index abb0eec..1cf23d6 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -673,6 +673,7 @@ elf_m68k_check_relocs (abfd, info, sec, relocs) || !bfd_set_section_alignment (dynobj, sreloc, 2)) return FALSE; } + elf_section_data (sec)->sreloc = sreloc; } if (sec->flags & SEC_READONLY @@ -1380,6 +1381,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Sym *sym; asection *sec; bfd_vma relocation; + bfd_boolean unresolved_reloc; bfd_reloc_status_type r; r_type = ELF32_R_TYPE (rel->r_info); @@ -1395,6 +1397,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, h = NULL; sym = NULL; sec = NULL; + unresolved_reloc = FALSE; if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; @@ -1407,71 +1410,29 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; + + relocation = 0; if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { sec = h->root.u.def.section; - if (((r_type == R_68K_PLT8 - || r_type == R_68K_PLT16 - || r_type == R_68K_PLT32 - || r_type == R_68K_PLT8O - || r_type == R_68K_PLT16O - || r_type == R_68K_PLT32O) - && h->plt.offset != (bfd_vma) -1 - && elf_hash_table (info)->dynamic_sections_created) - || ((r_type == R_68K_GOT8O - || r_type == R_68K_GOT16O - || r_type == R_68K_GOT32O - || ((r_type == R_68K_GOT8 - || r_type == R_68K_GOT16 - || r_type == R_68K_GOT32) - && strcmp (h->root.root.string, - "_GLOBAL_OFFSET_TABLE_") != 0)) - && (WILL_CALL_FINISH_DYNAMIC_SYMBOL - (elf_hash_table (info)->dynamic_sections_created, - info->shared, h)) - && (! info->shared - || (! info->symbolic - && h->dynindx != -1 - && (h->elf_link_hash_flags - & ELF_LINK_FORCED_LOCAL) == 0) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) - || (info->shared - && ((! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0) - && ((input_section->flags & SEC_ALLOC) != 0 - /* DWARF will emit R_68K_32 relocations in its - sections against symbols defined externally - in shared libraries. We can't do anything - with them here. */ - || ((input_section->flags & SEC_DEBUGGING) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) - && (r_type == R_68K_8 - || r_type == R_68K_16 - || r_type == R_68K_32 - || r_type == R_68K_PC8 - || r_type == R_68K_PC16 - || r_type == R_68K_PC32))) - { - /* In these cases, we don't need the relocation - value. We check specially because in some - obscure cases sec->output_section will be NULL. */ - relocation = 0; - } + if (sec->output_section == NULL) + /* Set a flag that will be cleared later if we find a + relocation value for this symbol. output_section + is typically NULL for symbols satisfied by a shared + library. */ + unresolved_reloc = TRUE; else relocation = (h->root.u.def.value + sec->output_section->vma + sec->output_offset); } else if (h->root.type == bfd_link_hash_undefweak) - relocation = 0; + ; else if (info->shared && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - relocation = 0; + ; else { if (!(info->callbacks->undefined_symbol @@ -1480,7 +1441,6 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, (!info->shared || info->no_undefined || ELF_ST_VISIBILITY (h->other))))) return FALSE; - relocation = 0; } } @@ -1546,6 +1506,8 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, h->got.offset |= 1; } } + else + unresolved_reloc = FALSE; } else { @@ -1628,6 +1590,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (splt->output_section->vma + splt->output_offset + h->plt.offset); + unresolved_reloc = FALSE; break; case R_68K_PLT8O: @@ -1644,6 +1607,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, } relocation = h->plt.offset; + unresolved_reloc = FALSE; /* This relocation does not use the addend. */ rel->r_addend = 0; @@ -1664,12 +1628,17 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, if (info->shared && r_symndx != 0 && (input_section->flags & SEC_ALLOC) != 0 + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) && ((r_type != R_68K_PC8 && r_type != R_68K_PC16 && r_type != R_68K_PC32) - || (!info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0))) + || (h != NULL + && h->dynindx != -1 + && (!info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) { Elf_Internal_Rela outrel; bfd_byte *loc; @@ -1679,26 +1648,6 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, are copied into the output file to be resolved at run time. */ - if (sreloc == NULL) - { - const char *name; - - name = (bfd_elf_string_from_elf_section - (input_bfd, - elf_elfheader (input_bfd)->e_shstrndx, - elf_section_data (input_section)->rel_hdr.sh_name)); - if (name == NULL) - return FALSE; - - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 - && strcmp (bfd_get_section_name (input_bfd, - input_section), - name + 5) == 0); - - sreloc = bfd_get_section_by_name (dynobj, name); - BFD_ASSERT (sreloc != NULL); - } - skip = FALSE; relocate = FALSE; @@ -1714,19 +1663,22 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, if (skip) memset (&outrel, 0, sizeof outrel); - /* h->dynindx may be -1 if the symbol was marked to - become local. */ else if (h != NULL - && ((! info->symbolic && h->dynindx != -1) + && h->dynindx != -1 + && (r_type == R_68K_PC8 + || r_type == R_68K_PC16 + || r_type == R_68K_PC32 + || !info->shared + || !info->symbolic || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) { - BFD_ASSERT (h->dynindx != -1); outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); - outrel.r_addend = relocation + rel->r_addend; + outrel.r_addend = rel->r_addend; } else { + /* This symbol is local, or marked to become local. */ if (r_type == R_68K_32) { relocate = TRUE; @@ -1767,6 +1719,10 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, } } + sreloc = elf_section_data (input_section)->sreloc; + if (sreloc == NULL) + abort (); + loc = sreloc->contents; loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); @@ -1790,39 +1746,58 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, break; } + /* Dynamic relocs are not propagated for SEC_DEBUGGING sections + because such sections are not SEC_ALLOC and thus ld.so will + not process them. */ + if (unresolved_reloc + && !((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) + { + (*_bfd_error_handler) + (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, + h->root.root.string); + return FALSE; + } + r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, relocation, rel->r_addend); if (r != bfd_reloc_ok) { - switch (r) + const char *name; + + if (h != NULL) + name = h->root.root.string; + else { - default: - case bfd_reloc_outofrange: - abort (); - case bfd_reloc_overflow: - { - const char *name; + name = bfd_elf_string_from_elf_section (input_bfd, + symtab_hdr->sh_link, + sym->st_name); + if (name == NULL) + return FALSE; + if (*name == '\0') + name = bfd_section_name (input_bfd, sec); + } - if (h != NULL) - name = h->root.root.string; - else - { - name = bfd_elf_string_from_elf_section (input_bfd, - symtab_hdr->sh_link, - sym->st_name); - if (name == NULL) - return FALSE; - if (*name == '\0') - name = bfd_section_name (input_bfd, sec); - } - if (!(info->callbacks->reloc_overflow - (info, name, howto->name, (bfd_vma) 0, - input_bfd, input_section, rel->r_offset))) - return FALSE; - } - break; + if (r == bfd_reloc_overflow) + { + if (!(info->callbacks->reloc_overflow + (info, name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset))) + return FALSE; + } + else + { + (*_bfd_error_handler) + (_("%s(%s+0x%lx): reloc against `%s': error %d"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, name, (int) r); + return FALSE; } } } @@ -2188,7 +2163,7 @@ bfd_m68k_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* Get a copy of the native relocations. */ - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, datasec, (PTR) NULL, (Elf_Internal_Rela *) NULL, info->keep_memory)); if (internal_relocs == NULL) diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index adf057b..3b47246 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -1197,13 +1197,7 @@ gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocateable, data, 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); + 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; @@ -1716,7 +1710,7 @@ bfd_mips_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) } /* Get a copy of the native relocations. */ - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, datasec, (PTR) NULL, (Elf_Internal_Rela *) NULL, info->keep_memory)); if (internal_relocs == NULL) diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 22cff53..1e1ab8c 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -147,27 +147,6 @@ static bfd_boolean ppc_elf_grok_psinfo #define TP_OFFSET 0x7000 #define DTP_OFFSET 0x8000 -/* Will references to this symbol always reference the symbol - in this object? STV_PROTECTED is excluded from the visibility test - here so that function pointer comparisons work properly. Since - function symbols not defined in an app are set to their .plt entry, - it's necessary for shared libs to also reference the .plt even - though the symbol is really local to the shared lib. */ -#define SYMBOL_REFERENCES_LOCAL(INFO, H) \ - ((! INFO->shared \ - || INFO->symbolic \ - || H->dynindx == -1 \ - || ELF_ST_VISIBILITY (H->other) == STV_INTERNAL \ - || ELF_ST_VISIBILITY (H->other) == STV_HIDDEN) \ - && (H->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) - -/* Will _calls_ to this symbol always call the version in this object? */ -#define SYMBOL_CALLS_LOCAL(INFO, H) \ - ((! INFO->shared \ - || INFO->symbolic \ - || H->dynindx == -1 \ - || ELF_ST_VISIBILITY (H->other) != STV_DEFAULT) \ - && (H->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) /* The PPC linker needs to keep track of the number of relocs that it decides to copy as dynamic relocs in check_relocs for each symbol. @@ -374,7 +353,9 @@ ppc_elf_copy_indirect_symbol (bed, dir, ind) edir->tls_mask |= eind->tls_mask; - if (ELIMINATE_COPY_RELOCS && ind->root.type != bfd_link_hash_indirect) + if (ELIMINATE_COPY_RELOCS + && ind->root.type != bfd_link_hash_indirect + && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) /* If called to transfer flags for a weakdef during processing of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF. We clear it ourselves for ELIMINATE_COPY_RELOCS. */ @@ -1733,9 +1714,9 @@ ppc_elf_relax_section (abfd, isec, link_info, again) /* Get a copy of the native relocations. */ internal_relocs - = _bfd_elf32_link_read_relocs (abfd, isec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - link_info->keep_memory); + = _bfd_elf_link_read_relocs (abfd, isec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + link_info->keep_memory); if (internal_relocs == NULL) goto error_return; if (! link_info->keep_memory) @@ -2514,19 +2495,21 @@ ppc_elf_adjust_dynamic_symbol (info, h) { /* Clear procedure linkage table information for any symbol that won't need a .plt entry. */ - if (! htab->elf.dynamic_sections_created + if (h->plt.refcount <= 0 || SYMBOL_CALLS_LOCAL (info, h) - || h->plt.refcount <= 0) + || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak)) { /* A PLT entry is not required/allowed when: - 1. We are not using ld.so; because then the PLT entry - can't be set up, so we can't use one. + 1. We are not using ld.so; because then the PLT entry + can't be set up, so we can't use one. In this case, + ppc_elf_adjust_dynamic_symbol won't even be called. - 2. We know for certain that a call to this symbol - will go to this object. + 2. GC has rendered the entry unused. - 3. GC has rendered the entry unused. */ + 3. We know for certain that a call to this symbol + will go to this object, or will remain undefined. */ h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; } @@ -2787,8 +2770,10 @@ allocate_dynrelocs (h, inf) else htab->got->_raw_size += 4; dyn = htab->elf.dynamic_sections_created; - if (info->shared - || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, &eh->elf)) + if ((info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, &eh->elf)) + && (ELF_ST_VISIBILITY (eh->elf.other) == STV_DEFAULT + || eh->elf.root.type != bfd_link_hash_undefweak)) { /* All the entries we allocated need relocs. */ htab->relgot->_raw_size @@ -2811,11 +2796,16 @@ allocate_dynrelocs (h, inf) defined in regular objects. For the normal shared case, discard space for relocs that have become local due to symbol visibility changes. */ + if (info->shared) { - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 - && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 - || info->symbolic)) + /* Relocs that use pc_count are those that appear on a call insn, + or certain REL relocs (see MUST_BE_DYN_RELOC) that can be + 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. */ + if (SYMBOL_CALLS_LOCAL (info, h)) { struct ppc_elf_dyn_relocs **pp; @@ -2829,6 +2819,12 @@ allocate_dynrelocs (h, inf) pp = &p->next; } } + + /* Also discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->dyn_relocs = NULL; } else if (ELIMINATE_COPY_RELOCS) { @@ -3848,9 +3844,9 @@ ppc_elf_tls_optimize (obfd, info) int expecting_tls_get_addr; /* Read the relocations. */ - relstart = _bfd_elf32_link_read_relocs (ibfd, sec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory); + relstart = _bfd_elf_link_read_relocs (ibfd, sec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (relstart == NULL) return FALSE; @@ -4791,7 +4787,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } /* Generate relocs for the dynamic linker. */ - if (info->shared || indx != 0) + if ((info->shared || indx != 0) + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) { outrel.r_offset = (htab->got->output_section->vma + htab->got->output_offset @@ -4993,12 +4992,12 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Fall thru. */ if ((info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) && (MUST_BE_DYN_RELOC (r_type) || (h != NULL - && h->dynindx != -1 - && (!info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + && !SYMBOL_CALLS_LOCAL (info, h)))) || (ELIMINATE_COPY_RELOCS && !info->shared && (input_section->flags & SEC_ALLOC) != 0 diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 857b7a0..9475f60 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -383,6 +383,12 @@ elf_s390_is_local_label_name (abfd, name) #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" +/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid + copying dynamic variables from a shared lib into an app's dynbss + section, and instead use a dynamic relocation to point into the + shared lib. */ +#define ELIMINATE_COPY_RELOCS 1 + /* The size in bytes of the first entry in the procedure linkage table. */ #define PLT_FIRST_ENTRY_SIZE 32 /* The size in bytes of an entry in the procedure linkage table. */ @@ -828,7 +834,18 @@ elf_s390_copy_indirect_symbol (bed, dir, ind) eind->tls_type = GOT_UNKNOWN; } - _bfd_elf_link_hash_copy_indirect (bed, dir, ind); + if (ELIMINATE_COPY_RELOCS + && ind->root.type != bfd_link_hash_indirect + && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + /* If called to transfer flags for a weakdef during processing + of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF. + We clear it ourselves for ELIMINATE_COPY_RELOCS. */ + dir->elf_link_hash_flags |= + (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK)); + else + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } static int @@ -1149,7 +1166,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs) || h->root.type == bfd_link_hash_defweak || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + || (ELIMINATE_COPY_RELOCS + && !info->shared && (sec->flags & SEC_ALLOC) != 0 && h != NULL && (h->root.type == bfd_link_hash_defweak @@ -1480,8 +1498,6 @@ elf_s390_adjust_dynamic_symbol (info, h) struct elf_link_hash_entry *h; { struct elf_s390_link_hash_table *htab; - struct elf_s390_link_hash_entry * eh; - struct elf_s390_dyn_relocs *p; asection *s; unsigned int power_of_two; @@ -1527,6 +1543,10 @@ elf_s390_adjust_dynamic_symbol (info, h) || h->weakdef->root.type == bfd_link_hash_defweak); h->root.u.def.section = h->weakdef->root.u.def.section; h->root.u.def.value = h->weakdef->root.u.def.value; + if (ELIMINATE_COPY_RELOCS || info->nocopyreloc) + h->elf_link_hash_flags + = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF) + | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF)); return TRUE; } @@ -1552,20 +1572,26 @@ elf_s390_adjust_dynamic_symbol (info, h) return TRUE; } - eh = (struct elf_s390_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) + if (ELIMINATE_COPY_RELOCS) { - s = p->sec->output_section; - if (s != NULL && (s->flags & SEC_READONLY) != 0) - break; - } + struct elf_s390_link_hash_entry * eh; + struct elf_s390_dyn_relocs *p; - /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ - if (p == NULL) - { - h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return TRUE; + eh = (struct elf_s390_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return TRUE; + } } /* We must allocate the symbol in our .dynbss section, which will @@ -1618,9 +1644,9 @@ elf_s390_adjust_dynamic_symbol (info, h) will be called from elflink.h. If elflink.h doesn't call our finish_dynamic_symbol routine, we'll need to do something about initializing any .plt and .got entries in elf_s390_relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ +#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \ ((DYN) \ - && ((INFO)->shared \ + && ((SHARED) \ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ && ((H)->dynindx != -1 \ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) @@ -1651,7 +1677,9 @@ allocate_dynrelocs (h, inf) htab = elf_s390_hash_table (info); if (htab->elf.dynamic_sections_created - && h->plt.refcount > 0) + && h->plt.refcount > 0 + && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ @@ -1662,7 +1690,8 @@ allocate_dynrelocs (h, inf) return FALSE; } - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) { asection *s = htab->splt; @@ -1758,7 +1787,10 @@ allocate_dynrelocs (h, inf) htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); else if (tls_type == GOT_TLS_GD) htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela); - else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))) htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); } else @@ -1792,8 +1824,14 @@ allocate_dynrelocs (h, inf) pp = &p->next; } } + + /* Also discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->dyn_relocs = NULL; } - else + else if (ELIMINATE_COPY_RELOCS) { /* For the non-shared case, discard space for relocs against symbols which turn out to need copy relocs or are not @@ -2301,12 +2339,14 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, off = h->got.offset; dyn = htab->elf.dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared && (info->symbolic || h->dynindx == -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + || (ELF_ST_VISIBILITY (h->other) + && h->root.type == bfd_link_hash_undefweak)) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined @@ -2471,6 +2511,9 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, break; if ((info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) && ((r_type != R_390_PC16 && r_type != R_390_PC16DBL && r_type != R_390_PC32DBL @@ -2480,7 +2523,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, && (! info->symbolic || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + || (ELIMINATE_COPY_RELOCS + && !info->shared && h != NULL && h->dynindx != -1 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 35a4dda..4ff31bf 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -2054,7 +2054,7 @@ sh_elf_relax_section (abfd, sec, link_info, again) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) @@ -2736,7 +2736,7 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) /* We always cache the relocs. Perhaps, if info->keep_memory is FALSE, we should free them, if we are permitted to, when we leave sh_coff_relax_section. */ - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, o, (PTR) NULL, (Elf_Internal_Rela *) NULL, TRUE)); if (internal_relocs == NULL) @@ -3940,6 +3940,10 @@ sh_elf_adjust_dynamic_symbol (info, h) || h->weakdef->root.type == bfd_link_hash_defweak); h->root.u.def.section = h->weakdef->root.u.def.section; h->root.u.def.value = h->weakdef->root.u.def.value; + if (info->nocopyreloc) + h->elf_link_hash_flags + = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF) + | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF)); return TRUE; } @@ -4083,7 +4087,9 @@ allocate_dynrelocs (h, inf) } if (htab->root.dynamic_sections_created - && h->plt.refcount > 0) + && h->plt.refcount > 0 + && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ @@ -4169,8 +4175,10 @@ allocate_dynrelocs (h, inf) htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); else if (tls_type == GOT_TLS_GD) htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela); - else if (info->shared || - WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)) + else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))) htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); } else @@ -4229,6 +4237,12 @@ allocate_dynrelocs (h, inf) pp = &p->next; } } + + /* Also discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->dyn_relocs = NULL; } else { @@ -4885,6 +4899,9 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_SH_DIR32: case R_SH_REL32: if (info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) && r_symndx != 0 && (input_section->flags & SEC_ALLOC) != 0 && (r_type != R_SH_REL32 @@ -5053,7 +5070,9 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, || (info->shared && (info->symbolic || h->dynindx == -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + || (ELF_ST_VISIBILITY (h->other) + && h->root.type == bfd_link_hash_undefweak)) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined @@ -5735,7 +5754,7 @@ sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order, Elf_Internal_Sym *isym, *isymend; bfd_size_type amt; - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (input_bfd, input_section, (PTR) NULL, (Elf_Internal_Rela *) NULL, FALSE)); if (internal_relocs == NULL) @@ -6128,7 +6147,17 @@ sh_elf_copy_indirect_symbol (bed, dir, ind) eind->tls_type = GOT_UNKNOWN; } - _bfd_elf_link_hash_copy_indirect (bed, dir, ind); + if (ind->root.type != bfd_link_hash_indirect + && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + /* If called to transfer flags for a weakdef during processing + of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF. + We clear it ourselves for ELIMINATE_COPY_RELOCS. */ + dir->elf_link_hash_flags |= + (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK)); + else + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } static int diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index 26201f5..62bbbda 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -1,5 +1,5 @@ /* V850-specific support for 32-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -2508,7 +2508,7 @@ v850_elf_relax_section (abfd, sec, link_info, again) symtab_hdr = & elf_tdata (abfd)->symtab_hdr; - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c index 22ab8ef..c05c186 100644 --- a/bfd/elf32-xstormy16.c +++ b/bfd/elf32-xstormy16.c @@ -101,22 +101,22 @@ static reloc_howto_type xstormy16_elf_howto_table [] = "R_XSTORMY16_16", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ - 0xffffffff, /* dst_mask */ + 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* An 8 bit absolute relocation. */ - HOWTO (R_XSTORMY16_8, /* type */ + HOWTO (R_XSTORMY16_8, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ + complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_XSTORMY16_8", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ - 0xffffffff, /* dst_mask */ + 0xff, /* dst_mask */ FALSE), /* pcrel_offset */ /* A 32 bit pc-relative relocation. */ @@ -176,7 +176,7 @@ static reloc_howto_type xstormy16_elf_howto_table [] = "R_XSTORMY16_REL_12", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ - 0x0fff, /* dst_mask */ + 0x0ffe, /* dst_mask */ TRUE), /* pcrel_offset */ /* A 24-bit absolute relocation suitable for the jump instructions. */ diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index b991df4..b277540 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -3925,7 +3925,7 @@ retrieve_internal_relocs (abfd, sec, keep_memory) internal_relocs = elf_section_data (sec)->relocs; if (internal_relocs == NULL) - internal_relocs = (_bfd_elf32_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, keep_memory)); return internal_relocs; diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 4a2658a..9ce3bf3 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -1556,7 +1556,7 @@ elf64_alpha_relax_opt_call (info, symval) } else { - tsec_relocs = (_bfd_elf64_link_read_relocs + tsec_relocs = (_bfd_elf_link_read_relocs (info->abfd, info->tsec, (PTR) NULL, (Elf_Internal_Rela *) NULL, info->link_info->keep_memory)); @@ -2072,7 +2072,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) local_got_entries = alpha_elf_tdata(abfd)->local_got_entries; /* Load the relocations for this section. */ - internal_relocs = (_bfd_elf64_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) @@ -5556,7 +5556,7 @@ static const struct elf_size_info alpha_elf_size_info = sizeof (Elf_External_Note), 8, 1, - 64, 8, + 64, 3, ELFCLASS64, EV_CURRENT, bfd_elf64_write_out_phdrs, bfd_elf64_write_shdrs_and_ehdr, diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 4d3b8d4..8ce5b20 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -606,7 +606,7 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs) the special sections required for dynamic linking. */ if (! elf_hash_table (info)->dynamic_sections_created) { - if (! bfd_elf64_link_create_dynamic_sections (abfd, info)) + if (! _bfd_elf_link_create_dynamic_sections (abfd, info)) return FALSE; } @@ -2692,7 +2692,7 @@ const struct elf_size_info hppa64_elf_size_info = sizeof (Elf_External_Note), 4, 1, - 64, 8, + 64, 3, ELFCLASS64, EV_CURRENT, bfd_elf64_write_out_phdrs, bfd_elf64_write_shdrs_and_ehdr, diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index 39f21b3..a43b3da 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -1227,6 +1227,38 @@ static reloc_howto_type elf_mips_gnu_vtentry_howto = 0, /* dst_mask */ FALSE); /* pcrel_offset */ +/* 16 bit offset for pc-relative branches. */ +static reloc_howto_type elf_mips_gnu_rel16_s2 = + HOWTO (R_MIPS_GNU_REL16_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MIPS_GNU_REL16_S2", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE); /* pcrel_offset */ + +/* 16 bit offset for pc-relative branches. */ +static reloc_howto_type elf_mips_gnu_rela16_s2 = + HOWTO (R_MIPS_GNU_REL16_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MIPS_GNU_REL16_S2", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE); /* pcrel_offset */ + /* Swap in a MIPS 64-bit Rel reloc. */ static void @@ -1960,6 +1992,8 @@ bfd_elf64_bfd_reloc_type_lookup (abfd, code) return &elf_mips_gnu_vtinherit_howto; case BFD_RELOC_VTABLE_ENTRY: return &elf_mips_gnu_vtentry_howto; + case BFD_RELOC_16_PCREL_S2: + return &elf_mips_gnu_rela16_s2; default: bfd_set_error (bfd_error_bad_value); return NULL; @@ -1983,6 +2017,11 @@ mips_elf64_rtype_to_howto (r_type, rela_p) return &elf_mips_gnu_vtinherit_howto; case R_MIPS_GNU_VTENTRY: return &elf_mips_gnu_vtentry_howto; + case R_MIPS_GNU_REL16_S2: + if (rela_p) + return &elf_mips_gnu_rela16_s2; + else + return &elf_mips_gnu_rel16_s2; default: BFD_ASSERT (r_type < (unsigned int) R_MIPS_max); if (rela_p) @@ -2782,7 +2821,7 @@ const struct elf_size_info mips_elf64_size_info = 4, /* hash-table entry size */ 3, /* internal relocations per external relocations */ 64, /* arch_size */ - 8, /* file_align */ + 3, /* log_file_align */ ELFCLASS64, EV_CURRENT, bfd_elf64_write_out_phdrs, diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index bcf9962..d0213e6 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -1854,9 +1854,9 @@ _bfd_mmix_check_all_relocs (abfd, info) continue; internal_relocs - = _bfd_elf64_link_read_relocs (abfd, o, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory); + = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (internal_relocs == NULL) return FALSE; @@ -2374,9 +2374,9 @@ mmix_elf_relax_section (abfd, sec, link_info, again) /* Get a copy of the native relocations. */ internal_relocs - = _bfd_elf64_link_read_relocs (abfd, sec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - link_info->keep_memory); + = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + link_info->keep_memory); if (internal_relocs == NULL) goto error_return; diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 29c90fe..f32d261 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -3272,6 +3272,7 @@ ppc64_elf_copy_indirect_symbol (bed, dir, ind) struct elf_link_hash_entry *dir, *ind; { struct ppc_link_hash_entry *edir, *eind; + flagword mask; edir = (struct ppc_link_hash_entry *) dir; eind = (struct ppc_link_hash_entry *) ind; @@ -3316,20 +3317,24 @@ ppc64_elf_copy_indirect_symbol (bed, dir, ind) edir->is_entry |= eind->is_entry; edir->tls_mask |= eind->tls_mask; - /* Copy down any references that we may have already seen to the - symbol which just became indirect. */ - edir->elf.elf_link_hash_flags |= - (eind->elf.elf_link_hash_flags - & (ELF_LINK_HASH_REF_DYNAMIC - | ELF_LINK_HASH_REF_REGULAR - | ELF_LINK_HASH_REF_REGULAR_NONWEAK - | ELF_LINK_NON_GOT_REF)); + mask = (ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK | ELF_LINK_NON_GOT_REF); + /* If called to transfer flags for a weakdef during processing + of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF. + We clear it ourselves for ELIMINATE_COPY_RELOCS. */ + if (ELIMINATE_COPY_RELOCS + && eind->elf.root.type != bfd_link_hash_indirect + && (edir->elf.elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + mask &= ~ELF_LINK_NON_GOT_REF; + + edir->elf.elf_link_hash_flags |= eind->elf.elf_link_hash_flags & mask; /* If we were called to copy over info for a weak sym, that's all. */ if (eind->elf.root.type != bfd_link_hash_indirect) return; - /* Copy over got entries. */ + /* Copy over got entries that we may have already seen to the + symbol which just became indirect. */ if (eind->elf.got.glist != NULL) { if (edir->elf.got.glist != NULL) @@ -3877,6 +3882,10 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) case R_PPC64_UADDR32: case R_PPC64_UADDR64: case R_PPC64_TOC: + if (h != NULL && !info->shared) + /* We may need a copy reloc. */ + h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; + /* Don't propagate .opd relocs. */ if (NO_OPD_RELOCS && opd_sym_map != NULL) break; @@ -4496,15 +4505,13 @@ ppc64_elf_adjust_dynamic_symbol (info, h) break; if (!((struct ppc_link_hash_entry *) h)->is_func_descriptor || ent == NULL - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 - || (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)) + || SYMBOL_CALLS_LOCAL (info, h) + || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak)) { h->plt.plist = NULL; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; } - return TRUE; } else h->plt.plist = NULL; @@ -4864,9 +4871,9 @@ ppc64_elf_edit_opd (obfd, info) sym_hashes = elf_sym_hashes (ibfd); /* Read the relocations. */ - relstart = _bfd_elf64_link_read_relocs (ibfd, sec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory); + relstart = _bfd_elf_link_read_relocs (ibfd, sec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (relstart == NULL) return FALSE; @@ -5187,9 +5194,9 @@ ppc64_elf_tls_optimize (obfd, info) int expecting_tls_get_addr; /* Read the relocations. */ - relstart = _bfd_elf64_link_read_relocs (ibfd, sec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory); + relstart = _bfd_elf_link_read_relocs (ibfd, sec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (relstart == NULL) return FALSE; @@ -5588,8 +5595,10 @@ allocate_dynrelocs (h, inf) s->_raw_size += (gent->tls_type & eh->tls_mask & (TLS_GD | TLS_LD)) ? 16 : 8; dyn = htab->elf.dynamic_sections_created; - if (info->shared - || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)) + if ((info->shared + || 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 += (gent->tls_type & eh->tls_mask & TLS_GD ? 2 * sizeof (Elf64_External_Rela) @@ -5609,9 +5618,13 @@ allocate_dynrelocs (h, inf) if (info->shared) { - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 - && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 - || info->symbolic)) + /* Relocs that use pc_count are those that appear on a call insn, + or certain REL relocs (see MUST_BE_DYN_RELOC) that can be + 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. */ + if (SYMBOL_CALLS_LOCAL (info, h)) { struct ppc_dyn_relocs **pp; @@ -5625,6 +5638,12 @@ allocate_dynrelocs (h, inf) pp = &p->next; } } + + /* Also discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->dyn_relocs = NULL; } else if (ELIMINATE_COPY_RELOCS) { @@ -6575,9 +6594,9 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, /* Get the relocs. */ internal_relocs - = _bfd_elf64_link_read_relocs (input_bfd, section, NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory); + = _bfd_elf_link_read_relocs (input_bfd, section, NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (internal_relocs == NULL) goto error_ret_free_local; @@ -7585,12 +7604,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_boolean dyn = htab->elf.dynamic_sections_created; if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared - && (info->symbolic - || h->dynindx == -1 - || (h->elf_link_hash_flags - & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR))) + && SYMBOL_REFERENCES_LOCAL (info, h))) /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined locally, or the symbol was forced to be local @@ -7631,7 +7645,10 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, the case of TLSLD where we'll use one entry per module. */ *offp = off | 1; - if (info->shared || indx != 0) + if ((info->shared || indx != 0) + && (h == NULL + || 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 @@ -7855,12 +7872,12 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; if ((info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) && (MUST_BE_DYN_RELOC (r_type) || (h != NULL - && h->dynindx != -1 - && (! info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + && !SYMBOL_CALLS_LOCAL (info, h)))) || (ELIMINATE_COPY_RELOCS && !info->shared && h != NULL @@ -7895,13 +7912,8 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (skip) memset (&outrel, 0, sizeof outrel); else if (h != NULL - && h->dynindx != -1 - && !is_opd - && (!MUST_BE_DYN_RELOC (r_type) - || !info->shared - || !info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) + && !SYMBOL_REFERENCES_LOCAL (info, h) + && !is_opd) outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); else { diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index e3c7f22..98555f2 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -405,6 +405,12 @@ elf_s390_is_local_label_name (abfd, name) #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" +/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid + copying dynamic variables from a shared lib into an app's dynbss + section, and instead use a dynamic relocation to point into the + shared lib. */ +#define ELIMINATE_COPY_RELOCS 1 + /* The size in bytes of the first entry in the procedure linkage table. */ #define PLT_FIRST_ENTRY_SIZE 32 /* The size in bytes of an entry in the procedure linkage table. */ @@ -782,7 +788,18 @@ elf_s390_copy_indirect_symbol (bed, dir, ind) eind->tls_type = GOT_UNKNOWN; } - _bfd_elf_link_hash_copy_indirect (bed, dir, ind); + if (ELIMINATE_COPY_RELOCS + && ind->root.type != bfd_link_hash_indirect + && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + /* If called to transfer flags for a weakdef during processing + of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF. + We clear it ourselves for ELIMINATE_COPY_RELOCS. */ + dir->elf_link_hash_flags |= + (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK)); + else + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } static int @@ -1114,7 +1131,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs) || h->root.type == bfd_link_hash_defweak || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + || (ELIMINATE_COPY_RELOCS + && !info->shared && (sec->flags & SEC_ALLOC) != 0 && h != NULL && (h->root.type == bfd_link_hash_defweak @@ -1452,8 +1470,6 @@ elf_s390_adjust_dynamic_symbol (info, h) struct elf_link_hash_entry *h; { struct elf_s390_link_hash_table *htab; - struct elf_s390_link_hash_entry * eh; - struct elf_s390_dyn_relocs *p; asection *s; unsigned int power_of_two; @@ -1499,6 +1515,10 @@ elf_s390_adjust_dynamic_symbol (info, h) || h->weakdef->root.type == bfd_link_hash_defweak); h->root.u.def.section = h->weakdef->root.u.def.section; h->root.u.def.value = h->weakdef->root.u.def.value; + if (ELIMINATE_COPY_RELOCS || info->nocopyreloc) + h->elf_link_hash_flags + = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF) + | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF)); return TRUE; } @@ -1524,20 +1544,26 @@ elf_s390_adjust_dynamic_symbol (info, h) return TRUE; } - eh = (struct elf_s390_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) + if (ELIMINATE_COPY_RELOCS) { - s = p->sec->output_section; - if (s != NULL && (s->flags & SEC_READONLY) != 0) - break; - } + struct elf_s390_link_hash_entry * eh; + struct elf_s390_dyn_relocs *p; - /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ - if (p == NULL) - { - h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return TRUE; + eh = (struct elf_s390_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return TRUE; + } } /* We must allocate the symbol in our .dynbss section, which will @@ -1590,9 +1616,9 @@ elf_s390_adjust_dynamic_symbol (info, h) will be called from elflink.h. If elflink.h doesn't call our finish_dynamic_symbol routine, we'll need to do something about initializing any .plt and .got entries in elf_s390_relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ +#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \ ((DYN) \ - && ((INFO)->shared \ + && ((SHARED) \ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ && ((H)->dynindx != -1 \ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) @@ -1623,7 +1649,9 @@ allocate_dynrelocs (h, inf) htab = elf_s390_hash_table (info); if (htab->elf.dynamic_sections_created - && h->plt.refcount > 0) + && h->plt.refcount > 0 + && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ @@ -1634,7 +1662,8 @@ allocate_dynrelocs (h, inf) return FALSE; } - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) { asection *s = htab->splt; @@ -1730,7 +1759,10 @@ allocate_dynrelocs (h, inf) htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); else if (tls_type == GOT_TLS_GD) htab->srelgot->_raw_size += 2 * sizeof (Elf64_External_Rela); - else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))) htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); } else @@ -1764,8 +1796,14 @@ allocate_dynrelocs (h, inf) pp = &p->next; } } + + /* Also discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->dyn_relocs = NULL; } - else + else if (ELIMINATE_COPY_RELOCS) { /* For the non-shared case, discard space for relocs against symbols which turn out to need copy relocs or are not @@ -2274,12 +2312,14 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, off = h->got.offset; dyn = htab->elf.dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared && (info->symbolic || h->dynindx == -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + || (ELF_ST_VISIBILITY (h->other) + && h->root.type == bfd_link_hash_undefweak)) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined @@ -2449,6 +2489,9 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, break; if ((info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) && ((r_type != R_390_PC16 && r_type != R_390_PC16DBL && r_type != R_390_PC32 @@ -2459,7 +2502,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, && (! info->symbolic || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + || (ELIMINATE_COPY_RELOCS + && !info->shared && h != NULL && h->dynindx != -1 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 @@ -3271,7 +3315,7 @@ const struct elf_size_info s390_elf64_size_info = 8, /* hash-table entry size. */ 1, /* internal relocations per external relocations. */ 64, /* arch_size. */ - 8, /* file_align. */ + 3, /* log_file_align. */ ELFCLASS64, EV_CURRENT, bfd_elf64_write_out_phdrs, bfd_elf64_write_shdrs_and_ehdr, diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index 122490e..d666fca 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -2226,7 +2226,7 @@ sh_elf64_get_relocated_section_contents (output_bfd, link_info, link_order, goto error_return; } - internal_relocs = (_bfd_elf64_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (input_bfd, input_section, (PTR) NULL, (Elf_Internal_Rela *) NULL, FALSE)); if (internal_relocs == NULL) diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index bca09b7..d7ad1b7 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -3170,7 +3170,7 @@ const struct elf_size_info sparc64_elf_size_info = we use 2. */ 1, 64, /* arch_size. */ - 8, /* file_align. */ + 3, /* log_file_align. */ ELFCLASS64, EV_CURRENT, bfd_elf64_write_out_phdrs, diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index f13b4d2..c0ce57d 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -324,6 +324,12 @@ elf64_x86_64_grok_psinfo (abfd, note) #define ELF_DYNAMIC_INTERPRETER "/lib/ld64.so.1" +/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid + copying dynamic variables from a shared lib into an app's dynbss + section, and instead use a dynamic relocation to point into the + shared lib. */ +#define ELIMINATE_COPY_RELOCS 1 + /* The size in bytes of an entry in the global offset table. */ #define GOT_ENTRY_SIZE 8 @@ -616,7 +622,18 @@ elf64_x86_64_copy_indirect_symbol (bed, dir, ind) eind->tls_type = GOT_UNKNOWN; } - _bfd_elf_link_hash_copy_indirect (bed, dir, ind); + if (ELIMINATE_COPY_RELOCS + && ind->root.type != bfd_link_hash_indirect + && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + /* If called to transfer flags for a weakdef during processing + of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF. + We clear it ourselves for ELIMINATE_COPY_RELOCS. */ + dir->elf_link_hash_flags |= + (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK)); + else + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } static bfd_boolean @@ -914,7 +931,8 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) || h->root.type == bfd_link_hash_defweak || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + || (ELIMINATE_COPY_RELOCS + && !info->shared && (sec->flags & SEC_ALLOC) != 0 && h != NULL && (h->root.type == bfd_link_hash_defweak @@ -1189,8 +1207,6 @@ elf64_x86_64_adjust_dynamic_symbol (info, h) struct elf_link_hash_entry *h; { struct elf64_x86_64_link_hash_table *htab; - struct elf64_x86_64_link_hash_entry * eh; - struct elf64_x86_64_dyn_relocs *p; asection *s; unsigned int power_of_two; @@ -1235,6 +1251,10 @@ elf64_x86_64_adjust_dynamic_symbol (info, h) || h->weakdef->root.type == bfd_link_hash_defweak); h->root.u.def.section = h->weakdef->root.u.def.section; h->root.u.def.value = h->weakdef->root.u.def.value; + if (ELIMINATE_COPY_RELOCS || info->nocopyreloc) + h->elf_link_hash_flags + = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF) + | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF)); return TRUE; } @@ -1260,20 +1280,26 @@ elf64_x86_64_adjust_dynamic_symbol (info, h) return TRUE; } - eh = (struct elf64_x86_64_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) + if (ELIMINATE_COPY_RELOCS) { - s = p->sec->output_section; - if (s != NULL && (s->flags & SEC_READONLY) != 0) - break; - } + struct elf64_x86_64_link_hash_entry * eh; + struct elf64_x86_64_dyn_relocs *p; - /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ - if (p == NULL) - { - h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return TRUE; + eh = (struct elf64_x86_64_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return TRUE; + } } /* We must allocate the symbol in our .dynbss section, which will @@ -1359,7 +1385,9 @@ allocate_dynrelocs (h, inf) htab = elf64_x86_64_hash_table (info); if (htab->elf.dynamic_sections_created - && h->plt.refcount > 0) + && h->plt.refcount > 0 + && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ @@ -1452,7 +1480,9 @@ allocate_dynrelocs (h, inf) htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); else if (tls_type == GOT_TLS_GD) htab->srelgot->_raw_size += 2 * sizeof (Elf64_External_Rela); - else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); } else @@ -1486,8 +1516,14 @@ allocate_dynrelocs (h, inf) pp = &p->next; } } + + /* Also discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->dyn_relocs = NULL; } - else + else if (ELIMINATE_COPY_RELOCS) { /* For the non-shared case, discard space for relocs against symbols which turn out to need copy relocs or are not @@ -1950,7 +1986,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, && (info->symbolic || h->dynindx == -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + || (ELF_ST_VISIBILITY (h->other) + && h->root.type == bfd_link_hash_undefweak)) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined locally, or the symbol @@ -2069,6 +2107,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, break; if ((info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) && ((r_type != R_X86_64_PC8 && r_type != R_X86_64_PC16 && r_type != R_X86_64_PC32) @@ -2077,7 +2118,8 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, && (! info->symbolic || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + || (ELIMINATE_COPY_RELOCS + && !info->shared && h != NULL && h->dynindx != -1 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 @@ -2351,7 +2393,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, { if (indx == 0) { - BFD_ASSERT (! unresolved_reloc); + BFD_ASSERT (! unresolved_reloc); bfd_put_64 (output_bfd, relocation - dtpoff_base (info), htab->sgot->contents + off + GOT_ENTRY_SIZE); diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 2a6f6bf..55c5b42 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -1,6 +1,6 @@ /* ELF executable support for BFD. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 Free Software Foundation, Inc. + 2001, 2002, 2003 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published in "UNIX System V Release 4, Programmers Guide: ANSI C and @@ -121,8 +121,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define elf_write_out_phdrs NAME(bfd_elf,write_out_phdrs) #define elf_write_relocs NAME(bfd_elf,write_relocs) #define elf_slurp_reloc_table NAME(bfd_elf,slurp_reloc_table) -#define elf_link_create_dynamic_sections \ - NAME(bfd_elf,link_create_dynamic_sections) #define elf_bfd_discard_info NAME(bfd_elf,discard_info) #define elf_reloc_symbol_deleted_p NAME(_bfd_elf,reloc_symbol_deleted_p) #define elf_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol @@ -1570,6 +1568,232 @@ elf_symbol_flags (flags) } #endif +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote memory + based on the ELF file header at EHDR_VMA and the ELF program headers it + points to. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs the + file headers (and hence BFD's idea of each section's VMA) put them at. + + The function TARGET_READ_MEMORY is called to copy LEN bytes from the + remote memory at target address VMA into the local buffer at MYADDR; it + should return zero on success or an `errno' code on failure. TEMPL must + be a BFD for a target with the word size and byte order found in the + remote memory. */ + +bfd * +NAME(_bfd_elf,bfd_from_remote_memory) (templ, ehdr_vma, loadbasep, + target_read_memory) + bfd *templ; + bfd_vma ehdr_vma; + bfd_vma *loadbasep; + int (*target_read_memory) PARAMS ((bfd_vma vma, char *myaddr, int len)); +{ + Elf_External_Ehdr x_ehdr; /* Elf file header, external form */ + Elf_Internal_Ehdr i_ehdr; /* Elf file header, internal form */ + Elf_External_Phdr *x_phdrs; + Elf_Internal_Phdr *i_phdrs, *last_phdr; + bfd *nbfd; + struct bfd_in_memory *bim; + int contents_size; + char *contents; + int err; + unsigned int i; + bfd_vma loadbase; + + /* Read in the ELF header in external format. */ + err = target_read_memory (ehdr_vma, (char *) &x_ehdr, sizeof x_ehdr); + if (err) + { + bfd_set_error (bfd_error_system_call); + errno = err; + return NULL; + } + + /* Now check to see if we have a valid ELF file, and one that BFD can + make use of. The magic number must match, the address size ('class') + and byte-swapping must match our XVEC entry. */ + + if (! elf_file_p (&x_ehdr) + || x_ehdr.e_ident[EI_VERSION] != EV_CURRENT + || x_ehdr.e_ident[EI_CLASS] != ELFCLASS) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + /* Check that file's byte order matches xvec's */ + switch (x_ehdr.e_ident[EI_DATA]) + { + case ELFDATA2MSB: /* Big-endian */ + if (! bfd_header_big_endian (templ)) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + break; + case ELFDATA2LSB: /* Little-endian */ + if (! bfd_header_little_endian (templ)) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + break; + case ELFDATANONE: /* No data encoding specified */ + default: /* Unknown data encoding specified */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + elf_swap_ehdr_in (templ, &x_ehdr, &i_ehdr); + + /* The file header tells where to find the program headers. + These are what we use to actually choose what to read. */ + + if (i_ehdr.e_phentsize != sizeof (Elf_External_Phdr) || i_ehdr.e_phnum == 0) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + x_phdrs = (Elf_External_Phdr *) + bfd_malloc (i_ehdr.e_phnum * (sizeof *x_phdrs + sizeof *i_phdrs)); + if (x_phdrs == NULL) + { + bfd_set_error (bfd_error_no_memory); + return NULL; + } + err = target_read_memory (ehdr_vma + i_ehdr.e_phoff, (char *) x_phdrs, + i_ehdr.e_phnum * sizeof x_phdrs[0]); + if (err) + { + free (x_phdrs); + bfd_set_error (bfd_error_system_call); + errno = err; + return NULL; + } + i_phdrs = (Elf_Internal_Phdr *) &x_phdrs[i_ehdr.e_phnum]; + + contents_size = 0; + last_phdr = NULL; + loadbase = ehdr_vma; + for (i = 0; i < i_ehdr.e_phnum; ++i) + { + elf_swap_phdr_in (templ, &x_phdrs[i], &i_phdrs[i]); + if (i_phdrs[i].p_type == PT_LOAD) + { + bfd_vma segment_end; + segment_end = (i_phdrs[i].p_offset + i_phdrs[i].p_filesz + + i_phdrs[i].p_align - 1) & -i_phdrs[i].p_align; + if (segment_end > (bfd_vma) contents_size) + contents_size = segment_end; + + if ((i_phdrs[i].p_offset & -i_phdrs[i].p_align) == 0) + loadbase = ehdr_vma - (i_phdrs[i].p_vaddr & -i_phdrs[i].p_align); + + last_phdr = &i_phdrs[i]; + } + } + if (last_phdr == NULL) + { + /* There were no PT_LOAD segments, so we don't have anything to read. */ + free (x_phdrs); + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + /* Trim the last segment so we don't bother with zeros in the last page + that are off the end of the file. However, if the extra bit in that + page includes the section headers, keep them. */ + if ((bfd_vma) contents_size > last_phdr->p_offset + last_phdr->p_filesz + && (bfd_vma) contents_size >= (i_ehdr.e_shoff + + i_ehdr.e_shnum * i_ehdr.e_shentsize)) + { + contents_size = last_phdr->p_offset + last_phdr->p_filesz; + if ((bfd_vma) contents_size < (i_ehdr.e_shoff + + i_ehdr.e_shnum * i_ehdr.e_shentsize)) + contents_size = i_ehdr.e_shoff + i_ehdr.e_shnum * i_ehdr.e_shentsize; + } + else + contents_size = last_phdr->p_offset + last_phdr->p_filesz; + + /* Now we know the size of the whole image we want read in. */ + contents = (char *) bfd_zmalloc ((bfd_size_type) contents_size); + if (contents == NULL) + { + free (x_phdrs); + bfd_set_error (bfd_error_no_memory); + return NULL; + } + + for (i = 0; i < i_ehdr.e_phnum; ++i) + if (i_phdrs[i].p_type == PT_LOAD) + { + bfd_vma start = i_phdrs[i].p_offset & -i_phdrs[i].p_align; + bfd_vma end = (i_phdrs[i].p_offset + i_phdrs[i].p_filesz + + i_phdrs[i].p_align - 1) & -i_phdrs[i].p_align; + if (end > (bfd_vma) contents_size) + end = contents_size; + err = target_read_memory ((loadbase + i_phdrs[i].p_vaddr) + & -i_phdrs[i].p_align, + contents + start, end - start); + if (err) + { + free (x_phdrs); + free (contents); + bfd_set_error (bfd_error_system_call); + errno = err; + return NULL; + } + } + free (x_phdrs); + + /* If the segments visible in memory didn't include the section headers, + then clear them from the file header. */ + if ((bfd_vma) contents_size < (i_ehdr.e_shoff + + i_ehdr.e_shnum * i_ehdr.e_shentsize)) + { + memset (&x_ehdr.e_shoff, 0, sizeof x_ehdr.e_shoff); + memset (&x_ehdr.e_shnum, 0, sizeof x_ehdr.e_shnum); + memset (&x_ehdr.e_shstrndx, 0, sizeof x_ehdr.e_shstrndx); + } + + /* This will normally have been in the first PT_LOAD segment. But it + conceivably could be missing, and we might have just changed it. */ + memcpy (contents, &x_ehdr, sizeof x_ehdr); + + /* Now we have a memory image of the ELF file contents. Make a BFD. */ + bim = ((struct bfd_in_memory *) + bfd_malloc ((bfd_size_type) sizeof (struct bfd_in_memory))); + if (bim == NULL) + { + free (contents); + bfd_set_error (bfd_error_no_memory); + return NULL; + } + nbfd = _bfd_new_bfd (); + if (nbfd == NULL) + { + free (bim); + free (contents); + bfd_set_error (bfd_error_no_memory); + return NULL; + } + nbfd->filename = "<in-memory>"; + nbfd->xvec = templ->xvec; + bim->size = contents_size; + bim->buffer = contents; + nbfd->iostream = (PTR) bim; + nbfd->flags = BFD_IN_MEMORY; + nbfd->direction = read_direction; + nbfd->mtime = time (NULL); + nbfd->mtime_set = TRUE; + + if (loadbasep) + *loadbasep = loadbase; + return nbfd; +} + #include "elfcore.h" #include "elflink.h" @@ -1585,7 +1809,7 @@ const struct elf_size_info NAME(_bfd_elf,size_info) = { sizeof (Elf_External_Note), 4, 1, - ARCH_SIZE, FILE_ALIGN, + ARCH_SIZE, LOG_FILE_ALIGN, ELFCLASS, EV_CURRENT, elf_write_out_phdrs, elf_write_shdrs_and_ehdr, diff --git a/bfd/elflink.c b/bfd/elflink.c index 962c104..cc31186 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -25,6 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ARCH_SIZE 0 #include "elf-bfd.h" +static bfd_boolean elf_link_read_relocs_from_section + PARAMS ((bfd *, Elf_Internal_Shdr *, PTR, Elf_Internal_Rela *)); + bfd_boolean _bfd_elf_create_got_section (abfd, info) bfd *abfd; @@ -104,33 +107,159 @@ _bfd_elf_create_got_section (abfd, info) return TRUE; } -/* Create dynamic sections when linking against a dynamic object. */ +/* Create some sections which will be filled in with dynamic linking + information. ABFD is an input file which requires dynamic sections + to be created. The dynamic sections take up virtual memory space + when the final executable is run, so we need to create them before + addresses are assigned to the output sections. We work out the + actual contents and size of these sections later. */ bfd_boolean -_bfd_elf_create_dynamic_sections (abfd, info) +_bfd_elf_link_create_dynamic_sections (abfd, info) bfd *abfd; struct bfd_link_info *info; { - flagword flags, pltflags; - asection *s; - struct elf_backend_data *bed = get_elf_backend_data (abfd); - int ptralign; + flagword flags; + register asection *s; + struct elf_link_hash_entry *h; + struct bfd_link_hash_entry *bh; + struct elf_backend_data *bed; - switch (bed->s->arch_size) + if (! is_elf_hash_table (info)) + return FALSE; + + if (elf_hash_table (info)->dynamic_sections_created) + return TRUE; + + /* Make sure that all dynamic sections use the same input BFD. */ + if (elf_hash_table (info)->dynobj == NULL) + elf_hash_table (info)->dynobj = abfd; + else + abfd = elf_hash_table (info)->dynobj; + + /* Note that we set the SEC_IN_MEMORY flag for all of these + sections. */ + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED); + + /* A dynamically linked executable has a .interp section, but a + shared library does not. */ + if (! info->shared) { - case 32: - ptralign = 2; - break; + s = bfd_make_section (abfd, ".interp"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)) + return FALSE; + } - case 64: - ptralign = 3; - break; + if (! info->traditional_format + && info->hash->creator->flavour == bfd_target_elf_flavour) + { + s = bfd_make_section (abfd, ".eh_frame_hdr"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, s, 2)) + return FALSE; + elf_hash_table (info)->eh_info.hdr_sec = s; + } - default: - bfd_set_error (bfd_error_bad_value); - return FALSE; + bed = get_elf_backend_data (abfd); + + /* Create sections to hold version informations. These are removed + if they are not needed. */ + s = bfd_make_section (abfd, ".gnu.version_d"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + + s = bfd_make_section (abfd, ".gnu.version"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, s, 1)) + return FALSE; + + s = bfd_make_section (abfd, ".gnu.version_r"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + + s = bfd_make_section (abfd, ".dynsym"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + + s = bfd_make_section (abfd, ".dynstr"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)) + return FALSE; + + /* Create a strtab to hold the dynamic symbol names. */ + if (elf_hash_table (info)->dynstr == NULL) + { + elf_hash_table (info)->dynstr = _bfd_elf_strtab_init (); + if (elf_hash_table (info)->dynstr == NULL) + return FALSE; } + s = bfd_make_section (abfd, ".dynamic"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags) + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + + /* The special symbol _DYNAMIC is always set to the start of the + .dynamic section. This call occurs before we have processed the + symbols for any dynamic object, so we don't have to worry about + overriding a dynamic definition. We could set _DYNAMIC in a + linker script, but we only want to define it if we are, in fact, + creating a .dynamic section. We don't want to define it if there + is no .dynamic section, since on some ELF platforms the start up + code examines it to decide how to initialize the process. */ + bh = NULL; + if (! (_bfd_generic_link_add_one_symbol + (info, abfd, "_DYNAMIC", BSF_GLOBAL, s, (bfd_vma) 0, + (const char *) 0, FALSE, get_elf_backend_data (abfd)->collect, &bh))) + return FALSE; + h = (struct elf_link_hash_entry *) bh; + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; + h->type = STT_OBJECT; + + if (info->shared + && ! _bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + + s = bfd_make_section (abfd, ".hash"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry; + + /* Let the backend create the rest of the sections. This lets the + backend set the right flags. The backend will normally create + the .got and .plt sections. */ + if (! (*bed->elf_backend_create_dynamic_sections) (abfd, info)) + return FALSE; + + elf_hash_table (info)->dynamic_sections_created = TRUE; + + return TRUE; +} + +/* Create dynamic sections when linking against a dynamic object. */ + +bfd_boolean +_bfd_elf_create_dynamic_sections (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + flagword flags, pltflags; + asection *s; + struct elf_backend_data *bed = get_elf_backend_data (abfd); + /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and .rel[a].bss sections. */ @@ -175,7 +304,7 @@ _bfd_elf_create_dynamic_sections (abfd, info) bed->default_use_rela_p ? ".rela.plt" : ".rel.plt"); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) - || ! bfd_set_section_alignment (abfd, s, ptralign)) + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) return FALSE; if (! _bfd_elf_create_got_section (abfd, info)) @@ -212,7 +341,7 @@ _bfd_elf_create_dynamic_sections (abfd, info) ? ".rela.bss" : ".rel.bss")); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) - || ! bfd_set_section_alignment (abfd, s, ptralign)) + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) return FALSE; } } @@ -306,6 +435,70 @@ _bfd_elf_link_record_dynamic_symbol (info, h) return TRUE; } + +/* Record an assignment to a symbol made by a linker script. We need + this in case some dynamic object refers to this symbol. */ + +bfd_boolean +bfd_elf_record_link_assignment (output_bfd, info, name, provide) + bfd *output_bfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info; + const char *name; + bfd_boolean provide; +{ + struct elf_link_hash_entry *h; + + if (info->hash->creator->flavour != bfd_target_elf_flavour) + return TRUE; + + h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, TRUE, FALSE); + if (h == NULL) + return FALSE; + + if (h->root.type == bfd_link_hash_new) + h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF; + + /* If this symbol is being provided by the linker script, and it is + currently defined by a dynamic object, but not by a regular + object, then mark it as undefined so that the generic linker will + force the correct value. */ + if (provide + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + h->root.type = bfd_link_hash_undefined; + + /* If this symbol is not being provided by the linker script, and it is + currently defined by a dynamic object, but not by a regular object, + then clear out any version information because the symbol will not be + associated with the dynamic object any more. */ + if (!provide + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + h->verinfo.verdef = NULL; + + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; + + if (((h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_DYNAMIC + | ELF_LINK_HASH_REF_DYNAMIC)) != 0 + || info->shared) + && h->dynindx == -1) + { + if (! _bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + + /* If this is a weak defined symbol, and we know a corresponding + real symbol from the same dynamic object, make sure the real + symbol is also made into a dynamic symbol. */ + if (h->weakdef != NULL + && h->weakdef->dynindx == -1) + { + if (! _bfd_elf_link_record_dynamic_symbol (info, h->weakdef)) + return FALSE; + } + } + + return TRUE; +} /* Record a new local dynamic symbol. Returns 0 on failure, 1 on success, and 2 on a failure caused by attempting to record a symbol @@ -477,6 +670,1231 @@ _bfd_elf_link_renumber_dynsyms (output_bfd, info) return elf_hash_table (info)->dynsymcount = dynsymcount; } + +/* This function is called when we want to define a new symbol. It + handles the various cases which arise when we find a definition in + a dynamic object, or when there is already a definition in a + dynamic object. The new symbol is described by NAME, SYM, PSEC, + and PVALUE. We set SYM_HASH to the hash table entry. We set + OVERRIDE if the old symbol is overriding a new definition. We set + TYPE_CHANGE_OK if it is OK for the type to change. We set + SIZE_CHANGE_OK if it is OK for the size to change. By OK to + change, we mean that we shouldn't warn if the type or size does + change. DT_NEEDED indicates if it comes from a DT_NEEDED entry of + a shared object. */ + +bfd_boolean +_bfd_elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, skip, + override, type_change_ok, size_change_ok, dt_needed) + bfd *abfd; + struct bfd_link_info *info; + const char *name; + Elf_Internal_Sym *sym; + asection **psec; + bfd_vma *pvalue; + struct elf_link_hash_entry **sym_hash; + bfd_boolean *skip; + bfd_boolean *override; + bfd_boolean *type_change_ok; + bfd_boolean *size_change_ok; + bfd_boolean dt_needed; +{ + asection *sec; + struct elf_link_hash_entry *h; + struct elf_link_hash_entry *flip; + int bind; + bfd *oldbfd; + bfd_boolean newdyn, olddyn, olddef, newdef, newdyncommon, olddyncommon; + bfd_boolean newweakdef, oldweakdef, newweakundef, oldweakundef; + + *skip = FALSE; + *override = FALSE; + + sec = *psec; + bind = ELF_ST_BIND (sym->st_info); + + if (! bfd_is_und_section (sec)) + h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, FALSE, FALSE); + else + h = ((struct elf_link_hash_entry *) + bfd_wrapped_link_hash_lookup (abfd, info, name, TRUE, FALSE, FALSE)); + if (h == NULL) + return FALSE; + *sym_hash = h; + + /* This code is for coping with dynamic objects, and is only useful + if we are doing an ELF link. */ + if (info->hash->creator != abfd->xvec) + return TRUE; + + /* For merging, we only care about real symbols. */ + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* If we just created the symbol, mark it as being an ELF symbol. + Other than that, there is nothing to do--there is no merge issue + with a newly defined symbol--so we just return. */ + + if (h->root.type == bfd_link_hash_new) + { + h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF; + return TRUE; + } + + /* OLDBFD is a BFD associated with the existing symbol. */ + + switch (h->root.type) + { + default: + oldbfd = NULL; + break; + + case bfd_link_hash_undefined: + case bfd_link_hash_undefweak: + oldbfd = h->root.u.undef.abfd; + break; + + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + oldbfd = h->root.u.def.section->owner; + break; + + case bfd_link_hash_common: + oldbfd = h->root.u.c.p->section->owner; + break; + } + + /* In cases involving weak versioned symbols, we may wind up trying + to merge a symbol with itself. Catch that here, to avoid the + confusion that results if we try to override a symbol with + itself. The additional tests catch cases like + _GLOBAL_OFFSET_TABLE_, which are regular symbols defined in a + dynamic object, which we do want to handle here. */ + if (abfd == oldbfd + && ((abfd->flags & DYNAMIC) == 0 + || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) + return TRUE; + + /* NEWDYN and OLDDYN indicate whether the new or old symbol, + respectively, is from a dynamic object. */ + + if ((abfd->flags & DYNAMIC) != 0) + newdyn = TRUE; + else + newdyn = FALSE; + + if (oldbfd != NULL) + olddyn = (oldbfd->flags & DYNAMIC) != 0; + else + { + asection *hsec; + + /* This code handles the special SHN_MIPS_{TEXT,DATA} section + indices used by MIPS ELF. */ + switch (h->root.type) + { + default: + hsec = NULL; + break; + + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + hsec = h->root.u.def.section; + break; + + case bfd_link_hash_common: + hsec = h->root.u.c.p->section; + break; + } + + if (hsec == NULL) + olddyn = FALSE; + else + olddyn = (hsec->symbol->flags & BSF_DYNAMIC) != 0; + } + + /* NEWDEF and OLDDEF indicate whether the new or old symbol, + respectively, appear to be a definition rather than reference. */ + + if (bfd_is_und_section (sec) || bfd_is_com_section (sec)) + newdef = FALSE; + else + newdef = TRUE; + + if (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_common) + olddef = FALSE; + else + olddef = TRUE; + + /* We need to rememeber if a symbol has a definition in a dynamic + object or is weak in all dynamic objects. Internal and hidden + visibility will make it unavailable to dynamic objects. */ + if (newdyn && (h->elf_link_hash_flags & ELF_LINK_DYNAMIC_DEF) == 0) + { + if (!bfd_is_und_section (sec)) + h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_DEF; + else + { + /* Check if this symbol is weak in all dynamic objects. If it + is the first time we see it in a dynamic object, we mark + if it is weak. Otherwise, we clear it. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0) + { + if (bind == STB_WEAK) + h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_WEAK; + } + else if (bind != STB_WEAK) + h->elf_link_hash_flags &= ~ELF_LINK_DYNAMIC_WEAK; + } + } + + /* If the old symbol has non-default visibility, we ignore the new + definition from a dynamic object. */ + if (newdyn + && ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && !bfd_is_und_section (sec)) + { + *skip = TRUE; + /* Make sure this symbol is dynamic. */ + h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; + /* A protected symbol has external availability. Make sure it is + recorded as dynamic. + + FIXME: Should we check type and size for protected symbol? */ + if (ELF_ST_VISIBILITY (h->other) == STV_PROTECTED) + return _bfd_elf_link_record_dynamic_symbol (info, h); + else + return TRUE; + } + else if (!newdyn + && ELF_ST_VISIBILITY (sym->st_other) != STV_DEFAULT + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0) + { + /* If the new symbol with non-default visibility comes from a + relocatable file and the old definition comes from a dynamic + object, we remove the old definition. */ + if ((*sym_hash)->root.type == bfd_link_hash_indirect) + h = *sym_hash; + h->root.type = bfd_link_hash_new; + h->root.u.undef.abfd = NULL; + if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) + { + h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC; + h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_DYNAMIC_DEF); + } + /* FIXME: Should we check type and size for protected symbol? */ + h->size = 0; + h->type = 0; + return TRUE; + } + + /* We need to treat weak definiton right, depending on if there is a + definition from a dynamic object. */ + if (bind == STB_WEAK) + { + if (olddef) + { + newweakdef = TRUE; + newweakundef = FALSE; + } + else + { + newweakdef = FALSE; + newweakundef = TRUE; + } + } + else + newweakdef = newweakundef = FALSE; + + /* If the new weak definition comes from a relocatable file and the + old symbol comes from a dynamic object, we treat the new one as + strong. */ + if (newweakdef && !newdyn && olddyn) + newweakdef = FALSE; + + if (h->root.type == bfd_link_hash_defweak) + { + oldweakdef = TRUE; + oldweakundef = FALSE; + } + else if (h->root.type == bfd_link_hash_undefweak) + { + oldweakdef = FALSE; + oldweakundef = TRUE; + } + else + oldweakdef = oldweakundef = FALSE; + + /* If the old weak definition comes from a relocatable file and the + new symbol comes from a dynamic object, we treat the old one as + strong. */ + if (oldweakdef && !olddyn && newdyn) + oldweakdef = FALSE; + + /* NEWDYNCOMMON and OLDDYNCOMMON indicate whether the new or old + symbol, respectively, appears to be a common symbol in a dynamic + object. If a symbol appears in an uninitialized section, and is + not weak, and is not a function, then it may be a common symbol + which was resolved when the dynamic object was created. We want + to treat such symbols specially, because they raise special + considerations when setting the symbol size: if the symbol + appears as a common symbol in a regular object, and the size in + the regular object is larger, we must make sure that we use the + larger size. This problematic case can always be avoided in C, + but it must be handled correctly when using Fortran shared + libraries. + + Note that if NEWDYNCOMMON is set, NEWDEF will be set, and + likewise for OLDDYNCOMMON and OLDDEF. + + Note that this test is just a heuristic, and that it is quite + possible to have an uninitialized symbol in a shared object which + is really a definition, rather than a common symbol. This could + lead to some minor confusion when the symbol really is a common + symbol in some regular object. However, I think it will be + harmless. */ + + if (newdyn + && newdef + && (sec->flags & SEC_ALLOC) != 0 + && (sec->flags & SEC_LOAD) == 0 + && sym->st_size > 0 + && !newweakdef + && !newweakundef + && ELF_ST_TYPE (sym->st_info) != STT_FUNC) + newdyncommon = TRUE; + else + newdyncommon = FALSE; + + if (olddyn + && olddef + && h->root.type == bfd_link_hash_defined + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->root.u.def.section->flags & SEC_ALLOC) != 0 + && (h->root.u.def.section->flags & SEC_LOAD) == 0 + && h->size > 0 + && h->type != STT_FUNC) + olddyncommon = TRUE; + else + olddyncommon = FALSE; + + /* It's OK to change the type if either the existing symbol or the + new symbol is weak unless it comes from a DT_NEEDED entry of + a shared object, in which case, the DT_NEEDED entry may not be + required at the run time. */ + + if ((! dt_needed && oldweakdef) + || oldweakundef + || newweakdef + || newweakundef) + *type_change_ok = TRUE; + + /* It's OK to change the size if either the existing symbol or the + new symbol is weak, or if the old symbol is undefined. */ + + if (*type_change_ok + || h->root.type == bfd_link_hash_undefined) + *size_change_ok = TRUE; + + /* If both the old and the new symbols look like common symbols in a + dynamic object, set the size of the symbol to the larger of the + two. */ + + if (olddyncommon + && newdyncommon + && sym->st_size != h->size) + { + /* Since we think we have two common symbols, issue a multiple + common warning if desired. Note that we only warn if the + size is different. If the size is the same, we simply let + the old symbol override the new one as normally happens with + symbols defined in dynamic objects. */ + + if (! ((*info->callbacks->multiple_common) + (info, h->root.root.string, oldbfd, bfd_link_hash_common, + h->size, abfd, bfd_link_hash_common, sym->st_size))) + return FALSE; + + if (sym->st_size > h->size) + h->size = sym->st_size; + + *size_change_ok = TRUE; + } + + /* If we are looking at a dynamic object, and we have found a + definition, we need to see if the symbol was already defined by + some other object. If so, we want to use the existing + definition, and we do not want to report a multiple symbol + definition error; we do this by clobbering *PSEC to be + bfd_und_section_ptr. + + We treat a common symbol as a definition if the symbol in the + shared library is a function, since common symbols always + represent variables; this can cause confusion in principle, but + any such confusion would seem to indicate an erroneous program or + shared library. We also permit a common symbol in a regular + object to override a weak symbol in a shared object. + + We prefer a non-weak definition in a shared library to a weak + definition in the executable unless it comes from a DT_NEEDED + entry of a shared object, in which case, the DT_NEEDED entry + may not be required at the run time. */ + + if (newdyn + && newdef + && (olddef + || (h->root.type == bfd_link_hash_common + && (newweakdef + || newweakundef + || ELF_ST_TYPE (sym->st_info) == STT_FUNC))) + && (!oldweakdef + || dt_needed + || newweakdef + || newweakundef)) + { + *override = TRUE; + newdef = FALSE; + newdyncommon = FALSE; + + *psec = sec = bfd_und_section_ptr; + *size_change_ok = TRUE; + + /* If we get here when the old symbol is a common symbol, then + we are explicitly letting it override a weak symbol or + function in a dynamic object, and we don't want to warn about + a type change. If the old symbol is a defined symbol, a type + change warning may still be appropriate. */ + + if (h->root.type == bfd_link_hash_common) + *type_change_ok = TRUE; + } + + /* Handle the special case of an old common symbol merging with a + new symbol which looks like a common symbol in a shared object. + We change *PSEC and *PVALUE to make the new symbol look like a + common symbol, and let _bfd_generic_link_add_one_symbol will do + the right thing. */ + + if (newdyncommon + && h->root.type == bfd_link_hash_common) + { + *override = TRUE; + newdef = FALSE; + newdyncommon = FALSE; + *pvalue = sym->st_size; + *psec = sec = bfd_com_section_ptr; + *size_change_ok = TRUE; + } + + /* If the old symbol is from a dynamic object, and the new symbol is + a definition which is not from a dynamic object, then the new + symbol overrides the old symbol. Symbols from regular files + always take precedence over symbols from dynamic objects, even if + they are defined after the dynamic object in the link. + + As above, we again permit a common symbol in a regular object to + override a definition in a shared object if the shared object + symbol is a function or is weak. + + As above, we permit a non-weak definition in a shared object to + override a weak definition in a regular object. */ + + flip = NULL; + if (! newdyn + && (newdef + || (bfd_is_com_section (sec) + && (oldweakdef || h->type == STT_FUNC))) + && olddyn + && olddef + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && ((!newweakdef && !newweakundef) || oldweakdef)) + { + /* Change the hash table entry to undefined, and let + _bfd_generic_link_add_one_symbol do the right thing with the + new definition. */ + + h->root.type = bfd_link_hash_undefined; + h->root.u.undef.abfd = h->root.u.def.section->owner; + *size_change_ok = TRUE; + + olddef = FALSE; + olddyncommon = FALSE; + + /* We again permit a type change when a common symbol may be + overriding a function. */ + + if (bfd_is_com_section (sec)) + *type_change_ok = TRUE; + + if ((*sym_hash)->root.type == bfd_link_hash_indirect) + flip = *sym_hash; + else + /* This union may have been set to be non-NULL when this symbol + was seen in a dynamic object. We must force the union to be + NULL, so that it is correct for a regular symbol. */ + h->verinfo.vertree = NULL; + } + + /* Handle the special case of a new common symbol merging with an + old symbol that looks like it might be a common symbol defined in + a shared object. Note that we have already handled the case in + which a new common symbol should simply override the definition + in the shared library. */ + + if (! newdyn + && bfd_is_com_section (sec) + && olddyncommon) + { + /* It would be best if we could set the hash table entry to a + common symbol, but we don't know what to use for the section + or the alignment. */ + if (! ((*info->callbacks->multiple_common) + (info, h->root.root.string, oldbfd, bfd_link_hash_common, + h->size, abfd, bfd_link_hash_common, sym->st_size))) + return FALSE; + + /* If the predumed common symbol in the dynamic object is + larger, pretend that the new symbol has its size. */ + + if (h->size > *pvalue) + *pvalue = h->size; + + /* FIXME: We no longer know the alignment required by the symbol + in the dynamic object, so we just wind up using the one from + the regular object. */ + + olddef = FALSE; + olddyncommon = FALSE; + + h->root.type = bfd_link_hash_undefined; + h->root.u.undef.abfd = h->root.u.def.section->owner; + + *size_change_ok = TRUE; + *type_change_ok = TRUE; + + if ((*sym_hash)->root.type == bfd_link_hash_indirect) + flip = *sym_hash; + else + h->verinfo.vertree = NULL; + } + + if (flip != NULL) + { + /* Handle the case where we had a versioned symbol in a dynamic + library and now find a definition in a normal object. In this + case, we make the versioned symbol point to the normal one. */ + struct elf_backend_data *bed = get_elf_backend_data (abfd); + flip->root.type = h->root.type; + h->root.type = bfd_link_hash_indirect; + h->root.u.i.link = (struct bfd_link_hash_entry *) flip; + (*bed->elf_backend_copy_indirect_symbol) (bed, flip, h); + flip->root.u.undef.abfd = h->root.u.undef.abfd; + if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) + { + h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC; + flip->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; + } + } + + /* Handle the special case of a weak definition in a regular object + followed by a non-weak definition in a shared object. In this + case, we prefer the definition in the shared object unless it + comes from a DT_NEEDED entry of a shared object, in which case, + the DT_NEEDED entry may not be required at the run time. */ + if (olddef + && ! dt_needed + && oldweakdef + && newdef + && newdyn + && !newweakdef + && !newweakundef) + { + /* To make this work we have to frob the flags so that the rest + of the code does not think we are using the regular + definition. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) + h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR; + else if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0) + h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; + h->elf_link_hash_flags &= ~ (ELF_LINK_HASH_DEF_REGULAR + | ELF_LINK_HASH_DEF_DYNAMIC); + + /* If H is the target of an indirection, we want the caller to + use H rather than the indirect symbol. Otherwise if we are + defining a new indirect symbol we will wind up attaching it + to the entry we are overriding. */ + *sym_hash = h; + } + + /* Handle the special case of a non-weak definition in a shared + object followed by a weak definition in a regular object. In + this case we prefer the definition in the shared object. To make + this work we have to tell the caller to not treat the new symbol + as a definition. */ + if (olddef + && olddyn + && !oldweakdef + && newdef + && ! newdyn + && (newweakdef || newweakundef)) + *override = TRUE; + + return TRUE; +} + +/* This function is called to create an indirect symbol from the + default for the symbol with the default version if needed. The + symbol is described by H, NAME, SYM, PSEC, VALUE, and OVERRIDE. We + set DYNSYM if the new indirect symbol is dynamic. DT_NEEDED + indicates if it comes from a DT_NEEDED entry of a shared object. */ + +bfd_boolean +_bfd_elf_add_default_symbol (abfd, info, h, name, sym, psec, value, + dynsym, override, dt_needed) + bfd *abfd; + struct bfd_link_info *info; + struct elf_link_hash_entry *h; + const char *name; + Elf_Internal_Sym *sym; + asection **psec; + bfd_vma *value; + bfd_boolean *dynsym; + bfd_boolean override; + bfd_boolean dt_needed; +{ + bfd_boolean type_change_ok; + bfd_boolean size_change_ok; + bfd_boolean skip; + char *shortname; + struct elf_link_hash_entry *hi; + struct bfd_link_hash_entry *bh; + struct elf_backend_data *bed; + bfd_boolean collect; + bfd_boolean dynamic; + char *p; + size_t len, shortlen; + asection *sec; + + /* If this symbol has a version, and it is the default version, we + create an indirect symbol from the default name to the fully + decorated name. This will cause external references which do not + specify a version to be bound to this version of the symbol. */ + p = strchr (name, ELF_VER_CHR); + if (p == NULL || p[1] != ELF_VER_CHR) + return TRUE; + + if (override) + { + /* We are overridden by an old defition. We need to check if we + need to create the indirect symbol from the default name. */ + hi = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, + FALSE, FALSE); + BFD_ASSERT (hi != NULL); + if (hi == h) + return TRUE; + while (hi->root.type == bfd_link_hash_indirect + || hi->root.type == bfd_link_hash_warning) + { + hi = (struct elf_link_hash_entry *) hi->root.u.i.link; + if (hi == h) + return TRUE; + } + } + + bed = get_elf_backend_data (abfd); + collect = bed->collect; + dynamic = (abfd->flags & DYNAMIC) != 0; + + shortlen = p - name; + shortname = bfd_hash_allocate (&info->hash->table, shortlen + 1); + if (shortname == NULL) + return FALSE; + memcpy (shortname, name, shortlen); + shortname[shortlen] = '\0'; + + /* We are going to create a new symbol. Merge it with any existing + symbol with this name. For the purposes of the merge, act as + though we were defining the symbol we just defined, although we + actually going to define an indirect symbol. */ + type_change_ok = FALSE; + size_change_ok = FALSE; + sec = *psec; + if (!_bfd_elf_merge_symbol (abfd, info, shortname, sym, &sec, value, + &hi, &skip, &override, &type_change_ok, + &size_change_ok, dt_needed)) + return FALSE; + + if (skip) + goto nondefault; + + if (! override) + { + bh = &hi->root; + if (! (_bfd_generic_link_add_one_symbol + (info, abfd, shortname, BSF_INDIRECT, bfd_ind_section_ptr, + (bfd_vma) 0, name, FALSE, collect, &bh))) + return FALSE; + hi = (struct elf_link_hash_entry *) bh; + } + else + { + /* In this case the symbol named SHORTNAME is overriding the + indirect symbol we want to add. We were planning on making + SHORTNAME an indirect symbol referring to NAME. SHORTNAME + is the name without a version. NAME is the fully versioned + name, and it is the default version. + + Overriding means that we already saw a definition for the + symbol SHORTNAME in a regular object, and it is overriding + the symbol defined in the dynamic object. + + When this happens, we actually want to change NAME, the + symbol we just added, to refer to SHORTNAME. This will cause + references to NAME in the shared object to become references + to SHORTNAME in the regular object. This is what we expect + when we override a function in a shared object: that the + references in the shared object will be mapped to the + definition in the regular object. */ + + while (hi->root.type == bfd_link_hash_indirect + || hi->root.type == bfd_link_hash_warning) + hi = (struct elf_link_hash_entry *) hi->root.u.i.link; + + h->root.type = bfd_link_hash_indirect; + h->root.u.i.link = (struct bfd_link_hash_entry *) hi; + if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) + { + h->elf_link_hash_flags &=~ ELF_LINK_HASH_DEF_DYNAMIC; + hi->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; + if (hi->elf_link_hash_flags + & (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR)) + { + if (! _bfd_elf_link_record_dynamic_symbol (info, hi)) + return FALSE; + } + } + + /* Now set HI to H, so that the following code will set the + other fields correctly. */ + hi = h; + } + + /* If there is a duplicate definition somewhere, then HI may not + point to an indirect symbol. We will have reported an error to + the user in that case. */ + + if (hi->root.type == bfd_link_hash_indirect) + { + struct elf_link_hash_entry *ht; + + /* If the symbol became indirect, then we assume that we have + not seen a definition before. */ + BFD_ASSERT ((hi->elf_link_hash_flags + & (ELF_LINK_HASH_DEF_DYNAMIC + | ELF_LINK_HASH_DEF_REGULAR)) == 0); + + ht = (struct elf_link_hash_entry *) hi->root.u.i.link; + (*bed->elf_backend_copy_indirect_symbol) (bed, ht, hi); + + /* See if the new flags lead us to realize that the symbol must + be dynamic. */ + if (! *dynsym) + { + if (! dynamic) + { + if (info->shared + || ((hi->elf_link_hash_flags + & ELF_LINK_HASH_REF_DYNAMIC) != 0)) + *dynsym = TRUE; + } + else + { + if ((hi->elf_link_hash_flags + & ELF_LINK_HASH_REF_REGULAR) != 0) + *dynsym = TRUE; + } + } + } + + /* We also need to define an indirection from the nondefault version + of the symbol. */ + +nondefault: + len = strlen (name); + shortname = bfd_hash_allocate (&info->hash->table, len); + if (shortname == NULL) + return FALSE; + memcpy (shortname, name, shortlen); + memcpy (shortname + shortlen, p + 1, len - shortlen); + + /* Once again, merge with any existing symbol. */ + type_change_ok = FALSE; + size_change_ok = FALSE; + sec = *psec; + if (!_bfd_elf_merge_symbol (abfd, info, shortname, sym, &sec, value, + &hi, &skip, &override, &type_change_ok, + &size_change_ok, dt_needed)) + return FALSE; + + if (skip) + return TRUE; + + if (override) + { + /* Here SHORTNAME is a versioned name, so we don't expect to see + the type of override we do in the case above unless it is + overridden by a versioned definiton. */ + if (hi->root.type != bfd_link_hash_defined + && hi->root.type != bfd_link_hash_defweak) + (*_bfd_error_handler) + (_("%s: warning: unexpected redefinition of indirect versioned symbol `%s'"), + bfd_archive_filename (abfd), shortname); + } + else + { + bh = &hi->root; + if (! (_bfd_generic_link_add_one_symbol + (info, abfd, shortname, BSF_INDIRECT, + bfd_ind_section_ptr, (bfd_vma) 0, name, FALSE, collect, &bh))) + return FALSE; + hi = (struct elf_link_hash_entry *) bh; + + /* If there is a duplicate definition somewhere, then HI may not + point to an indirect symbol. We will have reported an error + to the user in that case. */ + + if (hi->root.type == bfd_link_hash_indirect) + { + /* If the symbol became indirect, then we assume that we have + not seen a definition before. */ + BFD_ASSERT ((hi->elf_link_hash_flags + & (ELF_LINK_HASH_DEF_DYNAMIC + | ELF_LINK_HASH_DEF_REGULAR)) == 0); + + (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi); + + /* See if the new flags lead us to realize that the symbol + must be dynamic. */ + if (! *dynsym) + { + if (! dynamic) + { + if (info->shared + || ((hi->elf_link_hash_flags + & ELF_LINK_HASH_REF_DYNAMIC) != 0)) + *dynsym = TRUE; + } + else + { + if ((hi->elf_link_hash_flags + & ELF_LINK_HASH_REF_REGULAR) != 0) + *dynsym = TRUE; + } + } + } + } + + return TRUE; +} + +/* This routine is used to export all defined symbols into the dynamic + symbol table. It is called via elf_link_hash_traverse. */ + +bfd_boolean +_bfd_elf_export_symbol (h, data) + struct elf_link_hash_entry *h; + PTR data; +{ + struct elf_info_failed *eif = (struct elf_info_failed *) data; + + /* Ignore indirect symbols. These are added by the versioning code. */ + if (h->root.type == bfd_link_hash_indirect) + return TRUE; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->dynindx == -1 + && (h->elf_link_hash_flags + & (ELF_LINK_HASH_DEF_REGULAR | ELF_LINK_HASH_REF_REGULAR)) != 0) + { + struct bfd_elf_version_tree *t; + struct bfd_elf_version_expr *d; + + for (t = eif->verdefs; t != NULL; t = t->next) + { + if (t->globals != NULL) + { + for (d = t->globals; d != NULL; d = d->next) + { + if ((*d->match) (d, h->root.root.string)) + goto doit; + } + } + + if (t->locals != NULL) + { + for (d = t->locals ; d != NULL; d = d->next) + { + if ((*d->match) (d, h->root.root.string)) + return TRUE; + } + } + } + + if (!eif->verdefs) + { + doit: + if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h)) + { + eif->failed = TRUE; + return FALSE; + } + } + } + + return TRUE; +} + +/* Look through the symbols which are defined in other shared + libraries and referenced here. Update the list of version + dependencies. This will be put into the .gnu.version_r section. + This function is called via elf_link_hash_traverse. */ + +bfd_boolean +_bfd_elf_link_find_version_dependencies (h, data) + struct elf_link_hash_entry *h; + PTR data; +{ + struct elf_find_verdep_info *rinfo = (struct elf_find_verdep_info *) data; + Elf_Internal_Verneed *t; + Elf_Internal_Vernaux *a; + bfd_size_type amt; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* We only care about symbols defined in shared objects with version + information. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 + || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + || h->dynindx == -1 + || h->verinfo.verdef == NULL) + return TRUE; + + /* See if we already know about this version. */ + for (t = elf_tdata (rinfo->output_bfd)->verref; t != NULL; t = t->vn_nextref) + { + if (t->vn_bfd != h->verinfo.verdef->vd_bfd) + continue; + + for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr) + if (a->vna_nodename == h->verinfo.verdef->vd_nodename) + return TRUE; + + break; + } + + /* This is a new version. Add it to tree we are building. */ + + if (t == NULL) + { + amt = sizeof *t; + t = (Elf_Internal_Verneed *) bfd_zalloc (rinfo->output_bfd, amt); + if (t == NULL) + { + rinfo->failed = TRUE; + return FALSE; + } + + t->vn_bfd = h->verinfo.verdef->vd_bfd; + t->vn_nextref = elf_tdata (rinfo->output_bfd)->verref; + elf_tdata (rinfo->output_bfd)->verref = t; + } + + amt = sizeof *a; + a = (Elf_Internal_Vernaux *) bfd_zalloc (rinfo->output_bfd, amt); + + /* Note that we are copying a string pointer here, and testing it + above. If bfd_elf_string_from_elf_section is ever changed to + discard the string data when low in memory, this will have to be + fixed. */ + a->vna_nodename = h->verinfo.verdef->vd_nodename; + + a->vna_flags = h->verinfo.verdef->vd_flags; + a->vna_nextptr = t->vn_auxptr; + + h->verinfo.verdef->vd_exp_refno = rinfo->vers; + ++rinfo->vers; + + a->vna_other = h->verinfo.verdef->vd_exp_refno + 1; + + t->vn_auxptr = a; + + return TRUE; +} + +/* Figure out appropriate versions for all the symbols. We may not + have the version number script until we have read all of the input + files, so until that point we don't know which symbols should be + local. This function is called via elf_link_hash_traverse. */ + +bfd_boolean +_bfd_elf_link_assign_sym_version (h, data) + struct elf_link_hash_entry *h; + PTR data; +{ + struct elf_assign_sym_version_info *sinfo; + struct bfd_link_info *info; + struct elf_backend_data *bed; + struct elf_info_failed eif; + char *p; + bfd_size_type amt; + + sinfo = (struct elf_assign_sym_version_info *) data; + info = sinfo->info; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* Fix the symbol flags. */ + eif.failed = FALSE; + eif.info = info; + if (! _bfd_elf_fix_symbol_flags (h, &eif)) + { + if (eif.failed) + sinfo->failed = TRUE; + return FALSE; + } + + /* We only need version numbers for symbols defined in regular + objects. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + return TRUE; + + bed = get_elf_backend_data (sinfo->output_bfd); + p = strchr (h->root.root.string, ELF_VER_CHR); + if (p != NULL && h->verinfo.vertree == NULL) + { + struct bfd_elf_version_tree *t; + bfd_boolean hidden; + + hidden = TRUE; + + /* There are two consecutive ELF_VER_CHR characters if this is + not a hidden symbol. */ + ++p; + if (*p == ELF_VER_CHR) + { + hidden = FALSE; + ++p; + } + + /* If there is no version string, we can just return out. */ + if (*p == '\0') + { + if (hidden) + h->elf_link_hash_flags |= ELF_LINK_HIDDEN; + return TRUE; + } + + /* Look for the version. If we find it, it is no longer weak. */ + for (t = sinfo->verdefs; t != NULL; t = t->next) + { + if (strcmp (t->name, p) == 0) + { + size_t len; + char *alc; + struct bfd_elf_version_expr *d; + + len = p - h->root.root.string; + alc = bfd_malloc ((bfd_size_type) len); + if (alc == NULL) + return FALSE; + memcpy (alc, h->root.root.string, len - 1); + alc[len - 1] = '\0'; + if (alc[len - 2] == ELF_VER_CHR) + alc[len - 2] = '\0'; + + h->verinfo.vertree = t; + t->used = TRUE; + d = NULL; + + if (t->globals != NULL) + { + for (d = t->globals; d != NULL; d = d->next) + if ((*d->match) (d, alc)) + break; + } + + /* See if there is anything to force this symbol to + local scope. */ + if (d == NULL && t->locals != NULL) + { + for (d = t->locals; d != NULL; d = d->next) + { + if ((*d->match) (d, alc)) + { + if (h->dynindx != -1 + && info->shared + && ! info->export_dynamic) + { + (*bed->elf_backend_hide_symbol) (info, h, TRUE); + } + + break; + } + } + } + + free (alc); + break; + } + } + + /* If we are building an application, we need to create a + version node for this version. */ + if (t == NULL && ! info->shared) + { + struct bfd_elf_version_tree **pp; + int version_index; + + /* If we aren't going to export this symbol, we don't need + to worry about it. */ + if (h->dynindx == -1) + return TRUE; + + amt = sizeof *t; + t = ((struct bfd_elf_version_tree *) + bfd_alloc (sinfo->output_bfd, amt)); + if (t == NULL) + { + sinfo->failed = TRUE; + return FALSE; + } + + t->next = NULL; + t->name = p; + t->globals = NULL; + t->locals = NULL; + t->deps = NULL; + t->name_indx = (unsigned int) -1; + t->used = TRUE; + + version_index = 1; + /* Don't count anonymous version tag. */ + if (sinfo->verdefs != NULL && sinfo->verdefs->vernum == 0) + version_index = 0; + for (pp = &sinfo->verdefs; *pp != NULL; pp = &(*pp)->next) + ++version_index; + t->vernum = version_index; + + *pp = t; + + h->verinfo.vertree = t; + } + else if (t == NULL) + { + /* We could not find the version for a symbol when + generating a shared archive. Return an error. */ + (*_bfd_error_handler) + (_("%s: undefined versioned symbol name %s"), + bfd_get_filename (sinfo->output_bfd), h->root.root.string); + bfd_set_error (bfd_error_bad_value); + sinfo->failed = TRUE; + return FALSE; + } + + if (hidden) + h->elf_link_hash_flags |= ELF_LINK_HIDDEN; + } + + /* If we don't have a version for this symbol, see if we can find + something. */ + if (h->verinfo.vertree == NULL && sinfo->verdefs != NULL) + { + struct bfd_elf_version_tree *t; + struct bfd_elf_version_tree *local_ver; + struct bfd_elf_version_expr *d; + + /* See if can find what version this symbol is in. If the + symbol is supposed to be local, then don't actually register + it. */ + local_ver = NULL; + for (t = sinfo->verdefs; t != NULL; t = t->next) + { + if (t->globals != NULL) + { + bfd_boolean matched; + + matched = FALSE; + for (d = t->globals; d != NULL; d = d->next) + { + if ((*d->match) (d, h->root.root.string)) + { + if (d->symver) + matched = TRUE; + else + { + /* There is a version without definition. Make + the symbol the default definition for this + version. */ + h->verinfo.vertree = t; + local_ver = NULL; + d->script = 1; + break; + } + } + } + + if (d != NULL) + break; + else if (matched) + /* There is no undefined version for this symbol. Hide the + default one. */ + (*bed->elf_backend_hide_symbol) (info, h, TRUE); + } + + if (t->locals != NULL) + { + for (d = t->locals; d != NULL; d = d->next) + { + /* If the match is "*", keep looking for a more + explicit, perhaps even global, match. */ + if (d->pattern[0] == '*' && d->pattern[1] == '\0') + local_ver = t; + else if ((*d->match) (d, h->root.root.string)) + { + local_ver = t; + break; + } + } + + if (d != NULL) + break; + } + } + + if (local_ver != NULL) + { + h->verinfo.vertree = local_ver; + if (h->dynindx != -1 + && info->shared + && ! info->export_dynamic) + { + (*bed->elf_backend_hide_symbol) (info, h, TRUE); + } + } + } + + return TRUE; +} /* Create a special linker section, or return a pointer to a linker section already created */ @@ -650,3 +2068,582 @@ _bfd_elf_make_linker_section_rela (dynobj, lsect, alignment) return TRUE; } + +/* Read and swap the relocs from the section indicated by SHDR. This + may be either a REL or a RELA section. The relocations are + translated into RELA relocations and stored in INTERNAL_RELOCS, + which should have already been allocated to contain enough space. + The EXTERNAL_RELOCS are a buffer where the external form of the + relocations should be stored. + + Returns FALSE if something goes wrong. */ + +static bfd_boolean +elf_link_read_relocs_from_section (abfd, shdr, external_relocs, + internal_relocs) + bfd *abfd; + Elf_Internal_Shdr *shdr; + PTR external_relocs; + Elf_Internal_Rela *internal_relocs; +{ + struct elf_backend_data *bed; + void (*swap_in) PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); + const bfd_byte *erela; + const bfd_byte *erelaend; + Elf_Internal_Rela *irela; + + /* If there aren't any relocations, that's OK. */ + if (!shdr) + return TRUE; + + /* Position ourselves at the start of the section. */ + if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0) + return FALSE; + + /* Read the relocations. */ + if (bfd_bread (external_relocs, shdr->sh_size, abfd) != shdr->sh_size) + return FALSE; + + bed = get_elf_backend_data (abfd); + + /* Convert the external relocations to the internal format. */ + if (shdr->sh_entsize == bed->s->sizeof_rel) + swap_in = bed->s->swap_reloc_in; + else if (shdr->sh_entsize == bed->s->sizeof_rela) + swap_in = bed->s->swap_reloca_in; + else + { + bfd_set_error (bfd_error_wrong_format); + return FALSE; + } + + erela = external_relocs; + erelaend = erela + NUM_SHDR_ENTRIES (shdr) * shdr->sh_entsize; + irela = internal_relocs; + while (erela < erelaend) + { + (*swap_in) (abfd, erela, irela); + irela += bed->s->int_rels_per_ext_rel; + erela += shdr->sh_entsize; + } + + return TRUE; +} + +/* Read and swap the relocs for a section O. They may have been + cached. If the EXTERNAL_RELOCS and INTERNAL_RELOCS arguments are + not NULL, they are used as buffers to read into. They are known to + be large enough. If the INTERNAL_RELOCS relocs argument is NULL, + the return value is allocated using either malloc or bfd_alloc, + according to the KEEP_MEMORY argument. If O has two relocation + sections (both REL and RELA relocations), then the REL_HDR + relocations will appear first in INTERNAL_RELOCS, followed by the + REL_HDR2 relocations. */ + +Elf_Internal_Rela * +_bfd_elf_link_read_relocs (abfd, o, external_relocs, internal_relocs, + keep_memory) + bfd *abfd; + asection *o; + PTR external_relocs; + Elf_Internal_Rela *internal_relocs; + bfd_boolean keep_memory; +{ + Elf_Internal_Shdr *rel_hdr; + PTR alloc1 = NULL; + Elf_Internal_Rela *alloc2 = NULL; + struct elf_backend_data *bed = get_elf_backend_data (abfd); + + if (elf_section_data (o)->relocs != NULL) + return elf_section_data (o)->relocs; + + if (o->reloc_count == 0) + return NULL; + + rel_hdr = &elf_section_data (o)->rel_hdr; + + if (internal_relocs == NULL) + { + bfd_size_type size; + + size = o->reloc_count; + size *= bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela); + if (keep_memory) + internal_relocs = (Elf_Internal_Rela *) bfd_alloc (abfd, size); + else + internal_relocs = alloc2 = (Elf_Internal_Rela *) bfd_malloc (size); + if (internal_relocs == NULL) + goto error_return; + } + + if (external_relocs == NULL) + { + bfd_size_type size = rel_hdr->sh_size; + + if (elf_section_data (o)->rel_hdr2) + size += elf_section_data (o)->rel_hdr2->sh_size; + alloc1 = (PTR) bfd_malloc (size); + if (alloc1 == NULL) + goto error_return; + external_relocs = alloc1; + } + + if (!elf_link_read_relocs_from_section (abfd, rel_hdr, + external_relocs, + internal_relocs)) + goto error_return; + if (!elf_link_read_relocs_from_section + (abfd, + elf_section_data (o)->rel_hdr2, + ((bfd_byte *) external_relocs) + rel_hdr->sh_size, + internal_relocs + (NUM_SHDR_ENTRIES (rel_hdr) + * bed->s->int_rels_per_ext_rel))) + goto error_return; + + /* Cache the results for next time, if we can. */ + if (keep_memory) + elf_section_data (o)->relocs = internal_relocs; + + if (alloc1 != NULL) + free (alloc1); + + /* Don't free alloc2, since if it was allocated we are passing it + back (under the name of internal_relocs). */ + + return internal_relocs; + + error_return: + if (alloc1 != NULL) + free (alloc1); + if (alloc2 != NULL) + free (alloc2); + return NULL; +} + +/* Compute the size of, and allocate space for, REL_HDR which is the + section header for a section containing relocations for O. */ + +bfd_boolean +_bfd_elf_link_size_reloc_section (abfd, rel_hdr, o) + bfd *abfd; + Elf_Internal_Shdr *rel_hdr; + asection *o; +{ + bfd_size_type reloc_count; + bfd_size_type num_rel_hashes; + + /* Figure out how many relocations there will be. */ + if (rel_hdr == &elf_section_data (o)->rel_hdr) + reloc_count = elf_section_data (o)->rel_count; + else + reloc_count = elf_section_data (o)->rel_count2; + + num_rel_hashes = o->reloc_count; + if (num_rel_hashes < reloc_count) + num_rel_hashes = reloc_count; + + /* That allows us to calculate the size of the section. */ + rel_hdr->sh_size = rel_hdr->sh_entsize * reloc_count; + + /* The contents field must last into write_object_contents, so we + allocate it with bfd_alloc rather than malloc. Also since we + cannot be sure that the contents will actually be filled in, + we zero the allocated space. */ + rel_hdr->contents = (PTR) bfd_zalloc (abfd, rel_hdr->sh_size); + if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0) + return FALSE; + + /* We only allocate one set of hash entries, so we only do it the + first time we are called. */ + if (elf_section_data (o)->rel_hashes == NULL + && num_rel_hashes) + { + struct elf_link_hash_entry **p; + + p = ((struct elf_link_hash_entry **) + bfd_zmalloc (num_rel_hashes + * sizeof (struct elf_link_hash_entry *))); + if (p == NULL) + return FALSE; + + elf_section_data (o)->rel_hashes = p; + } + + return TRUE; +} + +/* Copy the relocations indicated by the INTERNAL_RELOCS (which + originated from the section given by INPUT_REL_HDR) to the + OUTPUT_BFD. */ + +bfd_boolean +_bfd_elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, + internal_relocs) + bfd *output_bfd; + asection *input_section; + Elf_Internal_Shdr *input_rel_hdr; + Elf_Internal_Rela *internal_relocs; +{ + Elf_Internal_Rela *irela; + Elf_Internal_Rela *irelaend; + bfd_byte *erel; + Elf_Internal_Shdr *output_rel_hdr; + asection *output_section; + unsigned int *rel_countp = NULL; + struct elf_backend_data *bed; + void (*swap_out) PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); + + output_section = input_section->output_section; + output_rel_hdr = NULL; + + if (elf_section_data (output_section)->rel_hdr.sh_entsize + == input_rel_hdr->sh_entsize) + { + output_rel_hdr = &elf_section_data (output_section)->rel_hdr; + rel_countp = &elf_section_data (output_section)->rel_count; + } + else if (elf_section_data (output_section)->rel_hdr2 + && (elf_section_data (output_section)->rel_hdr2->sh_entsize + == input_rel_hdr->sh_entsize)) + { + output_rel_hdr = elf_section_data (output_section)->rel_hdr2; + rel_countp = &elf_section_data (output_section)->rel_count2; + } + else + { + (*_bfd_error_handler) + (_("%s: relocation size mismatch in %s section %s"), + bfd_get_filename (output_bfd), + bfd_archive_filename (input_section->owner), + input_section->name); + bfd_set_error (bfd_error_wrong_object_format); + return FALSE; + } + + bed = get_elf_backend_data (output_bfd); + if (input_rel_hdr->sh_entsize == bed->s->sizeof_rel) + swap_out = bed->s->swap_reloc_out; + else if (input_rel_hdr->sh_entsize == bed->s->sizeof_rela) + swap_out = bed->s->swap_reloca_out; + else + abort (); + + erel = output_rel_hdr->contents; + erel += *rel_countp * input_rel_hdr->sh_entsize; + irela = internal_relocs; + irelaend = irela + (NUM_SHDR_ENTRIES (input_rel_hdr) + * bed->s->int_rels_per_ext_rel); + while (irela < irelaend) + { + (*swap_out) (output_bfd, irela, erel); + irela += bed->s->int_rels_per_ext_rel; + erel += input_rel_hdr->sh_entsize; + } + + /* Bump the counter, so that we know where to add the next set of + relocations. */ + *rel_countp += NUM_SHDR_ENTRIES (input_rel_hdr); + + return TRUE; +} + +/* Fix up the flags for a symbol. This handles various cases which + can only be fixed after all the input files are seen. This is + currently called by both adjust_dynamic_symbol and + assign_sym_version, which is unnecessary but perhaps more robust in + the face of future changes. */ + +bfd_boolean +_bfd_elf_fix_symbol_flags (h, eif) + struct elf_link_hash_entry *h; + struct elf_info_failed *eif; +{ + /* If this symbol was mentioned in a non-ELF file, try to set + DEF_REGULAR and REF_REGULAR correctly. This is the only way to + permit a non-ELF file to correctly refer to a symbol defined in + an ELF dynamic object. */ + if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) != 0) + { + while (h->root.type == bfd_link_hash_indirect) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK); + else + { + if (h->root.u.def.section->owner != NULL + && (bfd_get_flavour (h->root.u.def.section->owner) + == bfd_target_elf_flavour)) + h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK); + else + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; + } + + if (h->dynindx == -1 + && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)) + { + if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h)) + { + eif->failed = TRUE; + return FALSE; + } + } + } + else + { + /* Unfortunately, ELF_LINK_NON_ELF is only correct if the symbol + was first seen in a non-ELF file. Fortunately, if the symbol + was first seen in an ELF file, we're probably OK unless the + symbol was defined in a non-ELF file. Catch that case here. + FIXME: We're still in trouble if the symbol was first seen in + a dynamic object, and then later in a non-ELF regular object. */ + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 + && (h->root.u.def.section->owner != NULL + ? (bfd_get_flavour (h->root.u.def.section->owner) + != bfd_target_elf_flavour) + : (bfd_is_abs_section (h->root.u.def.section) + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) == 0))) + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; + } + + /* If this is a final link, and the symbol was defined as a common + symbol in a regular object file, and there was no definition in + any dynamic object, then the linker will have allocated space for + the symbol in a common section but the ELF_LINK_HASH_DEF_REGULAR + flag will not have been set. */ + if (h->root.type == bfd_link_hash_defined + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 + && (h->root.u.def.section->owner->flags & DYNAMIC) == 0) + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; + + /* If -Bsymbolic was used (which means to bind references to global + symbols to the definition within the shared object), and this + symbol was defined in a regular object, then it actually doesn't + need a PLT entry. Likewise, if the symbol has non-default + visibility. If the symbol has hidden or internal visibility, we + will force it local. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0 + && eif->info->shared + && is_elf_hash_table (eif->info) + && (eif->info->symbolic + || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) + { + struct elf_backend_data *bed; + bfd_boolean force_local; + + bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); + + force_local = (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL + || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN); + (*bed->elf_backend_hide_symbol) (eif->info, h, force_local); + } + + /* If a weak undefined symbol has non-default visibility, we also + hide it from the dynamic linker. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + { + struct elf_backend_data *bed; + bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); + (*bed->elf_backend_hide_symbol) (eif->info, h, TRUE); + } + + /* If this is a weak defined symbol in a dynamic object, and we know + the real definition in the dynamic object, copy interesting flags + over to the real definition. */ + if (h->weakdef != NULL) + { + struct elf_link_hash_entry *weakdef; + + weakdef = h->weakdef; + if (h->root.type == bfd_link_hash_indirect) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + BFD_ASSERT (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak); + BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined + || weakdef->root.type == bfd_link_hash_defweak); + BFD_ASSERT (weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC); + + /* If the real definition is defined by a regular object file, + don't do anything special. See the longer description in + _bfd_elf_adjust_dynamic_symbol, below. */ + if ((weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) + h->weakdef = NULL; + else + { + struct elf_backend_data *bed; + + bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); + (*bed->elf_backend_copy_indirect_symbol) (bed, weakdef, h); + } + } + + return TRUE; +} + +/* Make the backend pick a good value for a dynamic symbol. This is + called via elf_link_hash_traverse, and also calls itself + recursively. */ + +bfd_boolean +_bfd_elf_adjust_dynamic_symbol (h, data) + struct elf_link_hash_entry *h; + PTR data; +{ + struct elf_info_failed *eif = (struct elf_info_failed *) data; + bfd *dynobj; + struct elf_backend_data *bed; + + if (! is_elf_hash_table (eif->info)) + return FALSE; + + if (h->root.type == bfd_link_hash_warning) + { + h->plt = elf_hash_table (eif->info)->init_offset; + h->got = elf_hash_table (eif->info)->init_offset; + + /* When warning symbols are created, they **replace** the "real" + entry in the hash table, thus we never get to see the real + symbol in a hash traversal. So look at it now. */ + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } + + /* Ignore indirect symbols. These are added by the versioning code. */ + if (h->root.type == bfd_link_hash_indirect) + return TRUE; + + /* Fix the symbol flags. */ + if (! _bfd_elf_fix_symbol_flags (h, eif)) + return FALSE; + + /* If this symbol does not require a PLT entry, and it is not + defined by a dynamic object, or is not referenced by a regular + object, ignore it. We do have to handle a weak defined symbol, + even if no regular object refers to it, if we decided to add it + to the dynamic symbol table. FIXME: Do we normally need to worry + about symbols which are defined by one dynamic object and + referenced by another one? */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0 + && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 + || ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0 + && (h->weakdef == NULL || h->weakdef->dynindx == -1)))) + { + h->plt = elf_hash_table (eif->info)->init_offset; + return TRUE; + } + + /* If we've already adjusted this symbol, don't do it again. This + can happen via a recursive call. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + return TRUE; + + /* Don't look at this symbol again. Note that we must set this + after checking the above conditions, because we may look at a + symbol once, decide not to do anything, and then get called + recursively later after REF_REGULAR is set below. */ + h->elf_link_hash_flags |= ELF_LINK_HASH_DYNAMIC_ADJUSTED; + + /* If this is a weak definition, and we know a real definition, and + the real symbol is not itself defined by a regular object file, + then get a good value for the real definition. We handle the + real symbol first, for the convenience of the backend routine. + + Note that there is a confusing case here. If the real definition + is defined by a regular object file, we don't get the real symbol + from the dynamic object, but we do get the weak symbol. If the + processor backend uses a COPY reloc, then if some routine in the + dynamic object changes the real symbol, we will not see that + change in the corresponding weak symbol. This is the way other + ELF linkers work as well, and seems to be a result of the shared + library model. + + I will clarify this issue. Most SVR4 shared libraries define the + variable _timezone and define timezone as a weak synonym. The + tzset call changes _timezone. If you write + extern int timezone; + int _timezone = 5; + int main () { tzset (); printf ("%d %d\n", timezone, _timezone); } + you might expect that, since timezone is a synonym for _timezone, + the same number will print both times. However, if the processor + backend uses a COPY reloc, then actually timezone will be copied + into your process image, and, since you define _timezone + yourself, _timezone will not. Thus timezone and _timezone will + wind up at different memory locations. The tzset call will set + _timezone, leaving timezone unchanged. */ + + if (h->weakdef != NULL) + { + /* If we get to this point, we know there is an implicit + reference by a regular object file via the weak symbol H. + FIXME: Is this really true? What if the traversal finds + H->WEAKDEF before it finds H? */ + h->weakdef->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR; + + if (! _bfd_elf_adjust_dynamic_symbol (h->weakdef, (PTR) eif)) + return FALSE; + } + + /* If a symbol has no type and no size and does not require a PLT + entry, then we are probably about to do the wrong thing here: we + are probably going to create a COPY reloc for an empty object. + This case can arise when a shared object is built with assembly + code, and the assembly code fails to set the symbol type. */ + if (h->size == 0 + && h->type == STT_NOTYPE + && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0) + (*_bfd_error_handler) + (_("warning: type and size of dynamic symbol `%s' are not defined"), + h->root.root.string); + + dynobj = elf_hash_table (eif->info)->dynobj; + bed = get_elf_backend_data (dynobj); + if (! (*bed->elf_backend_adjust_dynamic_symbol) (eif->info, h)) + { + eif->failed = TRUE; + return FALSE; + } + + return TRUE; +} + +/* Adjust all external symbols pointing into SEC_MERGE sections + to reflect the object merging within the sections. */ + +bfd_boolean +_bfd_elf_link_sec_merge_syms (h, data) + struct elf_link_hash_entry *h; + PTR data; +{ + asection *sec; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && ((sec = h->root.u.def.section)->flags & SEC_MERGE) + && sec->sec_info_type == ELF_INFO_TYPE_MERGE) + { + bfd *output_bfd = (bfd *) data; + + h->root.u.def.value = + _bfd_merged_section_offset (output_bfd, + &h->root.u.def.section, + elf_section_data (sec)->sec_info, + h->root.u.def.value, (bfd_vma) 0); + } + + return TRUE; +} diff --git a/bfd/elflink.h b/bfd/elflink.h index 61505e0..7b32491 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -20,16 +20,6 @@ /* ELF linker code. */ -/* This struct is used to pass information to routines called via - elf_link_hash_traverse which must return failure. */ - -struct elf_info_failed -{ - bfd_boolean failed; - struct bfd_link_info *info; - struct bfd_elf_version_tree *verdefs; -}; - static bfd_boolean is_global_data_symbol_definition PARAMS ((bfd *, Elf_Internal_Sym *)); static bfd_boolean elf_link_is_defined_archive_symbol @@ -38,37 +28,12 @@ static bfd_boolean elf_link_add_object_symbols PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean elf_link_add_archive_symbols PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean elf_merge_symbol - PARAMS ((bfd *, struct bfd_link_info *, const char *, - Elf_Internal_Sym *, asection **, bfd_vma *, - struct elf_link_hash_entry **, bfd_boolean *, bfd_boolean *, - bfd_boolean *, bfd_boolean *, bfd_boolean)); -static bfd_boolean elf_add_default_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - const char *, Elf_Internal_Sym *, asection **, bfd_vma *, - bfd_boolean *, bfd_boolean, bfd_boolean)); -static bfd_boolean elf_export_symbol - PARAMS ((struct elf_link_hash_entry *, PTR)); static bfd_boolean elf_finalize_dynstr PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean elf_fix_symbol_flags - PARAMS ((struct elf_link_hash_entry *, struct elf_info_failed *)); -static bfd_boolean elf_adjust_dynamic_symbol - PARAMS ((struct elf_link_hash_entry *, PTR)); -static bfd_boolean elf_link_find_version_dependencies - PARAMS ((struct elf_link_hash_entry *, PTR)); -static bfd_boolean elf_link_assign_sym_version - PARAMS ((struct elf_link_hash_entry *, PTR)); static bfd_boolean elf_collect_hash_codes PARAMS ((struct elf_link_hash_entry *, PTR)); -static bfd_boolean elf_link_read_relocs_from_section - PARAMS ((bfd *, Elf_Internal_Shdr *, PTR, Elf_Internal_Rela *)); static size_t compute_bucket_count PARAMS ((struct bfd_link_info *)); -static bfd_boolean elf_link_output_relocs - PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *)); -static bfd_boolean elf_link_size_reloc_section - PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); static void elf_link_adjust_relocs PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned int, struct elf_link_hash_entry **)); @@ -450,772 +415,6 @@ elf_link_add_archive_symbols (abfd, info) return FALSE; } -/* This function is called when we want to define a new symbol. It - handles the various cases which arise when we find a definition in - a dynamic object, or when there is already a definition in a - dynamic object. The new symbol is described by NAME, SYM, PSEC, - and PVALUE. We set SYM_HASH to the hash table entry. We set - OVERRIDE if the old symbol is overriding a new definition. We set - TYPE_CHANGE_OK if it is OK for the type to change. We set - SIZE_CHANGE_OK if it is OK for the size to change. By OK to - change, we mean that we shouldn't warn if the type or size does - change. DT_NEEDED indicates if it comes from a DT_NEEDED entry of - a shared object. */ - -static bfd_boolean -elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, skip, - override, type_change_ok, size_change_ok, dt_needed) - bfd *abfd; - struct bfd_link_info *info; - const char *name; - Elf_Internal_Sym *sym; - asection **psec; - bfd_vma *pvalue; - struct elf_link_hash_entry **sym_hash; - bfd_boolean *skip; - bfd_boolean *override; - bfd_boolean *type_change_ok; - bfd_boolean *size_change_ok; - bfd_boolean dt_needed; -{ - asection *sec; - struct elf_link_hash_entry *h; - struct elf_link_hash_entry *flip; - int bind; - bfd *oldbfd; - bfd_boolean newdyn, olddyn, olddef, newdef, newdyncommon, olddyncommon; - - *skip = FALSE; - *override = FALSE; - - sec = *psec; - bind = ELF_ST_BIND (sym->st_info); - - if (! bfd_is_und_section (sec)) - h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, FALSE, FALSE); - else - h = ((struct elf_link_hash_entry *) - bfd_wrapped_link_hash_lookup (abfd, info, name, TRUE, FALSE, FALSE)); - if (h == NULL) - return FALSE; - *sym_hash = h; - - /* This code is for coping with dynamic objects, and is only useful - if we are doing an ELF link. */ - if (info->hash->creator != abfd->xvec) - return TRUE; - - /* For merging, we only care about real symbols. */ - - while (h->root.type == bfd_link_hash_indirect - || h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - /* If we just created the symbol, mark it as being an ELF symbol. - Other than that, there is nothing to do--there is no merge issue - with a newly defined symbol--so we just return. */ - - if (h->root.type == bfd_link_hash_new) - { - h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF; - return TRUE; - } - - /* OLDBFD is a BFD associated with the existing symbol. */ - - switch (h->root.type) - { - default: - oldbfd = NULL; - break; - - case bfd_link_hash_undefined: - case bfd_link_hash_undefweak: - oldbfd = h->root.u.undef.abfd; - break; - - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - oldbfd = h->root.u.def.section->owner; - break; - - case bfd_link_hash_common: - oldbfd = h->root.u.c.p->section->owner; - break; - } - - /* In cases involving weak versioned symbols, we may wind up trying - to merge a symbol with itself. Catch that here, to avoid the - confusion that results if we try to override a symbol with - itself. The additional tests catch cases like - _GLOBAL_OFFSET_TABLE_, which are regular symbols defined in a - dynamic object, which we do want to handle here. */ - if (abfd == oldbfd - && ((abfd->flags & DYNAMIC) == 0 - || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) - return TRUE; - - /* NEWDYN and OLDDYN indicate whether the new or old symbol, - respectively, is from a dynamic object. */ - - if ((abfd->flags & DYNAMIC) != 0) - newdyn = TRUE; - else - newdyn = FALSE; - - if (oldbfd != NULL) - olddyn = (oldbfd->flags & DYNAMIC) != 0; - else - { - asection *hsec; - - /* This code handles the special SHN_MIPS_{TEXT,DATA} section - indices used by MIPS ELF. */ - switch (h->root.type) - { - default: - hsec = NULL; - break; - - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - hsec = h->root.u.def.section; - break; - - case bfd_link_hash_common: - hsec = h->root.u.c.p->section; - break; - } - - if (hsec == NULL) - olddyn = FALSE; - else - olddyn = (hsec->symbol->flags & BSF_DYNAMIC) != 0; - } - - /* NEWDEF and OLDDEF indicate whether the new or old symbol, - respectively, appear to be a definition rather than reference. */ - - if (bfd_is_und_section (sec) || bfd_is_com_section (sec)) - newdef = FALSE; - else - newdef = TRUE; - - if (h->root.type == bfd_link_hash_undefined - || h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_common) - olddef = FALSE; - else - olddef = TRUE; - - /* We need to rememeber if a symbol has a definition in a dynamic - object or is weak in all dynamic objects. Internal and hidden - visibility will make it unavailable to dynamic objects. */ - if (newdyn && (h->elf_link_hash_flags & ELF_LINK_DYNAMIC_DEF) == 0) - { - if (!bfd_is_und_section (sec)) - h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_DEF; - else - { - /* Check if this symbol is weak in all dynamic objects. If it - is the first time we see it in a dynamic object, we mark - if it is weak. Otherwise, we clear it. */ - if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0) - { - if (bind == STB_WEAK) - h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_WEAK; - } - else if (bind != STB_WEAK) - h->elf_link_hash_flags &= ~ELF_LINK_DYNAMIC_WEAK; - } - } - - /* If the old symbol has non-default visibility, we ignore the new - definition from a dynamic object. */ - if (newdyn - && ELF_ST_VISIBILITY (h->other) - && !bfd_is_und_section (sec)) - { - *skip = TRUE; - /* Make sure this symbol is dynamic. */ - h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; - /* FIXME: Should we check type and size for protected symbol? */ - return _bfd_elf_link_record_dynamic_symbol (info, h); - } - else if (!newdyn - && ELF_ST_VISIBILITY (sym->st_other) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0) - { - /* If the new symbol with non-default visibility comes from a - relocatable file and the old definition comes from a dynamic - object, we remove the old definition. */ - h->root.type = bfd_link_hash_new; - h->root.u.undef.abfd = NULL; - h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC; - h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; - /* FIXME: Should we check type and size for protected symbol? */ - h->size = 0; - h->type = 0; - return TRUE; - } - - /* NEWDYNCOMMON and OLDDYNCOMMON indicate whether the new or old - symbol, respectively, appears to be a common symbol in a dynamic - object. If a symbol appears in an uninitialized section, and is - not weak, and is not a function, then it may be a common symbol - which was resolved when the dynamic object was created. We want - to treat such symbols specially, because they raise special - considerations when setting the symbol size: if the symbol - appears as a common symbol in a regular object, and the size in - the regular object is larger, we must make sure that we use the - larger size. This problematic case can always be avoided in C, - but it must be handled correctly when using Fortran shared - libraries. - - Note that if NEWDYNCOMMON is set, NEWDEF will be set, and - likewise for OLDDYNCOMMON and OLDDEF. - - Note that this test is just a heuristic, and that it is quite - possible to have an uninitialized symbol in a shared object which - is really a definition, rather than a common symbol. This could - lead to some minor confusion when the symbol really is a common - symbol in some regular object. However, I think it will be - harmless. */ - - if (newdyn - && newdef - && (sec->flags & SEC_ALLOC) != 0 - && (sec->flags & SEC_LOAD) == 0 - && sym->st_size > 0 - && bind != STB_WEAK - && ELF_ST_TYPE (sym->st_info) != STT_FUNC) - newdyncommon = TRUE; - else - newdyncommon = FALSE; - - if (olddyn - && olddef - && h->root.type == bfd_link_hash_defined - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (h->root.u.def.section->flags & SEC_ALLOC) != 0 - && (h->root.u.def.section->flags & SEC_LOAD) == 0 - && h->size > 0 - && h->type != STT_FUNC) - olddyncommon = TRUE; - else - olddyncommon = FALSE; - - /* It's OK to change the type if either the existing symbol or the - new symbol is weak unless it comes from a DT_NEEDED entry of - a shared object, in which case, the DT_NEEDED entry may not be - required at the run time. */ - - if ((! dt_needed && h->root.type == bfd_link_hash_defweak) - || h->root.type == bfd_link_hash_undefweak - || bind == STB_WEAK) - *type_change_ok = TRUE; - - /* It's OK to change the size if either the existing symbol or the - new symbol is weak, or if the old symbol is undefined. */ - - if (*type_change_ok - || h->root.type == bfd_link_hash_undefined) - *size_change_ok = TRUE; - - /* If both the old and the new symbols look like common symbols in a - dynamic object, set the size of the symbol to the larger of the - two. */ - - if (olddyncommon - && newdyncommon - && sym->st_size != h->size) - { - /* Since we think we have two common symbols, issue a multiple - common warning if desired. Note that we only warn if the - size is different. If the size is the same, we simply let - the old symbol override the new one as normally happens with - symbols defined in dynamic objects. */ - - if (! ((*info->callbacks->multiple_common) - (info, h->root.root.string, oldbfd, bfd_link_hash_common, - h->size, abfd, bfd_link_hash_common, sym->st_size))) - return FALSE; - - if (sym->st_size > h->size) - h->size = sym->st_size; - - *size_change_ok = TRUE; - } - - /* If we are looking at a dynamic object, and we have found a - definition, we need to see if the symbol was already defined by - some other object. If so, we want to use the existing - definition, and we do not want to report a multiple symbol - definition error; we do this by clobbering *PSEC to be - bfd_und_section_ptr. - - We treat a common symbol as a definition if the symbol in the - shared library is a function, since common symbols always - represent variables; this can cause confusion in principle, but - any such confusion would seem to indicate an erroneous program or - shared library. We also permit a common symbol in a regular - object to override a weak symbol in a shared object. - - We prefer a non-weak definition in a shared library to a weak - definition in the executable unless it comes from a DT_NEEDED - entry of a shared object, in which case, the DT_NEEDED entry - may not be required at the run time. */ - - if (newdyn - && newdef - && (olddef - || (h->root.type == bfd_link_hash_common - && (bind == STB_WEAK - || ELF_ST_TYPE (sym->st_info) == STT_FUNC))) - && (h->root.type != bfd_link_hash_defweak - || dt_needed - || bind == STB_WEAK)) - { - *override = TRUE; - newdef = FALSE; - newdyncommon = FALSE; - - *psec = sec = bfd_und_section_ptr; - *size_change_ok = TRUE; - - /* If we get here when the old symbol is a common symbol, then - we are explicitly letting it override a weak symbol or - function in a dynamic object, and we don't want to warn about - a type change. If the old symbol is a defined symbol, a type - change warning may still be appropriate. */ - - if (h->root.type == bfd_link_hash_common) - *type_change_ok = TRUE; - } - - /* Handle the special case of an old common symbol merging with a - new symbol which looks like a common symbol in a shared object. - We change *PSEC and *PVALUE to make the new symbol look like a - common symbol, and let _bfd_generic_link_add_one_symbol will do - the right thing. */ - - if (newdyncommon - && h->root.type == bfd_link_hash_common) - { - *override = TRUE; - newdef = FALSE; - newdyncommon = FALSE; - *pvalue = sym->st_size; - *psec = sec = bfd_com_section_ptr; - *size_change_ok = TRUE; - } - - /* If the old symbol is from a dynamic object, and the new symbol is - a definition which is not from a dynamic object, then the new - symbol overrides the old symbol. Symbols from regular files - always take precedence over symbols from dynamic objects, even if - they are defined after the dynamic object in the link. - - As above, we again permit a common symbol in a regular object to - override a definition in a shared object if the shared object - symbol is a function or is weak. - - As above, we permit a non-weak definition in a shared object to - override a weak definition in a regular object. */ - - flip = NULL; - if (! newdyn - && (newdef - || (bfd_is_com_section (sec) - && (h->root.type == bfd_link_hash_defweak - || h->type == STT_FUNC))) - && olddyn - && olddef - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (bind != STB_WEAK - || h->root.type == bfd_link_hash_defweak)) - { - /* Change the hash table entry to undefined, and let - _bfd_generic_link_add_one_symbol do the right thing with the - new definition. */ - - h->root.type = bfd_link_hash_undefined; - h->root.u.undef.abfd = h->root.u.def.section->owner; - *size_change_ok = TRUE; - - olddef = FALSE; - olddyncommon = FALSE; - - /* We again permit a type change when a common symbol may be - overriding a function. */ - - if (bfd_is_com_section (sec)) - *type_change_ok = TRUE; - - if ((*sym_hash)->root.type == bfd_link_hash_indirect) - flip = *sym_hash; - else - /* This union may have been set to be non-NULL when this symbol - was seen in a dynamic object. We must force the union to be - NULL, so that it is correct for a regular symbol. */ - h->verinfo.vertree = NULL; - } - - /* Handle the special case of a new common symbol merging with an - old symbol that looks like it might be a common symbol defined in - a shared object. Note that we have already handled the case in - which a new common symbol should simply override the definition - in the shared library. */ - - if (! newdyn - && bfd_is_com_section (sec) - && olddyncommon) - { - /* It would be best if we could set the hash table entry to a - common symbol, but we don't know what to use for the section - or the alignment. */ - if (! ((*info->callbacks->multiple_common) - (info, h->root.root.string, oldbfd, bfd_link_hash_common, - h->size, abfd, bfd_link_hash_common, sym->st_size))) - return FALSE; - - /* If the predumed common symbol in the dynamic object is - larger, pretend that the new symbol has its size. */ - - if (h->size > *pvalue) - *pvalue = h->size; - - /* FIXME: We no longer know the alignment required by the symbol - in the dynamic object, so we just wind up using the one from - the regular object. */ - - olddef = FALSE; - olddyncommon = FALSE; - - h->root.type = bfd_link_hash_undefined; - h->root.u.undef.abfd = h->root.u.def.section->owner; - - *size_change_ok = TRUE; - *type_change_ok = TRUE; - - if ((*sym_hash)->root.type == bfd_link_hash_indirect) - flip = *sym_hash; - else - h->verinfo.vertree = NULL; - } - - if (flip != NULL) - { - /* Handle the case where we had a versioned symbol in a dynamic - library and now find a definition in a normal object. In this - case, we make the versioned symbol point to the normal one. */ - struct elf_backend_data *bed = get_elf_backend_data (abfd); - flip->root.type = h->root.type; - h->root.type = bfd_link_hash_indirect; - h->root.u.i.link = (struct bfd_link_hash_entry *) flip; - (*bed->elf_backend_copy_indirect_symbol) (bed, flip, h); - flip->root.u.undef.abfd = h->root.u.undef.abfd; - if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) - { - h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC; - flip->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; - } - } - - /* Handle the special case of a weak definition in a regular object - followed by a non-weak definition in a shared object. In this - case, we prefer the definition in the shared object unless it - comes from a DT_NEEDED entry of a shared object, in which case, - the DT_NEEDED entry may not be required at the run time. */ - if (olddef - && ! dt_needed - && h->root.type == bfd_link_hash_defweak - && newdef - && newdyn - && bind != STB_WEAK) - { - /* To make this work we have to frob the flags so that the rest - of the code does not think we are using the regular - definition. */ - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) - h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR; - else if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0) - h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; - h->elf_link_hash_flags &= ~ (ELF_LINK_HASH_DEF_REGULAR - | ELF_LINK_HASH_DEF_DYNAMIC); - - /* If H is the target of an indirection, we want the caller to - use H rather than the indirect symbol. Otherwise if we are - defining a new indirect symbol we will wind up attaching it - to the entry we are overriding. */ - *sym_hash = h; - } - - /* Handle the special case of a non-weak definition in a shared - object followed by a weak definition in a regular object. In - this case we prefer the definition in the shared object. To make - this work we have to tell the caller to not treat the new symbol - as a definition. */ - if (olddef - && olddyn - && h->root.type != bfd_link_hash_defweak - && newdef - && ! newdyn - && bind == STB_WEAK) - *override = TRUE; - - return TRUE; -} - -/* This function is called to create an indirect symbol from the - default for the symbol with the default version if needed. The - symbol is described by H, NAME, SYM, PSEC, VALUE, and OVERRIDE. We - set DYNSYM if the new indirect symbol is dynamic. DT_NEEDED - indicates if it comes from a DT_NEEDED entry of a shared object. */ - -static bfd_boolean -elf_add_default_symbol (abfd, info, h, name, sym, psec, value, - dynsym, override, dt_needed) - bfd *abfd; - struct bfd_link_info *info; - struct elf_link_hash_entry *h; - const char *name; - Elf_Internal_Sym *sym; - asection **psec; - bfd_vma *value; - bfd_boolean *dynsym; - bfd_boolean override; - bfd_boolean dt_needed; -{ - bfd_boolean type_change_ok; - bfd_boolean size_change_ok; - bfd_boolean skip; - char *shortname; - struct elf_link_hash_entry *hi; - struct bfd_link_hash_entry *bh; - struct elf_backend_data *bed; - bfd_boolean collect; - bfd_boolean dynamic; - char *p; - size_t len, shortlen; - asection *sec; - - /* If this symbol has a version, and it is the default version, we - create an indirect symbol from the default name to the fully - decorated name. This will cause external references which do not - specify a version to be bound to this version of the symbol. */ - p = strchr (name, ELF_VER_CHR); - if (p == NULL || p[1] != ELF_VER_CHR) - return TRUE; - - if (override) - { - /* We are overridden by an old defition. We need to check if we - need to create the indirect symbol from the default name. */ - hi = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, - FALSE, FALSE); - BFD_ASSERT (hi != NULL); - if (hi == h) - return TRUE; - while (hi->root.type == bfd_link_hash_indirect - || hi->root.type == bfd_link_hash_warning) - { - hi = (struct elf_link_hash_entry *) hi->root.u.i.link; - if (hi == h) - return TRUE; - } - } - - bed = get_elf_backend_data (abfd); - collect = bed->collect; - dynamic = (abfd->flags & DYNAMIC) != 0; - - shortlen = p - name; - shortname = bfd_hash_allocate (&info->hash->table, shortlen + 1); - if (shortname == NULL) - return FALSE; - memcpy (shortname, name, shortlen); - shortname[shortlen] = '\0'; - - /* We are going to create a new symbol. Merge it with any existing - symbol with this name. For the purposes of the merge, act as - though we were defining the symbol we just defined, although we - actually going to define an indirect symbol. */ - type_change_ok = FALSE; - size_change_ok = FALSE; - sec = *psec; - if (! elf_merge_symbol (abfd, info, shortname, sym, &sec, value, - &hi, &skip, &override, &type_change_ok, - &size_change_ok, dt_needed)) - return FALSE; - - if (! override) - { - bh = &hi->root; - if (! (_bfd_generic_link_add_one_symbol - (info, abfd, shortname, BSF_INDIRECT, bfd_ind_section_ptr, - (bfd_vma) 0, name, FALSE, collect, &bh))) - return FALSE; - hi = (struct elf_link_hash_entry *) bh; - } - else - { - /* In this case the symbol named SHORTNAME is overriding the - indirect symbol we want to add. We were planning on making - SHORTNAME an indirect symbol referring to NAME. SHORTNAME - is the name without a version. NAME is the fully versioned - name, and it is the default version. - - Overriding means that we already saw a definition for the - symbol SHORTNAME in a regular object, and it is overriding - the symbol defined in the dynamic object. - - When this happens, we actually want to change NAME, the - symbol we just added, to refer to SHORTNAME. This will cause - references to NAME in the shared object to become references - to SHORTNAME in the regular object. This is what we expect - when we override a function in a shared object: that the - references in the shared object will be mapped to the - definition in the regular object. */ - - while (hi->root.type == bfd_link_hash_indirect - || hi->root.type == bfd_link_hash_warning) - hi = (struct elf_link_hash_entry *) hi->root.u.i.link; - - h->root.type = bfd_link_hash_indirect; - h->root.u.i.link = (struct bfd_link_hash_entry *) hi; - if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) - { - h->elf_link_hash_flags &=~ ELF_LINK_HASH_DEF_DYNAMIC; - hi->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; - if (hi->elf_link_hash_flags - & (ELF_LINK_HASH_REF_REGULAR - | ELF_LINK_HASH_DEF_REGULAR)) - { - if (! _bfd_elf_link_record_dynamic_symbol (info, hi)) - return FALSE; - } - } - - /* Now set HI to H, so that the following code will set the - other fields correctly. */ - hi = h; - } - - /* If there is a duplicate definition somewhere, then HI may not - point to an indirect symbol. We will have reported an error to - the user in that case. */ - - if (hi->root.type == bfd_link_hash_indirect) - { - struct elf_link_hash_entry *ht; - - /* If the symbol became indirect, then we assume that we have - not seen a definition before. */ - BFD_ASSERT ((hi->elf_link_hash_flags - & (ELF_LINK_HASH_DEF_DYNAMIC - | ELF_LINK_HASH_DEF_REGULAR)) == 0); - - ht = (struct elf_link_hash_entry *) hi->root.u.i.link; - (*bed->elf_backend_copy_indirect_symbol) (bed, ht, hi); - - /* See if the new flags lead us to realize that the symbol must - be dynamic. */ - if (! *dynsym) - { - if (! dynamic) - { - if (info->shared - || ((hi->elf_link_hash_flags - & ELF_LINK_HASH_REF_DYNAMIC) != 0)) - *dynsym = TRUE; - } - else - { - if ((hi->elf_link_hash_flags - & ELF_LINK_HASH_REF_REGULAR) != 0) - *dynsym = TRUE; - } - } - } - - /* We also need to define an indirection from the nondefault version - of the symbol. */ - - len = strlen (name); - shortname = bfd_hash_allocate (&info->hash->table, len); - if (shortname == NULL) - return FALSE; - memcpy (shortname, name, shortlen); - memcpy (shortname + shortlen, p + 1, len - shortlen); - - /* Once again, merge with any existing symbol. */ - type_change_ok = FALSE; - size_change_ok = FALSE; - sec = *psec; - if (! elf_merge_symbol (abfd, info, shortname, sym, &sec, value, - &hi, &skip, &override, &type_change_ok, - &size_change_ok, dt_needed)) - return FALSE; - - if (override) - { - /* Here SHORTNAME is a versioned name, so we don't expect to see - the type of override we do in the case above unless it is - overridden by a versioned definiton. */ - if (hi->root.type != bfd_link_hash_defined - && hi->root.type != bfd_link_hash_defweak) - (*_bfd_error_handler) - (_("%s: warning: unexpected redefinition of indirect versioned symbol `%s'"), - bfd_archive_filename (abfd), shortname); - } - else - { - bh = &hi->root; - if (! (_bfd_generic_link_add_one_symbol - (info, abfd, shortname, BSF_INDIRECT, - bfd_ind_section_ptr, (bfd_vma) 0, name, FALSE, collect, &bh))) - return FALSE; - hi = (struct elf_link_hash_entry *) bh; - - /* If there is a duplicate definition somewhere, then HI may not - point to an indirect symbol. We will have reported an error - to the user in that case. */ - - if (hi->root.type == bfd_link_hash_indirect) - { - /* If the symbol became indirect, then we assume that we have - not seen a definition before. */ - BFD_ASSERT ((hi->elf_link_hash_flags - & (ELF_LINK_HASH_DEF_DYNAMIC - | ELF_LINK_HASH_DEF_REGULAR)) == 0); - - (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi); - - /* See if the new flags lead us to realize that the symbol - must be dynamic. */ - if (! *dynsym) - { - if (! dynamic) - { - if (info->shared - || ((hi->elf_link_hash_flags - & ELF_LINK_HASH_REF_DYNAMIC) != 0)) - *dynsym = TRUE; - } - else - { - if ((hi->elf_link_hash_flags - & ELF_LINK_HASH_REF_REGULAR) != 0) - *dynsym = TRUE; - } - } - } - } - - return TRUE; -} - /* Add symbols from an ELF object file to the linker hash table. */ static bfd_boolean @@ -1358,7 +557,7 @@ elf_link_add_object_symbols (abfd, info) && ! hash_table->dynamic_sections_created && abfd->xvec == info->hash->creator) { - if (! elf_link_create_dynamic_sections (abfd, info)) + if (! _bfd_elf_link_create_dynamic_sections (abfd, info)) goto error_return; } } @@ -1548,7 +747,7 @@ elf_link_add_object_symbols (abfd, info) /* If this is the first dynamic object found in the link, create the special sections required for dynamic linking. */ if (! hash_table->dynamic_sections_created) - if (! elf_link_create_dynamic_sections (abfd, info)) + if (! _bfd_elf_link_create_dynamic_sections (abfd, info)) goto error_return; if (add_needed) @@ -1893,10 +1092,10 @@ elf_link_add_object_symbols (abfd, info) } } - if (! elf_merge_symbol (abfd, info, name, isym, &sec, &value, - sym_hash, &skip, &override, - &type_change_ok, &size_change_ok, - dt_needed)) + if (!_bfd_elf_merge_symbol (abfd, info, name, isym, &sec, &value, + sym_hash, &skip, &override, + &type_change_ok, &size_change_ok, + dt_needed)) goto error_free_vers; if (skip) @@ -2146,9 +1345,9 @@ elf_link_add_object_symbols (abfd, info) /* Check to see if we need to add an indirect symbol for the default name. */ if (definition || h->root.type == bfd_link_hash_common) - if (! elf_add_default_symbol (abfd, info, h, name, isym, - &sec, &value, &dynsym, - override, dt_needed)) + if (!_bfd_elf_add_default_symbol (abfd, info, h, name, isym, + &sec, &value, &dynsym, + override, dt_needed)) goto error_free_vers; if (definition && !dynamic) @@ -2409,10 +1608,10 @@ elf_link_add_object_symbols (abfd, info) || bfd_is_abs_section (o->output_section)) continue; - internal_relocs = (NAME(_bfd_elf,link_read_relocs) - (abfd, o, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory)); + internal_relocs + = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (internal_relocs == NULL) goto error_return; @@ -2508,148 +1707,6 @@ elf_link_add_object_symbols (abfd, info) return FALSE; } -/* Create some sections which will be filled in with dynamic linking - information. ABFD is an input file which requires dynamic sections - to be created. The dynamic sections take up virtual memory space - when the final executable is run, so we need to create them before - addresses are assigned to the output sections. We work out the - actual contents and size of these sections later. */ - -bfd_boolean -elf_link_create_dynamic_sections (abfd, info) - bfd *abfd; - struct bfd_link_info *info; -{ - flagword flags; - register asection *s; - struct elf_link_hash_entry *h; - struct bfd_link_hash_entry *bh; - struct elf_backend_data *bed; - - if (! is_elf_hash_table (info)) - return FALSE; - - if (elf_hash_table (info)->dynamic_sections_created) - return TRUE; - - /* Make sure that all dynamic sections use the same input BFD. */ - if (elf_hash_table (info)->dynobj == NULL) - elf_hash_table (info)->dynobj = abfd; - else - abfd = elf_hash_table (info)->dynobj; - - /* Note that we set the SEC_IN_MEMORY flag for all of these - sections. */ - flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS - | SEC_IN_MEMORY | SEC_LINKER_CREATED); - - /* A dynamically linked executable has a .interp section, but a - shared library does not. */ - if (! info->shared) - { - s = bfd_make_section (abfd, ".interp"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)) - return FALSE; - } - - if (! info->traditional_format - && info->hash->creator->flavour == bfd_target_elf_flavour) - { - s = bfd_make_section (abfd, ".eh_frame_hdr"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) - || ! bfd_set_section_alignment (abfd, s, 2)) - return FALSE; - elf_hash_table (info)->eh_info.hdr_sec = s; - } - - /* Create sections to hold version informations. These are removed - if they are not needed. */ - s = bfd_make_section (abfd, ".gnu.version_d"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) - || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN)) - return FALSE; - - s = bfd_make_section (abfd, ".gnu.version"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) - || ! bfd_set_section_alignment (abfd, s, 1)) - return FALSE; - - s = bfd_make_section (abfd, ".gnu.version_r"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) - || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN)) - return FALSE; - - s = bfd_make_section (abfd, ".dynsym"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) - || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN)) - return FALSE; - - s = bfd_make_section (abfd, ".dynstr"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)) - return FALSE; - - /* Create a strtab to hold the dynamic symbol names. */ - if (elf_hash_table (info)->dynstr == NULL) - { - elf_hash_table (info)->dynstr = _bfd_elf_strtab_init (); - if (elf_hash_table (info)->dynstr == NULL) - return FALSE; - } - - s = bfd_make_section (abfd, ".dynamic"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags) - || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN)) - return FALSE; - - /* The special symbol _DYNAMIC is always set to the start of the - .dynamic section. This call occurs before we have processed the - symbols for any dynamic object, so we don't have to worry about - overriding a dynamic definition. We could set _DYNAMIC in a - linker script, but we only want to define it if we are, in fact, - creating a .dynamic section. We don't want to define it if there - is no .dynamic section, since on some ELF platforms the start up - code examines it to decide how to initialize the process. */ - bh = NULL; - if (! (_bfd_generic_link_add_one_symbol - (info, abfd, "_DYNAMIC", BSF_GLOBAL, s, (bfd_vma) 0, - (const char *) 0, FALSE, get_elf_backend_data (abfd)->collect, &bh))) - return FALSE; - h = (struct elf_link_hash_entry *) bh; - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - h->type = STT_OBJECT; - - if (info->shared - && ! _bfd_elf_link_record_dynamic_symbol (info, h)) - return FALSE; - - bed = get_elf_backend_data (abfd); - - s = bfd_make_section (abfd, ".hash"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) - || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN)) - return FALSE; - elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry; - - /* Let the backend create the rest of the sections. This lets the - backend set the right flags. The backend will normally create - the .got and .plt sections. */ - if (! (*bed->elf_backend_create_dynamic_sections) (abfd, info)) - return FALSE; - - elf_hash_table (info)->dynamic_sections_created = TRUE; - - return TRUE; -} - /* Add an entry to the .dynamic table. */ bfd_boolean @@ -2688,251 +1745,6 @@ elf_add_dynamic_entry (info, tag, val) return TRUE; } -/* Read and swap the relocs from the section indicated by SHDR. This - may be either a REL or a RELA section. The relocations are - translated into RELA relocations and stored in INTERNAL_RELOCS, - which should have already been allocated to contain enough space. - The EXTERNAL_RELOCS are a buffer where the external form of the - relocations should be stored. - - Returns FALSE if something goes wrong. */ - -static bfd_boolean -elf_link_read_relocs_from_section (abfd, shdr, external_relocs, - internal_relocs) - bfd *abfd; - Elf_Internal_Shdr *shdr; - PTR external_relocs; - Elf_Internal_Rela *internal_relocs; -{ - struct elf_backend_data *bed; - void (*swap_in) PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); - const bfd_byte *erela; - const bfd_byte *erelaend; - Elf_Internal_Rela *irela; - - /* If there aren't any relocations, that's OK. */ - if (!shdr) - return TRUE; - - /* Position ourselves at the start of the section. */ - if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0) - return FALSE; - - /* Read the relocations. */ - if (bfd_bread (external_relocs, shdr->sh_size, abfd) != shdr->sh_size) - return FALSE; - - bed = get_elf_backend_data (abfd); - - /* Convert the external relocations to the internal format. */ - if (shdr->sh_entsize == sizeof (Elf_External_Rel)) - swap_in = bed->s->swap_reloc_in; - else if (shdr->sh_entsize == sizeof (Elf_External_Rela)) - swap_in = bed->s->swap_reloca_in; - else - { - bfd_set_error (bfd_error_wrong_format); - return FALSE; - } - - erela = external_relocs; - erelaend = erela + NUM_SHDR_ENTRIES (shdr) * shdr->sh_entsize; - irela = internal_relocs; - while (erela < erelaend) - { - (*swap_in) (abfd, erela, irela); - irela += bed->s->int_rels_per_ext_rel; - erela += shdr->sh_entsize; - } - - return TRUE; -} - -/* Read and swap the relocs for a section O. They may have been - cached. If the EXTERNAL_RELOCS and INTERNAL_RELOCS arguments are - not NULL, they are used as buffers to read into. They are known to - be large enough. If the INTERNAL_RELOCS relocs argument is NULL, - the return value is allocated using either malloc or bfd_alloc, - according to the KEEP_MEMORY argument. If O has two relocation - sections (both REL and RELA relocations), then the REL_HDR - relocations will appear first in INTERNAL_RELOCS, followed by the - REL_HDR2 relocations. */ - -Elf_Internal_Rela * -NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs, - keep_memory) - bfd *abfd; - asection *o; - PTR external_relocs; - Elf_Internal_Rela *internal_relocs; - bfd_boolean keep_memory; -{ - Elf_Internal_Shdr *rel_hdr; - PTR alloc1 = NULL; - Elf_Internal_Rela *alloc2 = NULL; - struct elf_backend_data *bed = get_elf_backend_data (abfd); - - if (elf_section_data (o)->relocs != NULL) - return elf_section_data (o)->relocs; - - if (o->reloc_count == 0) - return NULL; - - rel_hdr = &elf_section_data (o)->rel_hdr; - - if (internal_relocs == NULL) - { - bfd_size_type size; - - size = o->reloc_count; - size *= bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela); - if (keep_memory) - internal_relocs = (Elf_Internal_Rela *) bfd_alloc (abfd, size); - else - internal_relocs = alloc2 = (Elf_Internal_Rela *) bfd_malloc (size); - if (internal_relocs == NULL) - goto error_return; - } - - if (external_relocs == NULL) - { - bfd_size_type size = rel_hdr->sh_size; - - if (elf_section_data (o)->rel_hdr2) - size += elf_section_data (o)->rel_hdr2->sh_size; - alloc1 = (PTR) bfd_malloc (size); - if (alloc1 == NULL) - goto error_return; - external_relocs = alloc1; - } - - if (!elf_link_read_relocs_from_section (abfd, rel_hdr, - external_relocs, - internal_relocs)) - goto error_return; - if (!elf_link_read_relocs_from_section - (abfd, - elf_section_data (o)->rel_hdr2, - ((bfd_byte *) external_relocs) + rel_hdr->sh_size, - internal_relocs + (NUM_SHDR_ENTRIES (rel_hdr) - * bed->s->int_rels_per_ext_rel))) - goto error_return; - - /* Cache the results for next time, if we can. */ - if (keep_memory) - elf_section_data (o)->relocs = internal_relocs; - - if (alloc1 != NULL) - free (alloc1); - - /* Don't free alloc2, since if it was allocated we are passing it - back (under the name of internal_relocs). */ - - return internal_relocs; - - error_return: - if (alloc1 != NULL) - free (alloc1); - if (alloc2 != NULL) - free (alloc2); - return NULL; -} - -/* Record an assignment to a symbol made by a linker script. We need - this in case some dynamic object refers to this symbol. */ - -bfd_boolean -NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; - const char *name; - bfd_boolean provide; -{ - struct elf_link_hash_entry *h; - - if (info->hash->creator->flavour != bfd_target_elf_flavour) - return TRUE; - - h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, TRUE, FALSE); - if (h == NULL) - return FALSE; - - if (h->root.type == bfd_link_hash_new) - h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF; - - /* If this symbol is being provided by the linker script, and it is - currently defined by a dynamic object, but not by a regular - object, then mark it as undefined so that the generic linker will - force the correct value. */ - if (provide - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - h->root.type = bfd_link_hash_undefined; - - /* If this symbol is not being provided by the linker script, and it is - currently defined by a dynamic object, but not by a regular object, - then clear out any version information because the symbol will not be - associated with the dynamic object any more. */ - if (!provide - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - h->verinfo.verdef = NULL; - - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - - if (((h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_DYNAMIC - | ELF_LINK_HASH_REF_DYNAMIC)) != 0 - || info->shared) - && h->dynindx == -1) - { - if (! _bfd_elf_link_record_dynamic_symbol (info, h)) - return FALSE; - - /* If this is a weak defined symbol, and we know a corresponding - real symbol from the same dynamic object, make sure the real - symbol is also made into a dynamic symbol. */ - if (h->weakdef != NULL - && h->weakdef->dynindx == -1) - { - if (! _bfd_elf_link_record_dynamic_symbol (info, h->weakdef)) - return FALSE; - } - } - - return TRUE; -} - -/* This structure is used to pass information to - elf_link_assign_sym_version. */ - -struct elf_assign_sym_version_info -{ - /* Output BFD. */ - bfd *output_bfd; - /* General link information. */ - struct bfd_link_info *info; - /* Version tree. */ - struct bfd_elf_version_tree *verdefs; - /* Whether we had a failure. */ - bfd_boolean failed; -}; - -/* This structure is used to pass information to - elf_link_find_version_dependencies. */ - -struct elf_find_verdep_info -{ - /* Output BFD. */ - bfd *output_bfd; - /* General link information. */ - struct bfd_link_info *info; - /* The number of dependencies. */ - unsigned int vers; - /* Whether we had a failure. */ - bfd_boolean failed; -}; - /* Array used to determine the number of hash table buckets to use based on the number of symbols there are. If there are fewer than 3 symbols we use 1 bucket, fewer than 17 symbols we use 3 buckets, @@ -3228,7 +2040,8 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, table (this is not the normal case), then do so. */ if (info->export_dynamic) { - elf_link_hash_traverse (elf_hash_table (info), elf_export_symbol, + elf_link_hash_traverse (elf_hash_table (info), + _bfd_elf_export_symbol, (PTR) &eif); if (eif.failed) return FALSE; @@ -3292,7 +2105,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, asvinfo.failed = FALSE; elf_link_hash_traverse (elf_hash_table (info), - elf_link_assign_sym_version, + _bfd_elf_link_assign_sym_version, (PTR) &asvinfo); if (asvinfo.failed) return FALSE; @@ -3322,7 +2135,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, /* Find all symbols which were defined in a dynamic object and make the backend pick a reasonable value for them. */ elf_link_hash_traverse (elf_hash_table (info), - elf_adjust_dynamic_symbol, + _bfd_elf_adjust_dynamic_symbol, (PTR) &eif); if (eif.failed) return FALSE; @@ -3651,7 +2464,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, sinfo.failed = FALSE; elf_link_hash_traverse (elf_hash_table (info), - elf_link_find_version_dependencies, + _bfd_elf_link_find_version_dependencies, (PTR) &sinfo); if (elf_tdata (output_bfd)->verref == NULL) @@ -3982,663 +2795,6 @@ elf_finalize_dynstr (output_bfd, info) return TRUE; } - -/* Fix up the flags for a symbol. This handles various cases which - can only be fixed after all the input files are seen. This is - currently called by both adjust_dynamic_symbol and - assign_sym_version, which is unnecessary but perhaps more robust in - the face of future changes. */ - -static bfd_boolean -elf_fix_symbol_flags (h, eif) - struct elf_link_hash_entry *h; - struct elf_info_failed *eif; -{ - /* If this symbol was mentioned in a non-ELF file, try to set - DEF_REGULAR and REF_REGULAR correctly. This is the only way to - permit a non-ELF file to correctly refer to a symbol defined in - an ELF dynamic object. */ - if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) != 0) - { - while (h->root.type == bfd_link_hash_indirect) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - if (h->root.type != bfd_link_hash_defined - && h->root.type != bfd_link_hash_defweak) - h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR - | ELF_LINK_HASH_REF_REGULAR_NONWEAK); - else - { - if (h->root.u.def.section->owner != NULL - && (bfd_get_flavour (h->root.u.def.section->owner) - == bfd_target_elf_flavour)) - h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR - | ELF_LINK_HASH_REF_REGULAR_NONWEAK); - else - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - } - - if (h->dynindx == -1 - && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)) - { - if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h)) - { - eif->failed = TRUE; - return FALSE; - } - } - } - else - { - /* Unfortunately, ELF_LINK_NON_ELF is only correct if the symbol - was first seen in a non-ELF file. Fortunately, if the symbol - was first seen in an ELF file, we're probably OK unless the - symbol was defined in a non-ELF file. Catch that case here. - FIXME: We're still in trouble if the symbol was first seen in - a dynamic object, and then later in a non-ELF regular object. */ - if ((h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 - && (h->root.u.def.section->owner != NULL - ? (bfd_get_flavour (h->root.u.def.section->owner) - != bfd_target_elf_flavour) - : (bfd_is_abs_section (h->root.u.def.section) - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_DYNAMIC) == 0))) - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - } - - /* If this is a final link, and the symbol was defined as a common - symbol in a regular object file, and there was no definition in - any dynamic object, then the linker will have allocated space for - the symbol in a common section but the ELF_LINK_HASH_DEF_REGULAR - flag will not have been set. */ - if (h->root.type == bfd_link_hash_defined - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->root.u.def.section->owner->flags & DYNAMIC) == 0) - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - - /* If -Bsymbolic was used (which means to bind references to global - symbols to the definition within the shared object), and this - symbol was defined in a regular object, then it actually doesn't - need a PLT entry, and we can accomplish that by forcing it local. - Likewise, if the symbol has hidden or internal visibility. - FIXME: It might be that we also do not need a PLT for other - non-hidden visibilities, but we would have to tell that to the - backend specifically; we can't just clear PLT-related data here. */ - if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0 - && eif->info->shared - && is_elf_hash_table (eif->info) - && (eif->info->symbolic - || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL - || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) - { - struct elf_backend_data *bed; - bfd_boolean force_local; - - bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); - - force_local = (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL - || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN); - (*bed->elf_backend_hide_symbol) (eif->info, h, force_local); - } - - /* If this is a weak defined symbol in a dynamic object, and we know - the real definition in the dynamic object, copy interesting flags - over to the real definition. */ - if (h->weakdef != NULL) - { - struct elf_link_hash_entry *weakdef; - - weakdef = h->weakdef; - if (h->root.type == bfd_link_hash_indirect) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - BFD_ASSERT (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak); - BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined - || weakdef->root.type == bfd_link_hash_defweak); - BFD_ASSERT (weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC); - - /* If the real definition is defined by a regular object file, - don't do anything special. See the longer description in - elf_adjust_dynamic_symbol, below. */ - if ((weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) - h->weakdef = NULL; - else - { - struct elf_backend_data *bed; - - bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); - (*bed->elf_backend_copy_indirect_symbol) (bed, weakdef, h); - } - } - - return TRUE; -} - -/* Make the backend pick a good value for a dynamic symbol. This is - called via elf_link_hash_traverse, and also calls itself - recursively. */ - -static bfd_boolean -elf_adjust_dynamic_symbol (h, data) - struct elf_link_hash_entry *h; - PTR data; -{ - struct elf_info_failed *eif = (struct elf_info_failed *) data; - bfd *dynobj; - struct elf_backend_data *bed; - - if (! is_elf_hash_table (eif->info)) - return FALSE; - - if (h->root.type == bfd_link_hash_warning) - { - h->plt = elf_hash_table (eif->info)->init_offset; - h->got = elf_hash_table (eif->info)->init_offset; - - /* When warning symbols are created, they **replace** the "real" - entry in the hash table, thus we never get to see the real - symbol in a hash traversal. So look at it now. */ - h = (struct elf_link_hash_entry *) h->root.u.i.link; - } - - /* Ignore indirect symbols. These are added by the versioning code. */ - if (h->root.type == bfd_link_hash_indirect) - return TRUE; - - /* Fix the symbol flags. */ - if (! elf_fix_symbol_flags (h, eif)) - return FALSE; - - /* If this symbol does not require a PLT entry, and it is not - defined by a dynamic object, or is not referenced by a regular - object, ignore it. We do have to handle a weak defined symbol, - even if no regular object refers to it, if we decided to add it - to the dynamic symbol table. FIXME: Do we normally need to worry - about symbols which are defined by one dynamic object and - referenced by another one? */ - if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0 - && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 - || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - || ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0 - && (h->weakdef == NULL || h->weakdef->dynindx == -1)))) - { - h->plt = elf_hash_table (eif->info)->init_offset; - return TRUE; - } - - /* If we've already adjusted this symbol, don't do it again. This - can happen via a recursive call. */ - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) - return TRUE; - - /* Don't look at this symbol again. Note that we must set this - after checking the above conditions, because we may look at a - symbol once, decide not to do anything, and then get called - recursively later after REF_REGULAR is set below. */ - h->elf_link_hash_flags |= ELF_LINK_HASH_DYNAMIC_ADJUSTED; - - /* If this is a weak definition, and we know a real definition, and - the real symbol is not itself defined by a regular object file, - then get a good value for the real definition. We handle the - real symbol first, for the convenience of the backend routine. - - Note that there is a confusing case here. If the real definition - is defined by a regular object file, we don't get the real symbol - from the dynamic object, but we do get the weak symbol. If the - processor backend uses a COPY reloc, then if some routine in the - dynamic object changes the real symbol, we will not see that - change in the corresponding weak symbol. This is the way other - ELF linkers work as well, and seems to be a result of the shared - library model. - - I will clarify this issue. Most SVR4 shared libraries define the - variable _timezone and define timezone as a weak synonym. The - tzset call changes _timezone. If you write - extern int timezone; - int _timezone = 5; - int main () { tzset (); printf ("%d %d\n", timezone, _timezone); } - you might expect that, since timezone is a synonym for _timezone, - the same number will print both times. However, if the processor - backend uses a COPY reloc, then actually timezone will be copied - into your process image, and, since you define _timezone - yourself, _timezone will not. Thus timezone and _timezone will - wind up at different memory locations. The tzset call will set - _timezone, leaving timezone unchanged. */ - - if (h->weakdef != NULL) - { - /* If we get to this point, we know there is an implicit - reference by a regular object file via the weak symbol H. - FIXME: Is this really true? What if the traversal finds - H->WEAKDEF before it finds H? */ - h->weakdef->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR; - - if (! elf_adjust_dynamic_symbol (h->weakdef, (PTR) eif)) - return FALSE; - } - - /* If a symbol has no type and no size and does not require a PLT - entry, then we are probably about to do the wrong thing here: we - are probably going to create a COPY reloc for an empty object. - This case can arise when a shared object is built with assembly - code, and the assembly code fails to set the symbol type. */ - if (h->size == 0 - && h->type == STT_NOTYPE - && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0) - (*_bfd_error_handler) - (_("warning: type and size of dynamic symbol `%s' are not defined"), - h->root.root.string); - - dynobj = elf_hash_table (eif->info)->dynobj; - bed = get_elf_backend_data (dynobj); - if (! (*bed->elf_backend_adjust_dynamic_symbol) (eif->info, h)) - { - eif->failed = TRUE; - return FALSE; - } - - return TRUE; -} - -/* This routine is used to export all defined symbols into the dynamic - symbol table. It is called via elf_link_hash_traverse. */ - -static bfd_boolean -elf_export_symbol (h, data) - struct elf_link_hash_entry *h; - PTR data; -{ - struct elf_info_failed *eif = (struct elf_info_failed *) data; - - /* Ignore indirect symbols. These are added by the versioning code. */ - if (h->root.type == bfd_link_hash_indirect) - return TRUE; - - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - if (h->dynindx == -1 - && (h->elf_link_hash_flags - & (ELF_LINK_HASH_DEF_REGULAR | ELF_LINK_HASH_REF_REGULAR)) != 0) - { - struct bfd_elf_version_tree *t; - struct bfd_elf_version_expr *d; - - for (t = eif->verdefs; t != NULL; t = t->next) - { - if (t->globals != NULL) - { - for (d = t->globals; d != NULL; d = d->next) - { - if ((*d->match) (d, h->root.root.string)) - goto doit; - } - } - - if (t->locals != NULL) - { - for (d = t->locals ; d != NULL; d = d->next) - { - if ((*d->match) (d, h->root.root.string)) - return TRUE; - } - } - } - - if (!eif->verdefs) - { - doit: - if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h)) - { - eif->failed = TRUE; - return FALSE; - } - } - } - - return TRUE; -} - -/* Look through the symbols which are defined in other shared - libraries and referenced here. Update the list of version - dependencies. This will be put into the .gnu.version_r section. - This function is called via elf_link_hash_traverse. */ - -static bfd_boolean -elf_link_find_version_dependencies (h, data) - struct elf_link_hash_entry *h; - PTR data; -{ - struct elf_find_verdep_info *rinfo = (struct elf_find_verdep_info *) data; - Elf_Internal_Verneed *t; - Elf_Internal_Vernaux *a; - bfd_size_type amt; - - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - /* We only care about symbols defined in shared objects with version - information. */ - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 - || h->dynindx == -1 - || h->verinfo.verdef == NULL) - return TRUE; - - /* See if we already know about this version. */ - for (t = elf_tdata (rinfo->output_bfd)->verref; t != NULL; t = t->vn_nextref) - { - if (t->vn_bfd != h->verinfo.verdef->vd_bfd) - continue; - - for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr) - if (a->vna_nodename == h->verinfo.verdef->vd_nodename) - return TRUE; - - break; - } - - /* This is a new version. Add it to tree we are building. */ - - if (t == NULL) - { - amt = sizeof *t; - t = (Elf_Internal_Verneed *) bfd_zalloc (rinfo->output_bfd, amt); - if (t == NULL) - { - rinfo->failed = TRUE; - return FALSE; - } - - t->vn_bfd = h->verinfo.verdef->vd_bfd; - t->vn_nextref = elf_tdata (rinfo->output_bfd)->verref; - elf_tdata (rinfo->output_bfd)->verref = t; - } - - amt = sizeof *a; - a = (Elf_Internal_Vernaux *) bfd_zalloc (rinfo->output_bfd, amt); - - /* Note that we are copying a string pointer here, and testing it - above. If bfd_elf_string_from_elf_section is ever changed to - discard the string data when low in memory, this will have to be - fixed. */ - a->vna_nodename = h->verinfo.verdef->vd_nodename; - - a->vna_flags = h->verinfo.verdef->vd_flags; - a->vna_nextptr = t->vn_auxptr; - - h->verinfo.verdef->vd_exp_refno = rinfo->vers; - ++rinfo->vers; - - a->vna_other = h->verinfo.verdef->vd_exp_refno + 1; - - t->vn_auxptr = a; - - return TRUE; -} - -/* Figure out appropriate versions for all the symbols. We may not - have the version number script until we have read all of the input - files, so until that point we don't know which symbols should be - local. This function is called via elf_link_hash_traverse. */ - -static bfd_boolean -elf_link_assign_sym_version (h, data) - struct elf_link_hash_entry *h; - PTR data; -{ - struct elf_assign_sym_version_info *sinfo; - struct bfd_link_info *info; - struct elf_backend_data *bed; - struct elf_info_failed eif; - char *p; - bfd_size_type amt; - - sinfo = (struct elf_assign_sym_version_info *) data; - info = sinfo->info; - - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - /* Fix the symbol flags. */ - eif.failed = FALSE; - eif.info = info; - if (! elf_fix_symbol_flags (h, &eif)) - { - if (eif.failed) - sinfo->failed = TRUE; - return FALSE; - } - - /* We only need version numbers for symbols defined in regular - objects. */ - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - return TRUE; - - bed = get_elf_backend_data (sinfo->output_bfd); - p = strchr (h->root.root.string, ELF_VER_CHR); - if (p != NULL && h->verinfo.vertree == NULL) - { - struct bfd_elf_version_tree *t; - bfd_boolean hidden; - - hidden = TRUE; - - /* There are two consecutive ELF_VER_CHR characters if this is - not a hidden symbol. */ - ++p; - if (*p == ELF_VER_CHR) - { - hidden = FALSE; - ++p; - } - - /* If there is no version string, we can just return out. */ - if (*p == '\0') - { - if (hidden) - h->elf_link_hash_flags |= ELF_LINK_HIDDEN; - return TRUE; - } - - /* Look for the version. If we find it, it is no longer weak. */ - for (t = sinfo->verdefs; t != NULL; t = t->next) - { - if (strcmp (t->name, p) == 0) - { - size_t len; - char *alc; - struct bfd_elf_version_expr *d; - - len = p - h->root.root.string; - alc = bfd_malloc ((bfd_size_type) len); - if (alc == NULL) - return FALSE; - memcpy (alc, h->root.root.string, len - 1); - alc[len - 1] = '\0'; - if (alc[len - 2] == ELF_VER_CHR) - alc[len - 2] = '\0'; - - h->verinfo.vertree = t; - t->used = TRUE; - d = NULL; - - if (t->globals != NULL) - { - for (d = t->globals; d != NULL; d = d->next) - if ((*d->match) (d, alc)) - break; - } - - /* See if there is anything to force this symbol to - local scope. */ - if (d == NULL && t->locals != NULL) - { - for (d = t->locals; d != NULL; d = d->next) - { - if ((*d->match) (d, alc)) - { - if (h->dynindx != -1 - && info->shared - && ! info->export_dynamic) - { - (*bed->elf_backend_hide_symbol) (info, h, TRUE); - } - - break; - } - } - } - - free (alc); - break; - } - } - - /* If we are building an application, we need to create a - version node for this version. */ - if (t == NULL && ! info->shared) - { - struct bfd_elf_version_tree **pp; - int version_index; - - /* If we aren't going to export this symbol, we don't need - to worry about it. */ - if (h->dynindx == -1) - return TRUE; - - amt = sizeof *t; - t = ((struct bfd_elf_version_tree *) - bfd_alloc (sinfo->output_bfd, amt)); - if (t == NULL) - { - sinfo->failed = TRUE; - return FALSE; - } - - t->next = NULL; - t->name = p; - t->globals = NULL; - t->locals = NULL; - t->deps = NULL; - t->name_indx = (unsigned int) -1; - t->used = TRUE; - - version_index = 1; - /* Don't count anonymous version tag. */ - if (sinfo->verdefs != NULL && sinfo->verdefs->vernum == 0) - version_index = 0; - for (pp = &sinfo->verdefs; *pp != NULL; pp = &(*pp)->next) - ++version_index; - t->vernum = version_index; - - *pp = t; - - h->verinfo.vertree = t; - } - else if (t == NULL) - { - /* We could not find the version for a symbol when - generating a shared archive. Return an error. */ - (*_bfd_error_handler) - (_("%s: undefined versioned symbol name %s"), - bfd_get_filename (sinfo->output_bfd), h->root.root.string); - bfd_set_error (bfd_error_bad_value); - sinfo->failed = TRUE; - return FALSE; - } - - if (hidden) - h->elf_link_hash_flags |= ELF_LINK_HIDDEN; - } - - /* If we don't have a version for this symbol, see if we can find - something. */ - if (h->verinfo.vertree == NULL && sinfo->verdefs != NULL) - { - struct bfd_elf_version_tree *t; - struct bfd_elf_version_tree *local_ver; - struct bfd_elf_version_expr *d; - - /* See if can find what version this symbol is in. If the - symbol is supposed to be local, then don't actually register - it. */ - local_ver = NULL; - for (t = sinfo->verdefs; t != NULL; t = t->next) - { - if (t->globals != NULL) - { - bfd_boolean matched; - - matched = FALSE; - for (d = t->globals; d != NULL; d = d->next) - { - if ((*d->match) (d, h->root.root.string)) - { - if (d->symver) - matched = TRUE; - else - { - /* There is a version without definition. Make - the symbol the default definition for this - version. */ - h->verinfo.vertree = t; - local_ver = NULL; - d->script = 1; - break; - } - } - } - - if (d != NULL) - break; - else if (matched) - /* There is no undefined version for this symbol. Hide the - default one. */ - (*bed->elf_backend_hide_symbol) (info, h, TRUE); - } - - if (t->locals != NULL) - { - for (d = t->locals; d != NULL; d = d->next) - { - /* If the match is "*", keep looking for a more - explicit, perhaps even global, match. */ - if (d->pattern[0] == '*' && d->pattern[1] == '\0') - local_ver = t; - else if ((*d->match) (d, h->root.root.string)) - { - local_ver = t; - break; - } - } - - if (d != NULL) - break; - } - } - - if (local_ver != NULL) - { - h->verinfo.vertree = local_ver; - if (h->dynindx != -1 - && info->shared - && ! info->export_dynamic) - { - (*bed->elf_backend_hide_symbol) (info, h, TRUE); - } - } - } - - return TRUE; -} /* Final phase of ELF linker. */ @@ -4699,8 +2855,6 @@ static bfd_boolean elf_link_flush_output_syms PARAMS ((struct elf_final_link_info *)); static bfd_boolean elf_link_output_extsym PARAMS ((struct elf_link_hash_entry *, PTR)); -static bfd_boolean elf_link_sec_merge_syms - PARAMS ((struct elf_link_hash_entry *, PTR)); static bfd_boolean elf_link_check_versioned_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static bfd_boolean elf_link_input_bfd @@ -4718,58 +2872,6 @@ struct elf_outext_info struct elf_final_link_info *finfo; }; -/* Compute the size of, and allocate space for, REL_HDR which is the - section header for a section containing relocations for O. */ - -static bfd_boolean -elf_link_size_reloc_section (abfd, rel_hdr, o) - bfd *abfd; - Elf_Internal_Shdr *rel_hdr; - asection *o; -{ - bfd_size_type reloc_count; - bfd_size_type num_rel_hashes; - - /* Figure out how many relocations there will be. */ - if (rel_hdr == &elf_section_data (o)->rel_hdr) - reloc_count = elf_section_data (o)->rel_count; - else - reloc_count = elf_section_data (o)->rel_count2; - - num_rel_hashes = o->reloc_count; - if (num_rel_hashes < reloc_count) - num_rel_hashes = reloc_count; - - /* That allows us to calculate the size of the section. */ - rel_hdr->sh_size = rel_hdr->sh_entsize * reloc_count; - - /* The contents field must last into write_object_contents, so we - allocate it with bfd_alloc rather than malloc. Also since we - cannot be sure that the contents will actually be filled in, - we zero the allocated space. */ - rel_hdr->contents = (PTR) bfd_zalloc (abfd, rel_hdr->sh_size); - if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0) - return FALSE; - - /* We only allocate one set of hash entries, so we only do it the - first time we are called. */ - if (elf_section_data (o)->rel_hashes == NULL - && num_rel_hashes) - { - struct elf_link_hash_entry **p; - - p = ((struct elf_link_hash_entry **) - bfd_zmalloc (num_rel_hashes - * sizeof (struct elf_link_hash_entry *))); - if (p == NULL) - return FALSE; - - elf_section_data (o)->rel_hashes = p; - } - - return TRUE; -} - /* When performing a relocateable link, the input relocations are preserved. But, if they reference global symbols, the indices referenced must be updated. Update all the relocations in @@ -5138,9 +3240,10 @@ elf_bfd_final_link (abfd, info) { Elf_Internal_Rela * relocs; - relocs = (NAME(_bfd_elf,link_read_relocs) - (abfd, sec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, info->keep_memory)); + relocs + = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); reloc_count = (*bed->elf_backend_count_relocs) (sec, relocs); @@ -5258,7 +3361,7 @@ elf_bfd_final_link (abfd, info) if (! info->relocateable && merged) elf_link_hash_traverse (elf_hash_table (info), - elf_link_sec_merge_syms, (PTR) abfd); + _bfd_elf_link_sec_merge_syms, (PTR) abfd); /* Figure out the file positions for everything but the symbol table and the relocs. We set symcount to force assign_section_numbers @@ -5274,15 +3377,13 @@ elf_bfd_final_link (abfd, info) { if ((o->flags & SEC_RELOC) != 0) { - if (!elf_link_size_reloc_section (abfd, - &elf_section_data (o)->rel_hdr, - o)) + if (!(_bfd_elf_link_size_reloc_section + (abfd, &elf_section_data (o)->rel_hdr, o))) goto error_return; if (elf_section_data (o)->rel_hdr2 - && !elf_link_size_reloc_section (abfd, - elf_section_data (o)->rel_hdr2, - o)) + && !(_bfd_elf_link_size_reloc_section + (abfd, elf_section_data (o)->rel_hdr2, o))) goto error_return; } @@ -5307,7 +3408,7 @@ elf_bfd_final_link (abfd, info) /* sh_link is set in assign_section_numbers. */ /* sh_info is set below. */ /* sh_offset is set just below. */ - symtab_hdr->sh_addralign = bed->s->file_align; + symtab_hdr->sh_addralign = 1 << bed->s->log_file_align; off = elf_tdata (abfd)->next_file_pos; off = _bfd_elf_assign_file_position_for_section (symtab_hdr, off, TRUE); @@ -5917,7 +4018,7 @@ elf_bfd_final_link (abfd, info) if ((o->flags & SEC_LINKER_CREATED) == 0) { /* At this point, we are only interested in sections - created by elf_link_create_dynamic_sections. */ + created by _bfd_elf_link_create_dynamic_sections. */ continue; } if ((elf_section_data (o->output_section)->this_hdr.sh_type @@ -6124,53 +4225,47 @@ elf_link_flush_output_syms (finfo) return TRUE; } -/* Adjust all external symbols pointing into SEC_MERGE sections - to reflect the object merging within the sections. */ - -static bfd_boolean -elf_link_sec_merge_syms (h, data) - struct elf_link_hash_entry *h; - PTR data; -{ - asection *sec; - - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - if ((h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - && ((sec = h->root.u.def.section)->flags & SEC_MERGE) - && sec->sec_info_type == ELF_INFO_TYPE_MERGE) - { - bfd *output_bfd = (bfd *) data; - - h->root.u.def.value = - _bfd_merged_section_offset (output_bfd, - &h->root.u.def.section, - elf_section_data (sec)->sec_info, - h->root.u.def.value, (bfd_vma) 0); - } - - return TRUE; -} - /* For DSOs loaded in via a DT_NEEDED entry, emulate ld.so in allowing an unsatisfied unversioned symbol in the DSO to match a - versioned symbol that would normally require an explicit version. */ + versioned symbol that would normally require an explicit version. + We also handle the case that a DSO references a hidden symbol + which may be satisfied by a versioned symbol in another DSO. */ static bfd_boolean elf_link_check_versioned_symbol (info, h) struct bfd_link_info *info; struct elf_link_hash_entry *h; { - bfd *undef_bfd = h->root.u.undef.abfd; + bfd *abfd; struct elf_link_loaded_list *loaded; - if ((undef_bfd->flags & DYNAMIC) == 0 - || info->hash->creator->flavour != bfd_target_elf_flavour - || elf_dt_soname (undef_bfd) == NULL) + if (info->hash->creator->flavour != bfd_target_elf_flavour) return FALSE; + switch (h->root.type) + { + default: + abfd = NULL; + break; + + case bfd_link_hash_undefined: + case bfd_link_hash_undefweak: + abfd = h->root.u.undef.abfd; + if ((abfd->flags & DYNAMIC) == 0 || elf_dt_soname (abfd) == NULL) + return FALSE; + break; + + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + abfd = h->root.u.def.section->owner; + break; + + case bfd_link_hash_common: + abfd = h->root.u.c.p->section->owner; + break; + } + BFD_ASSERT (abfd != NULL); + for (loaded = elf_hash_table (info)->loaded; loaded != NULL; loaded = loaded->next) @@ -6190,7 +4285,7 @@ elf_link_check_versioned_symbol (info, h) input = loaded->abfd; /* We check each DSO for a possible hidden versioned definition. */ - if (input == undef_bfd + if (input == abfd || (input->flags & DYNAMIC) == 0 || elf_dynversym (input) == 0) continue; @@ -6239,6 +4334,7 @@ elf_link_check_versioned_symbol (info, h) { const char *name; Elf_Internal_Versym iver; + unsigned short version_index; if (ELF_ST_BIND (isym->st_info) == STB_LOCAL || isym->st_shndx == SHN_UNDEF) @@ -6259,9 +4355,10 @@ elf_link_check_versioned_symbol (info, h) abort (); } - if ((iver.vs_vers & VERSYM_VERSION) == 2) + version_index = iver.vs_vers & VERSYM_VERSION; + if (version_index == 1 || version_index == 2) { - /* This is the oldest (default) sym. We can use it. */ + /* This is the base or first version. We can use it. */ free (extversym); free (isymbuf); return TRUE; @@ -6342,7 +4439,8 @@ elf_link_output_extsym (h, data) && (h->elf_link_hash_flags & (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_DYNAMIC_DEF | ELF_LINK_DYNAMIC_WEAK)) - == (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC)) + == (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC) + && ! elf_link_check_versioned_symbol (finfo->info, h)) { (*_bfd_error_handler) (_("%s: %s symbol `%s' in %s is referenced by DSO"), @@ -6482,7 +4580,9 @@ elf_link_output_extsym (h, data) forced local syms when non-shared is due to a historical quirk. */ if ((h->dynindx != -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) - && (finfo->info->shared + && ((finfo->info->shared + && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) && elf_hash_table (finfo->info)->dynamic_sections_created) { @@ -6520,9 +4620,9 @@ 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 - && ELF_ST_VISIBILITY (sym.st_other) + && ELF_ST_VISIBILITY (sym.st_other) != STV_DEFAULT && ELF_ST_BIND (sym.st_info) != STB_WEAK - && h->root.type != bfd_link_hash_undefweak + && h->root.type == bfd_link_hash_undefined && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { (*_bfd_error_handler) @@ -6612,81 +4712,6 @@ elf_link_output_extsym (h, data) return TRUE; } -/* Copy the relocations indicated by the INTERNAL_RELOCS (which - originated from the section given by INPUT_REL_HDR) to the - OUTPUT_BFD. */ - -static bfd_boolean -elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, - internal_relocs) - bfd *output_bfd; - asection *input_section; - Elf_Internal_Shdr *input_rel_hdr; - Elf_Internal_Rela *internal_relocs; -{ - Elf_Internal_Rela *irela; - Elf_Internal_Rela *irelaend; - bfd_byte *erel; - Elf_Internal_Shdr *output_rel_hdr; - asection *output_section; - unsigned int *rel_countp = NULL; - struct elf_backend_data *bed; - void (*swap_out) PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); - - output_section = input_section->output_section; - output_rel_hdr = NULL; - - if (elf_section_data (output_section)->rel_hdr.sh_entsize - == input_rel_hdr->sh_entsize) - { - output_rel_hdr = &elf_section_data (output_section)->rel_hdr; - rel_countp = &elf_section_data (output_section)->rel_count; - } - else if (elf_section_data (output_section)->rel_hdr2 - && (elf_section_data (output_section)->rel_hdr2->sh_entsize - == input_rel_hdr->sh_entsize)) - { - output_rel_hdr = elf_section_data (output_section)->rel_hdr2; - rel_countp = &elf_section_data (output_section)->rel_count2; - } - else - { - (*_bfd_error_handler) - (_("%s: relocation size mismatch in %s section %s"), - bfd_get_filename (output_bfd), - bfd_archive_filename (input_section->owner), - input_section->name); - bfd_set_error (bfd_error_wrong_object_format); - return FALSE; - } - - bed = get_elf_backend_data (output_bfd); - if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel)) - swap_out = bed->s->swap_reloc_out; - else if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rela)) - swap_out = bed->s->swap_reloca_out; - else - abort (); - - erel = output_rel_hdr->contents; - erel += *rel_countp * input_rel_hdr->sh_entsize; - irela = internal_relocs; - irelaend = irela + (NUM_SHDR_ENTRIES (input_rel_hdr) - * bed->s->int_rels_per_ext_rel); - while (irela < irelaend) - { - (*swap_out) (output_bfd, irela, erel); - irela += bed->s->int_rels_per_ext_rel; - erel += input_rel_hdr->sh_entsize; - } - - /* Bump the counter, so that we know where to add the next set of - relocations. */ - *rel_countp += NUM_SHDR_ENTRIES (input_rel_hdr); - - return TRUE; -} - /* Link an input file into the linker output file. This function handles all the sections and relocations of the input file at once. This is so that we only have to read the local symbols once, and @@ -6907,7 +4932,7 @@ elf_link_input_bfd (finfo, input_bfd) if ((o->flags & SEC_LINKER_CREATED) != 0) { - /* Section was created by elf_link_create_dynamic_sections + /* Section was created by _bfd_elf_link_create_dynamic_sections or somesuch. */ continue; } @@ -6931,9 +4956,9 @@ elf_link_input_bfd (finfo, input_bfd) Elf_Internal_Rela *internal_relocs; /* Get the swapped relocs. */ - internal_relocs = (NAME(_bfd_elf,link_read_relocs) - (input_bfd, o, finfo->external_relocs, - finfo->internal_relocs, FALSE)); + internal_relocs + = _bfd_elf_link_read_relocs (input_bfd, o, finfo->external_relocs, + finfo->internal_relocs, FALSE); if (internal_relocs == NULL && o->reloc_count > 0) return FALSE; @@ -7250,7 +5275,7 @@ elf_link_input_bfd (finfo, input_bfd) || finfo->info->emitrelocations)) reloc_emitter = bed->elf_backend_emit_relocs; else - reloc_emitter = elf_link_output_relocs; + reloc_emitter = _bfd_elf_link_output_relocs; if (input_rel_hdr->sh_size != 0 && ! (*reloc_emitter) (output_bfd, o, input_rel_hdr, @@ -7824,9 +5849,9 @@ elf_gc_mark (info, sec, gc_mark_hook) } /* Read the relocations. */ - relstart = (NAME(_bfd_elf,link_read_relocs) - (input_bfd, sec, NULL, (Elf_Internal_Rela *) NULL, - info->keep_memory)); + relstart = _bfd_elf_link_read_relocs (input_bfd, sec, NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (relstart == NULL) { ret = FALSE; @@ -7929,8 +5954,10 @@ elf_gc_sweep (info, gc_sweep_hook) Elf_Internal_Rela *internal_relocs; bfd_boolean r; - internal_relocs = (NAME(_bfd_elf,link_read_relocs) - (o->owner, o, NULL, NULL, info->keep_memory)); + internal_relocs + = _bfd_elf_link_read_relocs (o->owner, o, NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (internal_relocs == NULL) return FALSE; @@ -8028,9 +6055,9 @@ elf_gc_propagate_vtable_entries_used (h, okp) { asection *sec = h->root.u.def.section; struct elf_backend_data *bed = get_elf_backend_data (sec->owner); - int file_align = bed->s->file_align; + unsigned int log_file_align = bed->s->log_file_align; - n = h->vtable_parent->vtable_entries_size / file_align; + n = h->vtable_parent->vtable_entries_size >> log_file_align; while (n--) { if (*pu) @@ -8053,7 +6080,7 @@ elf_gc_smash_unused_vtentry_relocs (h, okp) bfd_vma hstart, hend; Elf_Internal_Rela *relstart, *relend, *rel; struct elf_backend_data *bed; - int file_align; + unsigned int log_file_align; if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; @@ -8070,12 +6097,12 @@ elf_gc_smash_unused_vtentry_relocs (h, okp) hstart = h->root.u.def.value; hend = hstart + h->size; - relstart = (NAME(_bfd_elf,link_read_relocs) - (sec->owner, sec, NULL, (Elf_Internal_Rela *) NULL, TRUE)); + relstart = _bfd_elf_link_read_relocs (sec->owner, sec, NULL, + (Elf_Internal_Rela *) NULL, TRUE); if (!relstart) return *(bfd_boolean *) okp = FALSE; bed = get_elf_backend_data (sec->owner); - file_align = bed->s->file_align; + log_file_align = bed->s->log_file_align; relend = relstart + sec->reloc_count * bed->s->int_rels_per_ext_rel; @@ -8086,7 +6113,7 @@ elf_gc_smash_unused_vtentry_relocs (h, okp) if (h->vtable_entries_used && (rel->r_offset - hstart) < h->vtable_entries_size) { - bfd_vma entry = (rel->r_offset - hstart) / file_align; + bfd_vma entry = (rel->r_offset - hstart) >> log_file_align; if (h->vtable_entries_used[entry]) continue; } @@ -8221,7 +6248,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend) bfd_vma addend; { struct elf_backend_data *bed = get_elf_backend_data (abfd); - int file_align = bed->s->file_align; + unsigned int log_file_align = bed->s->log_file_align; if (addend >= h->vtable_entries_size) { @@ -8245,7 +6272,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend) /* Allocate one extra entry for use as a "done" flag for the consolidation pass. */ - bytes = (size / file_align + 1) * sizeof (bfd_boolean); + bytes = ((size >> log_file_align) + 1) * sizeof (bfd_boolean); if (ptr) { @@ -8255,7 +6282,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend) { size_t oldbytes; - oldbytes = ((h->vtable_entries_size / file_align + 1) + oldbytes = (((h->vtable_entries_size >> log_file_align) + 1) * sizeof (bfd_boolean)); memset (((char *) ptr) + oldbytes, 0, bytes - oldbytes); } @@ -8271,7 +6298,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend) h->vtable_entries_size = size; } - h->vtable_entries_used[addend / file_align] = TRUE; + h->vtable_entries_used[addend >> log_file_align] = TRUE; return TRUE; } @@ -8567,9 +6594,10 @@ elf_bfd_discard_info (output_bfd, info) cookie.rels = NULL; count = stab->reloc_count; if (count != 0) - cookie.rels = (NAME(_bfd_elf,link_read_relocs) - (abfd, stab, (PTR) NULL, (Elf_Internal_Rela *) NULL, - info->keep_memory)); + cookie.rels + = _bfd_elf_link_read_relocs (abfd, stab, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (cookie.rels != NULL) { cookie.rel = cookie.rels; @@ -8590,9 +6618,10 @@ elf_bfd_discard_info (output_bfd, info) cookie.rels = NULL; count = eh->reloc_count; if (count != 0) - cookie.rels = (NAME(_bfd_elf,link_read_relocs) - (abfd, eh, (PTR) NULL, (Elf_Internal_Rela *) NULL, - info->keep_memory)); + cookie.rels + = _bfd_elf_link_read_relocs (abfd, eh, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); cookie.rel = cookie.rels; cookie.relend = cookie.rels; if (cookie.rels != NULL) diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c index ab255fa..2e49948 100644 --- a/bfd/elfn32-mips.c +++ b/bfd/elfn32-mips.c @@ -1199,6 +1199,38 @@ static reloc_howto_type elf_mips_gnu_vtentry_howto = 0, /* dst_mask */ FALSE); /* pcrel_offset */ +/* 16 bit offset for pc-relative branches. */ +static reloc_howto_type elf_mips_gnu_rel16_s2 = + HOWTO (R_MIPS_GNU_REL16_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GNU_REL16_S2", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE); /* pcrel_offset */ + +/* 16 bit offset for pc-relative branches. */ +static reloc_howto_type elf_mips_gnu_rela16_s2 = + HOWTO (R_MIPS_GNU_REL16_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GNU_REL16_S2", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE); /* pcrel_offset */ + /* This is derived from bfd_elf_generic_reloc. NewABI allows us to have several relocations against the same address. The addend is derived from the addends of preceding relocations. If we don't need to @@ -1897,6 +1929,8 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code) return &elf_mips_gnu_vtinherit_howto; case BFD_RELOC_VTABLE_ENTRY: return &elf_mips_gnu_vtentry_howto; + case BFD_RELOC_16_PCREL_S2: + return &elf_mips_gnu_rela16_s2; default: bfd_set_error (bfd_error_bad_value); return NULL; @@ -1920,6 +1954,11 @@ mips_elf_n32_rtype_to_howto (r_type, rela_p) return &elf_mips_gnu_vtinherit_howto; case R_MIPS_GNU_VTENTRY: return &elf_mips_gnu_vtentry_howto; + case R_MIPS_GNU_REL16_S2: + if (rela_p) + return &elf_mips_gnu_rela16_s2; + else + return &elf_mips_gnu_rel16_s2; default: BFD_ASSERT (r_type < (unsigned int) R_MIPS_max); if (rela_p) diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 946157f..ab2ff21 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -720,7 +720,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* Load the relocations for this section. */ - internal_relocs = (_bfd_elfNN_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) @@ -796,7 +796,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) goto error_return; } - isym = isymbuf + ELF64_R_SYM (irel->r_info); + isym = isymbuf + ELFNN_R_SYM (irel->r_info); if (isym->st_shndx == SHN_UNDEF) continue; /* We can't do anthing with undefined symbols. */ else if (isym->st_shndx == SHN_ABS) @@ -1089,7 +1089,7 @@ elfNN_ia64_relax_ldxmov (abfd, contents, off) case 0: shift = 5; break; case 1: shift = 14; off += 3; break; case 2: shift = 23; off += 6; break; - case 3: + default: abort (); } @@ -1466,7 +1466,7 @@ elfNN_ia64_aix_link_add_symbols (abfd, info) if (! elf_hash_table (info)->dynamic_sections_created && abfd->xvec == info->hash->creator) { - if (! bfd_elfNN_link_create_dynamic_sections (abfd, info)) + if (! _bfd_elf_link_create_dynamic_sections (abfd, info)) return FALSE; } @@ -1792,7 +1792,10 @@ elfNN_ia64_hash_hide_symbol (info, xh, force_local) _bfd_elf_link_hash_hide_symbol (info, &h->root, force_local); for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next) - dyn_i->want_plt2 = 0; + { + dyn_i->want_plt2 = 0; + dyn_i->want_plt = 0; + } } /* Create the derived linker hash table. The IA-64 ELF port uses this @@ -2635,7 +2638,10 @@ allocate_fptr (dyn_i, data) || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; - if (x->info->shared + if ((x->info->shared + && (!h + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) /* AIX needs an FPTR in this case. */ || (elfNN_ia64_aix_vec (x->info->hash->creator) && (!h @@ -2760,15 +2766,18 @@ allocate_dynrel_entries (dyn_i, data) struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; struct elfNN_ia64_link_hash_table *ia64_info; struct elfNN_ia64_dyn_reloc_entry *rent; - bfd_boolean dynamic_symbol, shared; + bfd_boolean dynamic_symbol, shared, resolved_zero; ia64_info = elfNN_ia64_hash_table (x->info); dynamic_symbol = elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info) || (elfNN_ia64_aix_vec (x->info->hash->creator) /* Don't allocate an entry for __GLOB_DATA_PTR */ && (!dyn_i->h || strcmp (dyn_i->h->root.root.string, - "__GLOB_DATA_PTR") != 0)); + "__GLOB_DATA_PTR") != 0)); shared = x->info->shared; + resolved_zero = (dyn_i->h + && ELF_ST_VISIBILITY (dyn_i->h->other) + && dyn_i->h->root.type == bfd_link_hash_undefweak); /* Take care of the normal data relocations. */ @@ -2813,8 +2822,12 @@ allocate_dynrel_entries (dyn_i, data) /* Take care of the GOT and PLT relocations. */ - if (((dynamic_symbol || shared) && (dyn_i->want_got || dyn_i->want_gotx)) - || (dyn_i->want_ltoff_fptr && dyn_i->h && dyn_i->h->dynindx != -1)) + if ((!resolved_zero + && (dynamic_symbol || shared) + && (dyn_i->want_got || dyn_i->want_gotx)) + || (dyn_i->want_ltoff_fptr + && dyn_i->h + && dyn_i->h->dynindx != -1)) ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); if ((dynamic_symbol || shared) && dyn_i->want_tprel) ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); @@ -2823,7 +2836,7 @@ allocate_dynrel_entries (dyn_i, data) if (dynamic_symbol && dyn_i->want_dtprel) ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); - if (dyn_i->want_pltoff) + if (!resolved_zero && dyn_i->want_pltoff) { bfd_size_type t = 0; @@ -3431,7 +3444,11 @@ set_got_entry (abfd, info, dyn_i, dynindx, addend, value, dyn_r_type) bfd_put_64 (abfd, value, got_sec->contents + got_offset); /* Install a dynamic relocation if needed. */ - if ((info->shared && dyn_r_type != R_IA64_DTPREL64LSB) + if ((info->shared + && (!dyn_i->h + || ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT + || dyn_i->h->root.type != bfd_link_hash_undefweak) + && dyn_r_type != R_IA64_DTPREL64LSB) || elfNN_ia64_dynamic_symbol_p (dyn_i->h, info) || elfNN_ia64_aix_vec (abfd->xvec) || (dynindx != -1 && dyn_r_type == R_IA64_FPTR64LSB)) @@ -3552,7 +3569,11 @@ set_pltoff_entry (abfd, info, dyn_i, value, is_plt) bfd_put_64 (abfd, gp, pltoff_sec->contents + dyn_i->pltoff_offset + 8); /* Install dynamic relocations if needed. */ - if (!is_plt && info->shared) + if (!is_plt + && info->shared + && (!dyn_i->h + || ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT + || dyn_i->h->root.type != bfd_link_hash_undefweak)) { unsigned int dyn_r_type; @@ -3872,6 +3893,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, asection *sym_sec; bfd_byte *hit_addr; bfd_boolean dynamic_symbol_p; + bfd_boolean local_symbol_p; bfd_boolean undef_weak_ref; r_type = ELFNN_R_TYPE (rel->r_info); @@ -3983,6 +4005,11 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, hit_addr = contents + rel->r_offset; value += rel->r_addend; dynamic_symbol_p = elfNN_ia64_dynamic_symbol_p (h, info); + /* Is this symbol locally defined? A protected symbol is locallly + defined. But its function descriptor may not. Use it with + caution. */ + local_symbol_p = (! dynamic_symbol_p + || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT); switch (r_type) { @@ -4015,7 +4042,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, /* If we don't need dynamic symbol lookup, find a matching RELATIVE relocation. */ dyn_r_type = r_type; - if (dynamic_symbol_p) + if (! local_symbol_p) { dynindx = h->dynindx; addend = rel->r_addend; @@ -4344,7 +4371,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, /* If we don't need dynamic symbol lookup, install two RELATIVE relocations. */ - if (! dynamic_symbol_p) + if (local_symbol_p) { unsigned int dyn_r_type; diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 0c3a5d9..4199ff7 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -163,8 +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. */ @@ -246,8 +245,7 @@ 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; @@ -542,7 +540,7 @@ static bfd *reldyn_sorting_bfd; /* The default alignment for sections, as a power of two. */ #define MIPS_ELF_LOG_FILE_ALIGN(abfd) \ - (get_elf_backend_data (abfd)->s->file_align == 8 ? 3 : 2) + (get_elf_backend_data (abfd)->s->log_file_align) /* Get word-sized data. */ #define MIPS_ELF_GET_WORD(abfd, ptr) \ @@ -1719,15 +1717,15 @@ mips_elf_get_global_gotsym_index (abfd) if (abfd == NULL) return 0; - + sgot = mips_elf_got_section (abfd, TRUE); if (sgot == NULL || mips_elf_section_data (sgot) == NULL) return 0; - + g = mips_elf_section_data (sgot)->u.got_info; if (g == NULL || g->global_gotsym == NULL) return 0; - + return g->global_gotsym->dynindx; } @@ -1770,7 +1768,7 @@ mips_elf_global_got_index (abfd, ibfd, h) if (g->bfd2got && ibfd) { struct mips_got_entry e, *p; - + BFD_ASSERT (h->dynindx >= 0); g = mips_elf_got_for_ibfd (g, ibfd); @@ -1828,7 +1826,7 @@ mips_elf_got_page (abfd, ibfd, info, value, offsetp) if (!entry) return MINUS_ONE; - + index = entry->gotidx; if (offsetp) @@ -1886,7 +1884,7 @@ mips_elf_got_offset_from_index (dynobj, output_bfd, input_bfd, index) g = mips_elf_got_info (dynobj, &sgot); gp = _bfd_get_gp_value (output_bfd) + mips_elf_adjust_gp (output_bfd, g, input_bfd); - + return sgot->output_section->vma + sgot->output_offset + index - gp; } @@ -1918,14 +1916,14 @@ mips_elf_create_local_got_entry (abfd, ibfd, gg, sgot, value) INSERT); if (*loc) return *loc; - + entry.gotidx = MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno++; *loc = (struct mips_got_entry *)bfd_alloc (abfd, sizeof entry); if (! *loc) return NULL; - + memcpy (*loc, &entry, sizeof entry); if (g->assigned_gotno >= g->local_gotno) @@ -1965,7 +1963,7 @@ mips_elf_sort_hash_table (info, max_local) g = mips_elf_got_info (dynobj, NULL); hsd.low = NULL; - hsd.max_unref_got_dynindx = + hsd.max_unref_got_dynindx = hsd.min_got_dynindx = elf_hash_table (info)->dynsymcount /* In the multi-got case, assigned_gotno of the master got_info indicate the number of entries that aren't referenced in the @@ -2079,7 +2077,7 @@ mips_elf_record_global_got_symbol (h, abfd, info, g) if (! *loc) return FALSE; - + entry.gotidx = -1; memcpy (*loc, &entry, sizeof entry); @@ -2121,7 +2119,7 @@ mips_elf_record_local_got_symbol (abfd, symndx, addend, g) if (! *loc) return FALSE; - + memcpy (*loc, &entry, sizeof entry); return TRUE; @@ -2187,7 +2185,7 @@ mips_elf_make_got_per_bfd (entryp, p) struct mips_got_info *g; struct mips_elf_bfd2got_hash bfdgot_entry, *bfdgot; void **bfdgotp; - + /* Find the got_info for this GOT entry's input bfd. Create one if none exists. */ bfdgot_entry.bfd = entry->abfd; @@ -2239,7 +2237,7 @@ mips_elf_make_got_per_bfd (entryp, p) entryp = htab_find_slot (g->got_entries, entry, INSERT); if (*entryp != NULL) return 1; - + *entryp = entry; if (entry->symndx >= 0 || entry->d.h->forced_local) @@ -2268,7 +2266,7 @@ mips_elf_merge_gots (bfd2got_, p) unsigned int lcount = bfd2got->g->local_gotno; unsigned int gcount = bfd2got->g->global_gotno; unsigned int maxcnt = arg->max_count; - + /* If we don't have a primary GOT and this is not too big, use it as a starting point for the primary GOT. */ if (! arg->primary && lcount + gcount <= maxcnt) @@ -2336,7 +2334,7 @@ mips_elf_merge_gots (bfd2got_, p) { bfd2got->g->next = arg->current; arg->current = bfd2got->g; - + arg->current_count = lcount + gcount; } @@ -2417,7 +2415,7 @@ mips_elf_resolve_final_got_entry (entryp, p) if (entry->d.h == h) return 1; - + entry->d.h = h; /* If we can't find this entry with the new bfd hash, re-insert @@ -2437,7 +2435,7 @@ mips_elf_resolve_final_got_entry (entryp, p) /* We might want to decrement the global_gotno count, but it's either too early or too late for that at this point. */ } - + return 1; } @@ -2478,7 +2476,7 @@ mips_elf_adjust_gp (abfd, g, ibfd) BFD_ASSERT (g->next); g = g->next; - + return (g->local_gotno + g->global_gotno) * MIPS_ELF_GOT_SIZE (abfd); } @@ -2566,7 +2564,7 @@ mips_elf_multi_got (abfd, info, g, got, pages) { struct mips_elf_bfd2got_hash *bfdgot; void **bfdgotp; - + bfdgot = (struct mips_elf_bfd2got_hash *)bfd_alloc (abfd, sizeof (struct mips_elf_bfd2got_hash)); @@ -2592,7 +2590,7 @@ mips_elf_multi_got (abfd, info, g, got, pages) the cache. Also, knowing that every external symbol has a GOT helps speed up the resolution of local symbols too, so GNU/Linux follows IRIX's practice. - + The number 2 is used by mips_elf_sort_hash_table_f to count global GOT symbols that are unreferenced in the primary GOT, with an initial dynamic index computed from gg->assigned_gotno, where @@ -2665,10 +2663,10 @@ mips_elf_multi_got (abfd, info, g, got, pages) got->_raw_size = (gg->next->local_gotno + gg->next->global_gotno) * MIPS_ELF_GOT_SIZE (abfd); - + return TRUE; } - + /* Returns the first relocation of type r_type found, beginning with RELOCATION. RELEND is one-past-the-end of the relocation table. */ @@ -5106,10 +5104,10 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) sizeof CALL_FP_STUB - 1) == 0) continue; - sec_relocs = (MNAME(abfd,_bfd_elf,link_read_relocs) - (abfd, o, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory)); + sec_relocs + = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (sec_relocs == NULL) return FALSE; @@ -5370,12 +5368,12 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) { struct mips_elf_link_hash_entry *hmips = (struct mips_elf_link_hash_entry *) h; - + while (hmips->root.root.type == bfd_link_hash_indirect || hmips->root.root.type == bfd_link_hash_warning) hmips = (struct mips_elf_link_hash_entry *) hmips->root.root.u.i.link; - + if ((hmips->root.root.type == bfd_link_hash_defined || hmips->root.root.type == bfd_link_hash_defweak) && hmips->root.root.u.def.section @@ -5561,9 +5559,9 @@ _bfd_mips_relax_section (abfd, sec, link_info, again) if (link_info->relocateable) return TRUE; - internal_relocs = (MNAME(abfd,_bfd_elf,link_read_relocs) - (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, - link_info->keep_memory)); + internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + link_info->keep_memory); if (internal_relocs == NULL) return TRUE; @@ -5599,7 +5597,7 @@ _bfd_mips_relax_section (abfd, sec, link_info, again) while (h->root.root.type == bfd_link_hash_indirect || h->root.root.type == bfd_link_hash_warning) h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link; - + /* If a symbol is undefined, or if it may be overridden, skip it. */ if (! ((h->root.root.type == bfd_link_hash_defined @@ -5662,7 +5660,7 @@ _bfd_mips_relax_section (abfd, sec, link_info, again) /* Check that it's in range. */ if (sym_offset < -0x8000 || sym_offset >= 0x8000) continue; - + /* Get the section contents if we haven't done so already. */ if (contents == NULL) { @@ -5711,7 +5709,7 @@ _bfd_mips_relax_section (abfd, sec, link_info, again) } return TRUE; - relax_return: + relax_return: if (free_contents != NULL) free (free_contents); return FALSE; @@ -5857,7 +5855,7 @@ _bfd_mips_elf_always_size_sections (output_bfd, info) if (dynobj == NULL) /* Relocatable links don't have it. */ return TRUE; - + g = mips_elf_got_info (dynobj, &s); if (s == NULL) return TRUE; @@ -6022,7 +6020,7 @@ _bfd_mips_elf_size_dynamic_sections (output_bfd, info) struct mips_got_info *g = gg; struct mips_elf_set_global_got_offset_arg set_got_offset_arg; unsigned int needed_relocs = 0; - + if (gg->next) { set_got_offset_arg.value = MIPS_ELF_GOT_SIZE (output_bfd); @@ -6782,7 +6780,7 @@ _bfd_mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym) e.abfd = output_bfd; e.symndx = -1; e.d.h = (struct mips_elf_link_hash_entry *)h; - + if (info->shared || h->root.type == bfd_link_hash_undefined || h->root.type == bfd_link_hash_undefweak) @@ -7887,10 +7885,9 @@ _bfd_mips_elf_discard_info (abfd, cookie, info) if (! tdata) return FALSE; - cookie->rels = (MNAME(abfd,_bfd_elf,link_read_relocs) - (abfd, o, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory)); + cookie->rels = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (!cookie->rels) { free (tdata); @@ -8381,17 +8378,6 @@ _bfd_mips_elf_final_link (abfd, info) scRData, scSData, scSBss, scBss }; - /* If all the things we linked together were PIC, but we're - producing an executable (rather than a shared object), then the - resulting file is CPIC (i.e., it calls PIC code.) */ - if (!info->shared - && !info->relocateable - && elf_elfheader (abfd)->e_flags & EF_MIPS_PIC) - { - elf_elfheader (abfd)->e_flags &= ~EF_MIPS_PIC; - elf_elfheader (abfd)->e_flags |= EF_MIPS_CPIC; - } - /* We'd carefully arranged the dynamic symbol indices, and then the generic size_dynamic_sections renumbered them out from under us. Rather than trying somehow to prevent the renumbering, just do @@ -9174,12 +9160,25 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd) /* Check if we have the same endianess */ if (! _bfd_generic_verify_endian_match (ibfd, obfd)) - return FALSE; + { + (*_bfd_error_handler) + (_("%s: endianness incompatible with that of the selected emulation"), + bfd_archive_filename (ibfd)); + return FALSE; + } if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) return TRUE; + if (strcmp (bfd_get_target (ibfd), bfd_get_target (obfd)) != 0) + { + (*_bfd_error_handler) + (_("%s: ABI is incompatible with that of the selected emulation"), + bfd_archive_filename (ibfd)); + return FALSE; + } + new_flags = elf_elfheader (ibfd)->e_flags; elf_elfheader (obfd)->e_flags |= new_flags & EF_MIPS_NOREORDER; old_flags = elf_elfheader (obfd)->e_flags; @@ -9238,25 +9237,22 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd) ok = TRUE; - if ((new_flags & EF_MIPS_PIC) != (old_flags & EF_MIPS_PIC)) + if (((new_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0) + != ((old_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0)) { - new_flags &= ~EF_MIPS_PIC; - old_flags &= ~EF_MIPS_PIC; (*_bfd_error_handler) - (_("%s: linking PIC files with non-PIC files"), + (_("%s: warning: linking PIC files with non-PIC files"), bfd_archive_filename (ibfd)); - ok = FALSE; + ok = TRUE; } - if ((new_flags & EF_MIPS_CPIC) != (old_flags & EF_MIPS_CPIC)) - { - new_flags &= ~EF_MIPS_CPIC; - old_flags &= ~EF_MIPS_CPIC; - (*_bfd_error_handler) - (_("%s: linking abicalls files with non-abicalls files"), - bfd_archive_filename (ibfd)); - ok = FALSE; - } + if (new_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) + elf_elfheader (obfd)->e_flags |= EF_MIPS_CPIC; + if (! (new_flags & EF_MIPS_PIC)) + elf_elfheader (obfd)->e_flags &= ~EF_MIPS_PIC; + + new_flags &= ~ (EF_MIPS_PIC | EF_MIPS_CPIC); + old_flags &= ~ (EF_MIPS_PIC | EF_MIPS_CPIC); /* Compare the ISAs. */ if (mips_32bit_flags_p (old_flags) != mips_32bit_flags_p (new_flags)) diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index 734d78b..58a96b1 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -338,6 +338,9 @@ #ifndef elf_backend_ecoff_debug_swap #define elf_backend_ecoff_debug_swap 0 #endif +#ifndef elf_backend_bfd_from_remote_memory +#define elf_backend_bfd_from_remote_memory _bfd_elfNN_bfd_from_remote_memory +#endif #ifndef elf_backend_got_header_size #define elf_backend_got_header_size 0 #endif @@ -490,6 +493,7 @@ static const struct elf_backend_data elfNN_bed = elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto, elf_backend_ecoff_debug_swap, + elf_backend_bfd_from_remote_memory, ELF_MACHINE_ALT1, ELF_MACHINE_ALT2, &elf_backend_size_info, @@ -27,6 +27,9 @@ #include "libhppa.h" +/* Enable PA2.0 if available */ +#define PA_2_0 + #include <a.out.h> #include <lst.h> #include <ar.h> diff --git a/bfd/version.h b/bfd/version.h index a3d70e0..f9de765 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,3 +1,3 @@ -#define BFD_VERSION_DATE 20030430 +#define BFD_VERSION_DATE 20030523 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_string@ diff --git a/bfd/xtensa-isa.c b/bfd/xtensa-isa.c index ffbef53..761e5c6 100644 --- a/bfd/xtensa-isa.c +++ b/bfd/xtensa-isa.c @@ -159,7 +159,7 @@ configuration.\n" static int xtensa_add_isa (xtensa_isa_internal *isa, libisa_module_specifier libisa) { - const int (*get_num_opcodes_fn) (void); + int (*get_num_opcodes_fn) (void); struct config_struct *(*get_config_table_fn) (void); xtensa_opcode_internal **(*get_opcodes_fn) (void); int (*decode_insn_fn) (const xtensa_insnbuf); diff --git a/bfd/xtensa-modules.c b/bfd/xtensa-modules.c index d023b52..e5d7682 100644 --- a/bfd/xtensa-modules.c +++ b/bfd/xtensa-modules.c @@ -41,7 +41,7 @@ tie_undo_reloc_l (uint32 offset, uint32 pc) } xtensa_opcode_internal** get_opcodes (void); -const int get_num_opcodes (void); +int get_num_opcodes (void); int decode_insn (const xtensa_insnbuf); int interface_version (void); @@ -5463,7 +5463,7 @@ get_opcodes (void) return &opcodes[0]; } -const int +int get_num_opcodes (void) { return 149; diff --git a/config-ml.in b/config-ml.in index e69de29..e227500 100644 --- a/config-ml.in +++ b/config-ml.in @@ -0,0 +1,847 @@ +# Configure fragment invoked in the post-target section for subdirs +# wanting multilib support. +# +# It is advisable to support a few --enable/--disable options to let the +# user select which libraries s/he really wants. +# +# Subdirectories wishing to use multilib should put the following lines +# in the "post-target" section of configure.in. +# +# if [ "${srcdir}" = "." ] ; then +# if [ "${with_target_subdir}" != "." ] ; then +# . ${with_multisrctop}../../config-ml.in +# else +# . ${with_multisrctop}../config-ml.in +# fi +# else +# . ${srcdir}/../config-ml.in +# fi +# +# +# Things are complicated because 6 separate cases must be handled: +# 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6. +# +# srcdir=. is special. It must handle make programs that don't handle VPATH. +# To implement this, a symlink tree is built for each library and for each +# multilib subdir. +# +# The build tree is layed out as +# +# ./ +# newlib +# m68020/ +# newlib +# m68881/ +# newlib +# +# The nice feature about this arrangement is that inter-library references +# in the build tree work without having to care where you are. Note that +# inter-library references also work in the source tree because symlink trees +# are built when srcdir=. +# +# Unfortunately, trying to access the libraries in the build tree requires +# the user to manually choose which library to use as GCC won't be able to +# find the right one. This is viewed as the lesser of two evils. +# +# Configure variables: +# ${with_target_subdir} = "." for native, or ${target_alias} for cross. +# Set by top level Makefile. +# ${with_multisrctop} = how many levels of multilibs there are in the source +# tree. It exists to handle the case of configuring in the source tree: +# ${srcdir} is not constant. +# ${with_multisubdir} = name of multilib subdirectory (eg: m68020/m68881). +# +# Makefile variables: +# MULTISRCTOP = number of multilib levels in source tree (+1 if cross) +# (FIXME: note that this is different than ${with_multisrctop}. Check out.). +# MULTIBUILDTOP = number of multilib levels in build tree +# MULTIDIRS = list of multilib subdirs (eg: m68000 m68020 ...) +# (only defined in each library's main Makefile). +# MULTISUBDIR = installed subdirectory name with leading '/' (eg: /m68000) +# (only defined in each multilib subdir). + +# FIXME: Multilib is currently disabled by default for everything other than +# newlib. It is up to each target to turn on multilib support for the other +# libraries as desired. + +# Autoconf incoming variables: +# srcdir, host, ac_configure_args +# +# We *could* figure srcdir and host out, but we'd have to do work that +# our caller has already done to figure them out and requiring these two +# seems reasonable. +# Note that `host' in this case is GCC's `target'. Target libraries are +# configured for a particular host. + +Makefile=${ac_file-Makefile} +ml_config_shell=${CONFIG_SHELL-/bin/sh} +ml_arguments="${ac_configure_args}" +ml_realsrcdir=${srcdir} + +# Scan all the arguments and set all the ones we need. + +ml_verbose=--verbose +for option in ${ml_arguments} +do + case $option in + --*) ;; + -*) option=-$option ;; + esac + + case $option in + --*=*) + optarg=`echo $option | sed -e 's/^[^=]*=//'` + ;; + esac + + case $option in + --disable-*) + enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'` + eval $enableopt=no + ;; + --enable-*) + case "$option" in + *=*) ;; + *) optarg=yes ;; + esac + enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'` + eval $enableopt="$optarg" + ;; + --norecursion | --no*) + ml_norecursion=yes + ;; + --silent | --sil* | --quiet | --q*) + ml_verbose=--silent + ;; + --verbose | --v | --verb*) + ml_verbose=--verbose + ;; + --with-*) + case "$option" in + *=*) ;; + *) optarg=yes ;; + esac + withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'` + eval $withopt="$optarg" + ;; + --without-*) + withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'` + eval $withopt=no + ;; + esac +done + +# Only do this if --enable-multilib. +if [ "${enable_multilib}" = yes ]; then + +# Compute whether this is the library's top level directory +# (ie: not a multilib subdirectory, and not a subdirectory like newlib/src). +# ${with_multisubdir} tells us we're in the right branch, but we could be +# in a subdir of that. +# ??? The previous version could void this test by separating the process into +# two files: one that only the library's toplevel configure.in ran (to +# configure the multilib subdirs), and another that all configure.in's ran to +# update the Makefile. It seemed reasonable to collapse all multilib support +# into one file, but it does leave us with having to perform this test. +ml_toplevel_p=no +if [ -z "${with_multisubdir}" ]; then + if [ "${srcdir}" = "." ]; then + # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}. + # ${with_target_subdir} = "." for native, otherwise target alias. + if [ "${with_target_subdir}" = "." ]; then + if [ -f ${ml_realsrcdir}/../config-ml.in ]; then + ml_toplevel_p=yes + fi + else + if [ -f ${ml_realsrcdir}/../../config-ml.in ]; then + ml_toplevel_p=yes + fi + fi + else + # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}. + if [ -f ${ml_realsrcdir}/../config-ml.in ]; then + ml_toplevel_p=yes + fi + fi +fi + +# If this is the library's top level directory, set multidirs to the +# multilib subdirs to support. This lives at the top because we need +# `multidirs' set right away. + +if [ "${ml_toplevel_p}" = yes ]; then + +multidirs= +for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do + dir=`echo $i | sed -e 's/;.*$//'` + if [ "${dir}" = "." ]; then + true + else + if [ -z "${multidirs}" ]; then + multidirs="${dir}" + else + multidirs="${multidirs} ${dir}" + fi + fi +done + +# Target libraries are configured for the host they run on, so we check +# $host here, not $target. + +case "${host}" in +arc-*-elf*) + if [ x$enable_biendian != xyes ] + then + old_multidirs=${multidirs} + multidirs="" + for x in ${old_multidirs}; do + case "${x}" in + *be*) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + ;; +arm-*-*) + if [ x"$enable_fpu" = xno ] + then + old_multidirs=${multidirs} + multidirs="" + for x in ${old_multidirs}; do + case "${x}" in + *fpu*) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x"$enable_26bit" = xno ] + then + old_multidirs=${multidirs} + multidirs="" + for x in ${old_multidirs}; do + case "${x}" in + *26bit*) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x"$enable_underscore" = xno ] + then + old_multidirs=${multidirs} + multidirs="" + for x in ${old_multidirs}; do + case "${x}" in + *under*) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x"$enable_interwork" = xno ] + then + old_multidirs=${multidirs} + multidirs="" + for x in ${old_multidirs}; do + case "${x}" in + *interwork*) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_biendian = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *le* ) : ;; + *be* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x"$enable_nofmult" = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *nofmult* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + ;; +m68*-*-*) + if [ x$enable_softfloat = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *soft-float* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_m68881 = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *m68881* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_m68000 = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *m68000* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_m68020 = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *m68020* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + ;; +mips*-*-*) + if [ x$enable_single_float = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *single* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_biendian = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *el* ) : ;; + *eb* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_softfloat = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *soft-float* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + case " $multidirs " in + *" mabi=64 "*) + # We will not be able to create libraries with -mabi=64 if + # we cannot even link a trivial program. It usually + # indicates the 64bit libraries are missing. + if echo 'main() {}' > conftest.c && + ${CC-gcc} -mabi=64 conftest.c -o conftest; then + : + else + echo Could not link program with -mabi=64, disabling it. + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *mabi=64* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + rm -f conftest.c conftest + ;; + esac + ;; +powerpc*-*-* | rs6000*-*-*) + if [ x$enable_aix64 = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *ppc64* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_pthread = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *pthread* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_softfloat = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *soft-float* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_powercpu = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + power | */power | */power/* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_powerpccpu = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *powerpc* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_powerpcos = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *mcall-linux* | *mcall-solaris* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_biendian = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *mlittle* | *mbig* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_sysv = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *mcall-sysv* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + ;; +sparc*-*-*) + case " $multidirs " in + *" m64 "*) + # We will not be able to create libraries with -m64 if + # we cannot even link a trivial program. It usually + # indicates the 64bit libraries are missing. + if echo 'main() {}' > conftest.c && + ${CC-gcc} -m64 conftest.c -o conftest; then + : + else + echo Could not link program with -m64, disabling it. + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *m64* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + rm -f conftest.c conftest + ;; + esac + ;; +esac + +# Remove extraneous blanks from multidirs. +# Tests like `if [ -n "$multidirs" ]' require it. +multidirs=`echo "$multidirs" | sed -e 's/^[ ][ ]*//' -e 's/[ ][ ]*$//' -e 's/[ ][ ]*/ /g'` + +# Add code to library's top level makefile to handle building the multilib +# subdirs. + +cat > Multi.tem <<\EOF + +PWD=$${PWDCMD-pwd} + +# FIXME: There should be an @-sign in front of the `if'. +# Leave out until this is tested a bit more. +multi-do: + if [ -z "$(MULTIDIRS)" ]; then \ + true; \ + else \ + rootpre=`${PWD}`/; export rootpre; \ + srcrootpre=`cd $(srcdir); ${PWD}`/; export srcrootpre; \ + lib=`echo $${rootpre} | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \ + compiler="$(CC)"; \ + for i in `$${compiler} --print-multi-lib 2>/dev/null`; do \ + dir=`echo $$i | sed -e 's/;.*$$//'`; \ + if [ "$${dir}" = "." ]; then \ + true; \ + else \ + if [ -d ../$${dir}/$${lib} ]; then \ + flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ + if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS) $${flags}" \ + prefix="$(prefix)" \ + exec_prefix="$(exec_prefix)" \ + GCJFLAGS="$(GCJFLAGS) $${flags}" \ + CXXFLAGS="$(CXXFLAGS) $${flags}" \ + LIBCFLAGS="$(LIBCFLAGS) $${flags}" \ + LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \ + LDFLAGS="$(LDFLAGS) $${flags}" \ + DESTDIR="$(DESTDIR)" \ + $(DO)); then \ + true; \ + else \ + exit 1; \ + fi; \ + else true; \ + fi; \ + fi; \ + done; \ + fi + +# FIXME: There should be an @-sign in front of the `if'. +# Leave out until this is tested a bit more. +multi-clean: + if [ -z "$(MULTIDIRS)" ]; then \ + true; \ + else \ + lib=`${PWD} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \ + for dir in Makefile $(MULTIDIRS); do \ + if [ -f ../$${dir}/$${lib}/Makefile ]; then \ + if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) $(DO)); \ + then true; \ + else exit 1; \ + fi; \ + else true; \ + fi; \ + done; \ + fi +EOF + +cat ${Makefile} Multi.tem > Makefile.tem +rm -f ${Makefile} Multi.tem +mv Makefile.tem ${Makefile} + +fi # ${ml_toplevel_p} = yes + +if [ "${ml_verbose}" = --verbose ]; then + echo "Adding multilib support to Makefile in ${ml_realsrcdir}" + if [ "${ml_toplevel_p}" = yes ]; then + echo "multidirs=${multidirs}" + fi + echo "with_multisubdir=${with_multisubdir}" +fi + +if [ "${srcdir}" = "." ]; then + if [ "${with_target_subdir}" != "." ]; then + ml_srcdotdot="../" + else + ml_srcdotdot="" + fi +else + ml_srcdotdot="" +fi + +if [ -z "${with_multisubdir}" ]; then + ml_subdir= + ml_builddotdot= + : # ml_srcdotdot= # already set +else + ml_subdir="/${with_multisubdir}" + # The '[^/][^/]*' appears that way to work around a SunOS sed bug. + ml_builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`/ + if [ "$srcdir" = "." ]; then + ml_srcdotdot=${ml_srcdotdot}${ml_builddotdot} + else + : # ml_srcdotdot= # already set + fi +fi + +if [ "${ml_toplevel_p}" = yes ]; then + ml_do='$(MAKE)' + ml_clean='$(MAKE)' +else + ml_do=true + ml_clean=true +fi + +# TOP is used by newlib and should not be used elsewhere for this purpose. +# MULTI{SRC,BUILD}TOP are the proper ones to use. MULTISRCTOP is empty +# when srcdir != builddir. MULTIBUILDTOP is always some number of ../'s. +# FIXME: newlib needs to be updated to use MULTI{SRC,BUILD}TOP so we can +# delete TOP. Newlib may wish to continue to use TOP for its own purposes +# of course. +# MULTIDIRS is non-empty for the cpu top level Makefile (eg: newlib/Makefile) +# and lists the subdirectories to recurse into. +# MULTISUBDIR is non-empty in each cpu subdirectory's Makefile +# (eg: newlib/h8300h/Makefile) and is the installed subdirectory name with +# a leading '/'. +# MULTIDO is used for targets like all, install, and check where +# $(FLAGS_TO_PASS) augmented with the subdir's compiler option is needed. +# MULTICLEAN is used for the *clean targets. +# +# ??? It is possible to merge MULTIDO and MULTICLEAN into one. They are +# currently kept separate because we don't want the *clean targets to require +# the existence of the compiler (which MULTIDO currently requires) and +# therefore we'd have to record the directory options as well as names +# (currently we just record the names and use --print-multi-lib to get the +# options). + +sed -e "s:^TOP[ ]*=[ ]*\([./]*\)[ ]*$:TOP = ${ml_builddotdot}\1:" \ + -e "s:^MULTISRCTOP[ ]*=.*$:MULTISRCTOP = ${ml_srcdotdot}:" \ + -e "s:^MULTIBUILDTOP[ ]*=.*$:MULTIBUILDTOP = ${ml_builddotdot}:" \ + -e "s:^MULTIDIRS[ ]*=.*$:MULTIDIRS = ${multidirs}:" \ + -e "s:^MULTISUBDIR[ ]*=.*$:MULTISUBDIR = ${ml_subdir}:" \ + -e "s:^MULTIDO[ ]*=.*$:MULTIDO = $ml_do:" \ + -e "s:^MULTICLEAN[ ]*=.*$:MULTICLEAN = $ml_clean:" \ + ${Makefile} > Makefile.tem +rm -f ${Makefile} +mv Makefile.tem ${Makefile} + +# If this is the library's top level, configure each multilib subdir. +# This is done at the end because this is the loop that runs configure +# in each multilib subdir and it seemed reasonable to finish updating the +# Makefile before going on to configure the subdirs. + +if [ "${ml_toplevel_p}" = yes ]; then + +# We must freshly configure each subdirectory. This bit of code is +# actually partially stolen from the main configure script. FIXME. + +if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then + + if [ "${ml_verbose}" = --verbose ]; then + echo "Running configure in multilib subdirs ${multidirs}" + echo "pwd: `${PWDCMD-pwd}`" + fi + + ml_origdir=`${PWDCMD-pwd}` + ml_libdir=`echo $ml_origdir | sed -e 's,^.*/,,'` + # cd to top-level-build-dir/${with_target_subdir} + cd .. + + for ml_dir in ${multidirs}; do + + if [ "${ml_verbose}" = --verbose ]; then + echo "Running configure in multilib subdir ${ml_dir}" + echo "pwd: `${PWDCMD-pwd}`" + fi + + if [ -d ${ml_dir} ]; then true; else + # ``mkdir -p ${ml_dir}'' See also mkinstalldirs. + pathcomp="" + for d in `echo ":${ml_dir}" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`; do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" 1>&2 + mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? + fi + if test ! -d "$pathcomp"; then + exit $lasterr + fi + pathcomp="$pathcomp/" + done + fi + if [ -d ${ml_dir}/${ml_libdir} ]; then true; else mkdir ${ml_dir}/${ml_libdir}; fi + + # Eg: if ${ml_dir} = m68000/m68881, dotdot = ../../ + dotdot=../`echo ${ml_dir} | sed -e 's|[^/]||g' -e 's|/|../|g'` + + case ${srcdir} in + ".") + echo Building symlink tree in `${PWDCMD-pwd}`/${ml_dir}/${ml_libdir} + if [ "${with_target_subdir}" != "." ]; then + ml_unsubdir="../" + else + ml_unsubdir="" + fi + (cd ${ml_dir}/${ml_libdir}; + ../${dotdot}${ml_unsubdir}symlink-tree ../${dotdot}${ml_unsubdir}${ml_libdir} "") + if [ -f ${ml_dir}/${ml_libdir}/Makefile ]; then + if [ x"${MAKE}" = x ]; then + (cd ${ml_dir}/${ml_libdir}; make distclean) + else + (cd ${ml_dir}/${ml_libdir}; ${MAKE} distclean) + fi + fi + ml_newsrcdir="." + ml_srcdiroption= + multisrctop=${dotdot} + ;; + *) + case "${srcdir}" in + /* | [A-Za-z]:[\\/]* ) # absolute path + ml_newsrcdir=${srcdir} + ;; + *) # otherwise relative + ml_newsrcdir=${dotdot}${srcdir} + ;; + esac + ml_srcdiroption="-srcdir=${ml_newsrcdir}" + multisrctop= + ;; + esac + + case "${progname}" in + /* | [A-Za-z]:[\\/]* ) ml_recprog=${progname} ;; + *) ml_recprog=${dotdot}${progname} ;; + esac + + # FIXME: POPDIR=${PWD=`pwd`} doesn't work here. + ML_POPDIR=`${PWDCMD-pwd}` + cd ${ml_dir}/${ml_libdir} + + if [ -f ${ml_newsrcdir}/configure ]; then + ml_recprog="${ml_newsrcdir}/configure --cache-file=../config.cache" + fi + + # find compiler flag corresponding to ${ml_dir} + for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do + dir=`echo $i | sed -e 's/;.*$//'` + if [ "${dir}" = "${ml_dir}" ]; then + flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'` + break + fi + done + ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" GCJ="${GCJ_}$flags"' + + if [ "${with_target_subdir}" = "." ]; then + CC_=$CC' ' + CXX_=$CXX' ' + GCJ_=$GCJ' ' + else + # Create a regular expression that matches any string as long + # as ML_POPDIR. + popdir_rx=`echo ${ML_POPDIR} | sed 's,.,.,g'` + CC_= + for arg in ${CC}; do + case $arg in + -[BIL]"${ML_POPDIR}"/*) + CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\1/p"`' ' ;; + "${ML_POPDIR}"/*) + CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; + *) + CC_="${CC_}${arg} " ;; + esac + done + + CXX_= + for arg in ${CXX}; do + case $arg in + -[BIL]"${ML_POPDIR}"/*) + CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; + "${ML_POPDIR}"/*) + CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; + *) + CXX_="${CXX_}${arg} " ;; + esac + done + + GCJ_= + for arg in ${GCJ}; do + case $arg in + -[BIL]"${ML_POPDIR}"/*) + GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; + "${ML_POPDIR}"/*) + GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; + *) + GCJ_="${GCJ_}${arg} " ;; + esac + done + + if test "x${LD_LIBRARY_PATH+set}" = xset; then + LD_LIBRARY_PATH_= + for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do + case "$arg" in + "${ML_POPDIR}"/*) + arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"` + ;; + esac + if test "x$LD_LIBRARY_PATH_" != x; then + LD_LIBRARY_PATH_=$LD_LIBRARY_PATH_:$arg + else + LD_LIBRARY_PATH_=$arg + fi + done + ml_config_env="$ml_config_env LD_LIBRARY_PATH=$LD_LIBRARY_PATH_" + fi + + if test "x${SHLIB_PATH+set}" = xset; then + SHLIB_PATH_= + for arg in `echo "$SHLIB_PATH" | tr ':' ' '`; do + case "$arg" in + "${ML_POPDIR}"/*) + arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"` + ;; + esac + if test "x$SHLIB_PATH_" != x; then + SHLIB_PATH_=$SHLIB_PATH_:$arg + else + SHLIB_PATH_=$arg + fi + done + ml_config_env="$ml_config_env SHLIB_PATH=$SHLIB_PATH_" + fi + fi + + if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \ + --with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \ + ${ml_arguments} ${ml_srcdiroption} ; then + true + else + exit 1 + fi + + cd ${ML_POPDIR} + + done + + cd ${ml_origdir} +fi + +fi # ${ml_toplevel_p} = yes +fi # ${enable_multilib} = yes diff --git a/config.guess b/config.guess index 4fc21ec..6bdac8d 100755 --- a/config.guess +++ b/config.guess @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2003-01-30' +timestamp='2003-05-09' # 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 @@ -235,9 +235,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - *:MicroBSD:*:*) - echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE} - exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -747,7 +744,7 @@ EOF *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; - *:FreeBSD:*:*) + *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -1036,7 +1033,7 @@ EOF exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0) + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2003-02-03' +timestamp='2003-05-09' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -373,6 +373,9 @@ case $basic_machine in basic_machine=a29k-none os=-bsd ;; + amd64) + basic_machine=x86_64-pc + ;; amdahl) basic_machine=580-amdahl os=-sysv @@ -1128,7 +1131,7 @@ case $os in | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -microbsd*) + | -powermax* | -dnix*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) diff --git a/config/ChangeLog b/config/ChangeLog index 091f6fd..13d3c88 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,13 @@ +2003-05-14 Kelley Cook <kelleycook@wideopenwest.com> + + * acinclude.m4: Accept i[3456789]86 for machine type. + +2003-05-18 Nathanael Nerode <neroden@gcc.gnu.org> + + * config/acx.m4: Introduce _GCC_TOPLEV_NONCANONICAL_BUILD, + _GCC_TOPLEV_NONCANOICAL_HOST, _GCC_TOPLEV_NONCANONICAL_TARGET, + GCC_TOPLEV_SUBDIRS. + 2003-03-04 Nathanael Nerode <neroden@gcc.gnu.org> * mh-dgux: Delete. diff --git a/config/acinclude.m4 b/config/acinclude.m4 index 00887e0..c60373a 100755 --- a/config/acinclude.m4 +++ b/config/acinclude.m4 @@ -788,7 +788,7 @@ dnl Yes, this is ugly, and only used for a canadian cross anyway. This dnl is just to keep configure from stopping here. case "${host}" in changequote(,) - i[3456]86-*-*) ac_cv_c_little_endian=yes ;; + i[3456789]86-*-*) ac_cv_c_little_endian=yes ;; sparc*-*-*) ac_cv_c_little_endian=no ;; changequote([,]) *) AC_MSG_WARN(Can't cross compile this test) ;; diff --git a/config/acx.m4 b/config/acx.m4 index 4e16bcd..ea5cb07 100644 --- a/config/acx.m4 +++ b/config/acx.m4 @@ -1,6 +1,67 @@ # Autoconf M4 include file defining utility macros for complex Canadian # cross builds. +dnl #### +dnl # _GCC_TOPLEV_NONCANONICAL_BUILD +dnl # $build_alias or canonical $build if blank. +dnl # Used when we would use $build_alias, but empty is not OK. +AC_DEFUN([_GCC_TOPLEV_NONCANONICAL_BUILD], +[AC_REQUIRE([AC_CANONICAL_BUILD]) []dnl +case ${build_alias} in + "") build_noncanonical=${build} ;; + *) build_noncanonical=${build_alias} ;; +esac +]) []dnl # _GCC_TOPLEV_NONCANONICAL_BUILD + +dnl #### +dnl # _GCC_TOPLEV_NONCANONICAL_HOST +dnl # $host_alias, or $build_noncanonical if blank. +dnl # Used when we would use $host_alias, but empty is not OK. +AC_DEFUN([_GCC_TOPLEV_NONCANONICAL_HOST], +[AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl +case ${host_alias} in + "") host_noncanonical=${build_noncanonical} ;; + *) host_noncanonical=${host_alias} ;; +esac +]) []dnl # _GCC_TOPLEV_NONCANONICAL_HOST + +dnl #### +dnl # _GCC_TOPLEV_NONCANONICAL_TARGET +dnl # $target_alias or $host_noncanonical if blank. +dnl # Used when we would use $target_alias, but empty is not OK. +AC_DEFUN([_GCC_TOPLEV_NONCANONICAL_TARGET], +[AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_HOST]) []dnl +case ${target_alias} in + "") target_noncanonical=${host_noncanonical} ;; + *) target_noncanonical=${target_alias} ;; +esac +]) []dnl # _GCC_TOPLEV_NONCANONICAL_TARGET + +dnl #### +dnl # GCC_TOPLEV_SUBDIRS +dnl # GCC & friends build 'build', 'host', and 'target' tools. These must +dnl # be separated into three well-known subdirectories of the build directory: +dnl # build_subdir, host_subdir, and target_subdir. The values are determined +dnl # here so that they can (theoretically) be changed in the future. They +dnl # were previously reproduced across many different files. +dnl # +dnl # This logic really amounts to very little with autoconf 2.13; it will +dnl # amount to a lot more with autoconf 2.5x. +AC_DEFUN([GCC_TOPLEV_SUBDIRS], +[AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_TARGET]) []dnl +AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl +# Prefix 'build-' so this never conflicts with target_subdir. +build_subdir="build-${build_noncanonical}" +# Not really a subdirectory, but here for completeness. +host_subdir=. +# No prefix. +target_subdir=${target_noncanonical} +AC_SUBST([build_subdir]) []dnl +AC_SUBST([host_subdir]) []dnl +AC_SUBST([target_subdir]) []dnl +]) []dnl # GCC_TOPLEV_SUBDIRS + + #### # _NCN_TOOL_PREFIXES: Some stuff that oughtta be done in AC_CANONICAL_SYSTEM # or AC_INIT. @@ -661,6 +661,11 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," # Autoconf M4 include file defining utility macros for complex Canadian # cross builds. + + + + + #### # _NCN_TOOL_PREFIXES: Some stuff that oughtta be done in AC_CANONICAL_SYSTEM # or AC_INIT. @@ -824,6 +829,16 @@ target_tools="target-examples target-groff target-gperf target-rda" configdirs=`echo ${host_libs} ${host_tools}` target_configdirs=`echo ${target_libs} ${target_tools}` +# Only make build modules if build != host. +# This should be done more generally, but at the moment it doesn't matter. +if test ${host_alias} != ${build_alias} ; then + # This is the only build module. + build_modules=libiberty +else + build_modules= +fi + + ################################################################################ srcname="gnu development package" @@ -839,9 +854,29 @@ else is_cross_compiler=yes fi -# We always want to use the same name for this directory, so that dejagnu -# can reliably find it. -target_subdir=${target_alias} +# Find the build and target subdirs. + case ${build_alias} in + "") build_noncanonical=${build} ;; + *) build_noncanonical=${build_alias} ;; +esac + + case ${host_alias} in + "") host_noncanonical=${build_noncanonical} ;; + *) host_noncanonical=${host_alias} ;; +esac + + case ${target_alias} in + "") target_noncanonical=${host_noncanonical} ;; + *) target_noncanonical=${target_alias} ;; +esac + + # Prefix 'build-' so this never conflicts with target_subdir. +build_subdir="build-${build_noncanonical}" +# Not really a subdirectory, but here for completeness. +host_subdir=. +# No prefix. +target_subdir=${target_noncanonical} + if test ! -d ${target_subdir} ; then if mkdir ${target_subdir} ; then true @@ -851,9 +886,6 @@ if test ! -d ${target_subdir} ; then fi fi -build_prefix=build- -build_subdir=${build_prefix}${build_alias} - if test x"${build_alias}" != x"${host}" ; then if test ! -d ${build_subdir} ; then if mkdir ${build_subdir} ; then true @@ -938,17 +970,17 @@ case "${host}" in hppa*64*-*-*) noconfigdirs="$noconfigdirs byacc" ;; - i[3456]86-*-vsta) + i[3456789]86-*-vsta) noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl itcl tix gnuserv gettext" ;; - i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*) + i[3456789]86-*-go32* | i[3456789]86-*-msdosdjgpp*) noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix gnuserv libffi" ;; - i[3456]86-*-mingw32*) + i[3456789]86-*-mingw32*) # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix gnuserv" noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool" ;; - i[3456]86-*-beos*) + i[3456789]86-*-beos*) noconfigdirs="$noconfigdirs tk itcl tix libgui gdb" ;; *-*-cygwin*) @@ -1155,13 +1187,13 @@ case "${target}" in # No gdb or ld support yet. noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb ld" ;; - i[3456]86-*-coff | i[3456]86-*-elf) + i[3456789]86-*-coff | i[3456789]86-*-elf) noconfigdirs="$noconfigdirs ${libgcj}" ;; - i[34567]86-*-freebsd*) + i[3456789]86-*-freebsd*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; - i[3456]86-*-linux*) + i[3456789]86-*-linux*) # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's # not build java stuff by default. case "${target}" in @@ -1180,13 +1212,13 @@ case "${target}" in # if the --with-newlib option has been given, because otherwise # 'target-newlib' will appear in skipdirs. ;; - i[3456]86-*-mingw32*) + i[3456789]86-*-mingw32*) target_configdirs="$target_configdirs target-mingw" noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}" # Can't build gdb for mingw32 if not native. case "${host}" in - i[3456]86-*-mingw32) ;; # keep gdb tcl tk expect etc. + i[3456789]86-*-mingw32) ;; # keep gdb tcl tk expect etc. *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix gnuserv" ;; esac @@ -1204,24 +1236,24 @@ case "${target}" in ;; esac ;; - i[3456]86-*-pe) + i[3456789]86-*-pe) noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" ;; - i[3456]86-*-sco3.2v5*) + i[3456789]86-*-sco3.2v5*) # The linker does not yet know about weak symbols in COFF, # and is not configured to handle mixed ELF and COFF. noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}" ;; - i[3456]86-*-sco*) + i[3456789]86-*-sco*) noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; - i[3456]86-*-solaris2*) + i[3456789]86-*-solaris2*) noconfigdirs="$noconfigdirs target-libgloss" ;; - i[3456]86-*-sysv4*) + i[3456789]86-*-sysv4*) noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;; - i[3456]86-*-beos*) + i[3456789]86-*-beos*) noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" ;; m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) @@ -1310,9 +1342,9 @@ case "${target}" in ;; sh-*-*) case "${host}" in - i[3456]86-*-vsta) ;; # don't add gprof back in - i[3456]86-*-go32*) ;; # don't add gprof back in - i[3456]86-*-msdosdjgpp*) ;; # don't add gprof back in + i[3456789]86-*-vsta) ;; # don't add gprof back in + i[3456789]86-*-go32*) ;; # don't add gprof back in + i[3456789]86-*-msdosdjgpp*) ;; # don't add gprof back in *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;; esac noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" @@ -1707,19 +1739,19 @@ case "${host}" in i370-ibm-opened*) tentative_cc="c89" ;; - i[3456]86-*-sysv5*) + i[3456789]86-*-sysv5*) host_makefile_frag="config/mh-sysv5" ;; - i[3456]86-*-dgux*) + i[3456789]86-*-dgux*) tentative_cc="gcc -Wall -ansi -D__using_DGUX" host_makefile_frag="config/mh-dgux386" ;; - i[3456]86-ncr-sysv4.3*) + i[3456789]86-ncr-sysv4.3*) # The MetaWare compiler will generate a copyright message unless you # turn it off by adding the -Hnocopyr flag. tentative_cc="cc -Hnocopyr" ;; - i[3456]86-ncr-sysv4*) + i[3456789]86-ncr-sysv4*) # for an NCR 3000 (i486/SVR4) system. # The NCR 3000 ships with a MetaWare compiler installed as /bin/cc. # This compiler not only emits obnoxious copyright messages every time @@ -1728,21 +1760,21 @@ case "${host}" in tentative_cc="/usr/ccs/ATT/cc" host_makefile_frag="config/mh-ncr3000" ;; - i[3456]86-*-sco3.2v5*) + i[3456789]86-*-sco3.2v5*) ;; - i[3456]86-*-sco*) + i[3456789]86-*-sco*) # The native C compiler botches some simple uses of const. Unfortunately, # it doesn't defined anything like "__sco__" for us to test for in ansidecl.h. tentative_cc="cc -Dconst=" host_makefile_frag="config/mh-sco" ;; - i[3456]86-*-udk*) + i[3456789]86-*-udk*) host_makefile_frag="config/mh-sysv5" ;; - i[3456]86-*-solaris2*) + i[3456789]86-*-solaris2*) host_makefile_frag="config/mh-sysv4" ;; - i[3456]86-*-msdosdjgpp*) + i[3456789]86-*-msdosdjgpp*) host_makefile_frag="config/mh-djgpp" ;; *-cygwin*) @@ -1792,7 +1824,7 @@ extra_nmflags_for_target= extra_ranlibflags_for_target= target_makefile_frag=/dev/null case "${target}" in - i[3456]86-*-netware*) + i[3456789]86-*-netware*) target_makefile_frag="config/mt-netware" ;; powerpc-*-netware*) @@ -1926,7 +1958,7 @@ fi # Some systems (e.g., one of the i386-aix systems the gas testers are # using) don't handle "\$" correctly, so don't use it here. -tooldir='$(exec_prefix)'/${target_alias} +tooldir='${exec_prefix}'/${target_alias} build_tooldir=${tooldir} # Generate a default definition for YACC. This is used if the makefile can't @@ -2264,59 +2296,14 @@ esac target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'` # This is the final value for target_configdirs. configdirs already -# has its final value. It's time to create some lists of valid targets. - -# While at that, we remove Makefiles if we were started for recursive -# configuration, such that the top-level Makefile reconfigures them, -# like we used to do when configure itself was recursive. +# has its final value, as does build_modules. It's time to create some +# lists of valid targets. all_build_modules= configure_build_modules= -# Only make build modules if build != host. -# This should be done more generally, but at the moment it doesn't matter. -if test ${host_alias} != ${build_alias} ; then - for module in libiberty ; do - all_build_modules=all-build-${module} - configure_build_modules=configure-build-${module} - if test -z "${no_recursion}" \ - && test -f ${build_subdir}/${module}/Makefile; then - echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure" - rm -f ${build_subdir}/${module}/Makefile - fi - done -fi - -all_host_modules= -check_host_modules= -install_host_modules= -configure_host_modules= -for module in ${configdirs} ; do - all_host_modules="${all_host_modules} all-${module}" - check_host_modules="${check_host_modules} check-${module}" - install_host_modules="${install_host_modules} install-${module}" - configure_host_modules="${configure_host_modules} configure-${module}" - if test -z "${no_recursion}" \ - && test -f ${module}/Makefile; then - echo 1>&2 "*** removing ${module}/Makefile to force reconfigure" - rm -f ${module}/Makefile - fi -done -install_host_modules_nogcc=`echo "${install_host_modules}" | sed -e 's/install-gcc//g'` - -all_target_modules= -check_target_modules= -install_target_modules= -configure_target_modules= -for module in ${target_configdirs} ; do - all_target_modules="${all_target_modules} all-target-${module}" - check_target_modules="${check_target_modules} check-target-${module}" - install_target_modules="${install_target_modules} install-target-${module}" - configure_target_modules="${configure_target_modules} configure-target-${module}" - if test -z "${no_recursion}" \ - && test -f ${target_subdir}/${module}/Makefile; then - echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure" - rm -f ${target_subdir}/${module}/Makefile - fi +for module in ${build_modules} ; do + all_build_modules=all-build-${module} + configure_build_modules=configure-build-${module} done # Determine whether gdb needs tk/tcl or not. @@ -2346,13 +2333,49 @@ case "$enable_gdbtk" in esac # Create the 'maybe dependencies'. This uses a temporary file. + +# While at that, we remove Makefiles if we were started for recursive +# configuration, so that the top-level Makefile reconfigures them, +# like we used to do when configure itself was recursive. rm -f maybedep.tmp echo '# maybedep.tmp' > maybedep.tmp -for item in ${all_build_modules} ${all_host_modules} ${all_target_modules} \ - ${install_host_modules} ${install_target_modules} \ - ${configure_build_modules} ${configure_host_modules} ${configure_target_modules} \ - ; do - echo "maybe-${item}: ${item}" >> maybedep.tmp + +# Make-targets which may need maybe dependencies. +mts="configure all install check" + +# Loop over modules and make-targets. +for module in ${build_modules} ; do + if test -z "${no_recursion}" \ + && test -f ${build_subdir}/${module}/Makefile; then + echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure" + rm -f ${build_subdir}/${module}/Makefile + fi + for mt in ${mts} ; do + case ${mt} in + install) ;; # No installing build modules. + *) echo "maybe-${mt}-build-${module}: ${mt}-build-${module}" >> maybedep.tmp ;; + esac + done +done +for module in ${configdirs} ; do + if test -z "${no_recursion}" \ + && test -f ${module}/Makefile; then + echo 1>&2 "*** removing ${module}/Makefile to force reconfigure" + rm -f ${module}/Makefile + fi + for mt in ${mts} ; do + echo "maybe-${mt}-${module}: ${mt}-${module}" >> maybedep.tmp + done +done +for module in ${target_configdirs} ; do + if test -z "${no_recursion}" \ + && test -f ${target_subdir}/${module}/Makefile; then + echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure" + rm -f ${target_subdir}/${module}/Makefile + fi + for mt in ${mts} ; do + echo "maybe-${mt}-target-${module}: ${mt}-target-${module}" >> maybedep.tmp + done done maybe_dependencies=maybedep.tmp @@ -2418,7 +2441,7 @@ baseargs=`echo " ${ac_configure_args} " | \ -e 's/ -host[= ][^ ]* / /' \ -e 's/ -build[= ][^ ]* / /' \ -e 's/ -target[= ][^ ]* / /' \ - -e 's/ [^ -][^ ]* / /' \ + -e "s/ [^' -][^ ]* / /" \ -e 's/^ *//;s/ *$//'` # For the build-side libraries, we just need to pretend we're native, @@ -2488,7 +2511,7 @@ case " $target_configdirs " in *" --with-newlib "*) case "$target" in *-cygwin*) - FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include -isystem $$s/newlib/libc/sys/cygwin -isystem $$s/newlib/libc/sys/cygwin32' ;; + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include' ;; esac # If we're not building GCC, don't discard standard headers. @@ -2515,7 +2538,7 @@ case " $target_configdirs " in fi case "${target}-${is_cross_compiler}" in - i[3456]86-*-linux*-no) + i[3456789]86-*-linux*-no) # Here host == target, so we don't need to build gcc, # so we don't want to discard standard headers. FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'` @@ -2642,25 +2665,14 @@ ospace_frag=${srcdir}/${ospace_frag} - # Host module lists & subconfigure args. - - - - - # Target module lists & subconfigure args. - - - - - # Build tools. @@ -2679,7 +2691,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:2687: checking for $ac_word" >&5 +echo "configure:2695: 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 @@ -2712,7 +2724,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:2720: checking for $ac_word" >&5 +echo "configure:2728: 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 @@ -2751,7 +2763,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:2759: checking for $ac_word" >&5 +echo "configure:2767: 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 @@ -2784,7 +2796,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:2792: checking for $ac_word" >&5 +echo "configure:2800: 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 @@ -2823,7 +2835,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:2831: checking for $ac_word" >&5 +echo "configure:2839: 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 @@ -2856,7 +2868,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:2864: checking for $ac_word" >&5 +echo "configure:2872: 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 @@ -2895,7 +2907,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:2903: checking for $ac_word" >&5 +echo "configure:2911: 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 @@ -2928,7 +2940,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:2936: checking for $ac_word" >&5 +echo "configure:2944: 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 @@ -2967,7 +2979,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:2975: checking for $ac_word" >&5 +echo "configure:2983: 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 @@ -3000,7 +3012,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:3008: checking for $ac_word" >&5 +echo "configure:3016: 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 @@ -3039,7 +3051,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:3047: checking for $ac_word" >&5 +echo "configure:3055: 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 @@ -3072,7 +3084,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:3080: checking for $ac_word" >&5 +echo "configure:3088: 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 @@ -3111,7 +3123,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:3119: checking for $ac_word" >&5 +echo "configure:3127: 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 @@ -3144,7 +3156,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:3152: checking for $ac_word" >&5 +echo "configure:3160: 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 @@ -3183,7 +3195,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:3191: checking for $ac_word" >&5 +echo "configure:3199: 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 @@ -3216,7 +3228,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:3224: checking for $ac_word" >&5 +echo "configure:3232: 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 @@ -3255,7 +3267,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:3263: checking for $ac_word" >&5 +echo "configure:3271: 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 @@ -3288,7 +3300,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:3296: checking for $ac_word" >&5 +echo "configure:3304: 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 @@ -3336,7 +3348,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:3344: checking for $ac_word" >&5 +echo "configure:3352: 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 @@ -3369,7 +3381,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:3377: checking for $ac_word" >&5 +echo "configure:3385: 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 @@ -3408,7 +3420,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:3416: checking for $ac_word" >&5 +echo "configure:3424: 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 @@ -3441,7 +3453,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:3449: checking for $ac_word" >&5 +echo "configure:3457: 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 @@ -3480,7 +3492,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:3488: checking for $ac_word" >&5 +echo "configure:3496: 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 @@ -3513,7 +3525,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:3521: checking for $ac_word" >&5 +echo "configure:3529: 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 @@ -3552,7 +3564,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:3560: checking for $ac_word" >&5 +echo "configure:3568: 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 @@ -3585,7 +3597,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:3593: checking for $ac_word" >&5 +echo "configure:3601: 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 @@ -3624,7 +3636,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:3632: checking for $ac_word" >&5 +echo "configure:3640: 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 @@ -3657,7 +3669,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:3665: checking for $ac_word" >&5 +echo "configure:3673: 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 @@ -3696,7 +3708,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:3704: checking for $ac_word" >&5 +echo "configure:3712: 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 @@ -3729,7 +3741,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:3737: checking for $ac_word" >&5 +echo "configure:3745: 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 @@ -3768,7 +3780,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:3776: checking for $ac_word" >&5 +echo "configure:3784: 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 @@ -3801,7 +3813,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:3809: checking for $ac_word" >&5 +echo "configure:3817: 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 @@ -3868,7 +3880,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:3876: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:3884: 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" @@ -4049,6 +4061,9 @@ s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g s%@TOPLEVEL_CONFIGURE_ARGUMENTS@%$TOPLEVEL_CONFIGURE_ARGUMENTS%g +s%@build_subdir@%$build_subdir%g +s%@host_subdir@%$host_subdir%g +s%@target_subdir@%$target_subdir%g /@maybe_dependencies@/r $maybe_dependencies s%@maybe_dependencies@%%g /@serialization_dependencies@/r $serialization_dependencies @@ -4073,24 +4088,13 @@ s%@build_tooldir@%$build_tooldir%g s%@GDB_TK@%$GDB_TK%g s%@gxx_include_dir@%$gxx_include_dir%g s%@libstdcxx_incdir@%$libstdcxx_incdir%g -s%@build_subdir@%$build_subdir%g s%@build_configargs@%$build_configargs%g s%@configure_build_modules@%$configure_build_modules%g s%@all_build_modules@%$all_build_modules%g s%@host_configargs@%$host_configargs%g s%@configdirs@%$configdirs%g -s%@configure_host_modules@%$configure_host_modules%g -s%@all_host_modules@%$all_host_modules%g -s%@check_host_modules@%$check_host_modules%g -s%@install_host_modules@%$install_host_modules%g -s%@install_host_modules_nogcc@%$install_host_modules_nogcc%g -s%@target_subdir@%$target_subdir%g s%@target_configargs@%$target_configargs%g s%@target_configdirs@%$target_configdirs%g -s%@configure_target_modules@%$configure_target_modules%g -s%@all_target_modules@%$all_target_modules%g -s%@check_target_modules@%$check_target_modules%g -s%@install_target_modules@%$install_target_modules%g s%@BISON@%$BISON%g s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g s%@LEX@%$LEX%g diff --git a/configure.in b/configure.in index f695982..87ab222 100644 --- a/configure.in +++ b/configure.in @@ -164,6 +164,16 @@ target_tools="target-examples target-groff target-gperf target-rda" configdirs=`echo ${host_libs} ${host_tools}` target_configdirs=`echo ${target_libs} ${target_tools}` +# Only make build modules if build != host. +# This should be done more generally, but at the moment it doesn't matter. +if test ${host_alias} != ${build_alias} ; then + # This is the only build module. + build_modules=libiberty +else + build_modules= +fi + + ################################################################################ srcname="gnu development package" @@ -179,9 +189,8 @@ else is_cross_compiler=yes fi -# We always want to use the same name for this directory, so that dejagnu -# can reliably find it. -target_subdir=${target_alias} +# Find the build and target subdirs. +GCC_TOPLEV_SUBDIRS if test ! -d ${target_subdir} ; then if mkdir ${target_subdir} ; then true @@ -191,9 +200,6 @@ if test ! -d ${target_subdir} ; then fi fi -build_prefix=build- -build_subdir=${build_prefix}${build_alias} - if test x"${build_alias}" != x"${host}" ; then if test ! -d ${build_subdir} ; then if mkdir ${build_subdir} ; then true @@ -278,17 +284,17 @@ case "${host}" in hppa*64*-*-*) noconfigdirs="$noconfigdirs byacc" ;; - i[[3456]]86-*-vsta) + i[[3456789]]86-*-vsta) noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl itcl tix gnuserv gettext" ;; - i[[3456]]86-*-go32* | i[[3456]]86-*-msdosdjgpp*) + i[[3456789]]86-*-go32* | i[[3456789]]86-*-msdosdjgpp*) noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix gnuserv libffi" ;; - i[[3456]]86-*-mingw32*) + i[[3456789]]86-*-mingw32*) # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix gnuserv" noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool" ;; - i[[3456]]86-*-beos*) + i[[3456789]]86-*-beos*) noconfigdirs="$noconfigdirs tk itcl tix libgui gdb" ;; *-*-cygwin*) @@ -495,13 +501,13 @@ case "${target}" in # No gdb or ld support yet. noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb ld" ;; - i[[3456]]86-*-coff | i[[3456]]86-*-elf) + i[[3456789]]86-*-coff | i[[3456789]]86-*-elf) noconfigdirs="$noconfigdirs ${libgcj}" ;; - i[[34567]]86-*-freebsd*) + i[[3456789]]86-*-freebsd*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; - i[[3456]]86-*-linux*) + i[[3456789]]86-*-linux*) # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's # not build java stuff by default. case "${target}" in @@ -520,13 +526,13 @@ case "${target}" in # if the --with-newlib option has been given, because otherwise # 'target-newlib' will appear in skipdirs. ;; - i[[3456]]86-*-mingw32*) + i[[3456789]]86-*-mingw32*) target_configdirs="$target_configdirs target-mingw" noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}" # Can't build gdb for mingw32 if not native. case "${host}" in - i[[3456]]86-*-mingw32) ;; # keep gdb tcl tk expect etc. + i[[3456789]]86-*-mingw32) ;; # keep gdb tcl tk expect etc. *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix gnuserv" ;; esac @@ -544,24 +550,24 @@ case "${target}" in ;; esac ;; - i[[3456]]86-*-pe) + i[[3456789]]86-*-pe) noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" ;; - i[[3456]]86-*-sco3.2v5*) + i[[3456789]]86-*-sco3.2v5*) # The linker does not yet know about weak symbols in COFF, # and is not configured to handle mixed ELF and COFF. noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}" ;; - i[[3456]]86-*-sco*) + i[[3456789]]86-*-sco*) noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; - i[[3456]]86-*-solaris2*) + i[[3456789]]86-*-solaris2*) noconfigdirs="$noconfigdirs target-libgloss" ;; - i[[3456]]86-*-sysv4*) + i[[3456789]]86-*-sysv4*) noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;; - i[[3456]]86-*-beos*) + i[[3456789]]86-*-beos*) noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" ;; m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) @@ -650,9 +656,9 @@ case "${target}" in ;; sh-*-*) case "${host}" in - i[[3456]]86-*-vsta) ;; # don't add gprof back in - i[[3456]]86-*-go32*) ;; # don't add gprof back in - i[[3456]]86-*-msdosdjgpp*) ;; # don't add gprof back in + i[[3456789]]86-*-vsta) ;; # don't add gprof back in + i[[3456789]]86-*-go32*) ;; # don't add gprof back in + i[[3456789]]86-*-msdosdjgpp*) ;; # don't add gprof back in *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;; esac noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" @@ -1047,19 +1053,19 @@ case "${host}" in i370-ibm-opened*) tentative_cc="c89" ;; - i[[3456]]86-*-sysv5*) + i[[3456789]]86-*-sysv5*) host_makefile_frag="config/mh-sysv5" ;; - i[[3456]]86-*-dgux*) + i[[3456789]]86-*-dgux*) tentative_cc="gcc -Wall -ansi -D__using_DGUX" host_makefile_frag="config/mh-dgux386" ;; - i[[3456]]86-ncr-sysv4.3*) + i[[3456789]]86-ncr-sysv4.3*) # The MetaWare compiler will generate a copyright message unless you # turn it off by adding the -Hnocopyr flag. tentative_cc="cc -Hnocopyr" ;; - i[[3456]]86-ncr-sysv4*) + i[[3456789]]86-ncr-sysv4*) # for an NCR 3000 (i486/SVR4) system. # The NCR 3000 ships with a MetaWare compiler installed as /bin/cc. # This compiler not only emits obnoxious copyright messages every time @@ -1068,21 +1074,21 @@ case "${host}" in tentative_cc="/usr/ccs/ATT/cc" host_makefile_frag="config/mh-ncr3000" ;; - i[[3456]]86-*-sco3.2v5*) + i[[3456789]]86-*-sco3.2v5*) ;; - i[[3456]]86-*-sco*) + i[[3456789]]86-*-sco*) # The native C compiler botches some simple uses of const. Unfortunately, # it doesn't defined anything like "__sco__" for us to test for in ansidecl.h. tentative_cc="cc -Dconst=" host_makefile_frag="config/mh-sco" ;; - i[[3456]]86-*-udk*) + i[[3456789]]86-*-udk*) host_makefile_frag="config/mh-sysv5" ;; - i[[3456]]86-*-solaris2*) + i[[3456789]]86-*-solaris2*) host_makefile_frag="config/mh-sysv4" ;; - i[[3456]]86-*-msdosdjgpp*) + i[[3456789]]86-*-msdosdjgpp*) host_makefile_frag="config/mh-djgpp" ;; *-cygwin*) @@ -1132,7 +1138,7 @@ extra_nmflags_for_target= extra_ranlibflags_for_target= target_makefile_frag=/dev/null case "${target}" in - i[[3456]]86-*-netware*) + i[[3456789]]86-*-netware*) target_makefile_frag="config/mt-netware" ;; powerpc-*-netware*) @@ -1266,7 +1272,7 @@ fi # Some systems (e.g., one of the i386-aix systems the gas testers are # using) don't handle "\$" correctly, so don't use it here. -tooldir='$(exec_prefix)'/${target_alias} +tooldir='${exec_prefix}'/${target_alias} build_tooldir=${tooldir} # Generate a default definition for YACC. This is used if the makefile can't @@ -1604,59 +1610,14 @@ esac target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'` # This is the final value for target_configdirs. configdirs already -# has its final value. It's time to create some lists of valid targets. - -# While at that, we remove Makefiles if we were started for recursive -# configuration, such that the top-level Makefile reconfigures them, -# like we used to do when configure itself was recursive. +# has its final value, as does build_modules. It's time to create some +# lists of valid targets. all_build_modules= configure_build_modules= -# Only make build modules if build != host. -# This should be done more generally, but at the moment it doesn't matter. -if test ${host_alias} != ${build_alias} ; then - for module in libiberty ; do - all_build_modules=all-build-${module} - configure_build_modules=configure-build-${module} - if test -z "${no_recursion}" \ - && test -f ${build_subdir}/${module}/Makefile; then - echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure" - rm -f ${build_subdir}/${module}/Makefile - fi - done -fi - -all_host_modules= -check_host_modules= -install_host_modules= -configure_host_modules= -for module in ${configdirs} ; do - all_host_modules="${all_host_modules} all-${module}" - check_host_modules="${check_host_modules} check-${module}" - install_host_modules="${install_host_modules} install-${module}" - configure_host_modules="${configure_host_modules} configure-${module}" - if test -z "${no_recursion}" \ - && test -f ${module}/Makefile; then - echo 1>&2 "*** removing ${module}/Makefile to force reconfigure" - rm -f ${module}/Makefile - fi -done -install_host_modules_nogcc=`echo "${install_host_modules}" | sed -e 's/install-gcc//g'` - -all_target_modules= -check_target_modules= -install_target_modules= -configure_target_modules= -for module in ${target_configdirs} ; do - all_target_modules="${all_target_modules} all-target-${module}" - check_target_modules="${check_target_modules} check-target-${module}" - install_target_modules="${install_target_modules} install-target-${module}" - configure_target_modules="${configure_target_modules} configure-target-${module}" - if test -z "${no_recursion}" \ - && test -f ${target_subdir}/${module}/Makefile; then - echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure" - rm -f ${target_subdir}/${module}/Makefile - fi +for module in ${build_modules} ; do + all_build_modules=all-build-${module} + configure_build_modules=configure-build-${module} done # Determine whether gdb needs tk/tcl or not. @@ -1686,13 +1647,49 @@ case "$enable_gdbtk" in esac # Create the 'maybe dependencies'. This uses a temporary file. + +# While at that, we remove Makefiles if we were started for recursive +# configuration, so that the top-level Makefile reconfigures them, +# like we used to do when configure itself was recursive. rm -f maybedep.tmp echo '# maybedep.tmp' > maybedep.tmp -for item in ${all_build_modules} ${all_host_modules} ${all_target_modules} \ - ${install_host_modules} ${install_target_modules} \ - ${configure_build_modules} ${configure_host_modules} ${configure_target_modules} \ - ; do - echo "maybe-${item}: ${item}" >> maybedep.tmp + +# Make-targets which may need maybe dependencies. +mts="configure all install check" + +# Loop over modules and make-targets. +for module in ${build_modules} ; do + if test -z "${no_recursion}" \ + && test -f ${build_subdir}/${module}/Makefile; then + echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure" + rm -f ${build_subdir}/${module}/Makefile + fi + for mt in ${mts} ; do + case ${mt} in + install) ;; # No installing build modules. + *) echo "maybe-${mt}-build-${module}: ${mt}-build-${module}" >> maybedep.tmp ;; + esac + done +done +for module in ${configdirs} ; do + if test -z "${no_recursion}" \ + && test -f ${module}/Makefile; then + echo 1>&2 "*** removing ${module}/Makefile to force reconfigure" + rm -f ${module}/Makefile + fi + for mt in ${mts} ; do + echo "maybe-${mt}-${module}: ${mt}-${module}" >> maybedep.tmp + done +done +for module in ${target_configdirs} ; do + if test -z "${no_recursion}" \ + && test -f ${target_subdir}/${module}/Makefile; then + echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure" + rm -f ${target_subdir}/${module}/Makefile + fi + for mt in ${mts} ; do + echo "maybe-${mt}-target-${module}: ${mt}-target-${module}" >> maybedep.tmp + done done maybe_dependencies=maybedep.tmp AC_SUBST_FILE(maybe_dependencies) @@ -1757,7 +1754,7 @@ baseargs=`echo " ${ac_configure_args} " | \ -e 's/ -host[[= ]][[^ ]]* / /' \ -e 's/ -build[[= ]][[^ ]]* / /' \ -e 's/ -target[[= ]][[^ ]]* / /' \ - -e 's/ [[^ -][^ ]*] / /' \ + -e "s/ [[^' -][^ ]*] / /" \ -e 's/^ *//;s/ *$//'` # For the build-side libraries, we just need to pretend we're native, @@ -1827,7 +1824,7 @@ case " $target_configdirs " in *" --with-newlib "*) case "$target" in *-cygwin*) - FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include -isystem $$s/newlib/libc/sys/cygwin -isystem $$s/newlib/libc/sys/cygwin32' ;; + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include' ;; esac # If we're not building GCC, don't discard standard headers. @@ -1854,7 +1851,7 @@ case " $target_configdirs " in fi case "${target}-${is_cross_compiler}" in - i[[3456]]86-*-linux*-no) + i[[3456789]]86-*-linux*-no) # Here host == target, so we don't need to build gcc, # so we don't want to discard standard headers. FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'` @@ -1977,7 +1974,6 @@ AC_SUBST(gxx_include_dir) AC_SUBST(libstdcxx_incdir) # Build module lists & subconfigure args. -AC_SUBST(build_subdir) AC_SUBST(build_configargs) AC_SUBST(configure_build_modules) AC_SUBST(all_build_modules) @@ -1985,20 +1981,10 @@ AC_SUBST(all_build_modules) # Host module lists & subconfigure args. AC_SUBST(host_configargs) AC_SUBST(configdirs) -AC_SUBST(configure_host_modules) -AC_SUBST(all_host_modules) -AC_SUBST(check_host_modules) -AC_SUBST(install_host_modules) -AC_SUBST(install_host_modules_nogcc) # Target module lists & subconfigure args. -AC_SUBST(target_subdir) AC_SUBST(target_configargs) AC_SUBST(target_configdirs) -AC_SUBST(configure_target_modules) -AC_SUBST(all_target_modules) -AC_SUBST(check_target_modules) -AC_SUBST(install_target_modules) # Build tools. AC_SUBST(BISON) diff --git a/etc/ChangeLog b/etc/ChangeLog index 9a1a67d..6865f2d 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2003-05-16 Kelley Cook <kelleycook@wideopenwest.com> + + * configure.texi: Use "i[3-7]86" in example. + 2003-01-02 H.J. Lu <hjl@gnu.org> * Makefile.in (DESTDIR): New. diff --git a/etc/configure.texi b/etc/configure.texi index 9140167..d69dc41 100644 --- a/etc/configure.texi +++ b/etc/configure.texi @@ -1451,7 +1451,7 @@ canonical configuration name (which will be the case if @smallexample case "$@{host@}" in -i[3456]86-*-linux-gnu*) do something ;; +i[3-7]86-*-linux-gnu*) do something ;; sparc*-sun-solaris2.[56789]*) do something ;; sparc*-sun-solaris*) do something ;; mips*-*-elf*) do something ;; @@ -1465,7 +1465,7 @@ field, in order to match the version number which will be generated by In most cases you must be careful to match a range of processor types. For most processor families, a trailing @samp{*} suffices, as in @samp{mips*} above. For the i386 family, something along the lines of -@samp{i[3456]86} suffices at present. For the m68k family, you will +@samp{i[3-7]86} suffices at present. For the m68k family, you will need something like @samp{m68*}. Of course, if you do not need to match on the processor, it is simpler to just replace the entire field by a @samp{*}, as in @samp{*-*-irix*}. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cdaf889..c03b174 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,776 @@ +2003-05-23 David Carlton <carlton@bactrian.org> + + * Merge with mainline; tag is carlton_dictionary-20030523-merge. + +2003-05-22 Ian Lance Taylor <ian@airs.com> + + * disasm.c (gdb_disassemble_info): Initialize disassemble_info + with fprintf_filtered, not fprintf_unfiltered. + +2003-05-22 Andrew Cagney <cagney@redhat.com> + + * stack.c (frame_info): Inline extract_address, replacing it with + extract_unsigned_integer. + * findvar.c (unsigned_pointer_to_address): Ditto. + * dwarf2loc.c (dwarf_expr_read_reg): Ditto. + * dwarf2expr.c (dwarf2_read_address): Ditto. + * frame.c (frame_pc_unwind): Update comment. + * dummy-frame.c (deprecated_read_register_dummy): Update comment. + +2003-05-22 Jeff Johnston <jjohnstn@redhat.com> + + * infptrace.c (detach): Call print_sys_errmsg rather than + perror_with_name to issue warning message when errno is non-zero + after calling ptrace detach. + +2003-05-21 J. Brobecker <brobecker@gnat.com> + + * config/pa/tm-hppa.h: Delete some unused macros. Move some + macro definitions from here... + * hppa-tdep.c: ...to there. + +2003-05-20 Kevin Buettner <kevinb@redhat.com> + + * mips-nat.c (REGISTER_PTRACE_ADDR): Convert macro to function + register_ptrace_addr(). Fix all callers. + +2003-05-21 Andreas Schwab <schwab@suse.de> + + * Makefile.in (m68k-tdep.o, m68klinux-tdep.o): Update + dependencies. + * m68k-tdep.c (m68k_gdbarch_init): Call gdbarch_init_osabi at the + end. + * m68klinux-tdep.c (m68k_linux_init_abi): New function. + (_initialize_m68k_linux_tdep): New function. + (m68k_linux_frame_saved_pc): Make static. + (m68k_linux_extract_return_value): Likewise. + (m68k_linux_store_return_value): Likewise. + (m68k_linux_extract_struct_value_address): Likewise. + * config/m68k/tm-linux.h (DEPRECATED_EXTRACT_RETURN_VALUE): + Remove. + (DEPRECATED_STORE_RETURN_VALUE): Remove. + (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Remove. + (DEPRECATED_FRAME_SAVED_PC): Remove. + +2003-05-20 Kris Warkentin <kewarken@qnx.com> + + * nto-tdep.c (fetch_core_registers): Match gdb's idea of + regset numbering rather than our own. + +2003-05-19 David Carlton <carlton@bactrian.org> + + * config/djgpp/fnchange.lst: Add testsuite/gdb.c++/rtti*. + +2003-05-19 David Carlton <carlton@bactrian.org> + + Partial fix for PR c++/827. + * cp-support.h: Include symtab.h. + Declare cp_lookup_symbol_nonlocal, cp_lookup_symbol_namespace. + * cp-namespace.c: Update contributors. + (cp_lookup_symbol_nonlocal): New. + (lookup_namespace_scope, cp_lookup_symbol_namespace) + (lookup_symbol_file): Ditto. + * c-lang.c (cplus_language_defn): Use cp_lookup_symbol_nonlocal. + * block.h: Declare block_scope, block_using, block_global_block. + * block.c (block_scope): New. + (block_using, block_global_block): Ditto. + * Makefile.in (cp_support_h): Depend on symtab_h. + * config/djgpp/fnchange.lst: Add testsuite/gdb.c++/namespace1.cc. + +2003-05-19 David Carlton <carlton@bactrian.org> + + * language.h (struct language_defn): Add 'la_value_of_this' + and 'la_lookup_symbol_nonlocal' members. + * symtab.h: Declare basic_lookup_symbol_nonlocal, + lookup_symbol_static, lookup_symbol_global, + lookup_symbol_aux_block. + * symtab.c (lookup_symbol_aux): Call language hooks to determine + if we should search fields of this and how to do static/global + lookup. + (lookup_symbol_aux_block): Make extern. + (basic_lookup_symbol_nonlocal): New. + (lookup_symbol_static, lookup_symbol_global): Ditto. + * ada-lang.c (ada_language_defn): Set 'la_value_of_this' and + 'la_lookup_symbol_nonlocal' members. + * c-lang.c (c_language_defn, cplus_language_defn) + (asm_language_defn, minimal_language_defn): Ditto. + * jv-lang.c (java_language_defn): Ditto. + * language.c (unknown_language_defn, auto_language_defn) + (local_language_defn): Ditto. + * m2-lang.c (m2_language_defn): Ditto. + * objc-lang.c (objc_language_defn): Ditto. + * scm-lang.c (scm_language_defn): Ditto. + * f-lang.c (f_language_defn): Ditto, and include value.h as well. + * p-lang.c (pascal_language_defn): Ditto for both. + * Makefile.in (f-lang.o): Depend on value_h. + (p-lang.o): Ditto. + +2003-05-19 David Carlton <carlton@bactrian.org> + + * block.h: Declare block_static_block. + * block.c (block_static_block): New. + * symtab.c (lookup_symbol_aux): Remove 'static_block' argument to + lookup_symbol_aux_local, calling block_static_block instead. + (lookup_symbol_aux_local): Delete 'static_block' argument. + +2003-05-19 David Carlton <carlton@bactrian.org> + + * symtab.c (lookup_symbol_aux): Delete #if 0 hunk. + +2003-05-19 Michal Ludvig <mludvig@suse.cz> + + * x86-64-tdep.c (x86_64_dwarf2gdb_regno_map): Fix + register numbers mapping. + +2003-05-18 Adam Fedor <fedor@gnu.org> + + * symtab.c (completion_list_objc_symbol): New function. + (make_symbol_completion_list): Use it to add ObjC symbols + when looking though the list. + (language_search_unquoted_string): New function. + (make_file_symbol_completion_list): Use it. + +2003-05-18 Andreas Schwab <schwab@suse.de> + + * Makefile (m68klinux-nat.o, m68klinux-tdep.o): Update + dependencies. + * config/m68k/tm-linux.h (DEPRECATED_EXTRACT_RETURN_VALUE): Define + as m68k_linux_extract_return_value. + (DEPRECATED_STORE_RETURN_VALUE): Define as + m68k_linux_store_return_value. + (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Define as + m68k_linux_extract_struct_value_address. + * m68klinux-tdep.c (m68k_linux_sigtramp_saved_pc): Use + get_next_frame, get_frame_base, get_frame_pc. + (m68k_linux_frame_saved_pc): Use get_frame_base. + (m68k_linux_extract_return_value): New function. + (m68k_linux_store_return_value): New function. + (m68k_linux_extract_struct_value_address): New function. + * config/m68k/tm-m68k.h: Declare m68k_get_longjmp_target. + + * c-exp.y (typebase): Remove duplicate occurence of + `SIGNED_KEYWORD LONG LONG'. Use builtin_type_long_long instead + of lookup_signed_typename. + +2003-05-18 Mark Kettenis <kettenis@gnu.org> + + * dwarf2loc.c (find_location_expression): Change type of second + argument to `size_t *'. + (loclist_read_variable, loclist_tracepoint_var_ref): Use size_t + for size variable. + +2003-05-18 David Carlton <carlton@bactrian.org> + + * symtab.c (lookup_symbol_aux): Rename 'mangled_name' argument to + 'linkage_name'. Add comment. + (lookup_symbol_aux_local): Rename 'mangled_name' argument to + 'linkage_name'. + (lookup_symbol_aux_block, lookup_symbol_aux_symtabs) + (lookup_symbol_aux_psymtabs, lookup_symbol_aux_minsyms) + (lookup_block_symbol): Ditto. + +2003-05-16 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (DEPRECATED_REGISTER_BYTES): Rename REGISTER_BYTES. + * gdbarch.h, gdbarch.c: Re-generate. + * arm-linux-tdep.c (arm_linux_extract_return_value): Delete reference. + * TODO (REGISTER_BYTES): Delete reference. + * alpha-tdep.c (alpha_gdbarch_init): Update. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_init_abi): Update. + * vax-tdep.c (vax_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init_32082): Update. + (ns32k_gdbarch_init_32382): 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. + * i386-tdep.c (i386_gdbarch_init): Update. + * i386-linux-tdep.c (i386_linux_init_abi): Update. + * hppa-tdep.c (hppa_gdbarch_init): Update. + * h8300-tdep.c (h8300_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * sparc-tdep.c (sparc_pop_frame): Update. + * rs6000-tdep.c (rs6000_pop_frame): Update. + * remote.c (init_remote_state): Update. + (remote_prepare_to_store): Update. + * remote-vx.c (vx_prepare_to_store): Update. + * remote-sds.c (sds_fetch_registers): Update. + (sds_prepare_to_store): Update. + * remote-array.c: Update. + * regcache.c (init_legacy_regcache_descr): Update. + (init_regcache_descr): Update. + * mips-tdep.c (mips_eabi_extract_return_value): Update. + (mips_o64_extract_return_value): Update. + * irix5-nat.c (fetch_core_registers): Update. + * irix4-nat.c (fetch_core_registers): Update. + * i386-tdep.h: Update. + * hppa-tdep.c (pa_do_registers_info): Update. + (pa_do_strcat_registers_info): Update. + * cris-tdep.c (cris_register_bytes_ok): Update. + * config/nm-gnu.h (CHILD_PREPARE_TO_STORE): Update. + * config/sparc/tm-sparc.h (DEPRECATED_REGISTER_BYTES): Update. + * config/sparc/nm-sun4sol2.h (CHILD_PREPARE_TO_STORE): Update. + * config/sparc/nm-sun4os4.h (CHILD_PREPARE_TO_STORE): Update. + * config/sparc/nm-nbsd.h (CHILD_PREPARE_TO_STORE): Update. + * config/sparc/tm-sp64.h (DEPRECATED_REGISTER_BYTES): Update. + * config/s390/tm-s390.h (DEPRECATED_REGISTER_BYTES): Update. + * config/pa/tm-hppa64.h (DEPRECATED_REGISTER_BYTES): Update. + * config/mips/tm-mips.h (DEPRECATED_REGISTER_BYTES): Update. + * config/mips/tm-irix6.h (DEPRECATED_REGISTER_BYTES): Update. + * config/mips/tm-irix5.h (DEPRECATED_REGISTER_BYTES): Update. + * config/m68k/tm-sun3.h (DEPRECATED_REGISTER_BYTES): Update. + (REGISTER_BYTES_OK): Update. + * config/m68k/nm-sun3.h (CHILD_PREPARE_TO_STORE): Update. + * config/ia64/tm-ia64.h (DEPRECATED_REGISTER_BYTES): Update. + +2003-05-16 Ian Lance Taylor <ian@airs.com> + + * vax-tdep.c (INVALID_FLOAT, MAXLEN, NOPCODES): Don't define. + (vax_print_insn, print_insn_arg): Remove static functions. + (vax_gdbarch_init): Call set_gdbarch_print_insn with + print_insn_vax from opcodes library. + (_initialize_vax_tdep): Don't set deprecated_tm_print_insn. + +2003-05-15 Andrew Cagney <cagney@redhat.com> + + * arch-utils.h (legacy_breakpoint_from_pc): Delete declaration. + * target.h (memory_breakpoint_from_pc): Delete declaration. + * mem-break.c (memory_breakpoint_from_pc): Delete function. + * arch-utils.c (legacy_breakpoint_from_pc): Delete function. + * monitor.c (monitor_insert_breakpoint): Use + gdbarch_breakpoint_from_pc instead of memory_breakpoint_from_pc. + * gdbarch.sh (BREAKPOINT_FROM_PC): Do not provide a default. + * gdbarch.h, gdbarch.c: Re-generate. + * sparc-tdep.c (sparc_breakpoint_from_pc): New function. + (sparc_gdbarch_init): Set breakpoint_from_pc to + sparc_breakpoint_from_pc. + * config/sparc/tm-sparc.h (BREAKPOINT): Delete macro. + (BREAKPOINT_FROM_PC): Define. + (sparc_breakpoint_from_pc): Declare. + * hppa-tdep.c (hppa_breakpoint_from_pc): New function. + * config/pa/tm-hppa.h (hppa_breakpoint_from_pc): Declare. + (BREAKPOINT_FROM_PC): Define. + (BREAKPOINT): Delete macro. + * target.h: Update comment. + * s390-tdep.c (s390_gdbarch_init): Update comments. + * remote.c: Update comments. + * remote-mips.c: Update comments. + * proc-api.c (write_with_trace): Do not check for a breakpoint. + * mem-break.c: Update comment. + * ia64-tdep.c (IA64_BREAKPOINT): Rename BREAKPOINT. + (ia64_memory_insert_breakpoint): Update. + * config/sparc/tm-sparc.h: Update comment. + * config/pa/tm-hppa64.h: Update comment. + * rs6000-tdep.c (BIG_BREAKPOINT, LITTLE_BREAKPOINT): Delete macro. + (rs6000_breakpoint_from_pc): Update. + * mips-tdep.c (BIG_BREAKPOINT, LITTLE_BREAKPOINT): Delete macro. + (PMON_BIG_BREAKPOINT, PMON_LITTLE_BREAKPOINT): Delete macro. + (IDT_LITTLE_BREAKPOINT, IDT_LITTLE_BREAKPOINT): Delete macro. + (MIPS16_LITTLE_BREAKPOINT, MIPS16_BIG_BREAKPOINT): Delete macro. + (mips_breakpoint_from_pc): Update. + (mips_dump_tdep): Update. + + * symtab.h (DEPRECATED_SYMBOL_MATCHES_NAME): Delete macro. + * minsyms.c (lookup_minimal_symbol): Inline + DEPRECATED_SYMBOL_MATCHES_NAME. Replace STREQ with strcmp. + + * c-lang.c (c_printstr): Delete "extern inspect_it" declaration. + * p-valprint.c (pascal_object_print_value_fields): Ditto. + * p-lang.c (pascal_printstr): Ditto. + * objc-lang.c (objc_printstr): Ditto. + * m2-lang.c (m2_printstr): Ditto. + * jv-valprint.c (java_print_value_fields): Ditto. + * f-lang.c (f_printstr): Ditto. + * cp-valprint.c (cp_print_value_fields): Ditto. Include "valprint.h". + * ada-valprint.c (inspect_it, repeat_count_threshold): Ditto, and + for repeat_count_threshold. + * Makefile.in (cp-valprint.o): Update dependencies. + +2003-05-15 Jeff Johnston <jjohnstn@redhat.com> + + * 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 + beyond our calculated value and we have trust_limit set, + use the lim_pc value. + +2003-05-15 Andrew Cagney <cagney@redhat.com> + + * dummy-frame.h (deprecated_find_dummy_frame_regcache): Rename + generic_find_dummy_frame. + * dummy-frame.c (deprecated_find_dummy_frame_regcache): Update. + (deprecated_generic_find_dummy_frame): Update. + (deprecated_read_register_dummy): Update. + * frame.c (deprecated_generic_get_saved_register): Update. + +2003-05-15 Theodore A. Roth <troth@openavr.org> + + * avr-tdep.c (avr_breakpoint_from_pc): New function. + (avr_gdbarch_init): Set breakpoint_from_pc method. + +2003-05-15 Andrew Cagney <cagney@redhat.com> + + * regcache.c (build_regcache): Set deprecated_register_valid + directly. + (deprecated_grub_regcache_for_register_valid): Delete function. + * regcache.h (deprecated_grub_regcache_for_register_valid): Delete + declaration. + +2003-05-15 David Carlton <carlton@bactrian.org> + + Committed by Elena Zannoni <ezannoni@redhat.com> + * 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 <kevinb@redhat.com> + + * dwarf2expr.c (new_dwarf_expr_context): Set ``stack_len'' to + correctly indicate an empty stack and ``stack_allocated'' to the + indicate the number of elements initially allocated. + (dwarf_expr_grow_stack): Simplify method for computing new + stack size. Don't loop infinitely if ``stack_len'' is zero. + (execute_stack_op): Move ``ctx->in_reg'' initialization + out of loop. Allow DW_OP_reg0 ... DW_OP_reg31 and DW_OP_regx to + be used in conjuction with DW_OP_piece. Revise error message + accordingly. + +2003-05-14 Theodore A. Roth <troth@openavr.org> + + * MAINTAINERS: Update my email address. + * avr-tdep.c: Ditto. + +2003-05-14 Elena Zannoni <ezannoni@redhat.com> + + * symtab.h (enum domain_enum): Rename from namespace_enum. + (UNDEF_DOMAIN, VAR_DOMAIN, STRUCT_DOMAIN, LABEL_DOMAIN, + VARIABLES_DOMAIN, FUNCTIONS_DOMAIN, TYPES_DOMAIN, METHODS_DOMAIN): + Rename from UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE, + LABEL_NAMESPACE, VARIABLES_NAMESPACE, FUNCTIONS_NAMESPACE, + TYPES_NAMESPACE, METHODS_NAMESPACE. + (SYMBOL_NAMESPACE): Rename to SYMBOL_DOMAIN. + (struct symbol, struct partial_symbol): Rename field + 'namespace_enum namespace' to 'domain_enum domain'. + (PSYMBOL_NAMESPACE): Rename to PSYMBOL_DOMAIN. + Delete old define kludge for namespace. + + * ada-exp.y, ada-lang.c, ada-lang.h, alpha-tdep.c, arm-tdep.c, + blockframe.c, c-exp.y, c-valprint.c, coffread.c, dbxread.c, + dwarf2read.c, dwarfread.c, f-exp.y, gdbtypes.c, gdbtypes.h, + gnu-v3-abi.c, hppa-tdep.c, hpread.c, jv-exp.y, jv-lang.c, + language.c, linespec.c, m2-exp.y, m3-nat.c, mdebugread.c, + mips-tdep.c, nlmread.c, objc-exp.y, objc-lang.c, objfiles.c, + p-exp.y, p-valprint.c, parse.c, printcmd.c, scm-lang.c, source.c, + stabsread.c, stack.c, symfile.c, symfile.h, symmisc.c, symtab.c, + valops.c, values.c, xcoffread.c, xstormy16-tdep.c: Replace all + occurrences of the above. + +2003-05-14 Ian Lance Taylor <ian@airs.com> + + * Makefile.in (install-only): Use $(SHELL) when running + mkinstalldirs. + +2003-05-13 Ian Lance Taylor <ian@airs.com> + + * MAINTAINERS (write after approval): Add myself. + + * ser-pipe.c (_initialize_ser_pipe): Correct call to memset--swap + second and third arguments. + * ser-tcp.c (_initialize_ser_tcp): Likewise. + * ser-unix.c (_initialize_ser_hardwire): Likewise. + +2003-05-13 Andrew Cagney <cagney@redhat.com> + + * defs.h (store_address): Delete declaration. + findvar.c (store_address): Delete function. + * arm-tdep.c (arm_push_dummy_call): Replace store_address with + store_unsigned_integer. + * xstormy16-tdep.c (xstormy16_address_to_pointer): Ditto. + * v850-tdep.c (v850_push_arguments): Ditto. + * sparc-tdep.c (sparc_get_saved_register): Ditto. + * sh-tdep.c (sh64_get_saved_register): Ditto. + * rs6000-tdep.c (rs6000_push_arguments): Ditto. + * ppc-sysv-tdep.c (ppc_sysv_abi_push_arguments): Ditto. + * mips-tdep.c (mips_eabi_push_arguments): Ditto. + (mips_get_saved_register): Ditto. + * ia64-tdep.c (ia64_get_saved_register): Ditto. + (find_func_descr, ia64_push_arguments): Ditto. + * i386-tdep.c (i386_push_arguments): Ditto. + * hpux-thread.c (hpux_thread_fetch_registers): Ditto. + * frv-tdep.c (frv_push_arguments): Ditto. + * frame.c (legacy_saved_regs_prev_register): Ditto. + (deprecated_generic_get_saved_register): Ditto. + * findvar.c (unsigned_address_to_pointer): Ditto. + * dwarf2read.c (dwarf2_const_value): Ditto. + * arm-linux-tdep.c (arm_linux_push_arguments): Ditto. + * alpha-tdep.c (alpha_push_arguments): Ditto. + +2003-05-12 J. Brobecker <brobecker@gnat.com> + + * NEWS: Mention that the hppa-hpux port has been partially + multiarched (32bit ABIT only, so far). + +2003-05-11 Andrew Cagney <cagney@redhat.com> + + * Makefile.in (mi-symbol-cmds.o): Rename mi-cmd-symbol. + * config/djgpp/fnchange.lst: Rename include/xtensa-isa-internal.h, + include/xtensa-isa.h, sim/testsuite/sim/arm/misaligned1.ms, + sim/testsuite/sim/arm/misaligned2.ms, and + sim/testsuite/sim/arm/misaligned3.ms. + * disasm.h (struct ui_file): Add opaque struct declaration. + * config/pa/tm-hppa64.h (struct type, struct frame_info): Ditto. + * frame.h (struct ui_file): Ditto. + +2003-05-11 Mark Kettenis <kettenis@gnu.org> + + * value.h: Pretty print. + +2003-05-10 Mark Kettenis <kettenis@gnu.org> + + * config/i386/tm-linux.h (I386_GNULINUX_TARGET): Remove define. + +2003-05-08 Andrew Cagney <cagney@redhat.com> + + * regcache.h (max_register_size): Delete declaration. + * regcache.c (max_register_size): Delete function. + (struct regcache_descr): Delete field "max_register_size". + (init_regcache_descr, init_legacy_regcache_descr): Assert that all + registers fit in MAX_REGISTER_SIZE. + (regcache_save): Replace max_register_size with MAX_REGISTER_SIZE. + (regcache_restore, regcache_xfer_part, regcache_dump): Ditto. + * thread-db.c: Replace max_register_size with MAX_REGISTER_SIZE. + * sh-tdep.c, rom68k-rom.c, remote-sim.c, remote-mips.c: Ditto. + * remote-e7000.c, monitor.c, mipsv4-nat.c, mips-nat.c: Ditto. + * m68klinux-nat.c, lynx-nat.c, irix4-nat.c: Ditto. + * hpux-thread.c, hppah-nat.c, hppab-nat.c, hppa-tdep.c: Ditto. + * dve3900-rom.c, hppa-tdep.c: Ditto. + +2003-05-08 David Carlton <carlton@math.stanford.edu> + + * valops.c (push_word): Fix typo. + +2003-05-08 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh: Delete references to MAX_REGISTER_RAW_SIZE. + * gdbarch.h: Re-generate. + * defs.h (MAX_REGISTER_RAW_SIZE): Delete macro. + (legacy_max_register_raw_size): Delete declaration. + * regcache.c (legacy_max_register_raw_size): Delete function. + * valops.c: Replace MAX_REGISTER_RAW_SIZE with MAX_REGISTER_SIZE. + * target.c, stack.c, sparc-tdep.c, sh-tdep.c: Ditto. + * rs6000-tdep.c, rs6000-nat.c, remote.c, remote-sim.c: Ditto. + * remote-rdp.c, remote-array.c, regcache.c: Ditto. + * ppc-linux-nat.c, monitor.c, mn10300-tdep.c: Ditto. + * mips-tdep.c, mips-linux-tdep.c, m68klinux-nat.c: Ditto. + * infptrace.c, ia64-tdep.c, i386-tdep.c, frame.c: Ditto. + * findvar.c, dwarf2cfi.c: Ditto. + +2003-05-08 Andrew Cagney <cagney@redhat.com> + + * mips-tdep.c (read_signed_register): New function, moved to here + from "regcache.c". + (read_signed_register_pid): Ditto. + * regcache.c (read_signed_register_pid): Delete function, moved to + "mips-tdep.c". + (read_signed_register): Ditto. + * regcache.h (read_signed_register): Delete declaration. + (read_signed_register_pid): Delete declaration. + +2003-05-08 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh: Add comments on MAX_REGISTER_SIZE. + * gdbarch.h: Re-generate. + * defs.h (MAX_REGISTER_VIRTUAL_SIZE): Delete macro. + (legacy_max_register_virtual_size): Delete declaration. + * infcmd.c (default_print_registers_info): Use MAX_REGISTER_SIZE. + * d10v-tdep.c (d10v_print_registers_info): Ditto. + * tracepoint.c (memrange_sortmerge): Ditto. + * sparc-tdep.c (sparc_print_registers): Ditto. + * regcache.c (legacy_max_register_virtual_size): Delete function. + +2002-05-08 J. Brobecker <brobecker@gnat.com> + + * fork-child.c (escape_bang_in_quoted_argument): New function. + (fork_inferior): Escape '!' characters in quoted arguments + only when needed. + +2003-05-08 J. Brobecker <brobecker@gnat.com> + + * dwarf2read.c (set_cu_language): Set the language to "minimal" if + the language of the CU is not currently supported by GDB. + +2003-05-08 J. Brobecker <brobecker@gnat.com> + + * defs.h (language): Add language_minimal enum value. + * c-lang.c (minimal_language_defn): New language definition. + (_initialize_c_language): Add the new minimal language to the list + of languages known to GDB. + +2003-05-08 Kevin Buettner <kevinb@redhat.com> + + * frame.c (get_frame_type): Don't attempt to lazily initialize + frame's unwinder for legacy frames. + +2003-05-07 Andrew Cagney <cagney@redhat.com> + + * ia64-tdep.c (ia64_remote_translate_xfer_address): Add "gdbarch" + and "regcache" parameters. + * avr-tdep.c (avr_remote_translate_xfer_address): Ditto. + +2003-05-07 Jeff Johnston <jjohnstn@redhat.com> + + * 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 <cagney@redhat.com> + + * fork-child.c (startup_inferior): Delete #ifdef STARTUP_INFERIOR + code. + +2003-05-07 Jim Blandy <jimb@redhat.com> + + Rename commands 'maint list symtabs' and 'maint list psymtabs' to + 'maint info symtabs' and 'maint info psymtabs'. + * symmisc.c (maintenance_info_symtabs, maintenance_info_psymtabs): + Renamed from maintenance_list_symtabs and maintenance_list_psymtabs. + * symtab.h (maintenance_info_symtabs, maintenance_info_psymtabs): + Declarations updated. + * maint.c (maintenance_list_command): Delete. + (_initialize_maint_cmds): Update calls to add_cmd. + * gdbcmd.h (maintenancelistlist): Delete declaration. + * cli/cli-cmds.c (maintenancelistlist): Delete. + (init_cmd_lists): Don't initialize it. + * cli/cli-cmds.h (maintenancelistlist): Delete declaration. + +2003-05-07 Andrew Cagney <cagney@redhat.com> + + * d10v-tdep.c (remote_d10v_translate_xfer_address): Add + "regcache". + (d10v_print_registers_info): Update. + (d10v_dmap_register, d10v_imap_register): Delete functions. + (struct gdbarch_tdep): Add "regcache" parameter to "dmap_register" + and "imap_register". + (d10v_ts2_dmap_register, d10v_ts2_imap_register): Add "regcache". + (d10v_ts3_dmap_register, d10v_ts3_imap_register): Add "regcache". + * arch-utils.c (generic_remote_translate_xfer_address): Add + "regcache" and "gdbarch" parameters. + * gdbarch.sh (REMOTE_TRANSLATE_XFER_ADDRESS): Add "regcache" + parameter. Change class to multi-arch. + * gdbarch.h, gdbarch.c: Re-generate. + * remote.c (remote_xfer_memory): Use + gdbarch_remote_translate_xfer_address. + +2003-05-07 Jeff Johnston <jjohnstn@redhat.com> + + * infrun.c (prev_pc): Move declaration ahead of proceed(). + (proceed): Refresh prev_pc value before resuming. + (stop_stepping): Remove code to refresh prev_pc. + +2003-05-06 Kris Warkentin <kewarken@qnx.com> + + * nto-tdep.c: Removed stray comment. + +2003-05-06 Kris Warkentin <kewarken@qnx.com> + + * i386-nto-tdep.c: Fix old K&R function definitions. + * nto-tdep.c: Likewise and change stat.h include to gdb_stat.h. + Also change add_show_from_set() call to add_setshow_cmd(). + * nto-tdep.h: Remove PARAMS and grep ^func ARI hits. + +2003-05-05 Andrew Cagney <cagney@redhat.com> + + * dummy-frame.c: Include "command.h" and "gdbcmd.h". + (fprint_dummy_frames): New function. + (maintenance_print_dummy_frames): New function. + (_initialize_dummy_frame): Add command "maint print dummy-frames". + * frame.c (fprint_frame_id): Make global. + * frame.h (fprint_frame_id): Declare. + * Makefile.in (dummy-frame.o): Update dependencies. + +2003-05-05 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (DEPRECATED_REGISTER_SIZE): Rename REGISTER_SIZE. + (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS): Rename + SIZEOF_CALL_DUMMY_WORDS. + (DEPRECATED_CALL_DUMMY_WORDS): Rename CALL_DUMMY_WORDS. + (DEPRECATED_FIX_CALL_DUMMY): Rename FIX_CALL_DUMMY. + (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET): Rename + CALL_DUMMY_BREAKPOINT_OFFSET. + (DEPRECATED_CALL_DUMMY_START_OFFSET): Rename + CALL_DUMMY_START_OFFSET. + (DEPRECATED_CALL_DUMMY_LENGTH): Rename CALL_DUMMY_LENGTH. + * gdbarch.h, gdbarch.c: Re-generate. + * alpha-tdep.c, alphafbsd-tdep.c, arm-linux-tdep.c: Update. + * arm-tdep.c, avr-tdep.c, breakpoint.c, cris-tdep.c: Update. + * dummy-frame.c, dummy-frame.h, frv-tdep.c, gdbarch.c: Update. + * gdbarch.h, gdbarch.sh, h8300-tdep.c, hppa-tdep.c: Update. + * i386-tdep.c, ia64-tdep.c, infcall.c, inferior.h: Update. + * m68hc11-tdep.c, m68k-tdep.c, mcore-tdep.c: Update. + * mips-tdep.c, mn10300-tdep.c, ns32k-tdep.c: Update. + * rs6000-tdep.c, s390-tdep.c, sh-tdep.c, sol-thread.c: Update. + * sparc-tdep.c, target.c, v850-tdep.c, valops.c: Update. + * vax-tdep.c, x86-64-tdep.c, xstormy16-tdep.c: Update. + * config/ia64/tm-ia64.h, config/m68k/tm-vx68.h: Update. + * config/mips/tm-mips.h, config/pa/nm-hppah.h: Update. + * config/pa/tm-hppa.h, config/pa/tm-hppa64.h: Update. + * config/s390/tm-s390.h, config/sparc/tm-sp64.h: Update. + * config/sparc/tm-sparc.h: Update. + +2003-05-05 Kris Warkentin <kewarken@qnx.com> + + * configure.tgt: Add i[3456]86-*-nto*. + * i386-nto-tdep.c: New file. i386 specific support for QNX Neutrino. + * nto-tdep.c: New file. Neutrino target support routines. + * nto-tdep.h: New file. Neutrino target header. + * config/tm-qnxnto.h: New file. + * config/i386/i386nto.mt: New file. + * config/i386/tm-i386nto.h: New file. + +2003-05-04 Andrew Cagney <cagney@redhat.com> + + * gdbthread.h (save_infrun_state): Drop prev_func_name parameter. + (load_infrun_state): Ditto. + (struct thread_info): Drop "prev_func_name" field. + * thread.c (load_infrun_state): Update. + (save_infrun_state): Update. + * infrun.c (prev_func_name): Delete variable. + (init_wait_for_inferior): Do not clear prev_func_name. + (stop_stepping, keep_going, context_switch): Do not swap + prev_func_name. + (handle_inferior_event, check_sigtramp2): Use pc_in_sigtramp + instead of PC_IN_SIGTRAMP. + +2003-05-04 Andrew Cagney <cagney@redhat.com> + + * sentinel-frame.c (sentinel_frame_prev_register): Replace + REGISTER_BYTE with register_offset_hack. + * regcache.c (init_regcache_descr): When REGISTER_BYTE_P, check + 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 <kettenis@gnu.org> + + * i387-tdep.c (fxsave_offset): Add entries for %xmm8-%xmm15. + (FXSAVE_ADDR, i387_supply_fxsave): Add support for %xmm8-%xmm15. + + * i386-linux-nat.c (supply_gregset): Remove unnecessary casts. + +2003-05-03 J. Brobecker <brobecker@gnat.com> + + From Thierry Schneider <tpschneider1@yahoo.com> + * Makfile.in (SUBDIR_MI_OBS): Add dependency on mi-cmd-symbol.o. + (SUBDIR_MI_SRCS): Add mi-cmd-symbol.c. + (mi-cmd-symbol.o): Add rule. + +2003-05-03 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (PUSH_DUMMY_CODE): New architecture method, add + comments noteing that it replaces the old FIX_CALL_DUMMY code. + * gdbarch.h, gdbarch.c: Re-generate. + * d10v-tdep.c (d10v_push_dummy_code): New function. + (d10v_gdbarch_init): Set push_dummy_code. + * infcall.c (legacy_push_dummy_code): New function. + (generic_push_dummy_code): New function. + (push_dummy_code): New function. + (call_function_by_hand): Call push_dummy_code. Pass bp_addr, + instead of dummy_addr, to push_dummy_call. Move call to + generic_save_call_dummy_addr to outside of CALL_DUMMY_LOCATION + switch. + * sparc-tdep.c (sparc_gdbarch_init): Mention push_dummy_code. + +2003-05-03 Andrew Cagney <cagney@redhat.com> + + * disasm.h (print_insn): Declare. + * disasm.c (init_gdb_disassemble_info): New function. + (gdb_disassembly): Call init_gdb_disassemble_info. + (gdb_print_insn): New function. + * v850-tdep.c (v850_scan_prologue): Call gdb_print_insn, instead + of TARGET_PRINT_INSN. Send debug info to "gdb_stdlog". + * mcore-tdep.c: Include "disasm.h" + (mcore_dump_insn): Call gdb_print_insn, instead of TARGET_PRINT_INSN. + * d10v-tdep.c: Include "disasm.h". + (display_trace): Call gdb_print_insn, instead of print_insn. + (print_insn): Delete function. + * printcmd.c: Include "disasm.h". + (print_insn): Delete function. + (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 <cagney@redhat.com> + + * std-regs.c (value_of_builtin_frame_pc_reg): Delete #ifdef + PC_REGNUM, re-indent. + * stack.c (frame_info): Use "pc" for the name of get_frame_pc when + PC_REGNUM isn't set. + + * gdbarch.sh (REGISTER_SIZE, REGISTER_BYTES): Make optional. + * gdbarch.h, gdbarch.c: Re-generate. + * d10v-tdep.c (d10v_gdbarch_init): Do not set register_size, + register_virtual_size, pc_regnum, or register_bytes. + (D10V_PC_REGNUM): Rename _PC_REGNUM. + (d10v_register_type): Use D10V_PC_REGNUM. + (d10v_print_registers_info, d10v_read_pc): Ditto. + (d10v_write_pc, d10v_eva_prepare_to_trace): Ditto. + (d10v_unwind_pc, d10v_frame_prev_register): Ditto. + +2003-05-02 David Carlton <carlton@bactrian.org> + + * objfiles.c (allocate_objfile): For anonymous objfiles, allocate + the name with mstrsave. + +2003-05-02 Elena Zannoni <ezannoni@redhat.com> + + * charset.c (GDB_DEFAULT_TARGET_CHARSET, + GDB_DEFAULT_HOST_CHARSET): Move to earlier in the file. + (host_charset_name, target_charset_name): New vars for use by + set/show commands. + (host_charset_enum, target_charset_enum): New enums for set/show + commands. + (set_charset_sfunc, set_host_charset_sfunc, + set_target_charset_sfunc): New functions. + (set_host_charset, set_target_charset): Make static. + (list_charsets, set_host_charset_command, + set_target_charset_command): Delete functions. + (show_charset_command): Rewrite as.... + (show_charset): Hook this up with the set/show command mechanism. + (_initialize_charset): Change names of charsets to match the + set/show enums. Use host_charset_name and target_charset_name. + Use set/show mechanism for charset, host-charset, target-charset + commands. Do not make 'show host-charset' and 'show + target-charset' be aliases of 'show charset'. + + * charset.h (set_host_charset, set_target_charset): Don't export, + they are not used outside the file. + +2003-05-01 Andrew Cagney <cagney@redhat.com> + + * disasm.c (gdb_disassemble_from_exec): Delete global variable. + (gdb_disassembly): Make "di" non static, always initialize and + cleanup. Always use dis_asm_read_memory. + (gdb_dis_asm_read_memory): Delete function. + +2003-05-01 Andrew Cagney <cagney@redhat.com> + + * d10v-tdep.c (d10v_frame_align): Replace d10v_stack_align. + (d10v_gdbarch_init): Set frame_align instead of stack_align. + 2003-05-16 David Carlton <carlton@bactrian.org> * dwarf2read.c (read_comp_unit): Separate code out into diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS index 15a0ea8..08af70e 100644 --- a/gdb/MAINTAINERS +++ b/gdb/MAINTAINERS @@ -67,7 +67,7 @@ maintainer works with the native maintainer when resolving API issues. Richard Earnshaw rearnsha@arm.com avr --target=avr ,-Werror - Theodore A. Roth troth@verinet.com + Theodore A. Roth troth@openavr.org cris --target=cris-elf ,-Werror Orjan Friberg orjanf@axis.com @@ -368,7 +368,7 @@ David O'Brien obrien@freebsd.org Alexandre Oliva aoliva@redhat.com Tom Rix trix@redhat.com Bob Rossi bob_rossi@cox.net -Theodore A. Roth troth@verinet.com +Theodore A. Roth troth@openavr.org Ian Roxborough irox@redhat.com Grace Sainsbury graces@redhat.com Mark Salter msalter@redhat.com @@ -383,6 +383,7 @@ Stephen P. Smith ischis2@cox.net Jackie Smith Cashion jsmith@redhat.com Michael Snyder msnyder@redhat.com Petr Sorfa petrs@caldera.com +Ian Lance Taylor ian@airs.com Gary Thomas gthomas@redhat.com Jason Thorpe thorpej@wasabisystems.com Tom Tromey tromey@redhat.com diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 38b66b0..47113a2 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -168,14 +168,14 @@ SUBDIR_CLI_UNINSTALL= SUBDIR_MI_OBS = \ mi-out.o mi-console.o \ mi-cmds.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \ - mi-cmd-file.o mi-cmd-disas.o \ + mi-cmd-file.o mi-cmd-disas.o mi-symbol-cmds.o \ mi-interp.o \ mi-main.o mi-parse.o mi-getopt.o SUBDIR_MI_SRCS = \ mi/mi-out.c mi/mi-console.c \ mi/mi-cmds.c mi/mi-cmd-env.c \ mi/mi-cmd-var.c mi/mi-cmd-break.c mi/mi-cmd-stack.c \ - mi/mi-cmd-file.c mi/mi-cmd-disas.c \ + mi/mi-cmd-file.c mi/mi-cmd-disas.c mi/mi-symbol-cmds.c \ mi/mi-interp.c \ mi/mi-main.c mi/mi-parse.c mi/mi-getopt.c SUBDIR_MI_DEPS = @@ -626,7 +626,7 @@ complaints_h = complaints.h completer_h = completer.h config_h = config.h cp_abi_h = cp-abi.h -cp_support_h = cp-support.h +cp_support_h = cp-support.h $(symtab_h) dcache_h = dcache.h defs_h = defs.h $(config_h) $(gdb_locale_h) $(gdb_signals_h) $(ansidecl_h) \ $(libiberty_h) $(progress_h) $(bfd_h) $(tui_h) $(ui_file_h) $(xm_h) \ @@ -936,10 +936,10 @@ install-only: $(CONFIG_INSTALL) else \ true ; \ fi ; \ - $(srcdir)/../mkinstalldirs $(bindir) ; \ + $(SHELL) $(srcdir)/../mkinstalldirs $(bindir) ; \ $(INSTALL_PROGRAM) gdb$(EXEEXT) \ $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \ - $(srcdir)/../mkinstalldirs \ + $(SHELL) $(srcdir)/../mkinstalldirs \ $(DESTDIR)$(man1dir) ; \ $(INSTALL_DATA) $(srcdir)/gdb.1 \ $(DESTDIR)$(man1dir)/$$transformed_name.1 @@ -1631,7 +1631,7 @@ cp-support.o: cp-support.c $(defs_h) $(cp_support_h) $(gdb_string_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) \ - $(cp_abi_h) + $(cp_abi_h) $(valprint_h) cpu32bug-rom.o: cpu32bug-rom.c $(defs_h) $(gdbcore_h) $(target_h) \ $(monitor_h) $(serial_h) $(regcache_h) $(m68k_tdep_h) cris-tdep.o: cris-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(inferior_h) \ @@ -1643,7 +1643,7 @@ d10v-tdep.o: d10v-tdep.c $(defs_h) $(frame_h) $(frame_unwind_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) + $(gdb_assert_h) $(disasm_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) \ @@ -1667,7 +1667,8 @@ doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) \ dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h) dsrec.o: dsrec.c $(defs_h) $(serial_h) $(srec_h) dummy-frame.o: dummy-frame.c $(defs_h) $(dummy_frame_h) $(regcache_h) \ - $(frame_h) $(inferior_h) $(gdb_assert_h) $(frame_unwind_h) + $(frame_h) $(inferior_h) $(gdb_assert_h) $(frame_unwind_h) \ + $(command_h) $(gdbcmd_h) dve3900-rom.o: dve3900-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(serial_h) $(inferior_h) $(command_h) $(gdb_string_h) $(regcache_h) dwarf2cfi.o: dwarf2cfi.c $(defs_h) $(gdbcore_h) $(symtab_h) $(symfile_h) \ @@ -1707,7 +1708,7 @@ expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ $(block_h) f-lang.o: f-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(expression_h) $(parser_defs_h) $(language_h) $(f_lang_h) \ - $(valprint_h) + $(valprint_h) $(value_h) f-typeprint.o: f-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \ $(f_lang_h) $(gdb_string_h) @@ -1923,12 +1924,12 @@ m68hc11-tdep.o: m68hc11-tdep.c $(defs_h) $(frame_h) $(symtab_h) \ m68k-stub.o: m68k-stub.c m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcore_h) \ $(value_h) $(gdb_string_h) $(inferior_h) $(regcache_h) \ - $(arch_utils_h) $(gregset_h) $(m68k_tdep_h) + $(arch_utils_h) $(gregset_h) $(osabi_h) $(m68k_tdep_h) m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ - $(language_h) $(gdbcore_h) $(regcache_h) $(gdb_stat_h) \ - $(floatformat_h) $(target_h) $(gregset_h) $(m68k_tdep_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) + $(target_h) $(gdb_string_h) $(gdbtypes_h) $(osabi_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) @@ -1951,7 +1952,7 @@ mcore-rom.o: mcore-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(gdb_string_h) $(regcache_h) $(serial_h) mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \ $(gdbcmd_h) $(regcache_h) $(symfile_h) $(gdbcore_h) $(inferior_h) \ - $(arch_utils_h) $(gdb_string_h) + $(arch_utils_h) $(gdb_string_h) $(disasm_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) \ @@ -2028,7 +2029,7 @@ osabi.o: osabi.c $(defs_h) $(gdb_string_h) $(osabi_h) $(elf_bfd_h) \ $(gdbcmd_h) $(command_h) $(arch_utils_h) p-lang.o: p-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(expression_h) $(parser_defs_h) $(language_h) $(p_lang_h) \ - $(valprint_h) + $(valprint_h) $(value_h) p-typeprint.o: p-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \ $(language_h) $(p_lang_h) $(typeprint_h) $(gdb_string_h) @@ -2068,8 +2069,7 @@ printcmd.o: printcmd.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \ $(gdbtypes_h) $(value_h) $(language_h) $(expression_h) $(gdbcore_h) \ $(gdbcmd_h) $(target_h) $(breakpoint_h) $(demangle_h) $(valprint_h) \ $(annotate_h) $(symfile_h) $(objfiles_h) $(completer_h) $(ui_out_h) \ - $(gdb_assert_h) $(dictionary_h) $(block_h) \ - $(gdb_assert_h) $(block_h) + $(gdb_assert_h) $(dictionary_h) $(block_h) $(disasm_h) proc-api.o: proc-api.c $(defs_h) $(gdbcmd_h) $(completer_h) $(gdb_wait_h) \ $(proc_utils_h) proc-events.o: proc-events.c $(defs_h) @@ -2284,7 +2284,7 @@ symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ $(language_h) $(demangle_h) $(inferior_h) $(linespec_h) \ $(filenames_h) $(gdb_obstack_h) $(gdb_string_h) $(gdb_stat_h) \ $(cp_abi_h) $(source_h) $(block_h) $(objc_lang_h) $(dictionary_h) \ - $(cp_support_h) $(gdb_assert_h) + $(cp_support_h) target.o: target.c $(defs_h) $(gdb_string_h) $(target_h) $(gdbcmd_h) \ $(symtab_h) $(inferior_h) $(bfd_h) $(symfile_h) $(objfiles_h) \ $(gdb_wait_h) $(dcache_h) $(regcache_h) @@ -2612,6 +2612,9 @@ mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(ui_out_h) $(mi_out_h) mi-parse.o: $(srcdir)/mi/mi-parse.c $(defs_h) $(mi_cmds_h) $(mi_parse_h) \ $(gdb_string_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-parse.c +mi-symbol-cmds.o: $(srcdir)/mi/mi-symbol-cmds.c $(defs_h) \ + $(mi_cmds_h) $(ui_out_h) $(symtab_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-symbol-cmds.c # # rdi-share sub-directory @@ -30,6 +30,10 @@ Fix for gdb/672: update changelist is now output in mi list format. Fix for gdb/702: a -var-assign that updates the value now shows up in a subsequent -var-update. +* Multi-arched targets. + +HP/PA HPUX11, 32bit ABI (partial) hppa*-*-hpux* except hppa*64*-*-hpux11* + * OBSOLETE configurations and files Configurations that have been declared obsolete in this release have @@ -171,10 +171,6 @@ Deprecate, if not delete, the following: how it relates to rawreg and the regnum is clear. - REGISTER_BYTES - The size of the cache can be computed - on the fly. - -- Obsolete the targets: diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index d17e0c8..c82913d 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -841,7 +841,7 @@ write_object_renaming (orig_left_context, renaming) parser-defs.h, implemented in parse.c */ strncpy (name, expr, suffix-expr); name[suffix-expr] = '\000'; - sym = lookup_symbol (name, orig_left_context, VAR_NAMESPACE, 0, NULL); + sym = lookup_symbol (name, orig_left_context, VAR_DOMAIN, 0, NULL); /* if (sym == NULL) error ("Could not find renamed variable: %s", ada_demangle (name)); */ @@ -894,7 +894,7 @@ write_object_renaming (orig_left_context, renaming) suffix = end; index_sym = - lookup_symbol (index_name, NULL, VAR_NAMESPACE, 0, NULL); + lookup_symbol (index_name, NULL, VAR_DOMAIN, 0, NULL); if (index_sym == NULL) error ("Could not find %s", index_name); write_var_from_sym (NULL, block_found, sym); diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index b8b08f4..5c1e906 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -91,7 +91,7 @@ static struct value *make_array_descriptor (struct type *, struct value *, CORE_ADDR *); static void ada_add_block_symbols (struct block *, const char *, - namespace_enum, struct objfile *, int); + domain_enum, struct objfile *, int); static void fill_in_ada_prototype (struct symbol *); @@ -101,7 +101,7 @@ static void add_defn_to_vec (struct symbol *, struct block *); static struct partial_symbol *ada_lookup_partial_symbol (struct partial_symtab *, const char *, int, - namespace_enum, int); + domain_enum, int); static struct symtab *symtab_for_sym (struct symbol *); @@ -190,7 +190,7 @@ static struct value *value_pos_atr (struct value *); static struct value *value_val_atr (struct type *, struct value *); -static struct symbol *standard_lookup (const char *, namespace_enum); +static struct symbol *standard_lookup (const char *, domain_enum); extern void markTimeStart (int index); extern void markTimeStop (int index); @@ -706,7 +706,7 @@ ada_match_name (const char *sym_name, const char *name, int wild) int ada_suppress_symbol_printing (struct symbol *sym) { - if (SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE) + if (SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN) return 1; else return is_suppressed_name (DEPRECATED_SYMBOL_NAME (sym)); @@ -1233,7 +1233,7 @@ decode_packed_array_type (struct type *type) /* NOTE: Use ada_lookup_symbol_list because of bug in some versions * of gcc (Solaris, e.g.). FIXME when compiler is fixed. */ n = ada_lookup_symbol_list (name, get_selected_block (NULL), - VAR_NAMESPACE, &syms, &blocks); + VAR_DOMAIN, &syms, &blocks); for (i = 0; i < n; i += 1) if (syms[i] != NULL && SYMBOL_CLASS (syms[i]) == LOC_TYPEDEF && STREQ (name, ada_type_name (SYMBOL_TYPE (syms[i])))) @@ -2155,7 +2155,7 @@ ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p, n_candidates = ada_lookup_symbol_list (exp->elts[pc + 2].name, exp->elts[pc + 1].block, - VAR_NAMESPACE, + VAR_DOMAIN, &candidate_syms, &candidate_blocks); @@ -2257,7 +2257,7 @@ ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p, n_candidates = ada_lookup_symbol_list (exp->elts[pc + 5].name, exp->elts[pc + 4].block, - VAR_NAMESPACE, + VAR_DOMAIN, &candidate_syms, &candidate_blocks); if (n_candidates == 1) @@ -2311,7 +2311,7 @@ ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p, n_candidates = ada_lookup_symbol_list (ada_mangle (ada_op_name (op)), - (struct block *) NULL, VAR_NAMESPACE, + (struct block *) NULL, VAR_DOMAIN, &candidate_syms, &candidate_blocks); i = ada_resolve_function (candidate_syms, candidate_blocks, @@ -3180,14 +3180,14 @@ static struct symbol **defn_symbols = NULL; static struct block **defn_blocks = NULL; /* Return the result of a standard (literal, C-like) lookup of NAME in - * given NAMESPACE. */ + * given DOMAIN. */ static struct symbol * -standard_lookup (const char *name, namespace_enum namespace) +standard_lookup (const char *name, domain_enum domain) { struct symbol *sym; - sym = lookup_symbol (name, (struct block *) NULL, namespace, 0, NULL); + sym = lookup_symbol (name, (struct block *) NULL, domain, 0, NULL); return sym; } @@ -3236,7 +3236,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1) { if (sym0 == sym1) return 1; - if (SYMBOL_NAMESPACE (sym0) != SYMBOL_NAMESPACE (sym1) + if (SYMBOL_DOMAIN (sym0) != SYMBOL_DOMAIN (sym1) || SYMBOL_CLASS (sym0) != SYMBOL_CLASS (sym1)) return 0; @@ -3298,13 +3298,13 @@ add_defn_to_vec (struct symbol *sym, struct block *block) ndefns += 1; } -/* Look, in partial_symtab PST, for symbol NAME in given namespace. +/* Look, in partial_symtab PST, for symbol NAME in given domain. Check the global symbols if GLOBAL, the static symbols if not. Do wild-card match if WILD. */ static struct partial_symbol * ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, - int global, namespace_enum namespace, int wild) + int global, domain_enum domain, int wild) { struct partial_symbol **start; int name_len = strlen (name); @@ -3326,7 +3326,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, { struct partial_symbol *psym = start[i]; - if (SYMBOL_NAMESPACE (psym) == namespace && + if (SYMBOL_DOMAIN (psym) == domain && wild_match (name, name_len, DEPRECATED_SYMBOL_NAME (psym))) return psym; } @@ -3360,7 +3360,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, { struct partial_symbol *psym = start[i]; - if (SYMBOL_NAMESPACE (psym) == namespace) + if (SYMBOL_DOMAIN (psym) == domain) { int cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (psym), name_len); @@ -3402,7 +3402,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, { struct partial_symbol *psym = start[i]; - if (SYMBOL_NAMESPACE (psym) == namespace) + if (SYMBOL_DOMAIN (psym) == domain) { int cmp; @@ -3516,7 +3516,7 @@ ada_lookup_minimal_symbol (const char *name) } /* For all subprograms that statically enclose the subprogram of the - * selected frame, add symbols matching identifier NAME in NAMESPACE + * selected frame, add symbols matching identifier NAME in DOMAIN * and their blocks to vectors *defn_symbols and *defn_blocks, as for * ada_add_block_symbols (q.v.). If WILD, treat as NAME with a * wildcard prefix. At the moment, this function uses a heuristic to @@ -3525,7 +3525,7 @@ ada_lookup_minimal_symbol (const char *name) * frame as a static link, and then searches up the call stack for a * frame with that same local-variable base. */ static void -add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace, +add_symbols_from_enclosing_procs (const char *name, domain_enum domain, int wild_match) { #ifdef i386 @@ -3544,7 +3544,7 @@ add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace, DEPRECATED_SYMBOL_NAME (static_link) = ""; SYMBOL_LANGUAGE (static_link) = language_unknown; SYMBOL_CLASS (static_link) = LOC_LOCAL; - SYMBOL_NAMESPACE (static_link) = VAR_NAMESPACE; + SYMBOL_DOMAIN (static_link) = VAR_DOMAIN; SYMBOL_TYPE (static_link) = lookup_pointer_type (builtin_type_void); SYMBOL_VALUE (static_link) = -(long) TYPE_LENGTH (SYMBOL_TYPE (static_link)); @@ -3575,7 +3575,7 @@ add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace, block = get_frame_block (frame, 0); while (block != NULL && block_function (block) != NULL && ndefns == 0) { - ada_add_block_symbols (block, name, namespace, NULL, wild_match); + ada_add_block_symbols (block, name, domain, NULL, wild_match); block = BLOCK_SUPERBLOCK (block); } @@ -3641,7 +3641,7 @@ remove_extra_symbols (struct symbol **syms, struct block **blocks, int nsyms) return nsyms; } -/* Find symbols in NAMESPACE matching NAME, in BLOCK0 and enclosing +/* Find symbols in DOMAIN matching NAME, in BLOCK0 and enclosing scope and in global scopes, returning the number of matches. Sets *SYMS to point to a vector of matching symbols, with *BLOCKS pointing to the vector of corresponding blocks in which those @@ -3654,7 +3654,7 @@ remove_extra_symbols (struct symbol **syms, struct block **blocks, int nsyms) int ada_lookup_symbol_list (const char *name, struct block *block0, - namespace_enum namespace, struct symbol ***syms, + domain_enum domain, struct symbol ***syms, struct block ***blocks) { struct symbol *sym; @@ -3680,7 +3680,7 @@ ada_lookup_symbol_list (const char *name, struct block *block0, block = block0; while (block != NULL) { - ada_add_block_symbols (block, name, namespace, NULL, wild_match); + ada_add_block_symbols (block, name, domain, NULL, wild_match); /* If we found a non-function match, assume that's the one. */ if (is_nonfunction (defn_symbols, ndefns)) @@ -3706,10 +3706,10 @@ ada_lookup_symbol_list (const char *name, struct block *block0, continue; bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); - ada_add_block_symbols (block, name, namespace, objfile, wild_match); + ada_add_block_symbols (block, name, domain, objfile, wild_match); } - if (namespace == VAR_NAMESPACE) + if (domain == VAR_DOMAIN) { ALL_MSYMBOLS (objfile, msymbol) { @@ -3729,13 +3729,13 @@ ada_lookup_symbol_list (const char *name, struct block *block0, block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); ada_add_block_symbols (block, DEPRECATED_SYMBOL_NAME (msymbol), - namespace, objfile, wild_match); + domain, objfile, wild_match); if (ndefns == old_ndefns) { block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); ada_add_block_symbols (block, DEPRECATED_SYMBOL_NAME (msymbol), - namespace, objfile, + domain, objfile, wild_match); } } @@ -3748,14 +3748,14 @@ ada_lookup_symbol_list (const char *name, struct block *block0, { QUIT; if (!ps->readin - && ada_lookup_partial_symbol (ps, name, 1, namespace, wild_match)) + && ada_lookup_partial_symbol (ps, name, 1, domain, wild_match)) { s = PSYMTAB_TO_SYMTAB (ps); if (!s->primary) continue; bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); - ada_add_block_symbols (block, name, namespace, objfile, wild_match); + ada_add_block_symbols (block, name, domain, objfile, wild_match); } } @@ -3773,21 +3773,21 @@ ada_lookup_symbol_list (const char *name, struct block *block0, continue; bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); - ada_add_block_symbols (block, name, namespace, objfile, wild_match); + ada_add_block_symbols (block, name, domain, objfile, wild_match); } ALL_PSYMTABS (objfile, ps) { QUIT; if (!ps->readin - && ada_lookup_partial_symbol (ps, name, 0, namespace, wild_match)) + && ada_lookup_partial_symbol (ps, name, 0, domain, wild_match)) { s = PSYMTAB_TO_SYMTAB (ps); bv = BLOCKVECTOR (s); if (!s->primary) continue; block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); - ada_add_block_symbols (block, name, namespace, + ada_add_block_symbols (block, name, domain, objfile, wild_match); } } @@ -3798,7 +3798,7 @@ ada_lookup_symbol_list (const char *name, struct block *block0, rare. */ if (ndefns == 0) { - add_symbols_from_enclosing_procs (name, namespace, wild_match); + add_symbols_from_enclosing_procs (name, domain, wild_match); if (ndefns > 0) goto done; } @@ -3815,7 +3815,7 @@ done: return ndefns; } -/* Return a symbol in NAMESPACE matching NAME, in BLOCK0 and enclosing +/* Return a symbol in DOMAIN matching NAME, in BLOCK0 and enclosing * scope and in global scopes, or NULL if none. NAME is folded to * lower case first, unless it is surrounded in single quotes. * Otherwise, the result is as for ada_lookup_symbol_list, but is @@ -3823,14 +3823,14 @@ done: struct symbol * ada_lookup_symbol (const char *name, struct block *block0, - namespace_enum namespace) + domain_enum domain) { struct symbol **candidate_syms; struct block **candidate_blocks; int n_candidates; n_candidates = ada_lookup_symbol_list (name, - block0, namespace, + block0, domain, &candidate_syms, &candidate_blocks); if (n_candidates == 0) @@ -3946,7 +3946,7 @@ wild_match (const char *patn, int patn_len, const char *name) } -/* Add symbols from BLOCK matching identifier NAME in NAMESPACE to +/* Add symbols from BLOCK matching identifier NAME in DOMAIN to vector *defn_symbols, updating *defn_symbols (if necessary), *SZ (the size of the vector *defn_symbols), and *ndefns (the number of symbols currently stored in *defn_symbols). If WILD, treat as NAME with a @@ -3954,7 +3954,7 @@ wild_match (const char *patn, int patn_len, const char *name) static void ada_add_block_symbols (struct block *block, const char *name, - namespace_enum namespace, struct objfile *objfile, + domain_enum domain, struct objfile *objfile, int wild) { struct dict_iterator iter; @@ -3972,7 +3972,7 @@ ada_add_block_symbols (struct block *block, const char *name, struct symbol *sym; ALL_BLOCK_SYMBOLS (block, iter, sym) { - if (SYMBOL_NAMESPACE (sym) == namespace && + if (SYMBOL_DOMAIN (sym) == domain && wild_match (name, name_len, DEPRECATED_SYMBOL_NAME (sym))) { switch (SYMBOL_CLASS (sym)) @@ -4001,7 +4001,7 @@ ada_add_block_symbols (struct block *block, const char *name, { ALL_BLOCK_SYMBOLS (block, iter, sym) { - if (SYMBOL_NAMESPACE (sym) == namespace) + if (SYMBOL_DOMAIN (sym) == domain) { int cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (sym), name_len); @@ -4046,7 +4046,7 @@ ada_add_block_symbols (struct block *block, const char *name, ALL_BLOCK_SYMBOLS (block, iter, sym) { - if (SYMBOL_NAMESPACE (sym) == namespace) + if (SYMBOL_DOMAIN (sym) == domain) { int cmp; @@ -4333,10 +4333,10 @@ ada_finish_decode_line_1 (char **spec, struct symtab *file_table, n_matches = 0; if (lower_name != NULL) n_matches = ada_lookup_symbol_list (ada_mangle (lower_name), block, - VAR_NAMESPACE, &symbols, &blocks); + VAR_DOMAIN, &symbols, &blocks); if (n_matches == 0) n_matches = ada_lookup_symbol_list (unquoted_name, block, - VAR_NAMESPACE, &symbols, &blocks); + VAR_DOMAIN, &symbols, &blocks); if (n_matches == 0 && line_num >= 0) error ("No line number information found for %s.", unquoted_name); else if (n_matches == 0) @@ -4582,7 +4582,7 @@ nearest_line_number_in_linetable (struct linetable *linetable, int line_num) else { struct symbol *sym = - standard_lookup (func_name, VAR_NAMESPACE); + standard_lookup (func_name, VAR_DOMAIN); if (is_plausible_func_for_line (sym, line_num)) best = item->line; else @@ -4656,7 +4656,7 @@ find_next_line_in_linetable (struct linetable *linetable, int line_num, if (item->line == line_num) { struct symbol *sym = - standard_lookup (func_name, VAR_NAMESPACE); + standard_lookup (func_name, VAR_DOMAIN); if (is_plausible_func_for_line (sym, starting_line)) return i; else @@ -5800,11 +5800,11 @@ ada_find_any_type (const char *name) { struct symbol *sym; - sym = standard_lookup (name, VAR_NAMESPACE); + sym = standard_lookup (name, VAR_DOMAIN); if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF) return SYMBOL_TYPE (sym); - sym = standard_lookup (name, STRUCT_NAMESPACE); + sym = standard_lookup (name, STRUCT_DOMAIN); if (sym != NULL) return SYMBOL_TYPE (sym); @@ -7766,7 +7766,7 @@ get_var_value (char *name, char *err_msg) int nsyms; nsyms = - ada_lookup_symbol_list (name, get_selected_block (NULL), VAR_NAMESPACE, + ada_lookup_symbol_list (name, get_selected_block (NULL), VAR_DOMAIN, &syms, &blocks); if (nsyms != 1) @@ -8027,6 +8027,8 @@ const struct language_defn ada_language_defn = { ada_val_print, /* Print a value using appropriate syntax */ ada_value_print, /* Print a top-level value */ NULL, /* Language specific skip_trampoline */ + value_of_this, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ NULL, /* Language specific symbol demangler */ {"", "", "", ""}, /* Binary format info */ #if 0 diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index 3f00b9a..ae863bd 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -223,13 +223,13 @@ extern struct type *ada_index_type (struct type *, int); extern struct value *ada_array_bound (struct value *, int, int); extern int ada_lookup_symbol_list (const char *, struct block *, - namespace_enum, struct symbol ***, + domain_enum, struct symbol ***, struct block ***); extern char *ada_fold_name (const char *); extern struct symbol *ada_lookup_symbol (const char *, struct block *, - namespace_enum); + domain_enum); extern struct minimal_symbol *ada_lookup_minimal_symbol (const char *); diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 5b90c06..11c42bf 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -46,9 +46,6 @@ struct ada_val_print_args enum val_prettyprint pretty; }; -extern int inspect_it; -extern unsigned int repeat_count_threshold; - static void print_record (struct type *, char *, struct ui_file *, int, int, enum val_prettyprint); diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 4ae4d94..ad7ca74 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -66,8 +66,6 @@ static gdbarch_frame_locals_address_ftype alpha_frame_locals_address; static gdbarch_skip_prologue_ftype alpha_skip_prologue; -static gdbarch_fix_call_dummy_ftype alpha_fix_call_dummy; - static gdbarch_get_longjmp_target_ftype alpha_get_longjmp_target; struct frame_extra_info @@ -851,8 +849,7 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame) symbol reading. */ sym = NULL; else - - sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_NAMESPACE, + sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_DOMAIN, 0, NULL); } @@ -1149,7 +1146,9 @@ alpha_push_arguments (int nargs, struct value **args, CORE_ADDR sp, write_memory (sp + m_arg->offset, m_arg->contents, m_arg->len); if (struct_return) { - store_address (raw_buffer, sizeof (CORE_ADDR), struct_addr); + /* 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)); } @@ -1229,7 +1228,7 @@ alpha_push_dummy_frame (void) registers follow in ascending order. The PC is saved immediately below the SP. */ save_address = sp + PROC_REG_OFFSET (proc_desc); - store_address (raw_buffer, 8, read_register (ALPHA_RA_REGNUM)); + store_unsigned_integer (raw_buffer, 8, read_register (ALPHA_RA_REGNUM)); write_memory (save_address, raw_buffer, 8); save_address += 8; mask = PROC_REG_MASK (proc_desc) & 0xffffffffL; @@ -1238,12 +1237,12 @@ alpha_push_dummy_frame (void) { if (ireg == ALPHA_RA_REGNUM) continue; - store_address (raw_buffer, 8, read_register (ireg)); + store_unsigned_integer (raw_buffer, 8, read_register (ireg)); write_memory (save_address, raw_buffer, 8); save_address += 8; } - store_address (raw_buffer, 8, read_register (PC_REGNUM)); + store_unsigned_integer (raw_buffer, 8, read_register (PC_REGNUM)); write_memory (sp - 8, raw_buffer, 8); /* Save floating point registers. */ @@ -1252,7 +1251,7 @@ alpha_push_dummy_frame (void) for (ireg = 0; mask; ireg++, mask >>= 1) if (mask & 1) { - store_address (raw_buffer, 8, read_register (ireg + FP0_REGNUM)); + store_unsigned_integer (raw_buffer, 8, read_register (ireg + FP0_REGNUM)); write_memory (save_address, raw_buffer, 8); save_address += 8; } @@ -1812,8 +1811,8 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fp0_regnum (gdbarch, ALPHA_FP0_REGNUM); set_gdbarch_register_name (gdbarch, alpha_register_name); - set_gdbarch_register_size (gdbarch, ALPHA_REGISTER_SIZE); - set_gdbarch_register_bytes (gdbarch, ALPHA_REGISTER_BYTES); + 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); @@ -1860,8 +1859,8 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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_call_dummy_words (gdbarch, alpha_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); + 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); @@ -1874,7 +1873,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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_fix_call_dummy (gdbarch, alpha_fix_call_dummy); + 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); diff --git a/gdb/alphafbsd-tdep.c b/gdb/alphafbsd-tdep.c index 6b1b068..3d8eafb 100644 --- a/gdb/alphafbsd-tdep.c +++ b/gdb/alphafbsd-tdep.c @@ -32,7 +32,7 @@ alphafbsd_use_struct_convention (int gcc_p, struct type *type) /* All aggregate types that won't fit in a register must be returned in memory. */ - if (TYPE_LENGTH (type) > REGISTER_SIZE) + if (TYPE_LENGTH (type) > DEPRECATED_REGISTER_SIZE) return 1; /* The only aggregate types that can be returned in a register are diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index fad8ed1..48f7f7e 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -48,49 +48,6 @@ #include "floatformat.h" -/* Use the program counter to determine the contents and size - of a breakpoint instruction. If no target-dependent macro - BREAKPOINT_FROM_PC has been defined to implement this function, - assume that the breakpoint doesn't depend on the PC, and - use the values of the BIG_BREAKPOINT and LITTLE_BREAKPOINT macros. - Return a pointer to a string of bytes that encode a breakpoint - instruction, stores the length of the string to *lenptr, - and optionally adjust the pc to point to the correct memory location - for inserting the breakpoint. */ - -const unsigned char * -legacy_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) -{ - /* {BIG_,LITTLE_}BREAKPOINT is the sequence of bytes we insert for a - breakpoint. On some machines, breakpoints are handled by the - target environment and we don't have to worry about them here. */ -#ifdef BIG_BREAKPOINT - if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) - { - static unsigned char big_break_insn[] = BIG_BREAKPOINT; - *lenptr = sizeof (big_break_insn); - return big_break_insn; - } -#endif -#ifdef LITTLE_BREAKPOINT - if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG) - { - static unsigned char little_break_insn[] = LITTLE_BREAKPOINT; - *lenptr = sizeof (little_break_insn); - return little_break_insn; - } -#endif -#ifdef BREAKPOINT - { - static unsigned char break_insn[] = BREAKPOINT; - *lenptr = sizeof (break_insn); - return break_insn; - } -#endif - *lenptr = 0; - return NULL; -} - /* Implementation of extract return value that grubs around in the register cache. */ void @@ -191,7 +148,9 @@ LONGEST legacy_call_dummy_words[1]; int legacy_sizeof_call_dummy_words = sizeof (legacy_call_dummy_words); void -generic_remote_translate_xfer_address (CORE_ADDR gdb_addr, int gdb_len, +generic_remote_translate_xfer_address (struct gdbarch *gdbarch, + struct regcache *regcache, + CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR * rem_addr, int *rem_len) { *rem_addr = gdb_addr; diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index cf515a4..27f219b 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -40,11 +40,6 @@ extern CORE_ADDR generic_cannot_extract_struct_value_address (char *dummy); being passed */ extern gdbarch_frame_num_args_ftype frame_num_args_unknown; -/* Implementation of breakpoint from PC using any of the deprecated - macros BREAKPOINT, LITTLE_BREAKPOINT, BIG_BREAPOINT. For legacy - targets that don't yet implement their own breakpoint_from_pc(). */ -extern gdbarch_breakpoint_from_pc_ftype legacy_breakpoint_from_pc; - /* Implementation of extract return value that grubs around in the register cache. */ extern gdbarch_extract_return_value_ftype legacy_extract_return_value; diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index 91fa88f..a2ea493 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -46,7 +46,7 @@ static const char arm_linux_arm_le_breakpoint[] = {0x01,0x00,0x9f,0xef}; -/* CALL_DUMMY_WORDS: +/* DEPRECATED_CALL_DUMMY_WORDS: This sequence of words is the instructions mov lr, pc @@ -73,7 +73,7 @@ LONGEST arm_linux_call_dummy_words[] = hidden behind the regcache abstraction. */ static void arm_linux_extract_return_value (struct type *type, - char regbuf[REGISTER_BYTES], + char regbuf[], char *valbuf) { /* ScottB: This needs to be looked at to handle the different @@ -115,10 +115,10 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* Walk through the list of args and determine how large a temporary stack is required. Need to take care here as structs may be passed on the stack, and we have to to push them. */ - nstack_size = -4 * REGISTER_SIZE; /* Some arguments go into A1-A4. */ + nstack_size = -4 * DEPRECATED_REGISTER_SIZE; /* Some arguments go into A1-A4. */ if (struct_return) /* The struct address goes in A1. */ - nstack_size += REGISTER_SIZE; + nstack_size += DEPRECATED_REGISTER_SIZE; /* Walk through the arguments and add their size to nstack_size. */ for (argnum = 0; argnum < nargs; argnum++) @@ -131,7 +131,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* ANSI C code passes float arguments as integers, K&R code passes float arguments as doubles. Correct for this here. */ - if (TYPE_CODE_FLT == TYPE_CODE (arg_type) && REGISTER_SIZE == len) + if (TYPE_CODE_FLT == TYPE_CODE (arg_type) && DEPRECATED_REGISTER_SIZE == len) nstack_size += FP_REGISTER_VIRTUAL_SIZE; else nstack_size += len; @@ -178,7 +178,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp, .stabs records the type as FP_FLOAT. In this latter case the compiler converts the float arguments to double before calling the function. */ - if (TYPE_CODE_FLT == typecode && REGISTER_SIZE == len) + if (TYPE_CODE_FLT == typecode && DEPRECATED_REGISTER_SIZE == len) { DOUBLEST dblval; dblval = deprecated_extract_floating (val, len); @@ -195,7 +195,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp, { CORE_ADDR regval = extract_address (val, len); if (arm_pc_is_thumb (regval)) - store_address (val, len, MAKE_THUMB_ADDR (regval)); + store_unsigned_integer (val, len, MAKE_THUMB_ADDR (regval)); } /* Copy the argument to general registers or the stack in @@ -203,7 +203,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp, registers and stack. */ while (len > 0) { - int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE; + int partial_len = len < DEPRECATED_REGISTER_SIZE ? len : DEPRECATED_REGISTER_SIZE; if (argreg <= ARM_LAST_ARG_REGNUM) { @@ -214,8 +214,8 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp, else { /* Push the arguments onto the stack. */ - write_memory ((CORE_ADDR) fp, val, REGISTER_SIZE); - fp += REGISTER_SIZE; + write_memory ((CORE_ADDR) fp, val, DEPRECATED_REGISTER_SIZE); + fp += DEPRECATED_REGISTER_SIZE; } len -= partial_len; @@ -530,9 +530,8 @@ 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_gdbarch_call_dummy_words (gdbarch, arm_linux_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, - sizeof (arm_linux_call_dummy_words)); + 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)); /* The following two overrides shouldn't be needed. */ set_gdbarch_deprecated_extract_return_value (gdbarch, arm_linux_extract_return_value); diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index ee07a362..c0e2408 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -443,7 +443,7 @@ arm_skip_prologue (CORE_ADDR pc) struct symbol *sym; /* Found a function. */ - sym = lookup_symbol (func_name, NULL, VAR_NAMESPACE, NULL, NULL); + sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL, NULL); if (sym && SYMBOL_LANGUAGE (sym) != language_asm) { /* Don't use this trick for assembly source files. */ @@ -1237,7 +1237,7 @@ arm_push_dummy_frame (void) write_register (ARM_SP_REGNUM, sp); } -/* CALL_DUMMY_WORDS: +/* DEPRECATED_CALL_DUMMY_WORDS: This sequence of words is the instructions mov lr,pc @@ -1265,9 +1265,9 @@ static void arm_set_call_dummy_breakpoint_offset (void) { if (caller_is_thumb) - set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 4); + set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 4); else - set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 8); + set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 8); } /* Fix up the call dummy, based on whether the processor is currently @@ -1430,7 +1430,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, /* Some platforms require a double-word aligned stack. Make sure sp is correctly aligned before we start. We always do this even if it isn't really needed -- it can never hurt things. */ - sp &= ~(CORE_ADDR)(2 * REGISTER_SIZE - 1); + sp &= ~(CORE_ADDR)(2 * DEPRECATED_REGISTER_SIZE - 1); /* The struct_return pointer occupies the first parameter passing register. */ @@ -1468,7 +1468,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, if (arm_pc_is_thumb (regval)) { val = alloca (len); - store_address (val, len, MAKE_THUMB_ADDR (regval)); + store_unsigned_integer (val, len, MAKE_THUMB_ADDR (regval)); } } @@ -1477,7 +1477,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, registers and stack. */ while (len > 0) { - int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE; + int partial_len = len < DEPRECATED_REGISTER_SIZE ? len : DEPRECATED_REGISTER_SIZE; if (argreg <= ARM_LAST_ARG_REGNUM) { @@ -1487,7 +1487,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, if (arm_debug) fprintf_unfiltered (gdb_stdlog, "arg %d in %s = 0x%s\n", argnum, REGISTER_NAME (argreg), - phex (regval, REGISTER_SIZE)); + phex (regval, DEPRECATED_REGISTER_SIZE)); regcache_cooked_write_unsigned (regcache, argreg, regval); argreg++; } @@ -1497,8 +1497,8 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, if (arm_debug) fprintf_unfiltered (gdb_stdlog, "arg %d @ sp + %d\n", argnum, nstack); - si = push_stack_item (si, val, REGISTER_SIZE); - nstack += REGISTER_SIZE; + si = push_stack_item (si, val, DEPRECATED_REGISTER_SIZE); + nstack += DEPRECATED_REGISTER_SIZE; } len -= partial_len; @@ -1799,7 +1799,7 @@ thumb_get_next_pc (CORE_ADDR pc) /* Fetch the saved PC from the stack. It's stored above all of the other registers. */ - offset = bitcount (bits (inst1, 0, 7)) * REGISTER_SIZE; + offset = bitcount (bits (inst1, 0, 7)) * DEPRECATED_REGISTER_SIZE; sp = read_register (ARM_SP_REGNUM); nextpc = (CORE_ADDR) read_memory_integer (sp + offset, 4); nextpc = ADDR_BITS_REMOVE (nextpc); @@ -2309,10 +2309,10 @@ arm_use_struct_convention (int gcc_p, struct type *type) /* In the ARM ABI, "integer" like aggregate types are returned in registers. For an aggregate type to be integer like, its size - must be less than or equal to REGISTER_SIZE and the offset of - each addressable subfield must be zero. Note that bit fields are - not addressable, and all addressable subfields of unions always - start at offset zero. + must be less than or equal to DEPRECATED_REGISTER_SIZE and the + offset of each addressable subfield must be zero. Note that bit + fields are not addressable, and all addressable subfields of + unions always start at offset zero. This function is based on the behaviour of GCC 2.95.1. See: gcc/arm.c: arm_return_in_memory() for details. @@ -2326,7 +2326,7 @@ arm_use_struct_convention (int gcc_p, struct type *type) /* All aggregate types that won't fit in a register must be returned in memory. */ - if (TYPE_LENGTH (type) > REGISTER_SIZE) + if (TYPE_LENGTH (type) > DEPRECATED_REGISTER_SIZE) { return 1; } @@ -2348,11 +2348,11 @@ arm_use_struct_convention (int gcc_p, struct type *type) int i; /* Need to check if this struct/union is "integer" like. For this to be true, its size must be less than or equal to - REGISTER_SIZE and the offset of each addressable subfield - must be zero. Note that bit fields are not addressable, and - unions always start at offset zero. If any of the subfields - is a floating point type, the struct/union cannot be an - integer type. */ + DEPRECATED_REGISTER_SIZE and the offset of each addressable + subfield must be zero. Note that bit fields are not + addressable, and unions always start at offset zero. If any + of the subfields is a floating point type, the struct/union + cannot be an integer type. */ /* For each field in the object, check: 1) Is it FP? --> yes, nRc = 1; @@ -2930,8 +2930,8 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->lowest_pc = 0x20; tdep->jb_pc = -1; /* Longjump support not enabled by default. */ - set_gdbarch_call_dummy_words (gdbarch, arm_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); + set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_call_dummy_words); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0); set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call); @@ -2976,10 +2976,10 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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_register_bytes (gdbarch, - (NUM_GREGS * INT_REGISTER_RAW_SIZE - + NUM_FREGS * FP_REGISTER_RAW_SIZE - + NUM_SREGS * STATUS_REGISTER_SIZE)); + 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); @@ -2991,7 +2991,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_sim_regno (gdbarch, arm_register_sim_regno); /* Integer registers are 4 bytes. */ - set_gdbarch_register_size (gdbarch, 4); + set_gdbarch_deprecated_register_size (gdbarch, 4); set_gdbarch_register_name (gdbarch, arm_register_name); /* Returning results. */ diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 314c0a1..4ade2ab 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Contributed by Theodore A. Roth, troth@verinet.com */ +/* Contributed by Theodore A. Roth, troth@openavr.org */ /* Portions of this file were taken from the original gdb-4.18 patch developed by Denis Chertykov, denisc@overta.ru */ @@ -331,7 +331,7 @@ avr_pointer_to_address (struct type *type, const void *buf) 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 <troth@verinet.com>\n"); + "+++ If you see this, please send me an email <troth@openavr.org>\n"); } /* Is it a code address? */ @@ -396,7 +396,9 @@ avr_read_fp (void) pointer? */ static void -avr_remote_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes, +avr_remote_translate_xfer_address (struct gdbarch *gdbarch, + struct regcache *regcache, + CORE_ADDR memaddr, int nr_bytes, CORE_ADDR *targ_addr, int *targ_len) { long out_addr; @@ -1089,6 +1091,18 @@ avr_push_arguments (int nargs, struct value **args, CORE_ADDR sp, 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 */ + +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; +} + /* Initialize the gdbarch structure for the AVR's. */ static struct gdbarch * @@ -1156,8 +1170,8 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_pc_regnum (gdbarch, AVR_PC_REGNUM); set_gdbarch_register_name (gdbarch, avr_register_name); - set_gdbarch_register_size (gdbarch, 1); - set_gdbarch_register_bytes (gdbarch, AVR_NUM_REG_BYTES); + 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); @@ -1168,7 +1182,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_print_insn (gdbarch, print_insn_avr); set_gdbarch_call_dummy_address (gdbarch, avr_call_dummy_address); - set_gdbarch_call_dummy_words (gdbarch, avr_call_dummy_words); + set_gdbarch_deprecated_call_dummy_words (gdbarch, avr_call_dummy_words); /* set_gdbarch_believe_pcc_promotion (gdbarch, 1); // TRoth: should this be set? */ @@ -1187,6 +1201,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_decr_pc_after_break (gdbarch, 0); + set_gdbarch_breakpoint_from_pc (gdbarch, avr_breakpoint_from_pc); set_gdbarch_function_start_offset (gdbarch, 0); set_gdbarch_remote_translate_xfer_address (gdbarch, diff --git a/gdb/block.c b/gdb/block.c index 603744e..f2166ab 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -36,8 +36,6 @@ struct block_namespace_info struct using_direct *using; }; -static struct using_direct *block_using (const struct block *); - static void block_initialize_namespace (struct block *block, struct obstack *obstack); @@ -190,16 +188,25 @@ block_set_scope (struct block *block, const char *scope, BLOCK_NAMESPACE (block)->scope = scope; } -/* This returns the using directives associated to BLOCK (but _not_ - its parents), if any. */ +/* This returns the first using directives associated to BLOCK, if + any. */ + +/* FIXME: carlton/2003-04-23: This uses the fact that we currently + only have using directives in static blocks, because we only + generate using directives from anonymous namespaces. Eventually, + when we support using directives everywhere, we'll want to replace + this by some iterator functions. */ -static struct using_direct * +struct using_direct * block_using (const struct block *block) { - if (BLOCK_NAMESPACE (block) == NULL) + const struct block *static_block = block_static_block (block); + + if (static_block == NULL + || BLOCK_NAMESPACE (static_block) == NULL) return NULL; else - return BLOCK_NAMESPACE (block)->using; + return BLOCK_NAMESPACE (static_block)->using; } /* Set BLOCK's using member to USING; if needed, allocate memory via @@ -246,55 +253,19 @@ block_static_block (const struct block *block) return block; } -/* Initialize ITERATOR to point at the first using directive valid for - BLOCK, and return that using directive, or NULL if there aren't - any. */ +/* Return the static block associated to BLOCK. Return NULL if block + is NULL. */ -const struct using_direct * -block_using_iterator_first (const struct block *block, - struct block_using_iterator *iterator) +const struct block * +block_global_block (const struct block *block) { if (block == NULL) return NULL; - - iterator->current_block = block; - iterator->next_directive = block_using (block); - - return block_using_iterator_next (iterator); -} - -/* Advance ITERATOR, and return the next using directive, or NULL if - there aren't any more. Don't call this if you've previously - received NULL from block_using_iterator_first or - block_using_iterator_next during this iteration. */ -const struct using_direct * -block_using_iterator_next (struct block_using_iterator *iterator) -{ - if (iterator->next_directive != NULL) - { - const struct using_direct *retval = iterator->next_directive; - iterator->next_directive = retval->next; - return retval; - } - else - { - while (BLOCK_SUPERBLOCK (iterator->current_block) != NULL) - { - iterator->current_block - = BLOCK_SUPERBLOCK (iterator->current_block); - iterator->next_directive = block_using (iterator->current_block); - if (iterator->next_directive != NULL) - { - const struct using_direct *retval = iterator->next_directive; - iterator->next_directive = retval->next; - return retval; - } - } + while (BLOCK_SUPERBLOCK (block) != NULL) + block = BLOCK_SUPERBLOCK (block); - /* We didn't find any superblocks with using directives. */ - return NULL; - } + return block; } /* This allocates a block on OBSTACK, and initializes its elements to diff --git a/gdb/block.h b/gdb/block.h index c40759c..72fa68d 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -161,41 +161,15 @@ extern const char *block_scope (const struct block *block); extern void block_set_scope (struct block *block, const char *scope, struct obstack *obstack); +extern struct using_direct *block_using (const struct block *block); + extern void block_set_using (struct block *block, struct using_direct *using, struct obstack *obstack); extern const struct block *block_static_block (const struct block *block); -/* In an ideal world, this would be opaque: don't access it directly, - just use the iterator functions. */ - -struct block_using_iterator -{ - const struct block *current_block; - const struct using_direct *next_directive; -}; - -/* Initialize ITERATOR to point at the first using directive valid for - BLOCK, and return that using directive, or NULL if there aren't - any. */ - -extern const struct -using_direct *block_using_iterator_first (const struct block *block, - struct block_using_iterator - *iterator); - -/* Advance ITERATOR, and return the next using directive, or NULL if - there aren't any more. Don't call this if you've previously - received NULL from block_using_iterator_first or - block_using_iterator_next during this iteration. */ - -extern const struct -using_direct *block_using_iterator_next (struct block_using_iterator - *iterator); - -/* Allocate a dummy block. See warnings before the source code of - this function about using it correctly. */ +extern const struct block *block_global_block (const struct block *block); extern struct block *allocate_block (struct obstack *obstack); diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 28d26ba..3d7935f 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -1698,7 +1698,7 @@ deprecated_frame_in_dummy (struct frame_info *frame) for signals.exp in the testsuite. */ && (get_frame_pc (frame) >= (b->address - - SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * REGISTER_SIZE)) + - DEPRECATED_SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * DEPRECATED_REGISTER_SIZE)) && get_frame_pc (frame) <= b->address) return 1; } @@ -5465,7 +5465,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty) #if !defined(TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT) #define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(BYTE_SIZE) \ - ((BYTE_SIZE) <= (REGISTER_SIZE)) + ((BYTE_SIZE) <= (DEPRECATED_REGISTER_SIZE)) #endif #if !defined(TARGET_REGION_OK_FOR_HW_WATCHPOINT) diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 2933e32..a03568f 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -1,6 +1,6 @@ /* YACC parser for C expressions, for GDB. Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000, 2001, 2002 + 1998, 1999, 2000, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -568,7 +568,7 @@ block : BLOCKNAME block : block COLONCOLON name { struct symbol *tem = lookup_symbol (copy_name ($3), $1, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) error ("No function \"%s\" in specified context.", @@ -579,7 +579,7 @@ block : block COLONCOLON name variable: block COLONCOLON name { struct symbol *sym; sym = lookup_symbol (copy_name ($3), $1, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); if (sym == 0) error ("No symbol \"%s\" in specified context.", @@ -644,7 +644,7 @@ variable: qualified_name sym = lookup_symbol (name, (const struct block *) NULL, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); if (sym) { @@ -839,6 +839,8 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */ { $$ = builtin_type_long_long; } | SIGNED_KEYWORD LONG LONG { $$ = builtin_type_long_long; } + | SIGNED_KEYWORD LONG LONG INT_KEYWORD + { $$ = builtin_type_long_long; } | UNSIGNED LONG LONG { $$ = builtin_type_unsigned_long_long; } | UNSIGNED LONG LONG INT_KEYWORD @@ -847,10 +849,6 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */ { $$ = builtin_type_unsigned_long_long; } | LONG LONG UNSIGNED INT_KEYWORD { $$ = builtin_type_unsigned_long_long; } - | SIGNED_KEYWORD LONG LONG - { $$ = lookup_signed_typename ("long long"); } - | SIGNED_KEYWORD LONG LONG INT_KEYWORD - { $$ = lookup_signed_typename ("long long"); } | SHORT INT_KEYWORD { $$ = builtin_type_short; } | SHORT SIGNED_KEYWORD INT_KEYWORD @@ -1702,7 +1700,7 @@ yylex () int hextype; sym = lookup_symbol (tmp, expression_context_block, - VAR_NAMESPACE, + VAR_DOMAIN, current_language->la_language == language_cplus ? &is_a_field_of_this : (int *) NULL, (struct symtab **) NULL); diff --git a/gdb/c-lang.c b/gdb/c-lang.c index e492b9a..bdbbb54 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -32,6 +32,7 @@ #include "charset.h" #include "gdb_string.h" #include "demangle.h" +#include "cp-support.h" extern void _initialize_c_language (void); static void c_emit_char (int c, struct ui_file * stream, int quoter); @@ -91,7 +92,6 @@ c_printstr (struct ui_file *stream, char *string, unsigned int length, unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; - extern int inspect_it; /* If the string was not truncated due to `set print elements', and the last byte of it is a null, we don't print that, in traditional C @@ -554,6 +554,8 @@ const struct language_defn c_language_defn = c_val_print, /* Print a value using appropriate syntax */ c_value_print, /* Print a top-level value */ NULL, /* Language specific skip_trampoline */ + NULL, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ NULL, /* Language specific symbol demangler */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ @@ -608,6 +610,8 @@ const struct language_defn cplus_language_defn = c_val_print, /* Print a value using appropriate syntax */ c_value_print, /* Print a top-level value */ NULL, /* Language specific skip_trampoline */ + value_of_this, /* value_of_this */ + cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ cplus_demangle, /* Language specific symbol demangler */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ @@ -639,6 +643,46 @@ const struct language_defn asm_language_defn = c_val_print, /* Print a value using appropriate syntax */ c_value_print, /* Print a top-level value */ NULL, /* Language specific skip_trampoline */ + NULL, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ + NULL, /* Language specific symbol demangler */ + {"", "", "", ""}, /* Binary format info */ + {"0%lo", "0", "o", ""}, /* Octal format info */ + {"%ld", "", "d", ""}, /* Decimal format info */ + {"0x%lx", "0x", "x", ""}, /* Hex format info */ + c_op_print_tab, /* expression operators for printing */ + 1, /* c-style arrays */ + 0, /* String lower bound */ + &builtin_type_char, /* Type of string elements */ + LANG_MAGIC +}; + +/* The following language_defn does not represent a real language. + It just provides a minimal support a-la-C that should allow users + to do some simple operations when debugging applications that use + a language currently not supported by GDB. */ + +const struct language_defn minimal_language_defn = +{ + "minimal", /* Language name */ + language_minimal, + c_builtin_types, + range_check_off, + type_check_off, + case_sensitive_on, + c_preprocess_and_parse, + c_error, + evaluate_subexp_standard, + c_printchar, /* Print a character constant */ + c_printstr, /* Function to print string constant */ + c_emit_char, /* Print a single char */ + c_create_fundamental_type, /* Create fundamental type in this language */ + c_print_type, /* Print a type using appropriate syntax */ + c_val_print, /* Print a value using appropriate syntax */ + c_value_print, /* Print a top-level value */ + NULL, /* Language specific skip_trampoline */ + NULL, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ NULL, /* Language specific symbol demangler */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ @@ -657,4 +701,5 @@ _initialize_c_language (void) add_language (&c_language_defn); add_language (&cplus_language_defn); add_language (&asm_language_defn); + add_language (&minimal_language_defn); } diff --git a/gdb/charset.c b/gdb/charset.c index 4f5e5b4..0062e28 100644 --- a/gdb/charset.c +++ b/gdb/charset.c @@ -96,7 +96,7 @@ struct charset { struct charset *next; /* The name of the character set. Comparisons on character set - names are case-insensitive. */ + names are case-sensitive. */ const char *name; /* Non-zero iff this character set can be used as a host character @@ -125,7 +125,7 @@ struct translation { /* This structure describes functions going from the FROM character set to the TO character set. Comparisons on character set names - are case-insensitive. */ + are case-sensitive. */ const char *from, *to; /* Pointers to translation-specific functions, and data pointers to @@ -156,16 +156,32 @@ struct translation { /* The global lists of character sets and translations. */ -/* Character set names are always compared ignoring case. */ -static int -strcmp_case_insensitive (const char *p, const char *q) -{ - while (*p && *q && tolower (*p) == tolower (*q)) - p++, q++; +#ifndef GDB_DEFAULT_HOST_CHARSET +#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1" +#endif - return tolower (*p) - tolower (*q); -} +#ifndef GDB_DEFAULT_TARGET_CHARSET +#define GDB_DEFAULT_TARGET_CHARSET "ISO-8859-1" +#endif + +static const char *host_charset_name = GDB_DEFAULT_HOST_CHARSET; +static const char *target_charset_name = GDB_DEFAULT_TARGET_CHARSET; +static const char *host_charset_enum[] = +{ + "ASCII", + "ISO-8859-1", + 0 +}; + +static const char *target_charset_enum[] = +{ + "ASCII", + "ISO-8859-1", + "EBCDIC-US", + "IBM1047", + 0 +}; /* The global list of all the charsets GDB knows about. */ static struct charset *all_charsets; @@ -192,7 +208,7 @@ lookup_charset (const char *name) struct charset *cs; for (cs = all_charsets; cs; cs = cs->next) - if (! strcmp_case_insensitive (name, cs->name)) + if (! strcmp (name, cs->name)) return cs; return NULL; @@ -217,8 +233,8 @@ lookup_translation (const char *from, const char *to) struct translation *t; for (t = all_translations; t; t = t->next) - if (! strcmp_case_insensitive (from, t->from) - && ! strcmp_case_insensitive (to, t->to)) + if (! strcmp (from, t->from) + && ! strcmp (to, t->to)) return t; return 0; @@ -897,6 +913,26 @@ static void *target_char_to_host_baton; static struct cached_iconv cached_iconv_host_to_target; static struct cached_iconv cached_iconv_target_to_host; + +/* Charset structures manipulation functions. */ + +static struct charset * +lookup_charset_or_error (const char *name) +{ + struct charset *cs = lookup_charset (name); + + if (! cs) + error ("GDB doesn't know of any character set named `%s'.", name); + + return cs; +} + +static void +check_valid_host_charset (struct charset *cs) +{ + if (! cs->valid_host_charset) + error ("GDB can't use `%s' as its host character set.", cs->name); +} /* Set the host and target character sets to HOST and TARGET. */ static void @@ -986,35 +1022,76 @@ set_host_and_target_charsets (struct charset *host, struct charset *target) current_target_charset = target; } +/* Do the real work of setting the host charset. */ +static void +set_host_charset (const char *charset) +{ + struct charset *cs = lookup_charset_or_error (charset); + check_valid_host_charset (cs); + set_host_and_target_charsets (cs, current_target_charset); +} -static struct charset * -lookup_charset_or_error (const char *name) +/* Do the real work of setting the target charset. */ +static void +set_target_charset (const char *charset) { - struct charset *cs = lookup_charset (name); + struct charset *cs = lookup_charset_or_error (charset); - if (! cs) - error ("GDB doesn't know of any character set named `%s'.", name); + set_host_and_target_charsets (current_host_charset, cs); +} - return cs; + +/* 'Set charset', 'set host-charset', 'set target-charset', 'show + charset' sfunc's. */ + +/* This is the sfunc for the 'set charset' command. */ +static void +set_charset_sfunc (char *charset, int from_tty, struct cmd_list_element *c) +{ + struct charset *cs = lookup_charset_or_error (host_charset_name); + check_valid_host_charset (cs); + /* CAREFUL: set the target charset here as well. */ + target_charset_name = host_charset_name; + set_host_and_target_charsets (cs, cs); } - +/* 'set host-charset' command sfunc. We need a wrapper here because + the function needs to have a specific signature. */ static void -check_valid_host_charset (struct charset *cs) +set_host_charset_sfunc (char *charset, int from_tty, + struct cmd_list_element *c) { - if (! cs->valid_host_charset) - error ("GDB can't use `%s' as its host character set.", cs->name); + set_host_charset (host_charset_name); } +/* Wrapper for the 'set target-charset' command. */ +static void +set_target_charset_sfunc (char *charset, int from_tty, + struct cmd_list_element *c) +{ + set_target_charset (target_charset_name); +} -void -set_host_charset (const char *charset) +/* sfunc for the 'show charset' command. */ +static void +show_charset (char *arg, int from_tty) { - struct charset *cs = lookup_charset_or_error (charset); - check_valid_host_charset (cs); - set_host_and_target_charsets (cs, current_target_charset); + if (current_host_charset == current_target_charset) + { + printf_filtered ("The current host and target character set is `%s'.\n", + host_charset ()); + } + else + { + printf_filtered ("The current host character set is `%s'.\n", + host_charset ()); + printf_filtered ("The current target character set is `%s'.\n", + target_charset ()); + } } + +/* Accessor functions. */ const char * host_charset (void) @@ -1022,16 +1099,6 @@ host_charset (void) return current_host_charset->name; } - -void -set_target_charset (const char *charset) -{ - struct charset *cs = lookup_charset_or_error (charset); - - set_host_and_target_charsets (current_host_charset, cs); -} - - const char * target_charset (void) { @@ -1094,104 +1161,14 @@ target_char_to_host (int target_char, int *host_char) -/* Commands. */ - - -/* List the valid character sets. If HOST_ONLY is non-zero, list only - those character sets which can be used as GDB's host character set. */ -static void -list_charsets (int host_only) -{ - struct charset *cs; - - printf_filtered ("Valid character sets are:\n"); - - for (cs = all_charsets; cs; cs = cs->next) - if (host_only && cs->valid_host_charset) - printf_filtered (" %s\n", cs->name); - else - printf_filtered (" %s %s\n", - cs->name, - cs->valid_host_charset ? "*" : " "); - - if (! host_only) - printf_filtered ("* - can be used as a host character set\n"); -} - - -static void -set_charset_command (char *arg, int from_tty) -{ - if (! arg || arg[0] == '\0') - list_charsets (0); - else - { - struct charset *cs = lookup_charset_or_error (arg); - check_valid_host_charset (cs); - set_host_and_target_charsets (cs, cs); - } -} - - -static void -set_host_charset_command (char *arg, int from_tty) -{ - if (! arg || arg[0] == '\0') - list_charsets (1); - else - { - struct charset *cs = lookup_charset_or_error (arg); - check_valid_host_charset (cs); - set_host_and_target_charsets (cs, current_target_charset); - } -} - - -static void -set_target_charset_command (char *arg, int from_tty) -{ - if (! arg || arg[0] == '\0') - list_charsets (0); - else - { - struct charset *cs = lookup_charset_or_error (arg); - set_host_and_target_charsets (current_host_charset, cs); - } -} - - -static void -show_charset_command (char *arg, int from_tty) -{ - if (current_host_charset == current_target_charset) - { - printf_filtered ("The current host and target character set is `%s'.\n", - host_charset ()); - } - else - { - printf_filtered ("The current host character set is `%s'.\n", - host_charset ()); - printf_filtered ("The current target character set is `%s'.\n", - target_charset ()); - } -} - - - /* The charset.c module initialization function. */ -#ifndef GDB_DEFAULT_HOST_CHARSET -#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1" -#endif - -#ifndef GDB_DEFAULT_TARGET_CHARSET -#define GDB_DEFAULT_TARGET_CHARSET "ISO-8859-1" -#endif void _initialize_charset (void) { + struct cmd_list_element *new_cmd; + /* Register all the character set GDB knows about. You should use the same names that iconv does, where possible, to @@ -1204,28 +1181,28 @@ _initialize_charset (void) when a translation's function pointer for a particular operation is zero. Hopefully, these defaults will be correct often enough that we won't need to provide too many translations. */ - register_charset (simple_charset ("ascii", 1, + register_charset (simple_charset ("ASCII", 1, ascii_print_literally, 0, ascii_to_control, 0)); - register_charset (iso_8859_family_charset ("iso-8859-1")); - register_charset (ebcdic_family_charset ("ebcdic-us")); - register_charset (ebcdic_family_charset ("ibm1047")); + register_charset (iso_8859_family_charset ("ISO-8859-1")); + register_charset (ebcdic_family_charset ("EBCDIC-US")); + register_charset (ebcdic_family_charset ("IBM1047")); register_iconv_charsets (); { struct { char *from; char *to; int *table; } tlist[] = { - { "ascii", "iso-8859-1", ascii_to_iso_8859_1_table }, - { "ascii", "ebcdic-us", ascii_to_ebcdic_us_table }, - { "ascii", "ibm1047", ascii_to_ibm1047_table }, - { "iso-8859-1", "ascii", iso_8859_1_to_ascii_table }, - { "iso-8859-1", "ebcdic-us", iso_8859_1_to_ebcdic_us_table }, - { "iso-8859-1", "ibm1047", iso_8859_1_to_ibm1047_table }, - { "ebcdic-us", "ascii", ebcdic_us_to_ascii_table }, - { "ebcdic-us", "iso-8859-1", ebcdic_us_to_iso_8859_1_table }, - { "ebcdic-us", "ibm1047", ebcdic_us_to_ibm1047_table }, - { "ibm1047", "ascii", ibm1047_to_ascii_table }, - { "ibm1047", "iso-8859-1", ibm1047_to_iso_8859_1_table }, - { "ibm1047", "ebcdic-us", ibm1047_to_ebcdic_us_table } + { "ASCII", "ISO-8859-1", ascii_to_iso_8859_1_table }, + { "ASCII", "EBCDIC-US", ascii_to_ebcdic_us_table }, + { "ASCII", "IBM1047", ascii_to_ibm1047_table }, + { "ISO-8859-1", "ASCII", iso_8859_1_to_ascii_table }, + { "ISO-8859-1", "EBCDIC-US", iso_8859_1_to_ebcdic_us_table }, + { "ISO-8859-1", "IBM1047", iso_8859_1_to_ibm1047_table }, + { "EBCDIC-US", "ASCII", ebcdic_us_to_ascii_table }, + { "EBCDIC-US", "ISO-8859-1", ebcdic_us_to_iso_8859_1_table }, + { "EBCDIC-US", "IBM1047", ebcdic_us_to_ibm1047_table }, + { "IBM1047", "ASCII", ibm1047_to_ascii_table }, + { "IBM1047", "ISO-8859-1", ibm1047_to_iso_8859_1_table }, + { "IBM1047", "EBCDIC-US", ibm1047_to_ebcdic_us_table } }; int i; @@ -1236,40 +1213,63 @@ _initialize_charset (void) tlist[i].table)); } - set_host_charset (GDB_DEFAULT_HOST_CHARSET); - set_target_charset (GDB_DEFAULT_TARGET_CHARSET); - - add_cmd ("charset", class_support, set_charset_command, - "Use CHARSET as the host and target character set.\n" - "The `host character set' is the one used by the system GDB is running on.\n" - "The `target character set' is the one used by the program being debugged.\n" - "You may only use supersets of ASCII for your host character set; GDB does\n" - "not support any others.\n" - "To see a list of the character sets GDB supports, type `set charset'\n" - "with no argument.", - &setlist); - - add_cmd ("host-charset", class_support, set_host_charset_command, - "Use CHARSET as the host character set.\n" - "The `host character set' is the one used by the system GDB is running on.\n" - "You may only use supersets of ASCII for your host character set; GDB does\n" - "not support any others.\n" - "To see a list of the character sets GDB supports, type `set host-charset'\n" - "with no argument.", - &setlist); - - add_cmd ("target-charset", class_support, set_target_charset_command, - "Use CHARSET as the target character set.\n" - "The `target character set' is the one used by the program being debugged.\n" - "GDB translates characters and strings between the host and target\n" - "character sets as needed.\n" - "To see a list of the character sets GDB supports, type `set target-charset'\n" - "with no argument.", - &setlist); - - add_cmd ("charset", class_support, show_charset_command, - "Show the current host and target character sets.", - &showlist); - add_alias_cmd ("host-charset", "charset", class_alias, 1, &showlist); - add_alias_cmd ("target-charset", "charset", class_alias, 1, &showlist); + set_host_charset (host_charset_name); + set_target_charset (target_charset_name); + + new_cmd = add_set_enum_cmd ("charset", + class_support, + host_charset_enum, + &host_charset_name, + "Set the host and target character sets.\n" + "The `host character set' is the one used by the system GDB is running on.\n" + "The `target character set' is the one used by the program being debugged.\n" + "You may only use supersets of ASCII for your host character set; GDB does\n" + "not support any others.\n" + "To see a list of the character sets GDB supports, type `set charset <TAB>'.", + &setlist); + + /* Note that the sfunc below needs to set target_charset_name, because + the 'set charset' command sets two variables. */ + set_cmd_sfunc (new_cmd, set_charset_sfunc); + /* Don't use set_from_show - need to print some extra info. */ + add_cmd ("charset", class_support, show_charset, + "Show the host and target character sets.\n" + "The `host character set' is the one used by the system GDB is running on.\n" + "The `target character set' is the one used by the program being debugged.\n" + "You may only use supersets of ASCII for your host character set; GDB does\n" + "not support any others.\n" + "To see a list of the character sets GDB supports, type `set charset <TAB>'.", + &showlist); + + + new_cmd = add_set_enum_cmd ("host-charset", + class_support, + host_charset_enum, + &host_charset_name, + "Set the host character set.\n" + "The `host character set' is the one used by the system GDB is running on.\n" + "You may only use supersets of ASCII for your host character set; GDB does\n" + "not support any others.\n" + "To see a list of the character sets GDB supports, type `set host-charset <TAB>'.", + &setlist); + + set_cmd_sfunc (new_cmd, set_host_charset_sfunc); + + add_show_from_set (new_cmd, &showlist); + + + + new_cmd = add_set_enum_cmd ("target-charset", + class_support, + target_charset_enum, + &target_charset_name, + "Set the target character set.\n" + "The `target character set' is the one used by the program being debugged.\n" + "GDB translates characters and strings between the host and target\n" + "character sets as needed.\n" + "To see a list of the character sets GDB supports, type `set target-charset'<TAB>", + &setlist); + + set_cmd_sfunc (new_cmd, set_target_charset_sfunc); + add_show_from_set (new_cmd, &showlist); } diff --git a/gdb/charset.h b/gdb/charset.h index 10578cb..31dbe6f 100644 --- a/gdb/charset.h +++ b/gdb/charset.h @@ -46,23 +46,12 @@ the requirements above, it's easy to plug an entry into GDB's table that uses iconv to handle the details. */ - -/* Set the host character set to CHARSET. CHARSET must be a superset - of ASCII, since GDB's code assumes this. */ -void set_host_charset (const char *charset); - - -/* Set the target character set to CHARSET. */ -void set_target_charset (const char *charset); - - /* Return the name of the current host/target character set. The result is owned by the charset module; the caller should not free it. */ const char *host_charset (void); const char *target_charset (void); - /* In general, the set of C backslash escapes (\n, \f) is specific to the character set. Not all character sets will have form feed characters, for example. diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index c33c242..108329a 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -171,10 +171,6 @@ struct cmd_list_element *maintenanceinfolist; struct cmd_list_element *maintenanceprintlist; -/* Chain containing all defined "maintenance list" subcommands. */ - -struct cmd_list_element *maintenancelistlist; - struct cmd_list_element *setprintlist; struct cmd_list_element *showprintlist; @@ -1036,7 +1032,6 @@ init_cmd_lists (void) maintenancelist = NULL; maintenanceinfolist = NULL; maintenanceprintlist = NULL; - maintenancelistlist = NULL; setprintlist = NULL; showprintlist = NULL; setchecklist = NULL; diff --git a/gdb/cli/cli-cmds.h b/gdb/cli/cli-cmds.h index 1f340ef..a6e574e 100644 --- a/gdb/cli/cli-cmds.h +++ b/gdb/cli/cli-cmds.h @@ -87,10 +87,6 @@ extern struct cmd_list_element *maintenanceinfolist; extern struct cmd_list_element *maintenanceprintlist; -/* Chain containing all defined "maintenance list" subcommands. */ - -extern struct cmd_list_element *maintenancelistlist; - extern struct cmd_list_element *setprintlist; extern struct cmd_list_element *showprintlist; diff --git a/gdb/coffread.c b/gdb/coffread.c index f5eb127..2b827c7 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1425,7 +1425,7 @@ patch_opaque_types (struct symtab *s) but search the whole chain, as there may be several syms from different files with the same name. */ if (SYMBOL_CLASS (real_sym) == LOC_TYPEDEF && - SYMBOL_NAMESPACE (real_sym) == VAR_NAMESPACE && + SYMBOL_DOMAIN (real_sym) == VAR_DOMAIN && TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR && TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0) { @@ -1487,7 +1487,7 @@ process_coff_symbol (register struct coff_symbol *cs, /* default assumptions */ SYMBOL_VALUE (sym) = cs->c_value; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_SECTION (sym) = cs_to_section (cs, objfile); if (ISFCN (cs->c_type)) @@ -1609,7 +1609,7 @@ process_coff_symbol (register struct coff_symbol *cs, case C_TPDEF: SYMBOL_CLASS (sym) = LOC_TYPEDEF; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; /* If type has no name, give it one */ if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) @@ -1669,7 +1669,7 @@ process_coff_symbol (register struct coff_symbol *cs, case C_UNTAG: case C_ENTAG: SYMBOL_CLASS (sym) = LOC_TYPEDEF; - SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE; + SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN; /* Some compilers try to be helpful by inventing "fake" names for anonymous enums, structures, and unions, like @@ -2079,7 +2079,7 @@ coff_read_enum_type (int index, int length, int lastsym) obsavestring (name, strlen (name), ¤t_objfile->symbol_obstack); SYMBOL_CLASS (sym) = LOC_CONST; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_VALUE (sym) = ms->c_value; add_symbol_to_list (sym, symlist); nsyms++; diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst index c2ed914..386fcf0 100644 --- a/gdb/config/djgpp/fnchange.lst +++ b/gdb/config/djgpp/fnchange.lst @@ -261,10 +261,10 @@ @V@/gdb/testsuite/gdb.c++/psmang2.cc @V@/gdb/testsuite/gdb.cxx/psmang2.cc @V@/gdb/testsuite/gdb.c++/ref-types.cc @V@/gdb/testsuite/gdb.cxx/ref-types.cc @V@/gdb/testsuite/gdb.c++/ref-types.exp @V@/gdb/testsuite/gdb.cxx/ref-types.exp +@V@/gdb/testsuite/gdb.c++/rtti.exp @V@/gdb/testsuite/gdb.cxx/rtti.exp +@V@/gdb/testsuite/gdb.c++/rtti.h @V@/gdb/testsuite/gdb.cxx/rtti.h @V@/gdb/testsuite/gdb.c++/rtti1.cc @V@/gdb/testsuite/gdb.cxx/rtti1.cc @V@/gdb/testsuite/gdb.c++/rtti2.cc @V@/gdb/testsuite/gdb.cxx/rtti2.cc -@V@/gdb/testsuite/gdb.c++/rtti.h @V@/gdb/testsuite/gdb.cxx/rtti.h -@V@/gdb/testsuite/gdb.c++/rtti.exp @V@/gdb/testsuite/gdb.cxx/rtti.exp @V@/gdb/testsuite/gdb.c++/templates.cc @V@/gdb/testsuite/gdb.cxx/templates.cc @V@/gdb/testsuite/gdb.c++/templates.exp @V@/gdb/testsuite/gdb.cxx/templates.exp @V@/gdb/testsuite/gdb.c++/try_catch.cc @V@/gdb/testsuite/gdb.cxx/try_catch.cc @@ -286,6 +286,8 @@ @V@/gdb/tui/tuiSourceWin.h @V@/gdb/tui/tuiWinSource.h @V@/gdb/x86-64-linux-tdep.c @V@/gdb/x8664-ltdep.c @V@/gdb/x86-64-linux-nat.c @V@/gdb/x8664-lnat.c +@V@/include/xtensa-isa-internal.h @V@/include/xt-internal.h +@V@/include/xtensa-isa.h @V@/include/xt-isa.h @V@/intl/intlh.inst.in @V@/intl/intlh_inst.in @V@/intl/po2tbl.sed.in @V@/intl/po2tblsed.in @V@/itcl/itcl/itclConfig.sh.in @V@/itcl/itcl/itclConfig.sh-in @@ -451,6 +453,9 @@ @V@/sim/testsuite/d10v-elf/t-ae-st2w-ip.s @V@/sim/testsuite/d10v-elf/t-st2-ip.s @V@/sim/testsuite/d10v-elf/t-ae-st2w-is.s @V@/sim/testsuite/d10v-elf/t-st2-is.s @V@/sim/testsuite/d30v-elf/ls-ld4bhu.S @V@/sim/testsuite/d30v-elf/ls-ld4bu.S +@V@/sim/testsuite/sim/arm/misaligned1.ms @V@/sim/testsuite/sim/arm/mis1.ms +@V@/sim/testsuite/sim/arm/misaligned2.ms @V@/sim/testsuite/sim/arm/mis2.ms +@V@/sim/testsuite/sim/arm/misaligned3.ms @V@/sim/testsuite/sim/arm/mis3.ms @V@/tcl/cygwin/tclConfig.sh.in @V@/tcl/cygwin/tclConfig.sh-in @V@/tcl/doc/ExprLongObj.3 @V@/tcl/doc/ExprLObj.3 @V@/tcl/mac/tclMacBOAAppInit.c @V@/tcl/mac/tclBOAAppInit.c diff --git a/gdb/config/i386/tm-linux.h b/gdb/config/i386/tm-linux.h index ca46cb5..799678e 100644 --- a/gdb/config/i386/tm-linux.h +++ b/gdb/config/i386/tm-linux.h @@ -23,8 +23,6 @@ #ifndef TM_LINUX_H #define TM_LINUX_H -#define I386_GNULINUX_TARGET - #include "i386/tm-i386.h" #include "config/tm-linux.h" diff --git a/gdb/config/ia64/tm-ia64.h b/gdb/config/ia64/tm-ia64.h index dc36127..2445395 100644 --- a/gdb/config/ia64/tm-ia64.h +++ b/gdb/config/ia64/tm-ia64.h @@ -31,7 +31,7 @@ used in push_word and a few other places; REGISTER_RAW_SIZE is the real way to know how big a register is. */ -#define REGISTER_SIZE 8 +#define DEPRECATED_REGISTER_SIZE 8 #undef NUM_REGS #define NUM_REGS 590 @@ -50,7 +50,7 @@ need 8 bytes for each register, plus an additional 8 bytes for each of the 128 floating point registers. */ -#define REGISTER_BYTES (NUM_REGS*8+128*8) +#define DEPRECATED_REGISTER_BYTES (NUM_REGS*8+128*8) /* Index within `registers' of the first byte of the space for register N. */ diff --git a/gdb/config/m68k/nm-sun3.h b/gdb/config/m68k/nm-sun3.h index b2fecb2..3c5d47e 100644 --- a/gdb/config/m68k/nm-sun3.h +++ b/gdb/config/m68k/nm-sun3.h @@ -31,4 +31,4 @@ /* We have to grab the regs since we store all regs at once. */ -#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES) +#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES) diff --git a/gdb/config/m68k/tm-linux.h b/gdb/config/m68k/tm-linux.h index cc20c62..636df0b 100644 --- a/gdb/config/m68k/tm-linux.h +++ b/gdb/config/m68k/tm-linux.h @@ -1,6 +1,6 @@ /* Definitions to target GDB to GNU/Linux on m680x0. - Copyright 1996, 1998, 1999, 2000, 2002 Free Software Foundation, + Copyright 1996, 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -20,8 +20,10 @@ 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" -#include "m68k-tdep.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 @@ -29,65 +31,6 @@ #define START_INFERIOR_TRAPS_EXPECTED 2 -/* The following definitions are appropriate when using the ELF - format, where floating point values are returned in fp0, pointer - values in a0 and other values in d0. */ - -/* 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. */ - -#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ -{ \ - if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ - { \ - REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \ - ((char *) (REGBUF) \ - + REGISTER_BYTE (FP0_REGNUM)), \ - VALBUF); \ - } \ - else if (TYPE_CODE (TYPE) == TYPE_CODE_PTR) \ - memcpy (VALBUF, (char *) (REGBUF) + REGISTER_BYTE (M68K_A0_REGNUM), \ - TYPE_LENGTH (TYPE)); \ - else \ - memcpy (VALBUF, \ - ((char *) (REGBUF) \ - + (TYPE_LENGTH (TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH (TYPE))), \ - TYPE_LENGTH (TYPE)); \ -} - -/* Write into appropriate registers a function return value of type - TYPE, given in virtual format. */ - -#define DEPRECATED_STORE_RETURN_VALUE(TYPE,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_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \ - raw_buffer, TYPE_LENGTH (TYPE)); \ - } \ - else \ - { \ - if (TYPE_CODE (TYPE) == TYPE_CODE_PTR) \ - deprecated_write_register_bytes (REGISTER_BYTE (M68K_A0_REGNUM), VALBUF, \ - TYPE_LENGTH (TYPE)); \ - deprecated_write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); \ - } \ -} - -#include "config/tm-linux.h" -#include "m68k/tm-m68k.h" - -/* 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). */ - -#undef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS -#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ - (*(CORE_ADDR *)((char *) (REGBUF) + REGISTER_BYTE (M68K_A0_REGNUM))) - /* Offsets (in target ints) into jmp_buf. */ #define JB_ELEMENT_SIZE 4 @@ -100,9 +43,5 @@ #define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR) -#undef DEPRECATED_FRAME_SAVED_PC -#define DEPRECATED_FRAME_SAVED_PC(frame) m68k_linux_frame_saved_pc (frame) -extern CORE_ADDR m68k_linux_frame_saved_pc (struct frame_info *); - #define IN_SIGTRAMP(pc,name) m68k_linux_in_sigtramp (pc) extern int m68k_linux_in_sigtramp (CORE_ADDR pc); diff --git a/gdb/config/m68k/tm-m68k.h b/gdb/config/m68k/tm-m68k.h index 523cc4a..cb72c98 100644 --- a/gdb/config/m68k/tm-m68k.h +++ b/gdb/config/m68k/tm-m68k.h @@ -22,3 +22,5 @@ #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-sun3.h b/gdb/config/m68k/tm-sun3.h index aafba6a..6e978cf 100644 --- a/gdb/config/m68k/tm-sun3.h +++ b/gdb/config/m68k/tm-sun3.h @@ -28,12 +28,12 @@ <machine/reg.h>. */ /* a&d, pc,sr, fp, fpstat, fpflags */ -#define REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4 + 4) +#define DEPRECATED_REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4 + 4) #define NUM_REGS 31 #define REGISTER_BYTES_OK(b) \ - ((b) == REGISTER_BYTES \ + ((b) == DEPRECATED_REGISTER_BYTES \ || (b) == REGISTER_BYTES_FP \ || (b) == REGISTER_BYTES_NOFP) diff --git a/gdb/config/m68k/tm-vx68.h b/gdb/config/m68k/tm-vx68.h index f7e8fca..271eb7e 100644 --- a/gdb/config/m68k/tm-vx68.h +++ b/gdb/config/m68k/tm-vx68.h @@ -79,4 +79,4 @@ /* Number of registers in a ptrace_getfpregs call. */ #define VX_SIZE_FPREGS (8 * REGISTER_RAW_SIZE (FP0_REGNUM) \ - + (3 * REGISTER_SIZE)) + + (3 * DEPRECATED_REGISTER_SIZE)) diff --git a/gdb/config/mips/tm-irix5.h b/gdb/config/mips/tm-irix5.h index 2a1af87..d3dfdc4 100644 --- a/gdb/config/mips/tm-irix5.h +++ b/gdb/config/mips/tm-irix5.h @@ -30,8 +30,8 @@ * Irix 6 (n32 ABI) has 32-bit GP regs and 64-bit FP regs */ -#undef REGISTER_BYTES -#define REGISTER_BYTES (MIPS_NUMREGS * 8 + (NUM_REGS - MIPS_NUMREGS) * MIPS_REGSIZE) +#undef DEPRECATED_REGISTER_BYTES +#define DEPRECATED_REGISTER_BYTES (MIPS_NUMREGS * 8 + (NUM_REGS - MIPS_NUMREGS) * MIPS_REGSIZE) #undef REGISTER_BYTE #define REGISTER_BYTE(N) \ diff --git a/gdb/config/mips/tm-irix6.h b/gdb/config/mips/tm-irix6.h index 59d3c58..812aed5 100644 --- a/gdb/config/mips/tm-irix6.h +++ b/gdb/config/mips/tm-irix6.h @@ -62,8 +62,8 @@ #define FCRIR_REGNUM 70 /* FP implementation/revision */ -#undef REGISTER_BYTES -#define REGISTER_BYTES (MIPS_NUMREGS * 8 + (NUM_REGS - MIPS_NUMREGS) * MIPS_REGSIZE) +#undef DEPRECATED_REGISTER_BYTES +#define DEPRECATED_REGISTER_BYTES (MIPS_NUMREGS * 8 + (NUM_REGS - MIPS_NUMREGS) * MIPS_REGSIZE) #undef REGISTER_BYTE #define REGISTER_BYTE(N) \ diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h index dada615..540db16 100644 --- a/gdb/config/mips/tm-mips.h +++ b/gdb/config/mips/tm-mips.h @@ -49,10 +49,10 @@ extern int mips_step_skips_delay (CORE_ADDR); used in push_word and a few other places; REGISTER_RAW_SIZE is the real way to know how big a register is. */ -#define REGISTER_SIZE 4 +#define DEPRECATED_REGISTER_SIZE 4 /* The size of a register. This is predefined in tm-mips64.h. We - can't use REGISTER_SIZE because that is used for various other + can't use DEPRECATED_REGISTER_SIZE because that is used for various other things. */ #ifndef MIPS_REGSIZE @@ -106,7 +106,7 @@ extern int mips_step_skips_delay (CORE_ADDR); /* Total amount of space needed to store our copies of the machine's register state, the array `registers'. */ -#define REGISTER_BYTES (NUM_REGS*MIPS_REGSIZE) +#define DEPRECATED_REGISTER_BYTES (NUM_REGS*MIPS_REGSIZE) /* Index within `registers' of the first byte of the space for register N. */ diff --git a/gdb/config/nm-gnu.h b/gdb/config/nm-gnu.h index 1dedb57..73a4180 100644 --- a/gdb/config/nm-gnu.h +++ b/gdb/config/nm-gnu.h @@ -30,7 +30,7 @@ extern char *gnu_target_pid_to_str (int pid); /* Before storing, we need to read all the registers. */ -#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES) +#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES) /* Don't do wait_for_inferior on attach. */ #define ATTACH_NO_WAIT diff --git a/gdb/config/pa/nm-hppah.h b/gdb/config/pa/nm-hppah.h index 2cc1e30..f8a2a11 100644 --- a/gdb/config/pa/nm-hppah.h +++ b/gdb/config/pa/nm-hppah.h @@ -121,9 +121,10 @@ extern int hppa_can_use_hw_watchpoint (int type, int cnt, int ot); #define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \ hppa_can_use_hw_watchpoint(type, cnt, ot) -/* The PA can also watch memory regions of arbitrary size, since we're using - a page-protection scheme. (On some targets, apparently watch registers - are used, which can only accomodate regions of REGISTER_SIZE.) */ +/* The PA can also watch memory regions of arbitrary size, since we're + using a page-protection scheme. (On some targets, apparently watch + registers are used, which can only accomodate regions of + DEPRECATED_REGISTER_SIZE.) */ #define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(byte_count) \ (1) diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 8646ab0..988b790 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -60,7 +60,8 @@ struct inferior_status; /* Sequence of bytes for breakpoint instruction. */ -#define BREAKPOINT {0x00, 0x01, 0x00, 0x04} +const unsigned char *hppa_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr); +#define BREAKPOINT_FROM_PC(PCPTR,LENPTR) hppa_breakpoint_from_pc ((PCPTR), (LENPTR)) #define BREAKPOINT32 0x10004 extern int hppa_pc_requires_run_before_use (CORE_ADDR pc); @@ -274,20 +275,20 @@ extern void hppa_frame_init_saved_regs (struct frame_info *); (DEPRECATED_PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) && \ (read_memory_integer((pc), 4) == BREAKPOINT32)) -/* - * Insert the specified number of args and function address - * into a call sequence of the above form stored at DUMMYNAME. - * - * On the hppa we need to call the stack dummy through $$dyncall. - * Therefore our version of FIX_CALL_DUMMY takes an extra argument, - * real_pc, which is the location where gdb should start up the - * inferior to do the function call. - */ +/* Insert the specified number of args and function address into a + call sequence of the above form stored at DUMMYNAME. + + On the hppa we need to call the stack dummy through $$dyncall. + Therefore our version of DEPRECATED_FIX_CALL_DUMMY takes an extra + argument, real_pc, which is the location where gdb should start up + the inferior to do the function call. */ /* FIXME: brobecker 2002-12-26. This macro is going to cause us some - problems before we can go to multiarch partial as it has been diverted - on HPUX to return the value of the PC! */ -#define FIX_CALL_DUMMY hppa_fix_call_dummy + problems before we can go to multiarch partial as it has been + diverted on HPUX to return the value of the PC! */ +/* NOTE: cagney/2003-05-03: This has been replaced by push_dummy_code. + Hopefully that has all the parameters HP/UX needs. */ +#define DEPRECATED_FIX_CALL_DUMMY hppa_fix_call_dummy extern CORE_ADDR hppa_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, int, struct value **, struct type *, int); diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h index 17f40aa..6d39ed0 100644 --- a/gdb/config/pa/tm-hppa64.h +++ b/gdb/config/pa/tm-hppa64.h @@ -21,6 +21,9 @@ 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. */ +struct type; +struct frame_info; + /* PA 64-bit specific definitions. Override those which are in tm-hppa.h */ @@ -94,9 +97,8 @@ extern CORE_ADDR hppa_stack_align (CORE_ADDR sp); #define STACK_ALIGN(sp) hppa_stack_align (sp) #endif -/* Amount PC must be decremented by after a breakpoint. - This is often the number of bytes in BREAKPOINT - but not always. +/* Amount PC must be decremented by after a breakpoint. This is often + the number of bytes returned by BREAKPOINT_FROM_PC but not always. Not on the PA-RISC */ @@ -109,7 +111,7 @@ extern CORE_ADDR hppa_stack_align (CORE_ADDR sp); real way to know how big a register is. */ #if !GDB_MULTI_ARCH -#define REGISTER_SIZE 4 +#define DEPRECATED_REGISTER_SIZE 4 #endif /* Number of machine registers */ @@ -150,7 +152,7 @@ extern int hppa_register_raw_size (int reg_nr); /* Total amount of space needed to store our copies of the machine's register state, the array `registers'. */ #if !GDB_MULTI_ARCH -#define REGISTER_BYTES (NUM_REGS * 4) +#define DEPRECATED_REGISTER_BYTES (NUM_REGS * 4) #endif #if !GDB_MULTI_ARCH @@ -308,11 +310,11 @@ extern void hppa_pop_frame (void); #endif #if !GDB_MULTI_ARCH -#define CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 28) +#define DEPRECATED_CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 28) #endif #if !GDB_MULTI_ARCH -#define CALL_DUMMY_START_OFFSET 0 +#define DEPRECATED_CALL_DUMMY_START_OFFSET 0 #endif #if !GDB_MULTI_ARCH @@ -357,8 +359,8 @@ extern CORE_ADDR hppa_target_read_fp (void); push_word and a few other places, but REGISTER_RAW_SIZE is the real way to know how big a register is. */ -#undef REGISTER_SIZE -#define REGISTER_SIZE 8 +#undef DEPRECATED_REGISTER_SIZE +#define DEPRECATED_REGISTER_SIZE 8 /* Number of bytes of storage in the actual machine representation for register N. On the PA-RISC 2.0, all regs are 8 bytes, including @@ -375,8 +377,8 @@ extern CORE_ADDR hppa_target_read_fp (void); /* Total amount of space needed to store our copies of the machine's register state, the array `registers'. */ -#undef REGISTER_BYTES -#define REGISTER_BYTES (NUM_REGS * 8) +#undef DEPRECATED_REGISTER_BYTES +#define DEPRECATED_REGISTER_BYTES (NUM_REGS * 8) /* Index within `registers' of the first byte of the space for register N. */ @@ -501,14 +503,14 @@ call_dummy 0xe820f0000fb110d3LL, 0x0001000400151820LL,\ 0xe6c0000008000240LL} -#define CALL_DUMMY_BREAKPOINT_OFFSET 22 * 4 +#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET 22 * 4 -/* CALL_DUMMY_LENGTH is computed based on the size of a word on the target - machine, not the size of an instruction. Since a word on this target - holds two instructions we have to divide the instruction size by two to - get the word size of the dummy. */ -#undef CALL_DUMMY_LENGTH -#define CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 26 / 2) +/* DEPRECATED_CALL_DUMMY_LENGTH is computed based on the size of a + word on the target machine, not the size of an instruction. Since + a word on this target holds two instructions we have to divide the + instruction size by two to get the word size of the dummy. */ +#undef DEPRECATED_CALL_DUMMY_LENGTH +#define DEPRECATED_CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 26 / 2) /* The PA64 ABI mandates a 16 byte stack alignment. */ #undef STACK_ALIGN @@ -540,12 +542,12 @@ call_dummy if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ memcpy ((VALBUF), \ ((char *)(REGBUF)) + REGISTER_BYTE (FP4_REGNUM) + \ - (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \ + (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \ TYPE_LENGTH (TYPE)); \ else if (is_integral_type(TYPE)) \ memcpy ((VALBUF), \ (char *)(REGBUF) + REGISTER_BYTE (28) + \ - (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \ + (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \ TYPE_LENGTH (TYPE)); \ else if (TYPE_LENGTH (TYPE) <= 8) \ memcpy ((VALBUF), \ @@ -574,13 +576,13 @@ call_dummy if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ deprecated_write_register_bytes \ (REGISTER_BYTE (FP4_REGNUM) + \ - (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \ + (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \ (VALBUF), \ TYPE_LENGTH (TYPE)); \ else if (is_integral_type(TYPE)) \ deprecated_write_register_bytes \ (REGISTER_BYTE (28) + \ - (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \ + (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \ (VALBUF), \ TYPE_LENGTH (TYPE)); \ else if (TYPE_LENGTH (TYPE) <= 8) \ diff --git a/gdb/config/pa/tm-hppah.h b/gdb/config/pa/tm-hppah.h index 070c83c..290f752 100644 --- a/gdb/config/pa/tm-hppah.h +++ b/gdb/config/pa/tm-hppah.h @@ -35,8 +35,10 @@ 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); diff --git a/gdb/config/s390/tm-s390.h b/gdb/config/s390/tm-s390.h index 2bb4c2d..c8a6e8d 100644 --- a/gdb/config/s390/tm-s390.h +++ b/gdb/config/s390/tm-s390.h @@ -24,15 +24,15 @@ #define TM_S390_H 1 #define S390_NUM_GPRS (16) -#define S390_GPR_SIZE REGISTER_SIZE -#define S390_PSW_MASK_SIZE REGISTER_SIZE -#define S390_PSW_ADDR_SIZE REGISTER_SIZE +#define S390_GPR_SIZE DEPRECATED_REGISTER_SIZE +#define S390_PSW_MASK_SIZE DEPRECATED_REGISTER_SIZE +#define S390_PSW_ADDR_SIZE DEPRECATED_REGISTER_SIZE #define S390_NUM_FPRS (16) #define S390_FPR_SIZE (8) #define S390_FPC_SIZE (4) #define S390_FPC_PAD_SIZE (4) /* gcc insists on aligning the fpregs */ #define S390_NUM_CRS (16) -#define S390_CR_SIZE REGISTER_SIZE +#define S390_CR_SIZE DEPRECATED_REGISTER_SIZE #define S390_NUM_ACRS (16) #define S390_ACR_SIZE (4) @@ -94,16 +94,16 @@ int s390_cannot_fetch_register (int regno); 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 REGISTER_SIZE (8) -#define REGISTER_BYTES S390X_REGISTER_BYTES +#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 REGISTER_SIZE (4) -#define REGISTER_BYTES S390_REGISTER_BYTES +#define DEPRECATED_REGISTER_SIZE (4) +#define DEPRECATED_REGISTER_BYTES S390_REGISTER_BYTES #endif /* CONFIG_ARCH_S390X */ diff --git a/gdb/config/sparc/nm-nbsd.h b/gdb/config/sparc/nm-nbsd.h index 41341c6..7ffd72e 100644 --- a/gdb/config/sparc/nm-nbsd.h +++ b/gdb/config/sparc/nm-nbsd.h @@ -30,6 +30,6 @@ /* Before storing, we need to read all the registers. */ -#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES) +#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES) #endif /* NM_NBSD_H */ diff --git a/gdb/config/sparc/nm-sun4os4.h b/gdb/config/sparc/nm-sun4os4.h index cee2a3d..e77330c 100644 --- a/gdb/config/sparc/nm-sun4os4.h +++ b/gdb/config/sparc/nm-sun4os4.h @@ -30,7 +30,7 @@ /* Before storing, we need to read all the registers. */ -#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES) +#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES) /* Return sizeof user struct to callers in less machine dependent routines */ diff --git a/gdb/config/sparc/nm-sun4sol2.h b/gdb/config/sparc/nm-sun4sol2.h index 8ad58a1..6f37162 100644 --- a/gdb/config/sparc/nm-sun4sol2.h +++ b/gdb/config/sparc/nm-sun4sol2.h @@ -26,7 +26,7 @@ /* Before storing, we need to read all the registers. */ -#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES) +#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES) /* Solaris PSRVADDR support does not seem to include a place for nPC. */ diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h index f46d459..8baa66a 100644 --- a/gdb/config/sparc/tm-sp64.h +++ b/gdb/config/sparc/tm-sp64.h @@ -90,26 +90,26 @@ struct type; #undef CALL_DUMMY #define CALL_DUMMY {0} -#undef CALL_DUMMY_LENGTH -#define CALL_DUMMY_LENGTH 0 +#undef DEPRECATED_CALL_DUMMY_LENGTH +#define DEPRECATED_CALL_DUMMY_LENGTH 0 #undef CALL_DUMMY_CALL_OFFSET #define CALL_DUMMY_CALL_OFFSET 0 -#undef CALL_DUMMY_START_OFFSET -#define CALL_DUMMY_START_OFFSET 0 -#undef CALL_DUMMY_BREAKPOINT_OFFSET -#define CALL_DUMMY_BREAKPOINT_OFFSET 0 +#undef DEPRECATED_CALL_DUMMY_START_OFFSET +#define DEPRECATED_CALL_DUMMY_START_OFFSET 0 +#undef DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET +#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET 0 #undef CALL_DUMMY_LOCATION #define CALL_DUMMY_LOCATION AT_ENTRY_POINT #undef DEPRECATED_PC_IN_CALL_DUMMY #define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_at_entry_point (pc, sp, frame_address) #undef DEPRECATED_CALL_DUMMY_STACK_ADJUST #define DEPRECATED_CALL_DUMMY_STACK_ADJUST 128 -#undef SIZEOF_CALL_DUMMY_WORDS -#define SIZEOF_CALL_DUMMY_WORDS 0 +#undef DEPRECATED_SIZEOF_CALL_DUMMY_WORDS +#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS 0 #undef CALL_DUMMY_ADDRESS #define CALL_DUMMY_ADDRESS() entry_point_address() -#undef FIX_CALL_DUMMY -#define FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P) +#undef DEPRECATED_FIX_CALL_DUMMY +#define DEPRECATED_FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P) #undef DEPRECATED_PUSH_RETURN_ADDRESS #define DEPRECATED_PUSH_RETURN_ADDRESS(PC, SP) sparc_at_entry_push_return_address (PC, SP) extern CORE_ADDR sparc_at_entry_push_return_address (CORE_ADDR pc, @@ -147,20 +147,20 @@ extern void sparc_at_entry_store_struct_return (CORE_ADDR addr, CORE_ADDR sp); #define DEPRECATED_CALL_DUMMY_STACK_ADJUST 128 /* Size of the call dummy in bytes. */ -#undef CALL_DUMMY_LENGTH -#define CALL_DUMMY_LENGTH 192 +#undef DEPRECATED_CALL_DUMMY_LENGTH +#define DEPRECATED_CALL_DUMMY_LENGTH 192 /* Offset within CALL_DUMMY of the 'call' instruction. */ -#undef CALL_DUMMY_START_OFFSET -#define CALL_DUMMY_START_OFFSET 148 +#undef DEPRECATED_CALL_DUMMY_START_OFFSET +#define DEPRECATED_CALL_DUMMY_START_OFFSET 148 /* Offset within CALL_DUMMY of the 'call' instruction. */ #undef CALL_DUMMY_CALL_OFFSET -#define CALL_DUMMY_CALL_OFFSET (CALL_DUMMY_START_OFFSET + (5 * 4)) +#define CALL_DUMMY_CALL_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + (5 * 4)) /* Offset within CALL_DUMMY of the 'ta 1' instruction. */ -#undef CALL_DUMMY_BREAKPOINT_OFFSET -#define CALL_DUMMY_BREAKPOINT_OFFSET (CALL_DUMMY_START_OFFSET + (8 * 4)) +#undef DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET +#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + (8 * 4)) /* Call dummy will be located on the stack. */ #undef CALL_DUMMY_LOCATION @@ -169,15 +169,15 @@ extern void sparc_at_entry_store_struct_return (CORE_ADDR addr, CORE_ADDR sp); #define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) /* Insert the function address into the call dummy. */ -#undef FIX_CALL_DUMMY -#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ +#undef DEPRECATED_FIX_CALL_DUMMY +#define DEPRECATED_FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ sparc_fix_call_dummy (dummyname, pc, fun, type, gcc_p) void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, struct type *value_type, int using_gcc); /* The remainder of these will accept the default definition. */ -#undef SIZEOF_CALL_DUMMY_WORDS +#undef DEPRECATED_SIZEOF_CALL_DUMMY_WORDS #undef DEPRECATED_PUSH_RETURN_ADDRESS #undef CALL_DUMMY_ADDRESS #undef STORE_STRUCT_RETURN @@ -360,8 +360,8 @@ extern void sp64_extract_return_value (struct type *, char[], char *, int); register state, the array `registers'. 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). */ -#undef REGISTER_BYTES -#define REGISTER_BYTES (32*8+32*8+45*8) +#undef DEPRECATED_REGISTER_BYTES +#define DEPRECATED_REGISTER_BYTES (32*8+32*8+45*8) /* Index within `registers' of the first byte of the space for register N. */ @@ -376,8 +376,8 @@ extern void sp64_extract_return_value (struct type *, char[], char *, int); used in push_word and a few other places; REGISTER_RAW_SIZE is the real way to know how big a register is. */ -#undef REGISTER_SIZE -#define REGISTER_SIZE 8 +#undef DEPRECATED_REGISTER_SIZE +#define DEPRECATED_REGISTER_SIZE 8 /* Number of bytes of storage in the actual machine representation for register N. */ diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index e997bab..ab18477 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -164,9 +164,8 @@ extern int sparc_intreg_size (void); #define FUNCTION_START_OFFSET 0 -/* Amount PC must be decremented by after a breakpoint. - This is often the number of bytes in BREAKPOINT - but not always. */ +/* Amount PC must be decremented by after a breakpoint. This is often + the number of bytes returned by BREAKPOINT_FROM_PC but not always. */ #define DECR_PC_AFTER_BREAK 0 @@ -174,7 +173,7 @@ extern int sparc_intreg_size (void); used in push_word and a few other places; REGISTER_RAW_SIZE is the real way to know how big a register is. */ -#define REGISTER_SIZE 4 +#define DEPRECATED_REGISTER_SIZE 4 /* Number of machine registers */ @@ -205,7 +204,7 @@ extern int sparc_intreg_size (void); other hand, that is likely to be confusing or worse for flat frames. */ -#define REGISTER_BYTES (32*4+32*4+8*4) +#define DEPRECATED_REGISTER_BYTES (32*4+32*4+8*4) /* Index within `registers' of the first byte of the space for register N. */ @@ -361,7 +360,8 @@ extern CORE_ADDR sparc_pc_adjust (CORE_ADDR); /* Sequence of bytes for breakpoint instruction (ta 1). */ -#define BREAKPOINT {0x91, 0xd0, 0x20, 0x01} +extern const unsigned char *sparc_breakpoint_from_pc (CORE_ADDR *pc, int *len); +#define BREAKPOINT_FROM_PC(PC,LEN) sparc_breakpoint_from_pc ((PC), (LEN)) /* Register numbers of various important registers. Note that some of these values are "real" register numbers, @@ -589,19 +589,19 @@ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev); /* Size of the call dummy in bytes. */ -#define CALL_DUMMY_LENGTH 0x38 +#define DEPRECATED_CALL_DUMMY_LENGTH 0x38 /* Offset within call dummy of first instruction to execute. */ -#define CALL_DUMMY_START_OFFSET 0 +#define DEPRECATED_CALL_DUMMY_START_OFFSET 0 /* Offset within CALL_DUMMY of the 'call' instruction. */ -#define CALL_DUMMY_CALL_OFFSET (CALL_DUMMY_START_OFFSET + 0x24) +#define CALL_DUMMY_CALL_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + 0x24) /* Offset within CALL_DUMMY of the 'ta 1' trap instruction. */ -#define CALL_DUMMY_BREAKPOINT_OFFSET (CALL_DUMMY_START_OFFSET + 0x30) +#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + 0x30) #define DEPRECATED_CALL_DUMMY_STACK_ADJUST 68 @@ -626,7 +626,7 @@ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev); /* Insert the specified number of args and function address into a call sequence of the above form stored at DUMMYNAME. */ -#define FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P) \ +#define DEPRECATED_FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P) \ sparc_fix_call_dummy (DUMMYNAME, PC, FUN, TYPE, GCC_P) void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, struct type *value_type, int using_gcc); diff --git a/gdb/configure.tgt b/gdb/configure.tgt index aeb9e271..fe4cc5d 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -51,6 +51,7 @@ arm*-*-linux*) gdb_target=linux ;; arm*-*-netbsd*) gdb_target=nbsd gdb_multi_arch=yes ;; +arm-*-nto*) gdb_target=nto ;; arm*-*-* | thumb*-*-* | strongarm*-*-*) gdb_target=embed configdirs="$configdirs rdi-share" @@ -90,6 +91,7 @@ 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 ;; @@ -216,6 +218,7 @@ sh-*-linux*) gdb_target=linux build_gdbserver=yes ;; sh*-*-netbsdelf*) gdb_target=nbsd ;; +sh-*-nto*) gdb_target=nto ;; sh*) gdb_target=embed ;; sparc-*-aout*) gdb_target=sparc-em ;; @@ -280,5 +283,6 @@ esac case "${target}" in *-*-linux*) gdb_osabi=GDB_OSABI_LINUX ;; *-*-gnu*) gdb_osabi=GDB_OSABI_HURD ;; +*-*-nto*) gdb_osabi=GDB_OSABI_QNXNTO ;; *-*-solaris*) gdb_osabi=GDB_OSABI_SOLARIS ;; esac diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index d40914f..63af14a 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -1,7 +1,7 @@ /* Helper routines for C++ support in GDB. Copyright 2003 Free Software Foundation, Inc. - Contributed by David Carlton. + Contributed by David Carlton and by Kealia, Inc. This file is part of GDB. @@ -56,6 +56,21 @@ static struct using_direct *cp_add_using (const char *name, static struct using_direct *cp_copy_usings (struct using_direct *using, struct obstack *obstack); +static struct symbol *lookup_namespace_scope (const char *name, + const char *linkage_name, + const struct block *block, + const domain_enum domain, + struct symtab **symtab, + const char *scope, + int scope_len); + +static struct symbol *lookup_symbol_file (const char *name, + const char *linkage_name, + const struct block *block, + const domain_enum domain, + struct symtab **symtab, + int anonymous_namespace); + /* This block exists only to store symbols associated to namespaces. Normally, try to avoid accessing it directly: instead, use get_namespace_block if you can. Similarly with @@ -298,6 +313,214 @@ cp_copy_usings (struct using_direct *using, } } +/* The C++-specific version of name lookup for static and global + names. This makes sure that names get looked for in all namespaces + that are in scope. NAME is the natural name of the symbol that + we're looking for, LINKAGE_NAME (which is optional) is its linkage + name, BLOCK is the block that we're searching within, DOMAIN says + what kind of symbols we're looking for, and if SYMTAB is non-NULL, + we should store the symtab where we found the symbol in it. */ + +struct symbol * +cp_lookup_symbol_nonlocal (const char *name, + const char *linkage_name, + const struct block *block, + const domain_enum domain, + struct symtab **symtab) +{ + return lookup_namespace_scope (name, linkage_name, block, domain, + symtab, block_scope (block), 0); +} + +/* Lookup NAME at namespace scope (or, in C terms, in static and + global variables). SCOPE is the namespace that the current + function is defined within; only consider namespaces whose length + is at least SCOPE_LEN. Other arguments are as in + cp_lookup_symbol_nonlocal. + + For example, if we're within a function A::B::f and looking for a + symbol f, this will get called with NAME = "f", SCOPE = "A::B", and + SCOPE_LEN = 0. It then calls itself with NAME and SCOPE the same, + but with SCOPE_LEN = 1. And then it calls itself with NAME and + SCOPE the same, but with SCOPE_LEN = 4. This third call looks for + "A::B::x"; if it doesn't find it, then the second call looks for + "A::x", and if that call fails, then the first call looks for + "x". */ + +static struct symbol * +lookup_namespace_scope (const char *name, + const char *linkage_name, + const struct block *block, + const domain_enum domain, + struct symtab **symtab, + const char *scope, + int scope_len) +{ + char *namespace; + + if (scope[scope_len] != '\0') + { + /* Recursively search for names in child namespaces first. */ + + struct symbol *sym; + int new_scope_len = scope_len; + + /* If the current scope is followed by "::", skip past that. */ + if (new_scope_len != 0) + { + gdb_assert (scope[new_scope_len] == ':'); + new_scope_len += 2; + } + new_scope_len += cp_find_first_component (scope + new_scope_len); + sym = lookup_namespace_scope (name, linkage_name, block, + domain, symtab, + scope, new_scope_len); + if (sym != NULL) + return sym; + } + + /* Okay, we didn't find a match in our children, so look for the + name in the current namespace. */ + + namespace = alloca (scope_len + 1); + strncpy (namespace, scope, scope_len); + namespace[scope_len] = '\0'; + return cp_lookup_symbol_namespace (namespace, name, linkage_name, + block, domain, symtab); +} + +/* Look up NAME in the C++ namespace NAMESPACE, applying the using + directives that are active in BLOCK. Other arguments are as in + cp_lookup_symbol_nonlocal. */ + +struct symbol * +cp_lookup_symbol_namespace (const char *namespace, + const char *name, + const char *linkage_name, + const struct block *block, + const domain_enum domain, + struct symtab **symtab) +{ + const struct using_direct *current; + struct symbol *sym; + + /* First, go through the using directives. If any of them add new + names to the namespace we're searching in, see if we can find a + match by applying them. */ + + for (current = block_using (block); + current != NULL; + current = current->next) + { + if (strcmp (namespace, current->outer) == 0) + { + sym = cp_lookup_symbol_namespace (current->inner, + name, + linkage_name, + block, + domain, + symtab); + if (sym != NULL) + return sym; + } + } + + /* We didn't find anything by applying any of the using directives + that are still applicable; so let's see if we've got a match + using the current namespace. */ + + if (namespace[0] == '\0') + { + return lookup_symbol_file (name, linkage_name, block, + domain, symtab, 0); + } + else + { + char *concatenated_name + = alloca (strlen (namespace) + 2 + strlen (name) + 1); + strcpy (concatenated_name, namespace); + strcat (concatenated_name, "::"); + strcat (concatenated_name, name); + sym = lookup_symbol_file (concatenated_name, linkage_name, + block, domain, symtab, + cp_is_anonymous (namespace)); + return sym; + } +} + +/* Look up NAME in BLOCK's static block and in global blocks. If + ANONYMOUS_NAMESPACE is nonzero, the symbol in question is located + within an anonymous namespace. Other arguments are as in + cp_lookup_symbol_nonlocal. */ + +static struct symbol * +lookup_symbol_file (const char *name, + const char *linkage_name, + const struct block *block, + const domain_enum domain, + struct symtab **symtab, + int anonymous_namespace) +{ + struct symbol *sym = NULL; + + sym = lookup_symbol_static (name, linkage_name, block, domain, symtab); + if (sym != NULL) + return sym; + + if (anonymous_namespace) + { + /* Symbols defined in anonymous namespaces have external linkage + but should be treated as local to a single file nonetheless. + So we only search the current file's global block. */ + + const struct block *global_block = block_global_block (block); + + if (global_block != NULL) + sym = lookup_symbol_aux_block (name, linkage_name, global_block, + domain, symtab); + + if (sym == NULL || global_block == NULL) + sym = cp_lookup_namespace_symbol (name); + } + else + { + sym = lookup_symbol_global (name, linkage_name, domain, symtab); + } + + if (sym != NULL) + return sym; + + /* Now call "cp_lookup_possible_namespace_symbol". Symbols in here + claim to be associated to namespaces, whereas the names in + question might actually correspond to either namespaces or to + classes. But if they correspond to classes, then we should have + found a match to them above. So if we find them now, they should + be genuine. */ + + /* FIXME: carlton/2002-12-18: This is a hack and should eventually + be deleted: see cp-support.c. */ + + /* FIXME: carlton/2003-01-06: Searching this seems a bit fishy if + anonymous_namespace is nonzero, since we might return a namespace + that's really a class that doesn't happen to be mentioned in the + current file. Sigh. Still, I don't think anything catastrophic + should happen in that case. Probably the right thing to do is to + move anonymous namespace symbols to files' static blocks. */ + + if (domain == VAR_DOMAIN) + { + sym = cp_lookup_possible_namespace_symbol (name); + if (sym != NULL) + { + if (symtab != NULL) + *symtab = NULL; + return sym; + } + } + + return NULL; +} + /* Allocate everything necessary for namespace_block and possible_namespace_block. */ @@ -421,7 +644,7 @@ cp_check_namespace_symbol (const char *name, int len) DEPRECATED_SYMBOL_NAME (sym) = name_copy; SYMBOL_CLASS (sym) = LOC_TYPEDEF; SYMBOL_TYPE (sym) = type; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; dict_add_symbol (BLOCK_DICT (get_namespace_block ()), sym); } @@ -439,7 +662,7 @@ struct symbol * cp_lookup_namespace_symbol (const char *name) { return lookup_block_symbol (get_namespace_block (), name, NULL, - VAR_NAMESPACE); + VAR_DOMAIN); } /* The next few functions deal with "possible namespace symbols". @@ -466,7 +689,7 @@ check_one_possible_namespace_symbol (const char *name, int len) char *name_copy = obsavestring (name, len, &objfile->symbol_obstack); const struct block *block = get_possible_namespace_block (); struct symbol *sym = lookup_block_symbol (block, name_copy, - NULL, VAR_NAMESPACE); + NULL, VAR_DOMAIN); if (sym == NULL) { @@ -480,7 +703,7 @@ check_one_possible_namespace_symbol (const char *name, int len) DEPRECATED_SYMBOL_NAME (sym) = name_copy; SYMBOL_CLASS (sym) = LOC_TYPEDEF; SYMBOL_TYPE (sym) = type; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; dict_add_symbol (BLOCK_DICT (block), sym); return 0; @@ -537,7 +760,7 @@ struct symbol * cp_lookup_possible_namespace_symbol (const char *name) { return lookup_block_symbol (get_possible_namespace_block (), - name, NULL, VAR_NAMESPACE); + name, NULL, VAR_DOMAIN); } static void diff --git a/gdb/cp-support.h b/gdb/cp-support.h index cb53e8a..3401828 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -24,11 +24,14 @@ #ifndef CP_SUPPORT_H #define CP_SUPPORT_H +/* We need this for 'domain_enum', alas... */ + +#include "symtab.h" + /* Opaque declarations. */ struct obstack; struct block; -struct symbol; /* This struct is designed to store data from using directives. It says that names from namespace INNER should be visible within @@ -88,6 +91,19 @@ extern void cp_set_block_scope (const struct symbol *symbol, extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol); +extern struct symbol *cp_lookup_symbol_nonlocal (const char *name, + const char *linkage_name, + const struct block *block, + const domain_enum domain, + struct symtab **symtab); + +extern struct symbol *cp_lookup_symbol_namespace (const char *namespace, + const char *name, + const char *linkage_name, + const struct block *block, + const domain_enum domain, + struct symtab **symtab); + /* The list of "maint cplus" commands. */ extern struct cmd_list_element *maint_cplus_cmd_list; diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index 3cb1653..6749f8e 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -34,6 +34,7 @@ #include "c-lang.h" #include "target.h" #include "cp-abi.h" +#include "valprint.h" /* Indication of presence of HP-compiled object files */ extern int hp_som_som_object_present; /* defined in symtab.c */ @@ -266,8 +267,6 @@ cp_print_value_fields (struct type *type, struct type *real_type, char *valaddr, fprintf_filtered (stream, "<No data fields>"); else { - extern int inspect_it; - if (dont_print_statmem == 0) { /* If we're at top level, carve out a completely fresh diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index a963d21..2fbfde5 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -971,7 +971,7 @@ cris_abi_original_store_return_value (struct type *type, char *valbuf) { int len = TYPE_LENGTH (type); - if (len <= REGISTER_SIZE) + if (len <= DEPRECATED_REGISTER_SIZE) deprecated_write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf, len); else internal_error (__FILE__, __LINE__, "cris_abi_original_store_return_value: type length too large."); @@ -984,7 +984,7 @@ cris_abi_v2_store_return_value (struct type *type, char *valbuf) { int len = TYPE_LENGTH (type); - if (len <= 2 * REGISTER_SIZE) + if (len <= 2 * DEPRECATED_REGISTER_SIZE) { /* Note that this works since R10 and R11 are consecutive registers. */ deprecated_write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf, @@ -1042,7 +1042,7 @@ cris_register_name (int regno) int cris_register_bytes_ok (long bytes) { - return (bytes == REGISTER_BYTES); + return (bytes == DEPRECATED_REGISTER_BYTES); } /* Extract from an array regbuf containing the raw register state a function @@ -1057,7 +1057,7 @@ cris_abi_original_extract_return_value (struct type *type, char *regbuf, { int len = TYPE_LENGTH (type); - if (len <= REGISTER_SIZE) + if (len <= DEPRECATED_REGISTER_SIZE) memcpy (valbuf, regbuf + REGISTER_BYTE (RET_REGNUM), len); else internal_error (__FILE__, __LINE__, "cris_abi_original_extract_return_value: type length too large"); @@ -1071,7 +1071,7 @@ cris_abi_v2_extract_return_value (struct type *type, char *regbuf, { int len = TYPE_LENGTH (type); - if (len <= 2 * REGISTER_SIZE) + if (len <= 2 * DEPRECATED_REGISTER_SIZE) memcpy (valbuf, regbuf + REGISTER_BYTE (RET_REGNUM), len); else internal_error (__FILE__, __LINE__, "cris_abi_v2_extract_return_value: type length too large"); @@ -1311,13 +1311,13 @@ cris_abi_original_push_arguments (int nargs, struct value **args, /* Make sure there's space on the stack. Allocate space for data and a parameter to refer to that data. */ for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++) - stack_alloc += (TYPE_LENGTH (VALUE_TYPE (args[argnum])) + REGISTER_SIZE); + stack_alloc += (TYPE_LENGTH (VALUE_TYPE (args[argnum])) + DEPRECATED_REGISTER_SIZE); sp -= stack_alloc; /* We may over-allocate a little here, but that won't hurt anything. */ /* Initialize stack frame pointers. */ fp_params = sp; - fp_data = sp + (nargs * REGISTER_SIZE); + fp_data = sp + (nargs * DEPRECATED_REGISTER_SIZE); /* Now load as many as possible of the first arguments into registers, and push the rest onto the stack. */ @@ -1330,14 +1330,14 @@ cris_abi_original_push_arguments (int nargs, struct value **args, len = TYPE_LENGTH (type); val = (char *) VALUE_CONTENTS (args[argnum]); - if (len <= REGISTER_SIZE && argreg <= ARG4_REGNUM) + if (len <= DEPRECATED_REGISTER_SIZE && argreg <= ARG4_REGNUM) { /* Data fits in a register; put it in the first available register. */ write_register (argreg, *(unsigned long *) val); argreg++; } - else if (len > REGISTER_SIZE && argreg <= ARG4_REGNUM) + else if (len > DEPRECATED_REGISTER_SIZE && argreg <= ARG4_REGNUM) { /* Data does not fit in register; pass it on the stack and put its address in the first available register. */ @@ -1346,21 +1346,21 @@ cris_abi_original_push_arguments (int nargs, struct value **args, fp_data += len; argreg++; } - else if (len > REGISTER_SIZE) + else if (len > DEPRECATED_REGISTER_SIZE) { /* Data does not fit in register; put both data and parameter on the stack. */ write_memory (fp_data, val, len); - write_memory (fp_params, (char *) (&fp_data), REGISTER_SIZE); + write_memory (fp_params, (char *) (&fp_data), DEPRECATED_REGISTER_SIZE); fp_data += len; - fp_params += REGISTER_SIZE; + fp_params += DEPRECATED_REGISTER_SIZE; } else { /* Data fits in a register, but we are out of registers; put the parameter on the stack. */ - write_memory (fp_params, val, REGISTER_SIZE); - fp_params += REGISTER_SIZE; + write_memory (fp_params, val, DEPRECATED_REGISTER_SIZE); + fp_params += DEPRECATED_REGISTER_SIZE; } } @@ -1401,20 +1401,21 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int reg_demand; len = TYPE_LENGTH (VALUE_TYPE (args[argnum])); - reg_demand = (len / REGISTER_SIZE) + (len % REGISTER_SIZE != 0 ? 1 : 0); + reg_demand = (len / DEPRECATED_REGISTER_SIZE) + (len % DEPRECATED_REGISTER_SIZE != 0 ? 1 : 0); - /* reg_demand * REGISTER_SIZE is the amount of memory we might need to - allocate for this argument. 2 * REGISTER_SIZE is the amount of stack - space we might need to pass the argument itself (either by value or by + /* reg_demand * DEPRECATED_REGISTER_SIZE is the amount of memory + we might need to allocate for this argument. 2 * + DEPRECATED_REGISTER_SIZE is the amount of stack space we + might need to pass the argument itself (either by value or by reference). */ - stack_alloc += (reg_demand * REGISTER_SIZE + 2 * REGISTER_SIZE); + stack_alloc += (reg_demand * DEPRECATED_REGISTER_SIZE + 2 * DEPRECATED_REGISTER_SIZE); } sp -= stack_alloc; /* We may over-allocate a little here, but that won't hurt anything. */ /* Initialize frame pointers. */ fp_arg = sp; - fp_mem = sp + (nargs * (2 * REGISTER_SIZE)); + fp_mem = sp + (nargs * (2 * DEPRECATED_REGISTER_SIZE)); /* Now load as many as possible of the first arguments into registers, and push the rest onto the stack. */ @@ -1432,9 +1433,9 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp, val = (char *) VALUE_CONTENTS (args[argnum]); /* How may registers worth of storage do we need for this argument? */ - reg_demand = (len / REGISTER_SIZE) + (len % REGISTER_SIZE != 0 ? 1 : 0); + reg_demand = (len / DEPRECATED_REGISTER_SIZE) + (len % DEPRECATED_REGISTER_SIZE != 0 ? 1 : 0); - if (len <= (2 * REGISTER_SIZE) + if (len <= (2 * DEPRECATED_REGISTER_SIZE) && (argreg + reg_demand - 1 <= ARG4_REGNUM)) { /* Data passed by value. Fits in available register(s). */ @@ -1442,10 +1443,10 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp, { write_register (argreg, *(unsigned long *) val); argreg++; - val += REGISTER_SIZE; + val += DEPRECATED_REGISTER_SIZE; } } - else if (len <= (2 * REGISTER_SIZE) && argreg <= ARG4_REGNUM) + else if (len <= (2 * DEPRECATED_REGISTER_SIZE) && argreg <= ARG4_REGNUM) { /* Data passed by value. Does not fit in available register(s). Use the register(s) first, then the stack. */ @@ -1455,28 +1456,29 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp, { write_register (argreg, *(unsigned long *) val); argreg++; - val += REGISTER_SIZE; + val += DEPRECATED_REGISTER_SIZE; } else { - /* I guess this memory write could write the remaining data - all at once instead of in REGISTER_SIZE chunks. */ - write_memory (fp_arg, val, REGISTER_SIZE); - fp_arg += REGISTER_SIZE; - val += REGISTER_SIZE; + /* I guess this memory write could write the + remaining data all at once instead of in + DEPRECATED_REGISTER_SIZE chunks. */ + write_memory (fp_arg, val, DEPRECATED_REGISTER_SIZE); + fp_arg += DEPRECATED_REGISTER_SIZE; + val += DEPRECATED_REGISTER_SIZE; } } } - else if (len > (2 * REGISTER_SIZE)) + else if (len > (2 * DEPRECATED_REGISTER_SIZE)) { /* Data passed by reference. Put it on the stack. */ write_memory (fp_mem, val, len); - write_memory (fp_arg, (char *) (&fp_mem), REGISTER_SIZE); + write_memory (fp_arg, (char *) (&fp_mem), DEPRECATED_REGISTER_SIZE); /* fp_mem need not be word-aligned since it's just a chunk of memory being pointed at. That is, += len would do. */ - fp_mem += reg_demand * REGISTER_SIZE; - fp_arg += REGISTER_SIZE; + fp_mem += reg_demand * DEPRECATED_REGISTER_SIZE; + fp_arg += DEPRECATED_REGISTER_SIZE; } else { @@ -1486,7 +1488,7 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* fp_arg must be word-aligned (i.e., don't += len) to match the function prologue. */ - fp_arg += reg_demand * REGISTER_SIZE; + fp_arg += reg_demand * DEPRECATED_REGISTER_SIZE; } } @@ -4189,7 +4191,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Length of ordinary registers used in push_word and a few other places. REGISTER_RAW_SIZE is the real way to know how big a register is. */ - set_gdbarch_register_size (gdbarch, 4); + set_gdbarch_deprecated_register_size (gdbarch, 4); /* NEW */ set_gdbarch_register_bytes_ok (gdbarch, cris_register_bytes_ok); @@ -4233,7 +4235,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) internal_error (__FILE__, __LINE__, "cris_gdbarch_init: unknown CRIS version"); } - set_gdbarch_register_bytes (gdbarch, register_bytes); + set_gdbarch_deprecated_register_bytes (gdbarch, register_bytes); /* Returns the register offset for the first byte of register regno's space in the saved register state. */ @@ -4260,8 +4262,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Defined to 1 to indicate that the target supports inferior function calls. */ - set_gdbarch_call_dummy_words (gdbarch, 0); - set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); + set_gdbarch_deprecated_call_dummy_words (gdbarch, 0); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0); set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register); diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 69d8f3b..c184b44 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -43,6 +43,7 @@ #include "floatformat.h" #include "gdb/sim-d10v.h" #include "sim-regno.h" +#include "disasm.h" #include "gdb_assert.h" @@ -50,8 +51,8 @@ struct gdbarch_tdep { int a0_regnum; int nr_dmap_regs; - unsigned long (*dmap_register) (int nr); - unsigned long (*imap_register) (int nr); + unsigned long (*dmap_register) (void *regcache, int nr); + unsigned long (*imap_register) (void *regcache, int nr); }; /* These are the addresses the D10V-EVA board maps data and @@ -73,7 +74,7 @@ enum LR_REGNUM = 13, D10V_SP_REGNUM = 15, PSW_REGNUM = 16, - _PC_REGNUM = 18, + D10V_PC_REGNUM = 18, NR_IMAP_REGS = 2, NR_A_REGS = 2, TS2_NUM_REGS = 37, @@ -107,9 +108,11 @@ static void d10v_eva_prepare_to_trace (void); static void d10v_eva_get_trace_data (void); static CORE_ADDR -d10v_stack_align (CORE_ADDR len) +d10v_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) { - return (len + 1) & ~1; + /* Align to the size of an instruction (so that they can safely be + pushed onto the stack. */ + return sp & ~3; } /* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of @@ -233,7 +236,7 @@ d10v_ts3_register_name (int reg_nr) one of the segments. */ static unsigned long -d10v_ts2_dmap_register (int reg_nr) +d10v_ts2_dmap_register (void *regcache, int reg_nr) { switch (reg_nr) { @@ -241,40 +244,38 @@ d10v_ts2_dmap_register (int reg_nr) case 1: return 0x2000; case 2: - return read_register (TS2_DMAP_REGNUM); + { + ULONGEST reg; + regcache_cooked_read_unsigned (regcache, TS2_DMAP_REGNUM, ®); + return reg; + } default: return 0; } } static unsigned long -d10v_ts3_dmap_register (int reg_nr) -{ - return read_register (TS3_DMAP0_REGNUM + reg_nr); -} - -static unsigned long -d10v_dmap_register (int reg_nr) +d10v_ts3_dmap_register (void *regcache, int reg_nr) { - return gdbarch_tdep (current_gdbarch)->dmap_register (reg_nr); + ULONGEST reg; + regcache_cooked_read_unsigned (regcache, TS3_DMAP0_REGNUM + reg_nr, ®); + return reg; } static unsigned long -d10v_ts2_imap_register (int reg_nr) +d10v_ts2_imap_register (void *regcache, int reg_nr) { - return read_register (TS2_IMAP0_REGNUM + reg_nr); + ULONGEST reg; + regcache_cooked_read_unsigned (regcache, TS2_IMAP0_REGNUM + reg_nr, ®); + return reg; } static unsigned long -d10v_ts3_imap_register (int reg_nr) +d10v_ts3_imap_register (void *regcache, int reg_nr) { - return read_register (TS3_IMAP0_REGNUM + reg_nr); -} - -static unsigned long -d10v_imap_register (int reg_nr) -{ - return gdbarch_tdep (current_gdbarch)->imap_register (reg_nr); + ULONGEST reg; + regcache_cooked_read_unsigned (regcache, TS3_IMAP0_REGNUM + reg_nr, ®); + return reg; } /* MAP GDB's internal register numbering (determined by the layout fo @@ -320,7 +321,7 @@ d10v_ts3_register_sim_regno (int nr) static struct type * d10v_register_type (struct gdbarch *gdbarch, int reg_nr) { - if (reg_nr == PC_REGNUM) + if (reg_nr == D10V_PC_REGNUM) return builtin_type_void_func_ptr; if (reg_nr == D10V_SP_REGNUM || reg_nr == D10V_FP_REGNUM) return builtin_type_void_data_ptr; @@ -801,6 +802,7 @@ static void d10v_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all) { + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (regnum >= 0) { default_print_registers_info (gdbarch, file, frame, regnum, all); @@ -809,7 +811,7 @@ d10v_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, { ULONGEST pc, psw, rpt_s, rpt_e, rpt_c; - frame_read_unsigned_register (frame, PC_REGNUM, &pc); + frame_read_unsigned_register (frame, D10V_PC_REGNUM, &pc); frame_read_unsigned_register (frame, PSW_REGNUM, &psw); frame_read_unsigned_register (frame, frame_map_name_to_regnum ("rpt_s", -1), &rpt_s); frame_read_unsigned_register (frame, frame_map_name_to_regnum ("rpt_e", -1), &rpt_e); @@ -844,23 +846,26 @@ d10v_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, { if (a > 0) fprintf_filtered (file, " "); - fprintf_filtered (file, "IMAP%d %04lx", a, d10v_imap_register (a)); + fprintf_filtered (file, "IMAP%d %04lx", a, + tdep->imap_register (current_regcache, a)); } if (nr_dmap_regs (gdbarch) == 1) /* Registers DMAP0 and DMAP1 are constant. Just return dmap2. */ - fprintf_filtered (file, " DMAP %04lx\n", d10v_dmap_register (2)); + fprintf_filtered (file, " DMAP %04lx\n", + tdep->dmap_register (current_regcache, 2)); else { for (a = 0; a < nr_dmap_regs (gdbarch); a++) { - fprintf_filtered (file, " DMAP%d %04lx", a, d10v_dmap_register (a)); + fprintf_filtered (file, " DMAP%d %04lx", a, + tdep->dmap_register (current_regcache, a)); } fprintf_filtered (file, "\n"); } } { - char *num = alloca (max_register_size (gdbarch)); + char num[MAX_REGISTER_SIZE]; int a; fprintf_filtered (file, "A0-A%d", NR_A_REGS - 1); for (a = a0_regnum (gdbarch); a < a0_regnum (gdbarch) + NR_A_REGS; a++) @@ -893,7 +898,7 @@ d10v_read_pc (ptid_t ptid) save_ptid = inferior_ptid; inferior_ptid = ptid; - pc = (int) read_register (PC_REGNUM); + pc = (int) read_register (D10V_PC_REGNUM); inferior_ptid = save_ptid; retval = d10v_make_iaddr (pc); return retval; @@ -906,7 +911,7 @@ d10v_write_pc (CORE_ADDR val, ptid_t ptid) save_ptid = inferior_ptid; inferior_ptid = ptid; - write_register (PC_REGNUM, d10v_convert_iaddr_to_raw (val)); + write_register (D10V_PC_REGNUM, d10v_convert_iaddr_to_raw (val)); inferior_ptid = save_ptid; } @@ -953,6 +958,25 @@ pop_stack_item (struct stack_item *si) static CORE_ADDR +d10v_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 - 4) & ~3; + /* Store the address of that breakpoint taking care to first convert + it into a code (IADDR) address from a stack (DADDR) address. + This of course assumes that the two virtual addresses map onto + the same real address. */ + (*bp_addr) = d10v_make_iaddr (d10v_convert_iaddr_to_raw (sp)); + /* d10v always starts the call at the callee's entry point. */ + (*real_pc) = funaddr; + return sp; +} + +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) @@ -1078,15 +1102,16 @@ d10v_extract_return_value (struct type *type, struct regcache *regcache, VM system works, we just call that to do the translation. */ static void -remote_d10v_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes, +remote_d10v_translate_xfer_address (struct gdbarch *gdbarch, + struct regcache *regcache, + CORE_ADDR memaddr, int nr_bytes, CORE_ADDR *targ_addr, int *targ_len) { + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); long out_addr; long out_len; - out_len = sim_d10v_translate_addr (memaddr, nr_bytes, - &out_addr, - d10v_dmap_register, - d10v_imap_register); + out_len = sim_d10v_translate_addr (memaddr, nr_bytes, &out_addr, regcache, + tdep->dmap_register, tdep->imap_register); *targ_addr = out_addr; *targ_len = out_len; } @@ -1205,7 +1230,7 @@ d10v_eva_prepare_to_trace (void) if (!tracing) return; - last_pc = read_register (PC_REGNUM); + last_pc = read_register (D10V_PC_REGNUM); } /* Collect trace data from the target board and format it into a form @@ -1359,8 +1384,7 @@ display_trace (int low, int high) printf_filtered (":"); printf_filtered ("\t"); wrap_here (" "); - next_address += TARGET_PRINT_INSN (next_address, - &deprecated_tm_print_insn_info); + next_address += gdb_print_insn (next_address, gdb_stdout); printf_filtered ("\n"); gdb_flush (gdb_stdout); } @@ -1371,7 +1395,7 @@ static CORE_ADDR d10v_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) { ULONGEST pc; - frame_unwind_unsigned_register (next_frame, PC_REGNUM, &pc); + frame_unwind_unsigned_register (next_frame, D10V_PC_REGNUM, &pc); return d10v_make_iaddr (pc); } @@ -1475,7 +1499,7 @@ 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 == PC_REGNUM) + 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 @@ -1580,11 +1604,7 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, d10v_num_regs); set_gdbarch_sp_regnum (gdbarch, D10V_SP_REGNUM); - set_gdbarch_pc_regnum (gdbarch, 18); set_gdbarch_register_name (gdbarch, d10v_register_name); - set_gdbarch_register_size (gdbarch, 2); - set_gdbarch_register_bytes (gdbarch, (d10v_num_regs - 2) * 2 + 16); - set_gdbarch_register_virtual_size (gdbarch, generic_register_size); set_gdbarch_register_type (gdbarch, d10v_register_type); set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT); @@ -1619,6 +1639,7 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } set_gdbarch_extract_return_value (gdbarch, d10v_extract_return_value); + set_gdbarch_push_dummy_code (gdbarch, d10v_push_dummy_code); set_gdbarch_push_dummy_call (gdbarch, d10v_push_dummy_call); set_gdbarch_store_return_value (gdbarch, d10v_store_return_value); set_gdbarch_extract_struct_value_address (gdbarch, d10v_extract_struct_value_address); @@ -1636,7 +1657,7 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue); set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); - set_gdbarch_stack_align (gdbarch, d10v_stack_align); + set_gdbarch_frame_align (gdbarch, d10v_frame_align); set_gdbarch_register_sim_regno (gdbarch, d10v_register_sim_regno); diff --git a/gdb/dbxread.c b/gdb/dbxread.c index a80b0e5..de4ea74 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -1762,7 +1762,7 @@ read_dbx_symtab (struct objfile *objfile) namestring = STATIC_TRANSFORM_NAME (namestring); #endif add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_STATIC, + VAR_DOMAIN, LOC_STATIC, &objfile->static_psymbols, 0, nlist.n_value, psymtab_language, objfile); @@ -1772,7 +1772,7 @@ read_dbx_symtab (struct objfile *objfile) /* The addresses in these entries are reported to be wrong. See the code that reads 'G's for symtabs. */ add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_STATIC, + VAR_DOMAIN, LOC_STATIC, &objfile->global_psymbols, 0, nlist.n_value, psymtab_language, objfile); @@ -1790,7 +1790,7 @@ read_dbx_symtab (struct objfile *objfile) && namestring[0] != ' ')) { add_psymbol_to_list (namestring, p - namestring, - STRUCT_NAMESPACE, LOC_TYPEDEF, + STRUCT_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, nlist.n_value, 0, psymtab_language, objfile); @@ -1798,7 +1798,7 @@ read_dbx_symtab (struct objfile *objfile) { /* Also a typedef with the same name. */ add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_TYPEDEF, + VAR_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, nlist.n_value, 0, psymtab_language, objfile); @@ -1814,7 +1814,7 @@ read_dbx_symtab (struct objfile *objfile) // OBSOLETE { // OBSOLETE /* Also a typedef with the same name. */ // OBSOLETE add_psymbol_to_list (namestring, p - namestring, -// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF, +// OBSOLETE VAR_DOMAIN, LOC_TYPEDEF, // OBSOLETE &objfile->static_psymbols, // OBSOLETE nlist.n_value, 0, // OBSOLETE psymtab_language, objfile); @@ -1826,7 +1826,7 @@ read_dbx_symtab (struct objfile *objfile) if (p != namestring) /* a name is there, not just :T... */ { add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_TYPEDEF, + VAR_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, nlist.n_value, 0, psymtab_language, objfile); @@ -1888,7 +1888,7 @@ read_dbx_symtab (struct objfile *objfile) /* Note that the value doesn't matter for enum constants in psymtabs, just in symtabs. */ add_psymbol_to_list (p, q - p, - VAR_NAMESPACE, LOC_CONST, + VAR_DOMAIN, LOC_CONST, &objfile->static_psymbols, 0, 0, psymtab_language, objfile); /* Point past the name. */ @@ -1905,7 +1905,7 @@ read_dbx_symtab (struct objfile *objfile) case 'c': /* Constant, e.g. from "const" in Pascal. */ add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_CONST, + VAR_DOMAIN, LOC_CONST, &objfile->static_psymbols, nlist.n_value, 0, psymtab_language, objfile); continue; @@ -1966,7 +1966,7 @@ read_dbx_symtab (struct objfile *objfile) textlow_not_set = 0; } add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->static_psymbols, 0, nlist.n_value, psymtab_language, objfile); @@ -2031,7 +2031,7 @@ read_dbx_symtab (struct objfile *objfile) textlow_not_set = 0; } add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->global_psymbols, 0, nlist.n_value, psymtab_language, objfile); @@ -211,7 +211,8 @@ enum language language_m2, /* Modula-2 */ language_asm, /* Assembly language */ language_scm, /* Scheme / Guile */ - language_pascal /* Pascal */ + language_pascal, /* Pascal */ + language_minimal /* All other languages, minimal support only */ }; enum precision_type @@ -1085,28 +1086,10 @@ extern void *alloca (); #include "arch-utils.h" #endif -/* FIXME: cagney/2003-03-01: Hack to prop up old targets while they - migrate to the overhauled register cache. - - The problem is that some architectures specify different sized raw - and cooked (nee virtual) register sizes. They shouldn't. Instead, - all architectures should just implement a gdbarch_register_type(). - That can be used to compute all needed register attributes. While - waiting for the conversion, provide compatibility macros that keep - old code working. */ - -#ifdef MAX_REGISTER_RAW_SIZE -#error MAX_REGISTER_RAW_SIZE defined -#endif -extern int legacy_max_register_raw_size (void); -#define MAX_REGISTER_RAW_SIZE legacy_max_register_raw_size () - -#ifdef MAX_REGISTER_VIRTUAL_SIZE -#error MAX_REGISTER_VIRTUAL_SIZE defined -#endif -extern int legacy_max_register_virtual_size (void); -#define MAX_REGISTER_VIRTUAL_SIZE legacy_max_register_virtual_size () +/* Maximum size of a register. Something small, but large enough for + all known ISAs. If it turns out to be too small, make it bigger. */ +enum { MAX_REGISTER_SIZE = 16 }; /* Static target-system-dependent parameters for GDB. */ @@ -1151,8 +1134,6 @@ extern void store_signed_integer (void *, int, LONGEST); extern void store_unsigned_integer (void *, int, ULONGEST); -extern void store_address (void *, int, LONGEST); - extern void store_typed_address (void *buf, struct type *type, CORE_ADDR addr); diff --git a/gdb/dictionary.c b/gdb/dictionary.c index c3279bd..6836649 100644 --- a/gdb/dictionary.c +++ b/gdb/dictionary.c @@ -643,6 +643,7 @@ 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; } diff --git a/gdb/disasm.c b/gdb/disasm.c index e460255..553ca1c 100644 --- a/gdb/disasm.c +++ b/gdb/disasm.c @@ -65,29 +65,6 @@ dis_asm_print_address (bfd_vma addr, struct disassemble_info *info) print_address (addr, info->stream); } -/* This variable determines where memory used for disassembly is read from. */ -int gdb_disassemble_from_exec = -1; - -/* This is the memory_read_func for gdb_disassemble when we are - disassembling from the exec file. */ -static int -gdb_dis_asm_read_memory (bfd_vma memaddr, bfd_byte * myaddr, - unsigned int len, disassemble_info * info) -{ - extern struct target_ops exec_ops; - int res; - - errno = 0; - res = xfer_memory (memaddr, myaddr, len, 0, 0, &exec_ops); - - if (res == len) - return 0; - else if (errno == 0) - return EIO; - else - return errno; -} - static int compare_lines (const void *mle1p, const void *mle2p) { @@ -330,6 +307,32 @@ do_assembly_only (struct ui_out *uiout, disassemble_info * di, do_cleanups (ui_out_chain); } +/* Initialize the disassemble info struct ready for the specified + stream. */ + +static disassemble_info +gdb_disassemble_info (struct gdbarch *gdbarch, struct ui_file *file) +{ + disassemble_info di; + INIT_DISASSEMBLE_INFO_NO_ARCH (di, file, + (fprintf_ftype) fprintf_filtered); + di.flavour = bfd_target_unknown_flavour; + di.memory_error_func = dis_asm_memory_error; + di.print_address_func = dis_asm_print_address; + /* NOTE: cagney/2003-04-28: The original code, from the old Insight + disassembler had a local optomization here. By default it would + access the executable file, instead of the target memory (there + was a growing list of exceptions though). Unfortunatly, the + heuristic was flawed. Commands like "disassemble &variable" + didn't work as they relied on the access going to the target. + Further, it has been supperseeded by trust-read-only-sections + (although that should be superseeded by target_trust..._p()). */ + di.read_memory_func = dis_asm_read_memory; + di.mach = gdbarch_bfd_arch_info (gdbarch)->mach; + di.endian = gdbarch_byte_order (gdbarch); + return di; +} + void gdb_disassembly (struct ui_out *uiout, char *file_string, @@ -337,62 +340,14 @@ gdb_disassembly (struct ui_out *uiout, int mixed_source_and_assembly, int how_many, CORE_ADDR low, CORE_ADDR high) { - static disassemble_info di; - static int di_initialized; + struct ui_stream *stb = ui_out_stream_new (uiout); + struct cleanup *cleanups = make_cleanup_ui_out_stream_delete (stb); + disassemble_info di = gdb_disassemble_info (current_gdbarch, stb->stream); /* To collect the instruction outputted from opcodes. */ - static struct ui_stream *stb = NULL; struct symtab *symtab = NULL; struct linetable_entry *le = NULL; int nlines = -1; - if (!di_initialized) - { - /* We don't add a cleanup for this, because the allocation of - the stream is done once only for each gdb run, and we need to - keep it around until the end. Hopefully there won't be any - errors in the init code below, that make this function bail - out. */ - stb = ui_out_stream_new (uiout); - INIT_DISASSEMBLE_INFO_NO_ARCH (di, stb->stream, - (fprintf_ftype) fprintf_unfiltered); - di.flavour = bfd_target_unknown_flavour; - di.memory_error_func = dis_asm_memory_error; - di.print_address_func = dis_asm_print_address; - di_initialized = 1; - } - - di.mach = gdbarch_bfd_arch_info (current_gdbarch)->mach; - di.endian = gdbarch_byte_order (current_gdbarch); - - /* If gdb_disassemble_from_exec == -1, then we use the following heuristic to - determine whether or not to do disassembly from target memory or from the - exec file: - - If we're debugging a local process, read target memory, instead of the - exec file. This makes disassembly of functions in shared libs work - correctly. Also, read target memory if we are debugging native threads. - - Else, we're debugging a remote process, and should disassemble from the - exec file for speed. However, this is no good if the target modifies its - code (for relocation, or whatever). */ - - if (gdb_disassemble_from_exec == -1) - { - if (strcmp (target_shortname, "child") == 0 - || strcmp (target_shortname, "procfs") == 0 - || strcmp (target_shortname, "vxprocess") == 0 - || strcmp (target_shortname, "core") == 0 - || strstr (target_shortname, "-thread") != NULL) - gdb_disassemble_from_exec = 0; /* It's a child process, read inferior mem */ - else - gdb_disassemble_from_exec = 1; /* It's remote, read the exec file */ - } - - if (gdb_disassemble_from_exec) - di.read_memory_func = gdb_dis_asm_read_memory; - else - di.read_memory_func = dis_asm_read_memory; - /* Assume symtab is valid for whole PC range */ symtab = find_pc_symtab (low); @@ -411,9 +366,20 @@ gdb_disassembly (struct ui_out *uiout, do_mixed_source_and_assembly (uiout, &di, nlines, le, low, high, symtab, how_many, stb); + do_cleanups (cleanups); gdb_flush (gdb_stdout); } +/* Print the instruction at address MEMADDR in debugged memory, + on STREAM. Returns length of the instruction, in bytes. */ + +int +gdb_print_insn (CORE_ADDR memaddr, struct ui_file *stream) +{ + disassemble_info di = gdb_disassemble_info (current_gdbarch, stream); + return TARGET_PRINT_INSN (memaddr, &di); +} + /* FIXME: cagney/2003-04-28: This global deprecated_tm_print_insn_info is going away. */ @@ -424,6 +390,7 @@ extern void _initialize_disasm (void); void _initialize_disasm (void) { + INIT_DISASSEMBLE_INFO_NO_ARCH (deprecated_tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered); deprecated_tm_print_insn_info.flavour = bfd_target_unknown_flavour; diff --git a/gdb/disasm.h b/gdb/disasm.h index 6a6df7e..b5dbb84 100644 --- a/gdb/disasm.h +++ b/gdb/disasm.h @@ -22,10 +22,17 @@ #define DISASM_H struct ui_out; +struct ui_file; extern void gdb_disassembly (struct ui_out *uiout, char *file_string, int line_num, int mixed_source_and_assembly, int how_many, CORE_ADDR low, CORE_ADDR high); + +/* Print the instruction at address MEMADDR in debugged memory, on + STREAM. Returns length of the instruction, in bytes. */ + +extern int gdb_print_insn (CORE_ADDR memaddr, struct ui_file *stream); + #endif diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 7433c58..2cd0984 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,70 @@ +2003-05-21 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Delete + references to "extract_address" and "store_address". + +2003-05-16 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Replace + REGISTER_BYTES with DEPRECATED_REGISTER_BYTES. Fix typo, + DEPRECATED_REGISTER_SIZE instead of REGISTER_BYTE. + +2003-05-14 Theodore A. Roth <troth@openavr.org> + + * gdbint.texinfo (Breakpoint Handling): Correct a double negative. + +2003-05-10 H.J. Lu <hongjiu.lu@intel.com> + + * Makefile.in (gdb-cfg.texi): Replace $$LN_S with $(LN_S). + (gdb.dvi): Likewise. + (gdb.pdf): Likewise. + (links2roff): Likewise. + +2003-05-08 Jim Blandy <jimb@redhat.com> + + * gdb.texinfo (Dump/Restore Files): Update documentation for + 'dump', 'append', and 'restore': note that format argument is + optional; simplify presentation of the command variants; and be + more precise about the formats. + +2003-05-07 Jim Blandy <jimb@redhat.com> + + * gdb.texinfo (Symbols): Update documentation: 'maint list + symtabs' and 'maint list psymtabs' have been renamed 'maint info + symtabs' and 'maint info psymtabs'. + +2003-05-05 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Make + CALL_DUMMY_WORDS, SIZEOF_CALL_DUMMY_WORDS, CALL_DUMMY_LENGTH, + FIX_CALL_DUMMY, CALL_DUMMY_BREAKPOINT_OFFSET and + CALL_DUMMY_BREAKPOINT_OFFSET deprecated. + +2003-05-04 Andrew Cagney <cagney@redhat.com> + + * gdb.texinfo (Maintenance Commands): Document "maint print + dummy-frames". + +2003-05-04 Andrew Cagney <cagney@redhat.com> + + * gdb.texinfo (GDB/MI Symbol Query): Use @{ and @}. + +2003-05-03 J. Brobecker <brobecker@gnat.com> + + Thierry Schneider <tpschneider1@yahoo.com> + * gdb.texinfo (section GDB/MI Symbol Query): Add documentation + for new MI command. + +2003-05-03 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Document + push_dummy_code. Add cross references. + +2003-05-02 Elena Zannoni <ezannoni@redhat.com> + + * gdb.texinfo (Character Sets): Update to reflect new behavior of + set/show charsets commands. + 2003-04-28 Andrew Cagney <cagney@redhat.com> * gdbint.texinfo (Target Architecture Definition): Replace diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index 5221314..fcdabc5 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -245,7 +245,7 @@ GDBvn.texi : ${gdbdir}/version.in # not one for their binary config---which may not be specifically # defined anyways). gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi - (test "$$LN_S" = "ln -s" && \ + (test "$(LN_S)" = "ln -s" && \ ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \ ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \ cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi @@ -268,7 +268,7 @@ GDB_TEX_TMPS = gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \ # GDB MANUAL: TeX dvi file gdb.dvi: ${GDB_DOC_FILES} if [ ! -f ./GDBvn.texi ]; then \ - (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \ + (test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \ ln $(srcdir)/GDBvn.texi . || \ cp $(srcdir)/GDBvn.texi . ; else true; fi rm -f $(GDB_TEX_TMPS) @@ -279,7 +279,7 @@ gdb.ps: gdb.dvi gdb.pdf: ${GDB_DOC_FILES} if [ ! -f ./GDBvn.texi ]; then \ - (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \ + (test "$(LN_S)" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \ ln $(srcdir)/GDBvn.texi . || \ cp $(srcdir)/GDBvn.texi . ; else true; fi rm -f $(GDB_TEX_TMPS) @@ -306,7 +306,7 @@ gdb.info: ${GDB_DOC_FILES} # in main sourcedir. links2roff: $(GDB_DOC_SOURCE_INCLUDES) if [ ! -f gdb.texinfo ]; then \ - (test "$$LN_S" = "ln -s" && ln -s $(GDB_DOC_SOURCE_INCLUDES) .) || \ + (test "$(LN_S)" = "ln -s" && ln -s $(GDB_DOC_SOURCE_INCLUDES) .) || \ ln $(GDB_DOC_SOURCE_INCLUDES) . || \ cp $(GDB_DOC_SOURCE_INCLUDES) . ; \ fi diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 00a4ac7..9136e65 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -5861,62 +5861,53 @@ Disable @value{GDBN} from caching target memory. This is the default. @cindex append data to a file @cindex dump data to a file @cindex restore data from a file -@kindex dump -@kindex append -@kindex restore -The commands @code{dump}, @code{append}, and @code{restore} are used -for copying data between target memory and a file. Data is written -into a file using @code{dump} or @code{append}, and restored from a -file into memory by using @code{restore}. Files may be binary, srec, -intel hex, or tekhex (but only binary files can be appended). +You can use the commands @code{dump}, @code{append}, and +@code{restore} to copy data between target memory and a file. The +@code{dump} and @code{append} commands write data to a file, and the +@code{restore} command reads data from a file back into the inferior's +memory. Files may be in binary, Motorola S-record, Intel hex, or +Tektronix Hex format; however, @value{GDBN} can only append to binary +files. @table @code -@kindex dump binary -@kindex append binary -@item dump binary memory @var{filename} @var{start_addr} @var{end_addr} -Dump contents of memory from @var{start_addr} to @var{end_addr} into -raw binary format file @var{filename}. - -@item append binary memory @var{filename} @var{start_addr} @var{end_addr} -Append contents of memory from @var{start_addr} to @var{end_addr} to -raw binary format file @var{filename}. - -@item dump binary value @var{filename} @var{expression} -Dump value of @var{expression} into raw binary format file @var{filename}. -@item append binary memory @var{filename} @var{expression} -Append value of @var{expression} to raw binary format file @var{filename}. - -@kindex dump ihex -@item dump ihex memory @var{filename} @var{start_addr} @var{end_addr} -Dump contents of memory from @var{start_addr} to @var{end_addr} into -intel hex format file @var{filename}. - -@item dump ihex value @var{filename} @var{expression} -Dump value of @var{expression} into intel hex format file @var{filename}. - -@kindex dump srec -@item dump srec memory @var{filename} @var{start_addr} @var{end_addr} -Dump contents of memory from @var{start_addr} to @var{end_addr} into -srec format file @var{filename}. +@kindex dump +@item dump @r{[}@var{format}@r{]} memory @var{filename} @var{start_addr} @var{end_addr} +@itemx dump @r{[}@var{format}@r{]} value @var{filename} @var{expr} +Dump the contents of memory from @var{start_addr} to @var{end_addr}, +or the value of @var{expr}, to @var{filename} in the given format. -@item dump srec value @var{filename} @var{expression} -Dump value of @var{expression} into srec format file @var{filename}. +The @var{format} parameter may be any one of: +@table @code +@item binary +Raw binary form. +@item ihex +Intel hex format. +@item srec +Motorola S-record format. +@item tekhex +Tektronix Hex format. +@end table -@kindex dump tekhex -@item dump tekhex memory @var{filename} @var{start_addr} @var{end_addr} -Dump contents of memory from @var{start_addr} to @var{end_addr} into -tekhex format file @var{filename}. +@value{GDBN} uses the same definitions of these formats as the +@sc{gnu} binary utilities, like @samp{objdump} and @samp{objcopy}. If +@var{format} is omitted, @value{GDBN} dumps the data in raw binary +form. -@item dump tekhex value @var{filename} @var{expression} -Dump value of @var{expression} into tekhex format file @var{filename}. +@kindex append +@item append @r{[}binary@r{]} memory @var{filename} @var{start_addr} @var{end_addr} +@itemx append @r{[}binary@r{]} value @var{filename} @var{expr} +Append the contents of memory from @var{start_addr} to @var{end_addr}, +or the value of @var{expr}, to @var{filename}, in raw binary form. +(@value{GDBN} can only append data to files in raw binary form.) -@item restore @var{filename} [@var{binary}] @var{bias} @var{start} @var{end} -Restore the contents of file @var{filename} into memory. The @code{restore} -command can automatically recognize any known bfd file format, except for -raw binary. To restore a raw binary file you must use the optional argument -@var{binary} after the filename. +@kindex restore +@item restore @var{filename} @r{[}binary@r{]} @var{bias} @var{start} @var{end} +Restore the contents of file @var{filename} into memory. The +@code{restore} command can automatically recognize any known @sc{bfd} +file format, except for raw binary. To restore a raw binary file you +must specify the optional keyword @code{binary} after the filename. If @var{bias} is non-zero, its value will be added to the addresses contained in the file. Binary files always start at address zero, so @@ -5952,7 +5943,7 @@ remote protocol (@pxref{Remote,Remote Debugging}) to debug a program running on an IBM mainframe, which uses the @sc{ebcdic} character set, then the host character set is Latin-1, and the target character set is @sc{ebcdic}. If you give @value{GDBN} the command @code{set -target-charset ebcdic-us}, then @value{GDBN} translates between +target-charset EBCDIC-US}, then @value{GDBN} translates between @sc{ebcdic} and Latin 1 as you print character or string values, or use character and string literals in expressions. @@ -5967,9 +5958,9 @@ support: @item set target-charset @var{charset} @kindex set target-charset Set the current target character set to @var{charset}. We list the -character set names @value{GDBN} recognizes below, but if you invoke the -@code{set target-charset} command with no argument, @value{GDBN} lists -the character sets it supports. +character set names @value{GDBN} recognizes below, but if you type +@code{set target-charset} followed by @key{TAB}@key{TAB}, @value{GDBN} will +list the target character sets it supports. @end table @table @code @@ -5983,28 +5974,29 @@ system it is running on; you can override that default using the @value{GDBN} can only use certain character sets as its host character set. We list the character set names @value{GDBN} recognizes below, and -indicate which can be host character sets, but if you invoke the -@code{set host-charset} command with no argument, @value{GDBN} lists the -character sets it supports, placing an asterisk (@samp{*}) after those -it can use as a host character set. +indicate which can be host character sets, but if you type +@code{set target-charset} followed by @key{TAB}@key{TAB}, @value{GDBN} will +list the host character sets it supports. @item set charset @var{charset} @kindex set charset -Set the current host and target character sets to @var{charset}. If you -invoke the @code{set charset} command with no argument, it lists the -character sets it supports. @value{GDBN} can only use certain character -sets as its host character set; it marks those in the list with an -asterisk (@samp{*}). +Set the current host and target character sets to @var{charset}. As +above, if you type @code{set charset} followed by @key{TAB}@key{TAB}, +@value{GDBN} will list the name of the character sets that can be used +for both host and target. + @item show charset -@itemx show host-charset -@itemx show target-charset @kindex show charset +Show the names of the current host and target charsets. + +@itemx show host-charset @kindex show host-charset +Show the name of the current host charset. + +@itemx show target-charset @kindex show target-charset -Show the current host and target charsets. The @code{show host-charset} -and @code{show target-charset} commands are synonyms for @code{show -charset}. +Show the name of the current target charset. @end table @@ -6021,7 +6013,7 @@ character set. @item ISO-8859-1 @cindex ISO 8859-1 character set @cindex ISO Latin 1 character set -The ISO Latin 1 character set. This extends ASCII with accented +The ISO Latin 1 character set. This extends @sc{ascii} with accented characters needed for French, German, and Spanish. @value{GDBN} can use this as its host character set. @@ -6080,16 +6072,16 @@ strings: @smallexample (gdb) show charset -The current host and target character set is `iso-8859-1'. +The current host and target character set is `ISO-8859-1'. (gdb) @end smallexample For the sake of printing this manual, let's use @sc{ascii} as our initial character set: @smallexample -(gdb) set charset ascii +(gdb) set charset ASCII (gdb) show charset -The current host and target character set is `ascii'. +The current host and target character set is `ASCII'. (gdb) @end smallexample @@ -6131,17 +6123,13 @@ $5 = 200 '\310' (gdb) @end smallexample -If we invoke the @code{set target-charset} command without an argument, +If we invoke the @code{set target-charset} followed by @key{TAB}@key{TAB}, @value{GDBN} tells us the character sets it supports: @smallexample (gdb) set target-charset -Valid character sets are: - ascii * - iso-8859-1 * - ebcdic-us - ibm1047 -* - can be used as a host character set +ASCII EBCDIC-US IBM1047 ISO-8859-1 +(gdb) set target-charset @end smallexample We can select @sc{ibm1047} as our target character set, and examine the @@ -6151,10 +6139,10 @@ target character set, @sc{ibm1047}, to the host character set, @sc{ascii}, and they display correctly: @smallexample -(gdb) set target-charset ibm1047 +(gdb) set target-charset IBM1047 (gdb) show charset -The current host character set is `ascii'. -The current target character set is `ibm1047'. +The current host character set is `ASCII'. +The current target character set is `IBM1047'. (gdb) print ascii_hello $6 = 0x401698 "\110\145%%?\054\040\167?\162%\144\041\012" (gdb) print ascii_hello[0] @@ -6175,7 +6163,7 @@ $10 = 78 '+' (gdb) @end smallexample -The IBM1047 character set uses the number 78 to encode the @samp{+} +The @sc{ibm1047} character set uses the number 78 to encode the @samp{+} character. @@ -9034,14 +9022,14 @@ required for each object file from which @value{GDBN} has read some symbols. @xref{Files, ,Commands to specify files}, for a discussion of how @value{GDBN} reads symbols (in the description of @code{symbol-file}). -@kindex maint list symtabs -@kindex maint list psymtabs +@kindex maint info symtabs +@kindex maint info psymtabs @cindex listing @value{GDBN}'s internal symbol tables @cindex symbol tables, listing @value{GDBN}'s internal @cindex full symbol tables, listing @value{GDBN}'s internal @cindex partial symbol tables, listing @value{GDBN}'s internal -@item maint list symtabs @r{[} @var{regexp} @r{]} -@itemx maint list psymtabs @r{[} @var{regexp} @r{]} +@item maint info symtabs @r{[} @var{regexp} @r{]} +@itemx maint info psymtabs @r{[} @var{regexp} @r{]} List the @code{struct symtab} or @code{struct partial_symtab} structures whose names match @var{regexp}. If @var{regexp} is not @@ -9050,7 +9038,7 @@ copy into a @value{GDBN} debugging this one to examine a particular structure in more detail. For example: @smallexample -(@value{GDBP}) maint list psymtabs dwarf2read +(@value{GDBP}) maint info psymtabs dwarf2read @{ objfile /home/gnu/build/gdb/gdb ((struct objfile *) 0x82e69d0) @{ psymtab /home/gnu/src/gdb/dwarf2read.c @@ -9063,7 +9051,7 @@ structure in more detail. For example: dependencies (none) @} @} -(@value{GDBP}) maint list symtabs +(@value{GDBP}) maint info symtabs (@value{GDBP}) @end smallexample @noindent @@ -9077,7 +9065,7 @@ read the symtab for the compilation unit containing that function: (@value{GDBP}) break dwarf2_psymtab_to_symtab Breakpoint 1 at 0x814e5da: file /home/gnu/src/gdb/dwarf2read.c, line 1574. -(@value{GDBP}) maint list symtabs +(@value{GDBP}) maint info symtabs @{ objfile /home/gnu/build/gdb/gdb ((struct objfile *) 0x82e69d0) @{ symtab /home/gnu/src/gdb/dwarf2read.c @@ -17117,6 +17105,32 @@ List the functions in the executable. N.A. +@subheading The @code{-symbol-list-lines} Command +@findex -symbol-list-lines + +@subsubheading Synopsis + +@smallexample + -symbol-list-lines @var{filename} +@end smallexample + +Print the list of lines that contain code and their associated program +addresses for the given source filename. The entries are sorted in +ascending PC order. + +@subsubheading @value{GDBN} Command + +There is no corresponding @value{GDBN} command. + +@subsubheading Example +@smallexample +(@value{GDBP}) +-symbol-list-lines basics.c +^done,lines=[@{pc="0x08048554",line="7"@},@{pc="0x0804855a",line="8"@}] +(@value{GDBP}) +@end smallexample + + @subheading The @code{-symbol-list-types} Command @findex -symbol-list-types @@ -19350,6 +19364,28 @@ Create a core file? (y or n) @kbd{n} Takes an optional parameter that is used as the text of the error or warning message. +@kindex maint print dummy-frames +@item maint print dummy-frames + +Prints the contents of @value{GDBN}'s internal dummy-frame stack. + +@smallexample +(gdb) @kbd{b add} +@dots{} +(gdb) @kbd{print add(2,3)} +Breakpoint 2, add (a=2, b=3) at @dots{} +58 return (a + b); +The program being debugged stopped while in a function called from GDB. +@dots{} +(gdb) @kbd{maint print dummy-frames} +0x1a57c80: pc=0x01014068 fp=0x0200bddc sp=0x0200bdd6 + top=0x0200bdd4 id=@{stack=0x200bddc,code=0x101405c@} + call_lo=0x01014000 call_hi=0x01014001 +(gdb) +@end smallexample + +Takes an optional file parameter. + @kindex maint print registers @kindex maint print raw-registers @kindex maint print cooked-registers diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index c99d789..90b2575 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -288,7 +288,7 @@ A third possibility is that the target already has the ability to do breakpoints somehow; for instance, a ROM monitor may do its own software breakpoints. So although these are not literally ``hardware breakpoints'', from @value{GDBN}'s point of view they work the same; -@value{GDBN} need not do nothing more than set the breakpoint and wait +@value{GDBN} need not do anything more than set the breakpoint and wait for something to happen. Since they depend on hardware resources, hardware breakpoints may be @@ -2601,35 +2601,6 @@ This function performs architecture-specific conversions as described above for @code{store_typed_address}. @end deftypefun - -@value{GDBN} also provides functions that do the same tasks, but assume -that pointers are simply byte addresses; they aren't sensitive to the -current architecture, beyond knowing the appropriate endianness. - -@deftypefun CORE_ADDR extract_address (void *@var{addr}, int len) -Extract a @var{len}-byte number from @var{addr} in the appropriate -endianness for the current architecture, and return it. Note that -@var{addr} refers to @value{GDBN}'s memory, not the inferior's. - -This function should only be used in architecture-specific code; it -doesn't have enough information to turn bits into a true address in the -appropriate way for the current architecture. If you can, use -@code{extract_typed_address} instead. -@end deftypefun - -@deftypefun void store_address (void *@var{addr}, int @var{len}, LONGEST @var{val}) -Store @var{val} at @var{addr} as a @var{len}-byte integer, in the -appropriate endianness for the current architecture. Note that -@var{addr} refers to a buffer in @value{GDBN}'s memory, not the -inferior's. - -This function should only be used in architecture-specific code; it -doesn't have enough information to turn a true address into bits in the -appropriate way for the current architecture. If you can, use -@code{store_typed_address} instead. -@end deftypefun - - Here are some macros which architectures can define to indicate the relationship between pointers and addresses. These have default definitions, appropriate for architectures on which all pointers are @@ -3085,29 +3056,42 @@ custom breakpoint insertion and removal routines if @code{BREAKPOINT_FROM_PC} needs to read the target's memory for some reason. -@item CALL_DUMMY_WORDS -@findex CALL_DUMMY_WORDS +@item DEPRECATED_CALL_DUMMY_WORDS +@findex DEPRECATED_CALL_DUMMY_WORDS Pointer to an array of @code{LONGEST} words of data containing -host-byte-ordered @code{REGISTER_BYTES} sized values that partially -specify the sequence of instructions needed for an inferior function -call. +host-byte-ordered @code{DEPRECATED_REGISTER_SIZE} sized values that +partially specify the sequence of instructions needed for an inferior +function call. Should be deprecated in favor of a macro that uses target-byte-ordered data. -@item SIZEOF_CALL_DUMMY_WORDS -@findex SIZEOF_CALL_DUMMY_WORDS -The size of @code{CALL_DUMMY_WORDS}. This must return a positive value. -See also @code{CALL_DUMMY_LENGTH}. +This method has been replaced by @code{push_dummy_code} +(@pxref{push_dummy_code}). + +@item DEPRECATED_SIZEOF_CALL_DUMMY_WORDS +@findex DEPRECATED_SIZEOF_CALL_DUMMY_WORDS +The size of @code{DEPRECATED_CALL_DUMMY_WORDS}. This must return a +positive value. See also @code{DEPRECATED_CALL_DUMMY_LENGTH}. + +This method has been replaced by @code{push_dummy_code} +(@pxref{push_dummy_code}). @item CALL_DUMMY @findex CALL_DUMMY -A static initializer for @code{CALL_DUMMY_WORDS}. Deprecated. +A static initializer for @code{DEPRECATED_CALL_DUMMY_WORDS}. +Deprecated. + +This method has been replaced by @code{push_dummy_code} +(@pxref{push_dummy_code}). @item CALL_DUMMY_LOCATION @findex CALL_DUMMY_LOCATION See the file @file{inferior.h}. +This method has been replaced by @code{push_dummy_code} +(@pxref{push_dummy_code}). + @item DEPRECATED_CALL_DUMMY_STACK_ADJUST @findex DEPRECATED_CALL_DUMMY_STACK_ADJUST Stack adjustment needed when performing an inferior function call. This @@ -3707,14 +3691,39 @@ Returns the updated top-of-stack pointer. This method replaces @code{DEPRECATED_PUSH_ARGUMENTS}. +@item CORE_ADDR push_dummy_code (@var{gdbarch}, @var{sp}, @var{funaddr}, @var{using_gcc}, @var{args}, @var{nargs}, @var{value_type}, @var{real_pc}, @var{bp_addr}) +@findex push_dummy_code +@findex DEPRECATED_FIX_CALL_DUMMY +@anchor{push_dummy_code} Given a stack based call dummy, push the +instruction sequence (including space for a breakpoint) to which the +called function should return. + +Set @var{bp_addr} to the address at which the breakpoint instruction +should be inserted, @var{real_pc} to the resume address when starting +the call sequence, and return the updated inner-most stack address. + +By default, the stack is grown sufficient to hold a frame-aligned +(@pxref{frame_align}) breakpoint, @var{bp_addr} is set to the address +reserved for that breakpoint, and @var{real_pc} set to @var{funaddr}. + +This method replaces @code{DEPRECATED_CALL_DUMMY_WORDS}, +@code{DEPRECATED_SIZEOF_CALL_DUMMY_WORDS}, @code{CALL_DUMMY}, +@code{CALL_DUMMY_LOCATION}, @code{DEPRECATED_REGISTER_SIZE}, +@code{GDB_TARGET_IS_HPPA}, +@code{DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET}, and +@code{DEPRECATED_FIX_CALL_DUMMY}. + @item DEPRECATED_PUSH_DUMMY_FRAME @findex DEPRECATED_PUSH_DUMMY_FRAME Used in @samp{call_function_by_hand} to create an artificial stack frame. -@item REGISTER_BYTES -@findex REGISTER_BYTES -The total amount of space needed to store @value{GDBN}'s copy of the machine's -register state. +@item DEPRECATED_REGISTER_BYTES +@findex DEPRECATED_REGISTER_BYTES +The total amount of space needed to store @value{GDBN}'s copy of the +machine's register state. + +This is no longer needed. @value{GDBN} instead computes the size of the +register buffer at run-time. @item REGISTER_NAME(@var{i}) @findex REGISTER_NAME diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c index 7f3b2a2..94413f4 100644 --- a/gdb/dummy-frame.c +++ b/gdb/dummy-frame.c @@ -29,6 +29,8 @@ #include "inferior.h" #include "gdb_assert.h" #include "frame-unwind.h" +#include "command.h" +#include "gdbcmd.h" static void dummy_frame_this_id (struct frame_info *next_frame, void **this_prologue_cache, @@ -109,7 +111,7 @@ find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp) } struct regcache * -generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp) +deprecated_find_dummy_frame_regcache (CORE_ADDR pc, CORE_ADDR fp) { struct dummy_frame *dummy = find_dummy_frame (pc, fp); if (dummy != NULL) @@ -121,7 +123,7 @@ generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp) char * deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp) { - struct regcache *regcache = generic_find_dummy_frame (pc, fp); + struct regcache *regcache = deprecated_find_dummy_frame_regcache (pc, fp); if (regcache == NULL) return NULL; return deprecated_grub_regcache_for_registers (regcache); @@ -149,8 +151,9 @@ generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp) figure out what the real PC (as in the resume address) is BEFORE calling this function (Oh, and I'm not even sure that this function is called with an decremented PC, the call to pc_in_call_dummy() in - that file is conditional on !CALL_DUMMY_BREAKPOINT_OFFSET_P yet - generic dummy targets set CALL_DUMMY_BREAKPOINT_OFFSET. True?). */ + that file is conditional on + !DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET_P yet generic dummy + targets set DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET. True?). */ int pc_in_dummy_frame (CORE_ADDR pc) @@ -173,14 +176,14 @@ pc_in_dummy_frame (CORE_ADDR pc) CORE_ADDR deprecated_read_register_dummy (CORE_ADDR pc, CORE_ADDR fp, int regno) { - struct regcache *dummy_regs = generic_find_dummy_frame (pc, fp); + struct regcache *dummy_regs = deprecated_find_dummy_frame_regcache (pc, fp); if (dummy_regs) { /* NOTE: cagney/2002-08-12: Replaced a call to regcache_raw_read_as_address() with a call to regcache_cooked_read_unsigned(). The old, ...as_address - function was eventually calling extract_unsigned_integer (via + function was eventually calling extract_unsigned_integer (nee extract_address) to unpack the registers value. The below is doing an unsigned extract so that it is functionally equivalent. The read needs to be cooked as, otherwise, it @@ -418,3 +421,49 @@ dummy_frame_p (CORE_ADDR pc) else return NULL; } + +static void +fprint_dummy_frames (struct ui_file *file) +{ + struct dummy_frame *s; + for (s = dummy_frame_stack; s != NULL; s = s->next) + { + gdb_print_host_address (s, file); + fprintf_unfiltered (file, ":"); + fprintf_unfiltered (file, " pc=0x%s", paddr (s->pc)); + fprintf_unfiltered (file, " fp=0x%s", paddr (s->fp)); + fprintf_unfiltered (file, " sp=0x%s", paddr (s->sp)); + fprintf_unfiltered (file, " top=0x%s", paddr (s->top)); + fprintf_unfiltered (file, " id="); + fprint_frame_id (file, s->id); + fprintf_unfiltered (file, " call_lo=0x%s", paddr (s->call_lo)); + fprintf_unfiltered (file, " call_hi=0x%s", paddr (s->call_hi)); + fprintf_unfiltered (file, "\n"); + } +} + +static void +maintenance_print_dummy_frames (char *args, int from_tty) +{ + if (args == NULL) + fprint_dummy_frames (gdb_stdout); + else + { + struct ui_file *file = gdb_fopen (args, "w"); + if (file == NULL) + perror_with_name ("maintenance print dummy-frames"); + fprint_dummy_frames (file); + ui_file_delete (file); + } +} + +extern void _initialize_dummy_frame (void); + +void +_initialize_dummy_frame (void) +{ + add_cmd ("dummy-frames", class_maintenance, maintenance_print_dummy_frames, + "Print the contents of the internal dummy-frame stack.", + &maintenanceprintlist); + +} diff --git a/gdb/dummy-frame.h b/gdb/dummy-frame.h index bb41e8d..ae090e3 100644 --- a/gdb/dummy-frame.h +++ b/gdb/dummy-frame.h @@ -37,12 +37,13 @@ struct frame_id; generic enough to be used by many targets. The cheapest and most generic way to do CALL_DUMMY on a new target - is probably to define CALL_DUMMY to be empty, CALL_DUMMY_LENGTH to - zero, and CALL_DUMMY_LOCATION to AT_ENTRY. Then you must remember - to define PUSH_RETURN_ADDRESS, because no call instruction will be - being executed by the target. Also DEPRECATED_FRAME_CHAIN_VALID as + is probably to define CALL_DUMMY to be empty, + DEPRECATED_CALL_DUMMY_LENGTH to zero, and CALL_DUMMY_LOCATION to + AT_ENTRY. Then you must remember to define PUSH_RETURN_ADDRESS, + because no call instruction will be being executed by the target. + Also DEPRECATED_FRAME_CHAIN_VALID as generic_{file,func}_frame_chain_valid and do not set - FIX_CALL_DUMMY. */ + DEPRECATED_FIX_CALL_DUMMY. */ /* If the PC falls in a dummy frame, return a dummy frame unwinder. */ @@ -80,6 +81,6 @@ extern int pc_in_dummy_frame (CORE_ADDR pc); deprecated_generic_get_saved_register. Eliminate that function and this, to, can go. */ -extern struct regcache *generic_find_dummy_frame (CORE_ADDR pc, - CORE_ADDR fp); +extern struct regcache *deprecated_find_dummy_frame_regcache (CORE_ADDR pc, + CORE_ADDR fp); #endif /* !defined (DUMMY_FRAME_H) */ diff --git a/gdb/dve3900-rom.c b/gdb/dve3900-rom.c index e7329f8..02a273c 100644 --- a/gdb/dve3900-rom.c +++ b/gdb/dve3900-rom.c @@ -455,7 +455,7 @@ static void fetch_bitmapped_register (int regno, struct bit_field *bf) { unsigned long val; - unsigned char *regbuf = alloca (max_register_size (current_gdbarch)); + unsigned char regbuf[MAX_REGISTER_SIZE]; char *regname = NULL; if (regno >= sizeof (r3900_regnames) / sizeof (r3900_regnames[0])) diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c index 81fa207..085c91c 100644 --- a/gdb/dwarf2cfi.c +++ b/gdb/dwarf2cfi.c @@ -1751,7 +1751,7 @@ cfi_write_fp (CORE_ADDR val) void cfi_pop_frame (struct frame_info *fi) { - char *regbuf = alloca (MAX_REGISTER_RAW_SIZE); + char regbuf[MAX_REGISTER_SIZE]; int regnum; for (regnum = 0; regnum < NUM_REGS; regnum++) diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c index 35e76f3..aa391eb 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c @@ -39,8 +39,9 @@ new_dwarf_expr_context (void) { struct dwarf_expr_context *retval; retval = xcalloc (1, sizeof (struct dwarf_expr_context)); - retval->stack_len = 10; - retval->stack = xmalloc (10 * sizeof (CORE_ADDR)); + retval->stack_len = 0; + retval->stack_allocated = 10; + retval->stack = xmalloc (retval->stack_allocated * sizeof (CORE_ADDR)); return retval; } @@ -61,12 +62,10 @@ dwarf_expr_grow_stack (struct dwarf_expr_context *ctx, size_t need) { if (ctx->stack_len + need > ctx->stack_allocated) { - size_t templen = ctx->stack_len * 2; - while (templen < (ctx->stack_len + need)) - templen *= 2; + size_t newlen = ctx->stack_len + need + 10; ctx->stack = xrealloc (ctx->stack, - templen * sizeof (CORE_ADDR)); - ctx->stack_allocated = templen; + newlen * sizeof (CORE_ADDR)); + ctx->stack_allocated = newlen; } } @@ -179,7 +178,9 @@ dwarf2_read_address (unsigned char *buf, unsigned char *buf_end, int *bytes_read error ("dwarf2_read_address: Corrupted DWARF expression."); *bytes_read = TARGET_ADDR_BIT / TARGET_CHAR_BIT; - result = extract_address (buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT); + /* NOTE: cagney/2003-05-22: This extract is assuming that a DWARF 2 + address is always unsigned. That may or may not be true. */ + result = extract_unsigned_integer (buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT); return result; } @@ -228,6 +229,8 @@ static void execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr, unsigned char *op_end) { + ctx->in_reg = 0; + while (op_ptr < op_end) { enum dwarf_location_atom op = *op_ptr++; @@ -236,8 +239,6 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr, LONGEST offset; int bytes_read; - ctx->in_reg = 0; - switch (op) { case DW_OP_lit0: @@ -355,10 +356,9 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr, case DW_OP_reg29: case DW_OP_reg30: case DW_OP_reg31: - /* NOTE: in the presence of DW_OP_piece this check is incorrect. */ - if (op_ptr != op_end) + if (op_ptr != op_end && *op_ptr != DW_OP_piece) error ("DWARF-2 expression error: DW_OP_reg operations must be " - "used alone."); + "used either alone or in conjuction with DW_OP_piece."); result = op - DW_OP_reg0; ctx->in_reg = 1; @@ -367,9 +367,9 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr, case DW_OP_regx: op_ptr = read_uleb128 (op_ptr, op_end, ®); - if (op_ptr != op_end) + if (op_ptr != op_end && *op_ptr != DW_OP_piece) error ("DWARF-2 expression error: DW_OP_reg operations must be " - "used alone."); + "used either alone or in conjuction with DW_OP_piece."); result = reg; ctx->in_reg = 1; diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index f78c44a..bd0f2b9 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -50,7 +50,7 @@ static char * find_location_expression (struct dwarf2_loclist_baton *baton, - int *locexpr_length, CORE_ADDR pc) + size_t *locexpr_length, CORE_ADDR pc) { CORE_ADDR base_address = baton->base_address; CORE_ADDR low, high; @@ -124,7 +124,9 @@ dwarf_expr_read_reg (void *baton, int dwarf_regnum) frame_register (debaton->frame, regnum, &optimized, &lval_type, &save_addr, &realnum, buf); - result = extract_address (buf, regsize); + /* NOTE: cagney/2003-05-22: This extract is assuming that a DWARF 2 + address is always unsigned. That may or may not be true. */ + result = extract_unsigned_integer (buf, regsize); return result; } @@ -450,7 +452,7 @@ loclist_read_variable (const struct symbol *symbol, struct frame_info *frame) struct dwarf2_loclist_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol); struct value *val; unsigned char *data; - int size; + size_t size; data = find_location_expression (dlbaton, &size, frame ? get_frame_pc (frame) : 0); @@ -493,7 +495,7 @@ loclist_tracepoint_var_ref (const struct symbol * symbol, { struct dwarf2_loclist_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol); unsigned char *data; - int size; + size_t size; data = find_location_expression (dlbaton, &size, ax->scope); if (data == NULL) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 247ea47..71508fb 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1559,7 +1559,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile, /*prim_record_minimal_symbol (actual_name, pdi->lowpc + baseaddr, mst_text, objfile); */ psym = add_psymbol_to_list (actual_name, strlen (actual_name), - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->global_psymbols, 0, pdi->lowpc + baseaddr, cu_language, objfile); @@ -1569,7 +1569,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile, /*prim_record_minimal_symbol (actual_name, pdi->lowpc + baseaddr, mst_file_text, objfile); */ psym = add_psymbol_to_list (actual_name, strlen (actual_name), - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->static_psymbols, 0, pdi->lowpc + baseaddr, cu_language, objfile); @@ -1595,7 +1595,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile, addr = decode_locdesc (pdi->locdesc, objfile, cu_header); if (pdi->locdesc || pdi->has_type) psym = add_psymbol_to_list (actual_name, strlen (actual_name), - VAR_NAMESPACE, LOC_STATIC, + VAR_DOMAIN, LOC_STATIC, &objfile->global_psymbols, 0, addr + baseaddr, cu_language, objfile); @@ -1609,7 +1609,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile, /*prim_record_minimal_symbol (actual_name, addr + baseaddr, mst_file_data, objfile); */ add_psymbol_to_list (actual_name, strlen (actual_name), - VAR_NAMESPACE, LOC_STATIC, + VAR_DOMAIN, LOC_STATIC, &objfile->static_psymbols, 0, addr + baseaddr, cu_language, objfile); } @@ -1617,7 +1617,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile, case DW_TAG_typedef: case DW_TAG_base_type: add_psymbol_to_list (actual_name, strlen (actual_name), - VAR_NAMESPACE, LOC_TYPEDEF, + VAR_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, 0, (CORE_ADDR) 0, cu_language, objfile); break; @@ -1632,7 +1632,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile, if (pdi->has_children == 0) return; add_psymbol_to_list (actual_name, strlen (actual_name), - STRUCT_NAMESPACE, LOC_TYPEDEF, + STRUCT_DOMAIN, LOC_TYPEDEF, cu_language == language_cplus ? &objfile->global_psymbols : &objfile->static_psymbols, @@ -1642,14 +1642,14 @@ add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile, { /* For C++, these implicitly act as typedefs as well. */ add_psymbol_to_list (actual_name, strlen (actual_name), - VAR_NAMESPACE, LOC_TYPEDEF, + VAR_DOMAIN, LOC_TYPEDEF, &objfile->global_psymbols, 0, (CORE_ADDR) 0, cu_language, objfile); } break; case DW_TAG_enumerator: add_psymbol_to_list (actual_name, strlen (actual_name), - VAR_NAMESPACE, LOC_CONST, + VAR_DOMAIN, LOC_CONST, cu_language == language_cplus ? &objfile->static_psymbols : &objfile->global_psymbols, @@ -2684,8 +2684,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, char *physname; - /* C++ static member. - Get name of field. */ + /* Get name of field. */ fieldname = dwarf2_name (die); if (fieldname == NULL) return; @@ -3546,7 +3545,7 @@ read_namespace (struct die_info *die, struct objfile *objfile, cp_add_using_directive (processing_current_prefix, strlen (previous_prefix), strlen (processing_current_prefix)); - + if (die->child != NULL) { struct die_info *child_die = die->child; @@ -4903,7 +4902,7 @@ set_cu_language (unsigned int lang) case DW_LANG_Pascal83: case DW_LANG_Modula2: default: - cu_language = language_unknown; + cu_language = language_minimal; break; } cu_language_defn = language_def (cu_language); @@ -5233,8 +5232,8 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, * lh->minimum_instruction_length; line += lh->line_base + (adj_opcode % lh->line_range); /* append row to matrix using current values */ - address = check_cu_functions (address); - record_line (current_subfile, line, address); + record_line (current_subfile, line, + check_cu_functions (address)); basic_block = 1; } else switch (op_code) @@ -5280,8 +5279,8 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, } break; case DW_LNS_copy: - address = check_cu_functions (address); - record_line (current_subfile, line, address); + record_line (current_subfile, line, + check_cu_functions (address)); basic_block = 0; break; case DW_LNS_advance_pc: @@ -5477,7 +5476,7 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, /* Default assumptions. Use the passed type or decode it from the die. */ - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_CLASS (sym) = LOC_STATIC; if (type != NULL) SYMBOL_TYPE (sym) = type; @@ -5607,7 +5606,7 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, case DW_TAG_union_type: case DW_TAG_enumeration_type: SYMBOL_CLASS (sym) = LOC_TYPEDEF; - SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE; + SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN; /* Make sure that the symbol includes appropriate enclosing classes/namespaces in its name. These are calculated in @@ -5656,7 +5655,7 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); *typedef_sym = *sym; - SYMBOL_NAMESPACE (typedef_sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN; if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) TYPE_NAME (SYMBOL_TYPE (sym)) = obsavestring (DEPRECATED_SYMBOL_NAME (sym), @@ -5676,12 +5675,12 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, name); } SYMBOL_CLASS (sym) = LOC_TYPEDEF; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, list_in_scope); break; case DW_TAG_base_type: SYMBOL_CLASS (sym) = LOC_TYPEDEF; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, list_in_scope); break; case DW_TAG_enumerator: @@ -5743,8 +5742,10 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym, (sym))); SYMBOL_VALUE_BYTES (sym) = (char *) obstack_alloc (&objfile->symbol_obstack, cu_header->addr_size); - store_address (SYMBOL_VALUE_BYTES (sym), cu_header->addr_size, - DW_ADDR (attr)); + /* NOTE: cagney/2003-05-09: In-lined store_address call with + it's body - store_unsigned_integer. */ + store_unsigned_integer (SYMBOL_VALUE_BYTES (sym), cu_header->addr_size, + DW_ADDR (attr)); SYMBOL_CLASS (sym) = LOC_CONST_BYTES; break; case DW_FORM_block1: diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 6a13e55..2780858 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -1589,7 +1589,7 @@ read_enumeration (struct dieinfo *dip, char *thisdie, char *enddie, of the enumeration and return a type pointer for the enumeration. At the same time, for each member of the enumeration, create a - symbol for it with namespace VAR_NAMESPACE and class LOC_CONST, + symbol for it with domain VAR_DOMAIN and class LOC_CONST, and give it the type of the enumeration itself. NOTES @@ -1679,7 +1679,7 @@ enum_type (struct dieinfo *dip, struct objfile *objfile) DEPRECATED_SYMBOL_NAME (sym) = create_name (list->field.name, &objfile->symbol_obstack); SYMBOL_INIT_LANGUAGE_SPECIFIC (sym, cu_language); - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_CLASS (sym) = LOC_CONST; SYMBOL_TYPE (sym) = type; SYMBOL_VALUE (sym) = FIELD_BITPOS (list->field); @@ -2446,7 +2446,7 @@ add_enum_psymbol (struct dieinfo *dip, struct objfile *objfile) while (scan < listend) { scan += TARGET_FT_LONG_SIZE (objfile); - add_psymbol_to_list (scan, strlen (scan), VAR_NAMESPACE, LOC_CONST, + add_psymbol_to_list (scan, strlen (scan), VAR_DOMAIN, LOC_CONST, &objfile->static_psymbols, 0, 0, cu_language, objfile); scan += strlen (scan) + 1; @@ -2478,31 +2478,31 @@ add_partial_symbol (struct dieinfo *dip, struct objfile *objfile) { case TAG_global_subroutine: add_psymbol_to_list (dip->at_name, strlen (dip->at_name), - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->global_psymbols, 0, dip->at_low_pc, cu_language, objfile); break; case TAG_global_variable: add_psymbol_to_list (dip->at_name, strlen (dip->at_name), - VAR_NAMESPACE, LOC_STATIC, + VAR_DOMAIN, LOC_STATIC, &objfile->global_psymbols, 0, 0, cu_language, objfile); break; case TAG_subroutine: add_psymbol_to_list (dip->at_name, strlen (dip->at_name), - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->static_psymbols, 0, dip->at_low_pc, cu_language, objfile); break; case TAG_local_variable: add_psymbol_to_list (dip->at_name, strlen (dip->at_name), - VAR_NAMESPACE, LOC_STATIC, + VAR_DOMAIN, LOC_STATIC, &objfile->static_psymbols, 0, 0, cu_language, objfile); break; case TAG_typedef: add_psymbol_to_list (dip->at_name, strlen (dip->at_name), - VAR_NAMESPACE, LOC_TYPEDEF, + VAR_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, 0, 0, cu_language, objfile); break; @@ -2514,14 +2514,14 @@ add_partial_symbol (struct dieinfo *dip, struct objfile *objfile) if (!dip->has_at_byte_size) break; add_psymbol_to_list (dip->at_name, strlen (dip->at_name), - STRUCT_NAMESPACE, LOC_TYPEDEF, + STRUCT_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, 0, 0, cu_language, objfile); if (cu_language == language_cplus) { /* For C++, these implicitly act as typedefs as well. */ add_psymbol_to_list (dip->at_name, strlen (dip->at_name), - VAR_NAMESPACE, LOC_TYPEDEF, + VAR_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, 0, 0, cu_language, objfile); } @@ -2820,7 +2820,7 @@ new_symbol (struct dieinfo *dip, struct objfile *objfile) OBJSTAT (objfile, n_syms++); memset (sym, 0, sizeof (struct symbol)); /* default assumptions */ - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_CLASS (sym) = LOC_STATIC; SYMBOL_TYPE (sym) = decode_die_type (dip); @@ -2926,12 +2926,12 @@ new_symbol (struct dieinfo *dip, struct objfile *objfile) case TAG_union_type: case TAG_enumeration_type: SYMBOL_CLASS (sym) = LOC_TYPEDEF; - SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE; + SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN; add_symbol_to_list (sym, list_in_scope); break; case TAG_typedef: SYMBOL_CLASS (sym) = LOC_TYPEDEF; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, list_in_scope); break; default: @@ -2983,7 +2983,7 @@ synthesize_typedef (struct dieinfo *dip, struct objfile *objfile, SYMBOL_INIT_LANGUAGE_SPECIFIC (sym, cu_language); SYMBOL_TYPE (sym) = type; SYMBOL_CLASS (sym) = LOC_TYPEDEF; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, list_in_scope); } } diff --git a/gdb/f-exp.y b/gdb/f-exp.y index e25a5d2..495ec6a 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -1141,7 +1141,7 @@ yylex () int hextype; sym = lookup_symbol (tmp, expression_context_block, - VAR_NAMESPACE, + VAR_DOMAIN, current_language->la_language == language_cplus ? &is_a_field_of_this : NULL, NULL); diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 2a4eac3..9ed2d6f 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -30,6 +30,7 @@ #include "language.h" #include "f-lang.h" #include "valprint.h" +#include "value.h" /* The built-in types of F77. FIXME: integer*4 is missing, plain logical is missing (builtin_type_logical is logical*4). */ @@ -167,7 +168,6 @@ f_printstr (struct ui_file *stream, char *string, unsigned int length, unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; - extern int inspect_it; if (length == 0) { @@ -473,6 +473,8 @@ const struct language_defn f_language_defn = f_val_print, /* Print a value using appropriate syntax */ c_value_print, /* FIXME */ NULL, /* Language specific skip_trampoline */ + value_of_this, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ NULL, /* Language specific symbol demangler */ {"", "", "", ""}, /* Binary format info */ {"0%o", "0", "o", ""}, /* Octal format info */ diff --git a/gdb/findvar.c b/gdb/findvar.c index bb1d3a5..1cbecc9 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -252,24 +252,6 @@ store_unsigned_integer (void *addr, int len, ULONGEST val) } } -/* Store the address VAL as a LEN-byte value in target byte order at - ADDR. 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 store_typed_address instead, or something else - based on ADDRESS_TO_POINTER. */ -void -store_address (void *addr, int len, LONGEST val) -{ - store_unsigned_integer (addr, len, val); -} - - /* Store the address ADDR as a pointer of type TYPE at BUF, in target form. */ void @@ -300,7 +282,7 @@ value_of_register (int regnum, struct frame_info *frame) int optim; struct value *reg_val; int realnum; - char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); + char raw_buffer[MAX_REGISTER_SIZE]; enum lval_type lval; /* Builtin registers lie completly outside of the range of normal @@ -351,7 +333,7 @@ value_of_register (int regnum, struct frame_info *frame) CORE_ADDR unsigned_pointer_to_address (struct type *type, const void *buf) { - return extract_address (buf, TYPE_LENGTH (type)); + return extract_unsigned_integer (buf, TYPE_LENGTH (type)); } CORE_ADDR @@ -365,7 +347,7 @@ signed_pointer_to_address (struct type *type, const void *buf) void unsigned_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr) { - store_address (buf, TYPE_LENGTH (type), addr); + store_unsigned_integer (buf, TYPE_LENGTH (type), addr); } void @@ -664,7 +646,7 @@ 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 = (char*) alloca (MAX_REGISTER_RAW_SIZE); + char raw_buffer[MAX_REGISTER_SIZE]; CORE_ADDR addr; int optim; struct value *v = allocate_value (type); @@ -699,7 +681,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) CORE_ADDR last_addr = 0; CORE_ADDR first_addr = 0; - value_bytes = (char *) alloca (len + MAX_REGISTER_RAW_SIZE); + value_bytes = (char *) alloca (len + MAX_REGISTER_SIZE); /* Copy all of the data out, whereever it may be. */ diff --git a/gdb/fork-child.c b/gdb/fork-child.c index 1dc28e8..e1d32b0 100644 --- a/gdb/fork-child.c +++ b/gdb/fork-child.c @@ -88,6 +88,29 @@ breakup_args (char *scratch, char **argv) } +/* When executing a command under the given shell, return non-zero + if the '!' character should be escaped when embedded in a quoted + command-line argument. */ + +static int +escape_bang_in_quoted_argument (const char *shell_file) +{ + const int shell_file_len = strlen (shell_file); + + /* Bang should be escaped only in C Shells. For now, simply check + that the shell name ends with 'csh', which covers at least csh + and tcsh. This should be good enough for now. */ + + if (shell_file_len < 3) + return 0; + + if (shell_file[shell_file_len - 3] == 'c' + && shell_file[shell_file_len - 2] == 's' + && shell_file[shell_file_len - 1] == 'h') + return 1; + + return 0; +} /* Start an inferior Unix child process and sets inferior_ptid to its pid. EXEC_FILE is the file to run. @@ -171,6 +194,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, char *p; int need_to_quote; + const int escape_bang = escape_bang_in_quoted_argument (shell_file); strcat (shell_command, "exec "); @@ -215,7 +239,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, { if (*p == '\'') strcat (shell_command, "'\\''"); - else if (*p == '!') + else if (*p == '!' && escape_bang) strcat (shell_command, "\\!"); else strncat (shell_command, p, 1); @@ -404,9 +428,6 @@ startup_inferior (int ntraps) inferior_ignoring_leading_exec_events = target_reported_exec_events_per_exec_call () - 1; -#ifdef STARTUP_INFERIOR - STARTUP_INFERIOR (pending_execs); -#else while (1) { /* Make wait_for_inferior be quiet */ @@ -444,6 +465,5 @@ startup_inferior (int ntraps) resume (0, TARGET_SIGNAL_0); /* Just make it go on */ } } -#endif /* STARTUP_INFERIOR */ stop_soon = NO_STOP_QUIETLY; } diff --git a/gdb/frame.c b/gdb/frame.c index 4af3d6c..07e0e5b 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -139,7 +139,7 @@ static int frame_debug; static int backtrace_below_main; -static void +void fprint_frame_id (struct ui_file *file, struct frame_id id) { fprintf_unfiltered (file, "{stack=0x%s,code=0x%s}", @@ -376,7 +376,7 @@ frame_pc_unwind (struct frame_info *this_frame) implementation is no more than: frame_unwind_register (this_frame, ISA_PC_REGNUM, buf); - return extract_address (buf, size of ISA_PC_REGNUM); + return extract_unsigned_integer (buf, size of ISA_PC_REGNUM); Note: this method is very heavily dependent on a correct register-unwind implementation, it pays to fix that @@ -618,7 +618,7 @@ void frame_unwind_signed_register (struct frame_info *frame, int regnum, LONGEST *val) { - void *buf = alloca (MAX_REGISTER_RAW_SIZE); + char buf[MAX_REGISTER_SIZE]; frame_unwind_register (frame, regnum, buf); (*val) = extract_signed_integer (buf, REGISTER_VIRTUAL_SIZE (regnum)); } @@ -627,7 +627,7 @@ void frame_unwind_unsigned_register (struct frame_info *frame, int regnum, ULONGEST *val) { - void *buf = alloca (MAX_REGISTER_RAW_SIZE); + char buf[MAX_REGISTER_SIZE]; frame_unwind_register (frame, regnum, buf); (*val) = extract_unsigned_integer (buf, REGISTER_VIRTUAL_SIZE (regnum)); } @@ -983,8 +983,10 @@ legacy_saved_regs_prev_register (struct frame_info *next_frame, *addrp = 0; *realnump = -1; if (bufferp != NULL) - store_address (bufferp, REGISTER_RAW_SIZE (regnum), - get_frame_saved_regs (frame)[regnum]); + /* NOTE: cagney/2003-05-09: In-lined store_address with + it's body - store_unsigned_integer. */ + store_unsigned_integer (bufferp, REGISTER_RAW_SIZE (regnum), + get_frame_saved_regs (frame)[regnum]); } else { @@ -1110,8 +1112,8 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized, fly, constructs either a raw or pseudo register from the raw register cache. */ regcache_raw_read - (generic_find_dummy_frame (get_frame_pc (frame), - get_frame_base (frame)), + (deprecated_find_dummy_frame_regcache (get_frame_pc (frame), + get_frame_base (frame)), regnum, raw_buffer); return; } @@ -1125,8 +1127,11 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized, if (regnum == SP_REGNUM) { if (raw_buffer) /* SP register treated specially */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - get_frame_saved_regs (frame)[regnum]); + /* NOTE: cagney/2003-05-09: In-line store_address + with it's body - store_unsigned_integer. */ + store_unsigned_integer (raw_buffer, + REGISTER_RAW_SIZE (regnum), + get_frame_saved_regs (frame)[regnum]); } else { @@ -2069,7 +2074,12 @@ get_frame_type (struct frame_info *frame) if (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES && deprecated_frame_in_dummy (frame)) return DUMMY_FRAME; - if (frame->unwind == NULL) + + /* Some legacy code, e.g, mips_init_extra_frame_info() wants + to determine the frame's type prior to it being completely + initialized. Don't attempt to lazily initialize ->unwind for + legacy code. It will be initialized in legacy_get_prev_frame(). */ + if (frame->unwind == NULL && !legacy_frame_p (current_gdbarch)) { /* Initialize the frame's unwinder because it is that which provides the frame's type. */ diff --git a/gdb/frame.h b/gdb/frame.h index f21e017..ba7d5ad 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -28,6 +28,7 @@ struct frame_unwind; struct frame_base; struct block; struct gdbarch; +struct ui_file; /* A legacy unwinder to prop up architectures using the old style saved regs array. */ @@ -95,6 +96,10 @@ extern int frame_id_eq (struct frame_id l, struct frame_id r); above about frameless functions. */ extern int frame_id_inner (struct frame_id l, struct frame_id r); +/* Write the internal representation of a frame ID on the specified + stream. */ +extern void fprint_frame_id (struct ui_file *file, struct frame_id id); + /* For every stopped thread, GDB tracks two frames: current and selected. Current frame is the inner most frame of the selected diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index d45a76d..c26af4d 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -843,7 +843,7 @@ frv_push_arguments (int nargs, struct value **args, CORE_ADDR sp, if (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION) { - store_address (valbuf, 4, VALUE_ADDRESS (arg)); + store_unsigned_integer (valbuf, 4, VALUE_ADDRESS (arg)); typecode = TYPE_CODE_PTR; len = 4; val = valbuf; @@ -1057,8 +1057,8 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_pc_regnum (gdbarch, pc_regnum); set_gdbarch_register_name (gdbarch, frv_register_name); - set_gdbarch_register_size (gdbarch, 4); - set_gdbarch_register_bytes (gdbarch, frv_num_regs * 4); + 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_max_register_raw_size (gdbarch, 4); @@ -1092,8 +1092,8 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_push_return_address (gdbarch, frv_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, frv_pop_frame); - set_gdbarch_call_dummy_words (gdbarch, frv_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (frv_call_dummy_words)); + set_gdbarch_deprecated_call_dummy_words (gdbarch, frv_call_dummy_words); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (frv_call_dummy_words)); set_gdbarch_deprecated_init_extra_frame_info (gdbarch, frv_init_extra_frame_info); /* Settings that should be unnecessary. */ diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index bda28c7..976ce59 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -167,8 +167,8 @@ 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 register_size; - int register_bytes; + int deprecated_register_size; + int deprecated_register_bytes; gdbarch_register_byte_ftype *register_byte; gdbarch_register_raw_size_ftype *register_raw_size; int deprecated_max_register_raw_size; @@ -188,14 +188,15 @@ struct gdbarch int deprecated_use_generic_dummy_frames; int call_dummy_location; gdbarch_call_dummy_address_ftype *call_dummy_address; - CORE_ADDR call_dummy_start_offset; - CORE_ADDR call_dummy_breakpoint_offset; - int call_dummy_length; + 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 * call_dummy_words; - int sizeof_call_dummy_words; + LONGEST * deprecated_call_dummy_words; + int deprecated_sizeof_call_dummy_words; int deprecated_call_dummy_stack_adjust; - gdbarch_fix_call_dummy_ftype *fix_call_dummy; + gdbarch_deprecated_fix_call_dummy_ftype *deprecated_fix_call_dummy; + gdbarch_push_dummy_code_ftype *push_dummy_code; 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; @@ -401,6 +402,7 @@ struct gdbarch startup_gdbarch = 0, 0, 0, + generic_remote_translate_xfer_address, 0, 0, 0, @@ -514,8 +516,6 @@ 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_size = -1; - current_gdbarch->register_bytes = -1; current_gdbarch->register_byte = generic_register_byte; current_gdbarch->register_raw_size = generic_register_size; current_gdbarch->register_virtual_size = generic_register_size; @@ -527,8 +527,8 @@ gdbarch_alloc (const struct gdbarch_info *info, 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->call_dummy_words = legacy_call_dummy_words; - current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words; + 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->convert_register_p = legacy_convert_register_p; current_gdbarch->register_to_value = legacy_register_to_value; @@ -540,7 +540,6 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->store_return_value = legacy_store_return_value; current_gdbarch->use_struct_convention = generic_use_struct_convention; current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p; - current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc; 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; @@ -643,13 +642,7 @@ 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 */ - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->register_size == -1)) - fprintf_unfiltered (log, "\n\tregister_size"); - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->register_bytes == -1)) - fprintf_unfiltered (log, "\n\tregister_bytes"); - /* Skip verify of register_byte, invalid_p == 0 */ + /* Skip verify of register_byte, has predicate */ /* Skip verify of register_raw_size, invalid_p == 0 */ /* Skip verify of deprecated_max_register_raw_size, has predicate */ /* Skip verify of register_virtual_size, invalid_p == 0 */ @@ -669,10 +662,11 @@ verify_gdbarch (struct gdbarch *gdbarch) /* 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 call_dummy_words, invalid_p == 0 */ - /* Skip verify of sizeof_call_dummy_words, 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 fix_call_dummy, 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 */ @@ -706,7 +700,9 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->inner_than == 0)) fprintf_unfiltered (log, "\n\tinner_than"); - /* Skip verify of breakpoint_from_pc, invalid_p == 0 */ + if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) + && (gdbarch->breakpoint_from_pc == 0)) + fprintf_unfiltered (log, "\n\tbreakpoint_from_pc"); /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */ /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) @@ -921,22 +917,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->call_dummy_address /*CALL_DUMMY_ADDRESS ()*/); #endif -#ifdef CALL_DUMMY_BREAKPOINT_OFFSET - fprintf_unfiltered (file, - "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n", - XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET)); - fprintf_unfiltered (file, - "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = %ld\n", - (long) CALL_DUMMY_BREAKPOINT_OFFSET); -#endif -#ifdef CALL_DUMMY_LENGTH - fprintf_unfiltered (file, - "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n", - XSTRING (CALL_DUMMY_LENGTH)); - fprintf_unfiltered (file, - "gdbarch_dump: CALL_DUMMY_LENGTH = %d\n", - CALL_DUMMY_LENGTH); -#endif #ifdef CALL_DUMMY_LOCATION fprintf_unfiltered (file, "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n", @@ -945,22 +925,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: CALL_DUMMY_LOCATION = %d\n", CALL_DUMMY_LOCATION); #endif -#ifdef CALL_DUMMY_START_OFFSET - fprintf_unfiltered (file, - "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n", - XSTRING (CALL_DUMMY_START_OFFSET)); - fprintf_unfiltered (file, - "gdbarch_dump: CALL_DUMMY_START_OFFSET = %ld\n", - (long) CALL_DUMMY_START_OFFSET); -#endif -#ifdef CALL_DUMMY_WORDS - fprintf_unfiltered (file, - "gdbarch_dump: CALL_DUMMY_WORDS # %s\n", - XSTRING (CALL_DUMMY_WORDS)); - fprintf_unfiltered (file, - "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n", - (long) CALL_DUMMY_WORDS); -#endif #ifdef CANNOT_FETCH_REGISTER fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1039,6 +1003,22 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n", (long) DECR_PC_AFTER_BREAK); #endif +#ifdef DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET # %s\n", + XSTRING (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET)); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET = %ld\n", + (long) DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET); +#endif +#ifdef DEPRECATED_CALL_DUMMY_LENGTH + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_CALL_DUMMY_LENGTH # %s\n", + XSTRING (DEPRECATED_CALL_DUMMY_LENGTH)); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_CALL_DUMMY_LENGTH = %d\n", + DEPRECATED_CALL_DUMMY_LENGTH); +#endif #ifdef DEPRECATED_CALL_DUMMY_STACK_ADJUST_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1056,6 +1036,22 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: DEPRECATED_CALL_DUMMY_STACK_ADJUST = %d\n", DEPRECATED_CALL_DUMMY_STACK_ADJUST); #endif +#ifdef DEPRECATED_CALL_DUMMY_START_OFFSET + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_CALL_DUMMY_START_OFFSET # %s\n", + XSTRING (DEPRECATED_CALL_DUMMY_START_OFFSET)); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_CALL_DUMMY_START_OFFSET = %ld\n", + (long) DEPRECATED_CALL_DUMMY_START_OFFSET); +#endif +#ifdef DEPRECATED_CALL_DUMMY_WORDS + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_CALL_DUMMY_WORDS # %s\n", + XSTRING (DEPRECATED_CALL_DUMMY_WORDS)); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_CALL_DUMMY_WORDS = 0x%08lx\n", + (long) DEPRECATED_CALL_DUMMY_WORDS); +#endif #ifdef DEPRECATED_DO_REGISTERS_INFO_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1144,6 +1140,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED = %d\n", DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED); #endif +#ifdef DEPRECATED_FIX_CALL_DUMMY_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_FIX_CALL_DUMMY_P()", + XSTRING (DEPRECATED_FIX_CALL_DUMMY_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_FIX_CALL_DUMMY_P() = %d\n", + DEPRECATED_FIX_CALL_DUMMY_P ()); +#endif +#ifdef DEPRECATED_FIX_CALL_DUMMY +#if GDB_MULTI_ARCH + /* Macro might contain `[{}]' when not multi-arch */ + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)", + XSTRING (DEPRECATED_FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p))); +#endif + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_FIX_CALL_DUMMY = <0x%08lx>\n", + (long) current_gdbarch->deprecated_fix_call_dummy + /*DEPRECATED_FIX_CALL_DUMMY ()*/); +#endif #ifdef DEPRECATED_FP_REGNUM fprintf_unfiltered (file, "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n", @@ -1461,6 +1480,22 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->deprecated_push_return_address /*DEPRECATED_PUSH_RETURN_ADDRESS ()*/); #endif +#ifdef DEPRECATED_REGISTER_BYTES + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_REGISTER_BYTES # %s\n", + XSTRING (DEPRECATED_REGISTER_BYTES)); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_REGISTER_BYTES = %d\n", + DEPRECATED_REGISTER_BYTES); +#endif +#ifdef DEPRECATED_REGISTER_SIZE + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n", + XSTRING (DEPRECATED_REGISTER_SIZE)); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_REGISTER_SIZE = %d\n", + DEPRECATED_REGISTER_SIZE); +#endif #ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1481,6 +1516,14 @@ 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_SIZEOF_CALL_DUMMY_WORDS + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_SIZEOF_CALL_DUMMY_WORDS # %s\n", + XSTRING (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_SIZEOF_CALL_DUMMY_WORDS = %d\n", + DEPRECATED_SIZEOF_CALL_DUMMY_WORDS); +#endif #ifdef DEPRECATED_STORE_RETURN_VALUE #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1650,29 +1693,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->extract_struct_value_address /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/); #endif -#ifdef FIX_CALL_DUMMY_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "FIX_CALL_DUMMY_P()", - XSTRING (FIX_CALL_DUMMY_P ())); - fprintf_unfiltered (file, - "gdbarch_dump: FIX_CALL_DUMMY_P() = %d\n", - FIX_CALL_DUMMY_P ()); -#endif -#ifdef FIX_CALL_DUMMY -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)", - XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p))); -#endif - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: FIX_CALL_DUMMY = <0x%08lx>\n", - (long) current_gdbarch->fix_call_dummy - /*FIX_CALL_DUMMY ()*/); -#endif #ifdef FP0_REGNUM fprintf_unfiltered (file, "gdbarch_dump: FP0_REGNUM # %s\n", @@ -1972,6 +1992,23 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: push_dummy_call = 0x%08lx\n", (long) current_gdbarch->push_dummy_call); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n", + gdbarch_push_dummy_code_p (current_gdbarch)); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: push_dummy_code = 0x%08lx\n", + (long) current_gdbarch->push_dummy_code); +#ifdef REGISTER_BYTE_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "REGISTER_BYTE_P()", + XSTRING (REGISTER_BYTE_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: REGISTER_BYTE_P() = %d\n", + REGISTER_BYTE_P ()); +#endif #ifdef REGISTER_BYTE fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1983,14 +2020,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->register_byte /*REGISTER_BYTE ()*/); #endif -#ifdef REGISTER_BYTES - fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_BYTES # %s\n", - XSTRING (REGISTER_BYTES)); - fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_BYTES = %d\n", - REGISTER_BYTES); -#endif #ifdef REGISTER_BYTES_OK_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2083,14 +2112,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->register_sim_regno /*REGISTER_SIM_REGNO ()*/); #endif -#ifdef REGISTER_SIZE - fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_SIZE # %s\n", - XSTRING (REGISTER_SIZE)); - fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_SIZE = %d\n", - REGISTER_SIZE); -#endif #ifdef REGISTER_TO_VALUE #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -2164,20 +2185,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->reg_struct_has_addr /*REG_STRUCT_HAS_ADDR ()*/); #endif -#ifdef REMOTE_TRANSLATE_XFER_ADDRESS -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)", - XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len))); -#endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = <0x%08lx>\n", - (long) current_gdbarch->remote_translate_xfer_address - /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/); -#endif + "gdbarch_dump: remote_translate_xfer_address = 0x%08lx\n", + (long) current_gdbarch->remote_translate_xfer_address); #ifdef RETURN_VALUE_ON_STACK fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2263,14 +2274,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->sigtramp_start /*SIGTRAMP_START ()*/); #endif -#ifdef SIZEOF_CALL_DUMMY_WORDS - fprintf_unfiltered (file, - "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n", - XSTRING (SIZEOF_CALL_DUMMY_WORDS)); - fprintf_unfiltered (file, - "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = %d\n", - SIZEOF_CALL_DUMMY_WORDS); -#endif #ifdef SKIP_PROLOGUE fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -3283,41 +3286,42 @@ set_gdbarch_register_name (struct gdbarch *gdbarch, } int -gdbarch_register_size (struct gdbarch *gdbarch) +gdbarch_deprecated_register_size (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_size == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_size invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n"); - return gdbarch->register_size; + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n"); + return gdbarch->deprecated_register_size; } void -set_gdbarch_register_size (struct gdbarch *gdbarch, - int register_size) +set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, + int deprecated_register_size) { - gdbarch->register_size = register_size; + gdbarch->deprecated_register_size = deprecated_register_size; } int -gdbarch_register_bytes (struct gdbarch *gdbarch) +gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_bytes == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_bytes invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n"); - return gdbarch->register_bytes; + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_bytes called\n"); + return gdbarch->deprecated_register_bytes; } void -set_gdbarch_register_bytes (struct gdbarch *gdbarch, - int register_bytes) +set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch, + int deprecated_register_bytes) { - gdbarch->register_bytes = register_bytes; + gdbarch->deprecated_register_bytes = deprecated_register_bytes; +} + +int +gdbarch_register_byte_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->register_byte != generic_register_byte; } int @@ -3327,6 +3331,7 @@ gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr) if (gdbarch->register_byte == 0) internal_error (__FILE__, __LINE__, "gdbarch: gdbarch_register_byte invalid"); + /* Ignore predicate (gdbarch->register_byte != generic_register_byte). */ if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n"); return gdbarch->register_byte (reg_nr); @@ -3735,51 +3740,51 @@ set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, } CORE_ADDR -gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch) +gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n"); - return gdbarch->call_dummy_start_offset; + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_start_offset called\n"); + return gdbarch->deprecated_call_dummy_start_offset; } void -set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, - CORE_ADDR call_dummy_start_offset) +set_gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch, + CORE_ADDR deprecated_call_dummy_start_offset) { - gdbarch->call_dummy_start_offset = call_dummy_start_offset; + gdbarch->deprecated_call_dummy_start_offset = deprecated_call_dummy_start_offset; } CORE_ADDR -gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch) +gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n"); - return gdbarch->call_dummy_breakpoint_offset; + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_breakpoint_offset called\n"); + return gdbarch->deprecated_call_dummy_breakpoint_offset; } void -set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, - CORE_ADDR call_dummy_breakpoint_offset) +set_gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, + CORE_ADDR deprecated_call_dummy_breakpoint_offset) { - gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset; + gdbarch->deprecated_call_dummy_breakpoint_offset = deprecated_call_dummy_breakpoint_offset; } int -gdbarch_call_dummy_length (struct gdbarch *gdbarch) +gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n"); - return gdbarch->call_dummy_length; + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_length called\n"); + return gdbarch->deprecated_call_dummy_length; } void -set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, - int call_dummy_length) +set_gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch, + int deprecated_call_dummy_length) { - gdbarch->call_dummy_length = call_dummy_length; + gdbarch->deprecated_call_dummy_length = deprecated_call_dummy_length; } int @@ -3810,37 +3815,37 @@ set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, } LONGEST * -gdbarch_call_dummy_words (struct gdbarch *gdbarch) +gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - /* Skip verify of call_dummy_words, invalid_p == 0 */ + /* Skip verify of deprecated_call_dummy_words, invalid_p == 0 */ if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n"); - return gdbarch->call_dummy_words; + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_words called\n"); + return gdbarch->deprecated_call_dummy_words; } void -set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, - LONGEST * call_dummy_words) +set_gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch, + LONGEST * deprecated_call_dummy_words) { - gdbarch->call_dummy_words = call_dummy_words; + gdbarch->deprecated_call_dummy_words = deprecated_call_dummy_words; } int -gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch) +gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */ + /* Skip verify of deprecated_sizeof_call_dummy_words, invalid_p == 0 */ if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n"); - return gdbarch->sizeof_call_dummy_words; + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_sizeof_call_dummy_words called\n"); + return gdbarch->deprecated_sizeof_call_dummy_words; } void -set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, - int sizeof_call_dummy_words) +set_gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch, + int deprecated_sizeof_call_dummy_words) { - gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words; + gdbarch->deprecated_sizeof_call_dummy_words = deprecated_sizeof_call_dummy_words; } int @@ -3867,29 +3872,55 @@ set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch, } int -gdbarch_fix_call_dummy_p (struct gdbarch *gdbarch) +gdbarch_deprecated_fix_call_dummy_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_fix_call_dummy != 0; +} + +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); - return gdbarch->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 -gdbarch_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) +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->fix_call_dummy == 0) + if (gdbarch->push_dummy_code == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_fix_call_dummy invalid"); + "gdbarch: gdbarch_push_dummy_code invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n"); - gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p); + 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_fix_call_dummy (struct gdbarch *gdbarch, - gdbarch_fix_call_dummy_ftype fix_call_dummy) +set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, + gdbarch_push_dummy_code_ftype push_dummy_code) { - gdbarch->fix_call_dummy = fix_call_dummy; + gdbarch->push_dummy_code = push_dummy_code; } int @@ -4726,7 +4757,7 @@ set_gdbarch_function_start_offset (struct gdbarch *gdbarch, } void -gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len) +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) { gdb_assert (gdbarch != NULL); if (gdbarch->remote_translate_xfer_address == 0) @@ -4734,7 +4765,7 @@ gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_ad "gdbarch: gdbarch_remote_translate_xfer_address invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n"); - gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len); + gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len); } void diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index f95e709..e80836f 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -721,26 +721,48 @@ extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register #endif #endif -extern int gdbarch_register_size (struct gdbarch *gdbarch); -extern void set_gdbarch_register_size (struct gdbarch *gdbarch, int register_size); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIZE) -#error "Non multi-arch definition of REGISTER_SIZE" +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 GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIZE) -#define REGISTER_SIZE (gdbarch_register_size (current_gdbarch)) +#if !defined (DEPRECATED_REGISTER_SIZE) +#define DEPRECATED_REGISTER_SIZE (gdbarch_deprecated_register_size (current_gdbarch)) +#endif + +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) +#error "Non multi-arch definition of DEPRECATED_REGISTER_BYTES" #endif +#if !defined (DEPRECATED_REGISTER_BYTES) +#define DEPRECATED_REGISTER_BYTES (gdbarch_deprecated_register_bytes (current_gdbarch)) #endif -extern int gdbarch_register_bytes (struct gdbarch *gdbarch); -extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_bytes); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES) -#error "Non multi-arch definition of 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. */ + +#if defined (REGISTER_BYTE) +/* Legacy for systems yet to multi-arch REGISTER_BYTE */ +#if !defined (REGISTER_BYTE_P) +#define REGISTER_BYTE_P() (1) #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES) -#define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch)) #endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE_P) +#define REGISTER_BYTE_P() (0) +#endif + +extern int gdbarch_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)) #endif /* Default (function) for non- multi-arch platforms. */ @@ -760,10 +782,8 @@ extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register #endif #endif -/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, - MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, - REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced - by REGISTER_TYPE. */ +/* 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_RAW_SIZE) @@ -782,10 +802,9 @@ extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_regi #endif #endif -/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, - MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, - REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced - by REGISTER_TYPE. */ +/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and + DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by + MAX_REGISTER_SIZE (a constant). */ #if defined (DEPRECATED_MAX_REGISTER_RAW_SIZE) /* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_RAW_SIZE */ @@ -823,10 +842,8 @@ extern void set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarc #endif #endif -/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, - MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, - REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced - by REGISTER_TYPE. */ +/* 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) @@ -845,10 +862,9 @@ extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_ #endif #endif -/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, - MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, - REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced - by REGISTER_TYPE. */ +/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and + DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by + MAX_REGISTER_SIZE (a constant). */ #if defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE) /* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE */ @@ -886,10 +902,8 @@ extern void set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gd #endif #endif -/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, - MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, - REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE have all being replaced - by REGISTER_TYPE. */ +/* The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and + REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE. */ #if defined (REGISTER_VIRTUAL_TYPE) /* Legacy for systems yet to multi-arch REGISTER_VIRTUAL_TYPE */ @@ -1139,6 +1153,8 @@ extern void set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdb #define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (gdbarch_deprecated_use_generic_dummy_frames (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) @@ -1153,6 +1169,8 @@ 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 ()) @@ -1170,31 +1188,37 @@ extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_cal #endif #endif -extern CORE_ADDR gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch); -extern void set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_START_OFFSET) -#error "Non multi-arch definition of CALL_DUMMY_START_OFFSET" +/* Replaced by push_dummy_code. */ + +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); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_START_OFFSET) +#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_START_OFFSET" #endif -#if !defined (CALL_DUMMY_START_OFFSET) -#define CALL_DUMMY_START_OFFSET (gdbarch_call_dummy_start_offset (current_gdbarch)) +#if !defined (DEPRECATED_CALL_DUMMY_START_OFFSET) +#define DEPRECATED_CALL_DUMMY_START_OFFSET (gdbarch_deprecated_call_dummy_start_offset (current_gdbarch)) #endif -extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch); -extern void set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET) -#error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET" +/* Replaced by push_dummy_code. */ + +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); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET) +#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET" #endif -#if !defined (CALL_DUMMY_BREAKPOINT_OFFSET) -#define CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_call_dummy_breakpoint_offset (current_gdbarch)) +#if !defined (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET) +#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch)) #endif -extern int gdbarch_call_dummy_length (struct gdbarch *gdbarch); -extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dummy_length); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LENGTH) -#error "Non multi-arch definition of CALL_DUMMY_LENGTH" +/* Replaced by push_dummy_code. */ + +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); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_LENGTH) +#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_LENGTH" #endif -#if !defined (CALL_DUMMY_LENGTH) -#define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch)) +#if !defined (DEPRECATED_CALL_DUMMY_LENGTH) +#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 @@ -1240,34 +1264,40 @@ extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gd #endif #endif +/* Replaced by push_dummy_code. */ + /* Default (value) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_WORDS) -#define CALL_DUMMY_WORDS (legacy_call_dummy_words) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_WORDS) +#define DEPRECATED_CALL_DUMMY_WORDS (legacy_call_dummy_words) #endif -extern LONGEST * gdbarch_call_dummy_words (struct gdbarch *gdbarch); -extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * call_dummy_words); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_WORDS) -#error "Non multi-arch definition of CALL_DUMMY_WORDS" +extern LONGEST * gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch); +extern void set_gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch, LONGEST * deprecated_call_dummy_words); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_WORDS) +#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_WORDS" #endif -#if !defined (CALL_DUMMY_WORDS) -#define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch)) +#if !defined (DEPRECATED_CALL_DUMMY_WORDS) +#define DEPRECATED_CALL_DUMMY_WORDS (gdbarch_deprecated_call_dummy_words (current_gdbarch)) #endif +/* Replaced by push_dummy_code. */ + /* Default (value) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (SIZEOF_CALL_DUMMY_WORDS) -#define SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS) +#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words) #endif -extern int gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch); -extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int sizeof_call_dummy_words); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIZEOF_CALL_DUMMY_WORDS) -#error "Non multi-arch definition of SIZEOF_CALL_DUMMY_WORDS" +extern int gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch); +extern void set_gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch, int deprecated_sizeof_call_dummy_words); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS) +#error "Non multi-arch definition of DEPRECATED_SIZEOF_CALL_DUMMY_WORDS" #endif -#if !defined (SIZEOF_CALL_DUMMY_WORDS) -#define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch)) +#if !defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS) +#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS (gdbarch_deprecated_sizeof_call_dummy_words (current_gdbarch)) #endif +/* Replaced by push_dummy_code. */ + #if defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) /* Legacy for systems yet to multi-arch DEPRECATED_CALL_DUMMY_STACK_ADJUST */ #if !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P) @@ -1304,43 +1334,53 @@ extern void set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdba #endif #endif -#if defined (FIX_CALL_DUMMY) -/* Legacy for systems yet to multi-arch FIX_CALL_DUMMY */ -#if !defined (FIX_CALL_DUMMY_P) -#define FIX_CALL_DUMMY_P() (1) +/* Replaced by push_dummy_code. */ + +#if defined (DEPRECATED_FIX_CALL_DUMMY) +/* Legacy for systems yet to multi-arch DEPRECATED_FIX_CALL_DUMMY */ +#if !defined (DEPRECATED_FIX_CALL_DUMMY_P) +#define DEPRECATED_FIX_CALL_DUMMY_P() (1) #endif #endif /* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (FIX_CALL_DUMMY_P) -#define FIX_CALL_DUMMY_P() (0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FIX_CALL_DUMMY_P) +#define DEPRECATED_FIX_CALL_DUMMY_P() (0) #endif -extern int gdbarch_fix_call_dummy_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY_P) -#error "Non multi-arch definition of FIX_CALL_DUMMY" +extern int gdbarch_deprecated_fix_call_dummy_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FIX_CALL_DUMMY_P) +#error "Non multi-arch definition of DEPRECATED_FIX_CALL_DUMMY" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY_P) -#define FIX_CALL_DUMMY_P() (gdbarch_fix_call_dummy_p (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FIX_CALL_DUMMY_P) +#define DEPRECATED_FIX_CALL_DUMMY_P() (gdbarch_deprecated_fix_call_dummy_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (FIX_CALL_DUMMY) -#define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (internal_error (__FILE__, __LINE__, "FIX_CALL_DUMMY"), 0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FIX_CALL_DUMMY) +#define DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (internal_error (__FILE__, __LINE__, "DEPRECATED_FIX_CALL_DUMMY"), 0) #endif -typedef void (gdbarch_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p); -extern void gdbarch_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); -extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY) -#error "Non multi-arch definition of FIX_CALL_DUMMY" +typedef void (gdbarch_deprecated_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p); +extern 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); +extern void set_gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_fix_call_dummy_ftype *deprecated_fix_call_dummy); +#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 (FIX_CALL_DUMMY) -#define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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. */ + +extern int gdbarch_push_dummy_code_p (struct gdbarch *gdbarch); + +typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (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 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) @@ -2123,11 +2163,6 @@ extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ #endif #endif -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (BREAKPOINT_FROM_PC) -#define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr)) -#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); extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc); @@ -2213,22 +2248,9 @@ extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADD #endif #endif -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (REMOTE_TRANSLATE_XFER_ADDRESS) -#define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (generic_remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len)) -#endif - -typedef void (gdbarch_remote_translate_xfer_address_ftype) (CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); -extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); +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); extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REMOTE_TRANSLATE_XFER_ADDRESS) -#error "Non multi-arch definition of REMOTE_TRANSLATE_XFER_ADDRESS" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REMOTE_TRANSLATE_XFER_ADDRESS) -#define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (gdbarch_remote_translate_xfer_address (current_gdbarch, gdb_addr, gdb_len, rem_addr, rem_len)) -#endif -#endif extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch); extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip); diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 9b059d2..f6106e4 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -472,33 +472,30 @@ 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:2:REGISTER_SIZE:int:register_size::::0:-1 -v:2:REGISTER_BYTES:int:register_bytes::::0:-1 -f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte::0 -# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, -# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, -# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced -# by REGISTER_TYPE. +v::DEPRECATED_REGISTER_SIZE:int:deprecated_register_size +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 REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, -# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, -# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced -# by REGISTER_TYPE. +# The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and +# DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by +# MAX_REGISTER_SIZE (a constant). V:2:DEPRECATED_MAX_REGISTER_RAW_SIZE:int:deprecated_max_register_raw_size -# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, -# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, -# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced -# by REGISTER_TYPE. +# 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 REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, -# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, -# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced -# by REGISTER_TYPE. +# The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and +# DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by +# MAX_REGISTER_SIZE (a constant). V:2:DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE:int:deprecated_max_register_virtual_size -# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, -# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, -# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE have all being replaced -# by REGISTER_TYPE. +# 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: # @@ -523,21 +520,32 @@ F:2:GET_LONGJMP_TARGET:int:get_longjmp_target:CORE_ADDR *pc:pc::0:0 # 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 -v::CALL_DUMMY_START_OFFSET:CORE_ADDR:call_dummy_start_offset -v::CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset -v::CALL_DUMMY_LENGTH:int:call_dummy_length +# 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 -v::CALL_DUMMY_WORDS:LONGEST *:call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx -v::SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0 +# 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 -F::FIX_CALL_DUMMY:void: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 +# 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 # @@ -583,14 +591,14 @@ F:2:DEPRECATED_INIT_EXTRA_FRAME_INFO:void:deprecated_init_extra_frame_info:int f f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0 f:2:PROLOGUE_FRAMELESS_P:int:prologue_frameless_p:CORE_ADDR ip:ip::0:generic_prologue_frameless_p::0 f:2:INNER_THAN:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs::0:0 -f:2:BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::legacy_breakpoint_from_pc::0 +f::BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::0: 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 # -f:2:REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0 +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 # v:2:FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:-1 f:2:FRAMELESS_FUNCTION_INVOCATION:int:frameless_function_invocation:struct frame_info *fi:fi:::generic_frameless_function_invocation_not::0 diff --git a/gdb/gdbcmd.h b/gdb/gdbcmd.h index e626eb5..8c4490e 100644 --- a/gdb/gdbcmd.h +++ b/gdb/gdbcmd.h @@ -98,10 +98,6 @@ extern struct cmd_list_element *maintenanceinfolist; extern struct cmd_list_element *maintenanceprintlist; -/* Chain containing all defined "maintenance list" subcommands. */ - -extern struct cmd_list_element *maintenancelistlist; - extern struct cmd_list_element *setprintlist; extern struct cmd_list_element *showprintlist; diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index f336d91..09dea26 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -44,7 +44,6 @@ struct thread_info int num; /* Convenient handle (GDB thread id) */ /* State from wait_for_inferior */ CORE_ADDR prev_pc; - char *prev_func_name; struct breakpoint *step_resume_breakpoint; struct breakpoint *through_sigtramp_breakpoint; CORE_ADDR step_range_start; @@ -117,7 +116,6 @@ extern struct thread_info *iterate_over_threads (thread_callback_func, void *); /* infrun context switch: save the debugger state for the given thread. */ extern void save_infrun_state (ptid_t ptid, CORE_ADDR prev_pc, - char *prev_func_name, int trap_expected, struct breakpoint *step_resume_breakpoint, struct breakpoint *through_sigtramp_breakpoint, @@ -137,7 +135,6 @@ extern void save_infrun_state (ptid_t ptid, for the given thread. */ extern void load_infrun_state (ptid_t ptid, CORE_ADDR *prev_pc, - char **prev_func_name, int *trap_expected, struct breakpoint **step_resume_breakpoint, struct breakpoint **through_sigtramp_breakpoint, diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index c3c6581..78abf12 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1058,7 +1058,7 @@ lookup_typename (const char *name, struct block *block, int noerr) register struct symbol *sym; register struct type *tmp; - sym = lookup_symbol (name, block, VAR_NAMESPACE, 0, (struct symtab **) NULL); + sym = lookup_symbol (name, block, VAR_DOMAIN, 0, (struct symtab **) NULL); if (sym == NULL || SYMBOL_CLASS (sym) != LOC_TYPEDEF) { tmp = lookup_primitive_typename (name); @@ -1111,7 +1111,7 @@ lookup_struct (char *name, struct block *block) { register struct symbol *sym; - sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0, + sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0, (struct symtab **) NULL); if (sym == NULL) @@ -1134,7 +1134,7 @@ lookup_union (char *name, struct block *block) register struct symbol *sym; struct type *t; - sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0, + sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0, (struct symtab **) NULL); if (sym == NULL) @@ -1165,7 +1165,7 @@ lookup_enum (char *name, struct block *block) { register struct symbol *sym; - sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0, + sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0, (struct symtab **) NULL); if (sym == NULL) { @@ -1191,7 +1191,7 @@ lookup_template_type (char *name, struct type *type, struct block *block) strcat (nam, TYPE_NAME (type)); strcat (nam, " >"); /* FIXME, extra space still introduced in gcc? */ - sym = lookup_symbol (nam, block, VAR_NAMESPACE, 0, (struct symtab **) NULL); + sym = lookup_symbol (nam, block, VAR_DOMAIN, 0, (struct symtab **) NULL); if (sym == NULL) { @@ -1386,7 +1386,7 @@ check_typedef (struct type *type) name = type_name_no_tag (type); /* FIXME: shouldn't we separately check the TYPE_NAME and the - TYPE_TAG_NAME, and look in STRUCT_NAMESPACE and/or VAR_NAMESPACE + TYPE_TAG_NAME, and look in STRUCT_DOMAIN and/or VAR_DOMAIN as appropriate? (this code was written before TYPE_NAME and TYPE_TAG_NAME were separate). */ if (name == NULL) @@ -1394,7 +1394,7 @@ check_typedef (struct type *type) stub_noname_complaint (); return type; } - sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0, + sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0, (struct symtab **) NULL); if (sym) TYPE_TARGET_TYPE (type) = SYMBOL_TYPE (sym); @@ -1430,7 +1430,7 @@ check_typedef (struct type *type) { const char *name = type_name_no_tag (type); /* FIXME: shouldn't we separately check the TYPE_NAME and the - TYPE_TAG_NAME, and look in STRUCT_NAMESPACE and/or VAR_NAMESPACE + TYPE_TAG_NAME, and look in STRUCT_DOMAIN and/or VAR_DOMAIN as appropriate? (this code was written before TYPE_NAME and TYPE_TAG_NAME were separate). */ struct symbol *sym; @@ -1439,7 +1439,7 @@ check_typedef (struct type *type) stub_noname_complaint (); return type; } - sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0, (struct symtab **) NULL); + sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0, (struct symtab **) NULL); if (sym) make_cv_type (is_const, is_volatile, SYMBOL_TYPE (sym), &type); } diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 56ca42d..0d173e0 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -282,7 +282,7 @@ struct main_type /* Name of this type, or NULL if none. This is used for printing only, except by poorly designed C++ code. - For looking up a name, look for a symbol in the VAR_NAMESPACE. */ + For looking up a name, look for a symbol in the VAR_DOMAIN. */ char *name; @@ -293,7 +293,7 @@ struct main_type with this feature. This is used for printing only, except by poorly designed C++ code. - For looking up a name, look for a symbol in the STRUCT_NAMESPACE. + For looking up a name, look for a symbol in the STRUCT_DOMAIN. One more legitimate use is that if TYPE_FLAG_STUB is set, this is the name to use to look for definitions in other files. */ diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index 7e66ee9..da2a2d6 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -255,7 +255,7 @@ gnuv3_rtti_type (struct value *value, class_name = vtable_symbol_name + 11; /* Try to look up the class name as a type name. */ - class_symbol = lookup_symbol (class_name, 0, STRUCT_NAMESPACE, 0, 0); + class_symbol = lookup_symbol (class_name, 0, STRUCT_DOMAIN, 0, 0); if (! class_symbol) { warning ("can't find class named `%s', as given by C++ RTTI", class_name); diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 614bc81..0559805 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -1104,8 +1104,8 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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_register_size (gdbarch, BINWORD); - set_gdbarch_register_bytes (gdbarch, E_NUM_REGS * BINWORD); + 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); @@ -1156,8 +1156,8 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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_call_dummy_words (gdbarch, call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); + set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0); set_gdbarch_breakpoint_from_pc (gdbarch, h8300_breakpoint_from_pc); set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT); diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 343849f..0b84442 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -68,11 +68,33 @@ /* Some local constants. */ static const int hppa_num_regs = 128; +/* 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 + +/* Define offsets into the call dummy for the target function address. + See comments related to CALL_DUMMY for more info. */ +#define FUNC_LDIL_OFFSET (INSTRUCTION_SIZE * 9) +#define FUNC_LDO_OFFSET (INSTRUCTION_SIZE * 10) + +/* Define offsets into the call dummy for the _sr4export address. + See comments related to CALL_DUMMY for more info. */ +#define SR4EXPORT_LDIL_OFFSET (INSTRUCTION_SIZE * 12) +#define SR4EXPORT_LDO_OFFSET (INSTRUCTION_SIZE * 13) + /* To support detection of the pseudo-initial frame that threads have. */ #define THREAD_INITIAL_FRAME_SYMBOL "__pthread_exit" #define THREAD_INITIAL_FRAME_SYM_LEN sizeof(THREAD_INITIAL_FRAME_SYMBOL) +/* Sizes (in bytes) of the native unwind entries. */ +#define UNWIND_ENTRY_SIZE 16 +#define STUB_UNWIND_ENTRY_SIZE 8 + +static int get_field (unsigned word, int from, int to); + static int extract_5_load (unsigned int); static unsigned extract_5R_store (unsigned int); @@ -200,7 +222,7 @@ extern int exception_catchpoints_are_fragile; int hppa_use_struct_convention (int gcc_p, struct type *type) { - return (TYPE_LENGTH (type) > 2 * REGISTER_SIZE); + return (TYPE_LENGTH (type) > 2 * DEPRECATED_REGISTER_SIZE); } @@ -224,6 +246,15 @@ low_sign_extend (unsigned val, unsigned bits) return (int) ((val & 0x1 ? (-1 << (bits - 1)) : 0) | val >> 1); } +/* Extract the bits at positions between FROM and TO, using HP's numbering + (MSB = 0). */ + +static int +get_field (unsigned word, int from, int to) +{ + return ((word) >> (31 - (to)) & ((1 << ((to) - (from) + 1)) - 1)); +} + /* extract the immediate field from a ld{bhw}s instruction */ static int @@ -275,15 +306,15 @@ extract_21 (unsigned word) word &= MASK_21; word <<= 11; - val = GET_FIELD (word, 20, 20); + val = get_field (word, 20, 20); val <<= 11; - val |= GET_FIELD (word, 9, 19); + val |= get_field (word, 9, 19); val <<= 2; - val |= GET_FIELD (word, 5, 6); + val |= get_field (word, 5, 6); val <<= 5; - val |= GET_FIELD (word, 0, 4); + val |= get_field (word, 0, 4); val <<= 2; - val |= GET_FIELD (word, 7, 8); + val |= get_field (word, 7, 8); return sign_extend (val, 21) << 11; } @@ -296,15 +327,15 @@ deposit_21 (unsigned opnd, unsigned word) { unsigned val = 0; - val |= GET_FIELD (opnd, 11 + 14, 11 + 18); + val |= get_field (opnd, 11 + 14, 11 + 18); val <<= 2; - val |= GET_FIELD (opnd, 11 + 12, 11 + 13); + val |= get_field (opnd, 11 + 12, 11 + 13); val <<= 2; - val |= GET_FIELD (opnd, 11 + 19, 11 + 20); + val |= get_field (opnd, 11 + 19, 11 + 20); val <<= 11; - val |= GET_FIELD (opnd, 11 + 1, 11 + 11); + val |= get_field (opnd, 11 + 1, 11 + 11); val <<= 1; - val |= GET_FIELD (opnd, 11 + 0, 11 + 0); + val |= get_field (opnd, 11 + 0, 11 + 0); return word | val; } @@ -314,9 +345,9 @@ deposit_21 (unsigned opnd, unsigned word) static int extract_17 (unsigned word) { - return sign_extend (GET_FIELD (word, 19, 28) | - GET_FIELD (word, 29, 29) << 10 | - GET_FIELD (word, 11, 15) << 11 | + return sign_extend (get_field (word, 19, 28) | + get_field (word, 29, 29) << 10 | + get_field (word, 11, 15) << 11 | (word & 0x1) << 16, 17) << 2; } @@ -642,6 +673,14 @@ find_unwind_entry (CORE_ADDR pc) return NULL; } +const unsigned char * +hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len) +{ + static const char breakpoint[] = {0x00, 0x01, 0x00, 0x04}; + (*len) = sizeof (breakpoint); + return breakpoint; +} + /* Return the adjustment necessary to make for addresses on the stack as presented by hpread.c. @@ -904,16 +943,16 @@ hppa_frame_saved_pc (struct frame_info *frame) /* A call dummy is sized in words, but it is actually a series of instructions. Account for that scaling factor. */ - + ((REGISTER_SIZE / INSTRUCTION_SIZE) - * CALL_DUMMY_LENGTH) + + ((DEPRECATED_REGISTER_SIZE / INSTRUCTION_SIZE) + * DEPRECATED_CALL_DUMMY_LENGTH) /* Similarly we have to account for 64bit wide register saves. */ - + (32 * REGISTER_SIZE) + + (32 * DEPRECATED_REGISTER_SIZE) /* We always consider FP regs 8 bytes long. */ + (NUM_REGS - FP0_REGNUM) * 8 /* Similarly we have to account for 64bit wide register saves. */ - + (6 * REGISTER_SIZE))))) + + (6 * DEPRECATED_REGISTER_SIZE))))) { return read_memory_integer ((get_frame_base (frame) + (TARGET_PTR_BIT == 64 ? -16 : -20)), @@ -1467,24 +1506,24 @@ hppa_push_dummy_frame (void) /* The 32bit and 64bit ABIs save the return pointer into different stack slots. */ - if (REGISTER_SIZE == 8) - write_memory (sp - 16, (char *) &int_buffer, REGISTER_SIZE); + if (DEPRECATED_REGISTER_SIZE == 8) + write_memory (sp - 16, (char *) &int_buffer, DEPRECATED_REGISTER_SIZE); else - write_memory (sp - 20, (char *) &int_buffer, REGISTER_SIZE); + write_memory (sp - 20, (char *) &int_buffer, DEPRECATED_REGISTER_SIZE); int_buffer = deprecated_read_fp (); - write_memory (sp, (char *) &int_buffer, REGISTER_SIZE); + write_memory (sp, (char *) &int_buffer, DEPRECATED_REGISTER_SIZE); write_register (DEPRECATED_FP_REGNUM, sp); - sp += 2 * REGISTER_SIZE; + sp += 2 * DEPRECATED_REGISTER_SIZE; for (regnum = 1; regnum < 32; regnum++) if (regnum != RP_REGNUM && regnum != DEPRECATED_FP_REGNUM) sp = push_word (sp, read_register (regnum)); /* This is not necessary for the 64bit ABI. In fact it is dangerous. */ - if (REGISTER_SIZE != 8) + if (DEPRECATED_REGISTER_SIZE != 8) sp += 4; for (regnum = FP0_REGNUM; regnum < NUM_REGS; regnum++) @@ -1510,37 +1549,37 @@ find_dummy_frame_regs (struct frame_info *frame, int i; /* The 32bit and 64bit ABIs save RP into different locations. */ - if (REGISTER_SIZE == 8) + if (DEPRECATED_REGISTER_SIZE == 8) frame_saved_regs[RP_REGNUM] = (fp - 16) & ~0x3; else frame_saved_regs[RP_REGNUM] = (fp - 20) & ~0x3; frame_saved_regs[DEPRECATED_FP_REGNUM] = fp; - frame_saved_regs[1] = fp + (2 * REGISTER_SIZE); + frame_saved_regs[1] = fp + (2 * DEPRECATED_REGISTER_SIZE); - for (fp += 3 * REGISTER_SIZE, i = 3; i < 32; i++) + for (fp += 3 * DEPRECATED_REGISTER_SIZE, i = 3; i < 32; i++) { if (i != DEPRECATED_FP_REGNUM) { frame_saved_regs[i] = fp; - fp += REGISTER_SIZE; + fp += DEPRECATED_REGISTER_SIZE; } } /* This is not necessary or desirable for the 64bit ABI. */ - if (REGISTER_SIZE != 8) + if (DEPRECATED_REGISTER_SIZE != 8) fp += 4; for (i = FP0_REGNUM; i < NUM_REGS; i++, fp += 8) frame_saved_regs[i] = fp; frame_saved_regs[IPSW_REGNUM] = fp; - frame_saved_regs[SAR_REGNUM] = fp + REGISTER_SIZE; - frame_saved_regs[PCOQ_HEAD_REGNUM] = fp + 2 * REGISTER_SIZE; - frame_saved_regs[PCSQ_HEAD_REGNUM] = fp + 3 * REGISTER_SIZE; - frame_saved_regs[PCOQ_TAIL_REGNUM] = fp + 4 * REGISTER_SIZE; - frame_saved_regs[PCSQ_TAIL_REGNUM] = fp + 5 * REGISTER_SIZE; + frame_saved_regs[SAR_REGNUM] = fp + DEPRECATED_REGISTER_SIZE; + frame_saved_regs[PCOQ_HEAD_REGNUM] = fp + 2 * DEPRECATED_REGISTER_SIZE; + frame_saved_regs[PCSQ_HEAD_REGNUM] = fp + 3 * DEPRECATED_REGISTER_SIZE; + frame_saved_regs[PCOQ_TAIL_REGNUM] = fp + 4 * DEPRECATED_REGISTER_SIZE; + frame_saved_regs[PCSQ_TAIL_REGNUM] = fp + 5 * DEPRECATED_REGISTER_SIZE; } void @@ -1564,7 +1603,7 @@ hppa_pop_frame (void) for (regnum = 31; regnum > 0; regnum--) if (fsr[regnum]) write_register (regnum, read_memory_integer (fsr[regnum], - REGISTER_SIZE)); + DEPRECATED_REGISTER_SIZE)); for (regnum = NUM_REGS - 1; regnum >= FP0_REGNUM; regnum--) if (fsr[regnum]) @@ -1577,18 +1616,18 @@ hppa_pop_frame (void) if (fsr[IPSW_REGNUM]) write_register (IPSW_REGNUM, read_memory_integer (fsr[IPSW_REGNUM], - REGISTER_SIZE)); + DEPRECATED_REGISTER_SIZE)); if (fsr[SAR_REGNUM]) write_register (SAR_REGNUM, read_memory_integer (fsr[SAR_REGNUM], - REGISTER_SIZE)); + DEPRECATED_REGISTER_SIZE)); /* If the PC was explicitly saved, then just restore it. */ if (fsr[PCOQ_TAIL_REGNUM]) { npc = read_memory_integer (fsr[PCOQ_TAIL_REGNUM], - REGISTER_SIZE); + DEPRECATED_REGISTER_SIZE); write_register (PCOQ_TAIL_REGNUM, npc); } /* Else use the value in %rp to set the new PC. */ @@ -1598,7 +1637,7 @@ hppa_pop_frame (void) write_pc (npc); } - write_register (DEPRECATED_FP_REGNUM, read_memory_integer (fp, REGISTER_SIZE)); + write_register (DEPRECATED_FP_REGNUM, read_memory_integer (fp, DEPRECATED_REGISTER_SIZE)); if (fsr[IPSW_REGNUM]) /* call dummy */ write_register (SP_REGNUM, fp - 48); @@ -1667,7 +1706,7 @@ restore_pc_queue (CORE_ADDR *fsr) right place. */ write_register (21, read_memory_integer (fsr[PCSQ_HEAD_REGNUM], - REGISTER_SIZE)); + DEPRECATED_REGISTER_SIZE)); write_register (22, new_pc); for (insn_count = 0; insn_count < 3; insn_count++) @@ -1747,7 +1786,7 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp, the left. We do this by promoting them to full-width, although the ABI says to pad them with garbage. */ if (is_integral_type (arg_type) - && TYPE_LENGTH (arg_type) < REGISTER_SIZE) + && TYPE_LENGTH (arg_type) < DEPRECATED_REGISTER_SIZE) { args[i] = value_cast ((TYPE_UNSIGNED (arg_type) ? builtin_type_unsigned_long @@ -1760,7 +1799,7 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* Align the size of the argument to the word size for this target. */ - bytes_reserved = (lengths[i] + REGISTER_SIZE - 1) & -REGISTER_SIZE; + bytes_reserved = (lengths[i] + DEPRECATED_REGISTER_SIZE - 1) & -DEPRECATED_REGISTER_SIZE; offset[i] = cum_bytes_reserved; @@ -1772,8 +1811,8 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp, if (bytes_reserved > 8) { /* Round up the offset to a multiple of two slots. */ - int new_offset = ((offset[i] + 2*REGISTER_SIZE-1) - & -(2*REGISTER_SIZE)); + int new_offset = ((offset[i] + 2*DEPRECATED_REGISTER_SIZE-1) + & -(2*DEPRECATED_REGISTER_SIZE)); /* Note the space we've wasted, if any. */ bytes_reserved += new_offset - offset[i]; @@ -1860,15 +1899,15 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* Align the size of the argument to the word size for this target. */ - bytes_reserved = (lengths[i] + REGISTER_SIZE - 1) & -REGISTER_SIZE; + bytes_reserved = (lengths[i] + DEPRECATED_REGISTER_SIZE - 1) & -DEPRECATED_REGISTER_SIZE; offset[i] = (cum_bytes_reserved + (lengths[i] > 4 ? bytes_reserved : lengths[i])); /* If the argument is a double word argument, then it needs to be double word aligned. */ - if ((bytes_reserved == 2 * REGISTER_SIZE) - && (offset[i] % 2 * REGISTER_SIZE)) + if ((bytes_reserved == 2 * DEPRECATED_REGISTER_SIZE) + && (offset[i] % 2 * DEPRECATED_REGISTER_SIZE)) { int new_offset = 0; /* BYTES_RESERVED is already aligned to the word, so we put @@ -1876,13 +1915,13 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp, This will leave one empty word on the stack, and one unused register as mandated by the ABI. */ - new_offset = ((offset[i] + 2 * REGISTER_SIZE - 1) - & -(2 * REGISTER_SIZE)); + new_offset = ((offset[i] + 2 * DEPRECATED_REGISTER_SIZE - 1) + & -(2 * DEPRECATED_REGISTER_SIZE)); - if ((new_offset - offset[i]) >= 2 * REGISTER_SIZE) + if ((new_offset - offset[i]) >= 2 * DEPRECATED_REGISTER_SIZE) { - bytes_reserved += REGISTER_SIZE; - offset[i] += REGISTER_SIZE; + bytes_reserved += DEPRECATED_REGISTER_SIZE; + offset[i] += DEPRECATED_REGISTER_SIZE; } } @@ -2036,9 +2075,9 @@ cover_find_stub_with_shl_get (void *args_untyped) into a call sequence of the above form stored at DUMMYNAME. On the hppa we need to call the stack dummy through $$dyncall. - Therefore our version of FIX_CALL_DUMMY takes an extra argument, - real_pc, which is the location where gdb should start up the - inferior to do the function call. + Therefore our version of DEPRECATED_FIX_CALL_DUMMY takes an extra + argument, real_pc, which is the location where gdb should start up + the inferior to do the function call. This has to work across several versions of hpux, bsd, osf1. It has to work regardless of what compiler was used to build the inferior program. @@ -2194,7 +2233,7 @@ hppa_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, at *(fun+4). Note the call dummy is *NOT* allowed to trash %r19 before calling the target function. */ write_register (19, read_memory_integer ((fun & ~0x3) + 4, - REGISTER_SIZE)); + DEPRECATED_REGISTER_SIZE)); /* Now get the real address for the function we are calling, it's at *fun. */ @@ -2528,7 +2567,7 @@ hppa_alignof (struct type *type) void pa_do_registers_info (int regnum, int fpregs) { - char raw_regs[REGISTER_BYTES]; + char *raw_regs = alloca (DEPRECATED_REGISTER_BYTES); int i; /* Make a copy of gdb's save area (may cause actual @@ -2572,7 +2611,7 @@ void pa_do_strcat_registers_info (int regnum, int fpregs, struct ui_file *stream, enum precision_type precision) { - char raw_regs[REGISTER_BYTES]; + char *raw_regs = alloca (DEPRECATED_REGISTER_BYTES); int i; /* Make a copy of gdb's save area (may cause actual @@ -2629,7 +2668,7 @@ pa_register_look_aside (char *raw_regs, int regnum, long *raw_val) int start; - char *buf = alloca (max_register_size (current_gdbarch)); + char buf[MAX_REGISTER_SIZE]; long long reg_val; if (!know_which) @@ -2826,8 +2865,8 @@ pa_strcat_registers (char *raw_regs, int regnum, int fpregs, static void pa_print_fp_reg (int i) { - char *raw_buffer = alloca (max_register_size (current_gdbarch)); - char *virtual_buffer = alloca (max_register_size (current_gdbarch)); + char raw_buffer[MAX_REGISTER_SIZE]; + char virtual_buffer[MAX_REGISTER_SIZE]; /* Get 32bits of data. */ frame_register_read (deprecated_selected_frame, i, raw_buffer); @@ -2869,8 +2908,8 @@ pa_print_fp_reg (int i) static void pa_strcat_fp_reg (int i, struct ui_file *stream, enum precision_type precision) { - char *raw_buffer = alloca (max_register_size (current_gdbarch)); - char *virtual_buffer = alloca (max_register_size (current_gdbarch)); + char raw_buffer[MAX_REGISTER_SIZE]; + char virtual_buffer[MAX_REGISTER_SIZE]; fputs_filtered (REGISTER_NAME (i), stream); print_spaces_filtered (8 - strlen (REGISTER_NAME (i)), stream); @@ -2884,7 +2923,7 @@ pa_strcat_fp_reg (int i, struct ui_file *stream, enum precision_type precision) if (precision == double_precision && (i % 2) == 0) { - char *raw_buf = alloca (max_register_size (current_gdbarch)); + char raw_buf[MAX_REGISTER_SIZE]; /* Get the data in raw format for the 2nd half. */ frame_register_read (deprecated_selected_frame, i + 1, raw_buf); @@ -3881,16 +3920,16 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info, /* A call dummy is sized in words, but it is actually a series of instructions. Account for that scaling factor. */ - + ((REGISTER_SIZE / INSTRUCTION_SIZE) - * CALL_DUMMY_LENGTH) + + ((DEPRECATED_REGISTER_SIZE / INSTRUCTION_SIZE) + * DEPRECATED_CALL_DUMMY_LENGTH) /* Similarly we have to account for 64bit wide register saves. */ - + (32 * REGISTER_SIZE) + + (32 * DEPRECATED_REGISTER_SIZE) /* We always consider FP regs 8 bytes long. */ + (NUM_REGS - FP0_REGNUM) * 8 /* Similarly we have to account for 64bit wide register saves. */ - + (6 * REGISTER_SIZE))))) + + (6 * DEPRECATED_REGISTER_SIZE))))) find_dummy_frame_regs (frame_info, frame_saved_regs); /* Interrupt handlers are special too. They lay out the register @@ -4368,7 +4407,7 @@ initialize_hp_cxx_exception_support (void) } /* Next look for the catch enable flag provided end.o */ - sym = lookup_symbol (HP_ACC_EH_catch_catch); + sym = lookup_symbol_linkage (HP_ACC_EH_catch_catch); if (sym) /* sometimes present in debug info */ { eh_catch_throw_addr = SYMBOL_VALUE_ADDRESS (sym); @@ -4857,7 +4896,7 @@ int hppa_register_raw_size (int reg_nr) { /* All registers have the same size. */ - return REGISTER_SIZE; + return DEPRECATED_REGISTER_SIZE; } /* Index within the register vector of the first byte of the space i @@ -4986,7 +5025,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_inner_than (gdbarch, hppa_inner_than); set_gdbarch_stack_align (gdbarch, hppa_stack_align); set_gdbarch_decr_pc_after_break (gdbarch, 0); - set_gdbarch_register_size (gdbarch, 4); + set_gdbarch_deprecated_register_size (gdbarch, 4); set_gdbarch_num_regs (gdbarch, hppa_num_regs); set_gdbarch_deprecated_fp_regnum (gdbarch, 3); set_gdbarch_sp_regnum (gdbarch, 30); @@ -4994,7 +5033,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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_register_bytes (gdbarch, hppa_num_regs * 4); + 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_max_register_raw_size (gdbarch, 4); @@ -5020,8 +5059,8 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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); - set_gdbarch_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28); - /* set_gdbarch_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */ + set_gdbarch_deprecated_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28); + /* set_gdbarch_deprecated_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */ set_gdbarch_deprecated_push_arguments (gdbarch, hppa_push_arguments); set_gdbarch_smash_text_address (gdbarch, hppa_smash_text_address); set_gdbarch_believe_pcc_promotion (gdbarch, 1); diff --git a/gdb/hppab-nat.c b/gdb/hppab-nat.c index 3ec3a57..dc3e6b6 100644 --- a/gdb/hppab-nat.c +++ b/gdb/hppab-nat.c @@ -55,7 +55,7 @@ static void fetch_register (int regno) { register unsigned int regaddr; - char *buf = alloca (max_register_size (current_gdbarch)); + char buf[MAX_REGISTER_SIZE]; register int i; /* Offset of registers within the u area. */ diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c index b953d25..0b8b04f 100644 --- a/gdb/hppah-nat.c +++ b/gdb/hppah-nat.c @@ -190,7 +190,7 @@ store_inferior_registers (int regno) static void fetch_register (int regno) { - char *buf = alloca (max_register_size (current_gdbarch)); + char buf[MAX_REGISTER_SIZE]; unsigned int addr, len, offset; int i; diff --git a/gdb/hpread.c b/gdb/hpread.c index daa42c0..885d462 100644 --- a/gdb/hpread.c +++ b/gdb/hpread.c @@ -789,7 +789,7 @@ scan_procs (int *curr_pd_p, quick_procedure_entry *qPD, int max_procs, strlen (rtn_name), rtn_dem_name, strlen (rtn_dem_name), - VAR_NAMESPACE, + VAR_DOMAIN, LOC_BLOCK, /* "I am a routine" */ &objfile->global_psymbols, (qPD[curr_pd].adrStart + /* Starting address of rtn */ @@ -802,7 +802,7 @@ scan_procs (int *curr_pd_p, quick_procedure_entry *qPD, int max_procs, strlen (rtn_name), rtn_dem_name, strlen (rtn_dem_name), - VAR_NAMESPACE, + VAR_DOMAIN, LOC_BLOCK, /* "I am a routine" */ &objfile->static_psymbols, (qPD[curr_pd].adrStart + /* Starting address of rtn */ @@ -2061,12 +2061,12 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) set_namestring (dn_bufp, &namestring, objfile); if (dn_bufp->dfunc.global) add_psymbol_to_list (namestring, strlen (namestring), - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->global_psymbols, valu, 0, language_unknown, objfile); else add_psymbol_to_list (namestring, strlen (namestring), - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->static_psymbols, valu, 0, language_unknown, objfile); within_function = 1; @@ -2082,12 +2082,12 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) set_namestring (dn_bufp, &namestring, objfile); if (dn_bufp->ddocfunc.global) add_psymbol_to_list (namestring, strlen (namestring), - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->global_psymbols, valu, 0, language_unknown, objfile); else add_psymbol_to_list (namestring, strlen (namestring), - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->static_psymbols, valu, 0, language_unknown, objfile); within_function = 1; @@ -2128,7 +2128,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) { /* Variables, typedefs an the like. */ enum address_class storage; - namespace_enum namespace; + domain_enum domain; /* Don't add locals to the partial symbol table. */ if (within_function @@ -2136,11 +2136,11 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) || dn_bufp->dblock.kind == DNTT_TYPE_DVAR)) continue; - /* TAGDEFs go into the structure namespace. */ + /* TAGDEFs go into the structure domain. */ if (dn_bufp->dblock.kind == DNTT_TYPE_TAGDEF) - namespace = STRUCT_NAMESPACE; + domain = STRUCT_DOMAIN; else - namespace = VAR_NAMESPACE; + domain = VAR_DOMAIN; /* What kind of "storage" does this use? */ if (dn_bufp->dblock.kind == DNTT_TYPE_SVAR) @@ -2178,7 +2178,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) if (dn_bufp->dsvar.global) { add_psymbol_to_list (namestring, strlen (namestring), - namespace, storage, + domain, storage, &objfile->global_psymbols, valu, 0, language_unknown, objfile); @@ -2186,18 +2186,18 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) else { add_psymbol_to_list (namestring, strlen (namestring), - namespace, storage, + domain, storage, &objfile->static_psymbols, valu, 0, language_unknown, objfile); } /* For TAGDEF's, the above code added the tagname to the - struct namespace. This will cause tag "t" to be found + struct domain. This will cause tag "t" to be found on a reference of the form "(struct t) x". But for C++ classes, "t" will also be a typename, which we want to find on a reference of the form "ptype t". - Therefore, we also add "t" to the var namespace. + Therefore, we also add "t" to the var domain. Do the same for enum's due to the way aCC generates debug info for these (see more extended comment in hp-symtab-read.c). @@ -2216,7 +2216,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) if (global) { add_psymbol_to_list (namestring, strlen (namestring), - VAR_NAMESPACE, storage, + VAR_DOMAIN, storage, &objfile->global_psymbols, dn_bufp->dsvar.location, 0, language_unknown, objfile); @@ -2224,7 +2224,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) else { add_psymbol_to_list (namestring, strlen (namestring), - VAR_NAMESPACE, storage, + VAR_DOMAIN, storage, &objfile->static_psymbols, dn_bufp->dsvar.location, 0, language_unknown, objfile); @@ -2249,12 +2249,12 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline) } if (dn_bufp->dconst.global) add_psymbol_to_list (namestring, strlen (namestring), - VAR_NAMESPACE, LOC_CONST, + VAR_DOMAIN, LOC_CONST, &objfile->global_psymbols, 0, 0, language_unknown, objfile); else add_psymbol_to_list (namestring, strlen (namestring), - VAR_NAMESPACE, LOC_CONST, + VAR_DOMAIN, LOC_CONST, &objfile->static_psymbols, 0, 0, language_unknown, objfile); continue; @@ -3132,7 +3132,7 @@ hpread_read_enum_type (dnttpointer hp_type, union dnttentry *dn_bufp, DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name), &objfile->symbol_obstack); SYMBOL_CLASS (sym) = LOC_CONST; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_VALUE (sym) = memp->dmember.value; add_symbol_to_list (sym, symlist); nsyms++; @@ -3247,7 +3247,7 @@ hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp, SYMBOL_CLASS (sym) = LOC_REF_ARG; else SYMBOL_CLASS (sym) = LOC_ARG; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; if (paramp->dfparam.copyparam) { SYMBOL_VALUE (sym) = paramp->dfparam.location; @@ -3426,7 +3426,7 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp, SYMBOL_CLASS (sym) = LOC_REF_ARG; else SYMBOL_CLASS (sym) = LOC_ARG; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; if (paramp->dfparam.copyparam) { SYMBOL_VALUE (sym) = paramp->dfparam.location; @@ -5099,7 +5099,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, memset (sym, 0, sizeof (struct symbol)); DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name), &objfile->symbol_obstack); SYMBOL_LANGUAGE (sym) = language_auto; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_LINE (sym) = 0; SYMBOL_VALUE (sym) = 0; SYMBOL_CLASS (sym) = LOC_TYPEDEF; @@ -5659,7 +5659,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, /* DNTT_TYPE_IMPORT is not handled */ case DNTT_TYPE_LABEL: - SYMBOL_NAMESPACE (sym) = LABEL_NAMESPACE; + SYMBOL_DOMAIN (sym) = LABEL_DOMAIN; break; case DNTT_TYPE_FPARAM: @@ -5694,7 +5694,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, SYMBOL_CLASS (sym) = LOC_REF_ARG; else SYMBOL_CLASS (sym) = LOC_ARG; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; if (dn_bufp->dfparam.copyparam) { SYMBOL_VALUE (sym) = dn_bufp->dfparam.location; @@ -5810,9 +5810,9 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, case DNTT_TYPE_TYPEDEF: /* A typedef. We do want to process these, since a name is - * added to the namespace for the typedef'ed name. + * added to the domain for the typedef'ed name. */ - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dtype.type, objfile); if (dn_bufp->dtype.global) add_symbol_to_list (sym, &global_symbols); @@ -5827,10 +5827,10 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, int global = dn_bufp->dtag.global; /* Structure, union, enum, template, or class tag definition */ /* We do want to process these, since a name is - * added to the namespace for the tag name (and if C++ class, + * added to the domain for the tag name (and if C++ class, * for the typename also). */ - SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE; + SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN; /* The tag contains in its "type" field a pointer to the * DNTT_TYPE_STRUCT, DNTT_TYPE_UNION, DNTT_TYPE_ENUM, @@ -5887,7 +5887,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, memset (newsym, 0, sizeof (struct symbol)); DEPRECATED_SYMBOL_NAME (newsym) = name; SYMBOL_LANGUAGE (newsym) = language_auto; - SYMBOL_NAMESPACE (newsym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (newsym) = VAR_DOMAIN; SYMBOL_LINE (newsym) = 0; SYMBOL_VALUE (newsym) = 0; SYMBOL_CLASS (newsym) = LOC_TYPEDEF; diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c index b585ca5..02f5acd 100644 --- a/gdb/hpux-thread.c +++ b/gdb/hpux-thread.c @@ -285,7 +285,7 @@ hpux_thread_fetch_registers (int regno) child_ops.to_fetch_registers (regno); else { - unsigned char *buf = alloca (max_register_size (current_gdbarch)); + unsigned char buf[MAX_REGISTER_SIZE]; CORE_ADDR sp; sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160; @@ -294,7 +294,7 @@ hpux_thread_fetch_registers (int regno) /* Flags must be 0 to avoid bogus value for SS_INSYSCALL */ memset (buf, '\000', REGISTER_RAW_SIZE (regno)); else if (regno == SP_REGNUM) - store_address (buf, sizeof sp, sp); + store_unsigned_integer (buf, sizeof sp, sp); else if (regno == PC_REGNUM) read_memory (sp - 20, buf, REGISTER_RAW_SIZE (regno)); else @@ -347,7 +347,7 @@ hpux_thread_store_registers (int regno) child_ops.to_store_registers (regno); else { - unsigned char *buf = alloca (max_register_size (current_gdbarch)); + unsigned char buf[MAX_REGISTER_SIZE]; CORE_ADDR sp; sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160; diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index 3744124..cf769d8 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -72,7 +72,6 @@ /* Prototypes for local functions. */ static void dummy_sse_values (void); - /* The register sets used in GNU/Linux ELF core-dumps are identical to @@ -233,10 +232,10 @@ supply_gregset (elf_gregset_t *gregsetp) int i; for (i = 0; i < I386_NUM_GREGS; i++) - supply_register (i, (char *) (regp + regmap[i])); + supply_register (i, regp + regmap[i]); if (I386_LINUX_ORIG_EAX_REGNUM < NUM_REGS) - supply_register (I386_LINUX_ORIG_EAX_REGNUM, (char *) (regp + ORIG_EAX)); + supply_register (I386_LINUX_ORIG_EAX_REGNUM, regp + ORIG_EAX); } /* Fill register REGNO (if it is a general-purpose register) in diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 2fe4d04..afff548 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -461,7 +461,7 @@ 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_register_bytes (gdbarch, I386_SSE_SIZEOF_REGS + 4); + set_gdbarch_deprecated_register_bytes (gdbarch, I386_SSE_SIZEOF_REGS + 4); tdep->jb_pc_offset = 20; /* From <bits/setjmp.h>. */ diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 07c82b6..0428c13 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -864,7 +864,7 @@ i386_push_arguments (int nargs, struct value **args, CORE_ADDR sp, char buf[4]; sp -= 4; - store_address (buf, 4, struct_addr); + store_unsigned_integer (buf, 4, struct_addr); write_memory (sp, buf, 4); } @@ -1097,7 +1097,7 @@ i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, { if (i386_mmx_regnum_p (regnum)) { - char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE); + char mmx_buf[MAX_REGISTER_SIZE]; int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum); /* Extract (always little endian). */ @@ -1114,7 +1114,7 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, { if (i386_mmx_regnum_p (regnum)) { - char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE); + char mmx_buf[MAX_REGISTER_SIZE]; int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum); /* Read ... */ @@ -1486,8 +1486,8 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) be in use on any of the supported i386 targets. */ set_gdbarch_register_name (gdbarch, i386_register_name); - set_gdbarch_register_size (gdbarch, 4); - set_gdbarch_register_bytes (gdbarch, I386_SIZEOF_GREGS + I386_SIZEOF_FREGS); + set_gdbarch_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); @@ -1495,8 +1495,8 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_get_longjmp_target (gdbarch, i386_get_longjmp_target); /* Call dummy code. */ - set_gdbarch_call_dummy_words (gdbarch, NULL); - set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); + 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, diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h index 1e0b405..1b569d9 100644 --- a/gdb/i386-tdep.h +++ b/gdb/i386-tdep.h @@ -148,7 +148,7 @@ extern int i386_mxcsr_regnum_p (int regnum); /* Sizes of individual register sets. These cover the entire register file, so summing up the sizes of those portions actually present - yields REGISTER_BYTES. */ + 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) diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c index 045357e..c6a2d5d 100644 --- a/gdb/i387-tdep.c +++ b/gdb/i387-tdep.c @@ -522,19 +522,34 @@ static int fxsave_offset[] = 20, /* FOSEG_REGNUM (16 bits). */ 16, /* FOOFF_REGNUM. */ 6, /* FOP_REGNUM (bottom 11 bits). */ - 160, /* XMM0_REGNUM through ... */ - 176, - 192, - 208, - 224, - 240, - 256, - 272, /* ... XMM7_REGNUM (128 bits each). */ - 24, /* MXCSR_REGNUM. */ + 160 + 0 * 16, /* XMM0_REGNUM through ... */ + 160 + 1 * 16, + 160 + 2 * 16, + 160 + 3 * 16, + 160 + 4 * 16, + 160 + 5 * 16, + 160 + 6 * 16, + 160 + 7 * 16, + 160 + 8 * 16, + 160 + 9 * 16, + 160 + 10 * 16, + 160 + 11 * 16, + 160 + 12 * 16, + 160 + 13 * 16, + 160 + 14 * 16, + 160 + 15 * 16, /* ... XMM15_REGNUM (128 bits each). */ + 24 /* MXCSR_REGNUM. */ }; +/* FIXME: kettenis/20030430: We made an unfortunate choice in putting + %mxcsr after the SSE registers %xmm0-%xmm7 instead of before, since + it makes supporting the registers %xmm8-%xmm15 on x86-64 a bit + involved. Hack around it by explicitly overriding the offset for + %mxcsr here. */ + #define FXSAVE_ADDR(fxsave, regnum) \ - (fxsave + fxsave_offset[regnum - FP0_REGNUM]) + ((regnum == MXCSR_REGNUM) ? (fxsave + 24) : \ + (fxsave + fxsave_offset[regnum - FP0_REGNUM])) static int i387_tag (unsigned char *raw); diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 7aff5b9..a898f52 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -543,9 +543,9 @@ fetch_instruction (CORE_ADDR addr, instruction_type *it, long long *instr) using the pattern seen below. */ #if 0 -#define BREAKPOINT 0x00002000040LL +#define IA64_BREAKPOINT 0x00002000040LL #endif -#define BREAKPOINT 0x00003333300LL +#define IA64_BREAKPOINT 0x00003333300LL static int ia64_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache) @@ -573,7 +573,7 @@ ia64_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache) instr = slotN_contents (bundle, slotnum); memcpy(contents_cache, &instr, sizeof(instr)); - replace_slotN_contents (bundle, BREAKPOINT, slotnum); + replace_slotN_contents (bundle, IA64_BREAKPOINT, slotnum); if (val == 0) target_write_memory (addr, bundle, BUNDLE_LEN); @@ -737,7 +737,7 @@ ia64_frame_saved_pc (struct frame_info *frame) /* Limit the number of skipped non-prologue instructions since examining of the prologue is expensive. */ -static int max_skip_non_prologue_insns = 10; +static int max_skip_non_prologue_insns = 40; /* Given PC representing the starting address of a function, and LIM_PC which is the (sloppy) limit to which to scan when looking @@ -825,10 +825,13 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) CORE_ADDR spill_addr = 0; char instores[8]; char infpstores[8]; + char reg_contents[256]; int trust_limit; + int frameless = 0; memset (instores, 0, sizeof instores); memset (infpstores, 0, sizeof infpstores); + memset (reg_contents, 0, sizeof reg_contents); if (frame && !get_frame_saved_regs (frame)) { @@ -843,13 +846,14 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) return get_frame_extra_info (frame)->after_prologue; lim_pc = refine_prologue_limit (pc, lim_pc, &trust_limit); - - /* Must start with an alloc instruction */ next_pc = fetch_instruction (pc, &it, &instr); + + /* We want to check if we have a recognizable function start before we + look ahead for a prologue. */ if (pc < lim_pc && next_pc && it == M && ((instr & 0x1ee0000003fLL) == 0x02c00000000LL)) { - /* alloc */ + /* alloc - start of a regular function. */ int sor = (int) ((instr & 0x00078000000LL) >> 27); int sol = (int) ((instr & 0x00007f00000LL) >> 20); int sof = (int) ((instr & 0x000000fe000LL) >> 13); @@ -864,9 +868,35 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) } else { - pc = lim_pc; /* Frameless: We're done early. */ - if (trust_limit) - last_prologue_pc = lim_pc; + /* Look for a leaf routine. */ + if (pc < lim_pc && next_pc + && (it == I || it == M) + && ((instr & 0x1ee00000000LL) == 0x10800000000LL)) + { + /* adds rN = imm14, rM (or mov rN, rM when imm14 is 0) */ + int imm = (int) ((((instr & 0x01000000000LL) ? -1 : 0) << 13) + | ((instr & 0x001f8000000LL) >> 20) + | ((instr & 0x000000fe000LL) >> 13)); + int rM = (int) ((instr & 0x00007f00000LL) >> 20); + int rN = (int) ((instr & 0x00000001fc0LL) >> 6); + int qp = (int) (instr & 0x0000000003fLL); + if (qp == 0 && rN == 2 && imm == 0 && rM == 12 && fp_reg == 0) + { + /* mov r2, r12 - beginning of leaf routine */ + fp_reg = rN; + frameless = 1; + last_prologue_pc = next_pc; + } + } + + /* If we don't recognize a regular function or leaf routine, we are + done. */ + if (!fp_reg) + { + pc = lim_pc; + if (trust_limit) + last_prologue_pc = lim_pc; + } } /* Loop, looking for prologue instructions, keeping track of @@ -882,6 +912,8 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) { /* Exit loop upon hitting a non-nop branch instruction or a predicated instruction. */ + if (trust_limit) + lim_pc = pc; break; } else if (it == I && ((instr & 0x1eff8000000LL) == 0x00188000000LL)) @@ -941,6 +973,20 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) spill_reg = rN; last_prologue_pc = next_pc; } + else if (qp == 0 && rM >= 32 && rM < 40 && !instores[rM] && + rN < 256 && imm == 0) + { + /* mov rN, rM where rM is an input register */ + reg_contents[rN] = rM; + last_prologue_pc = next_pc; + } + else if (frameless && qp == 0 && rN == fp_reg && imm == 0 && + rM == 2) + { + /* mov r12, r2 */ + last_prologue_pc = next_pc; + break; + } } else if (it == M && ( ((instr & 0x1efc0000000LL) == 0x0eec0000000LL) @@ -1006,6 +1052,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) int rN = (int) ((instr & 0x00007f00000LL) >> 20); int rM = (int) ((instr & 0x000000fe000LL) >> 13); int qp = (int) (instr & 0x0000000003fLL); + int indirect = rM < 256 ? reg_contents[rM] : 0; if (qp == 0 && rN == spill_reg && spill_addr != 0 && (rM == unat_save_reg || rM == pr_save_reg)) { @@ -1040,6 +1087,13 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) instores[rM-32] = 1; last_prologue_pc = next_pc; } + else if (qp == 0 && 32 <= indirect && indirect < 40 && + !instores[indirect-32]) + { + /* Allow an indirect store of an input register. */ + instores[indirect-32] = 1; + last_prologue_pc = next_pc; + } } else if (it == M && ((instr & 0x1ff08000000LL) == 0x08c00000000LL)) { @@ -1054,11 +1108,19 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) register is permitted. */ int rM = (int) ((instr & 0x000000fe000LL) >> 13); int qp = (int) (instr & 0x0000000003fLL); + int indirect = rM < 256 ? reg_contents[rM] : 0; if (qp == 0 && 32 <= rM && rM < 40 && !instores[rM-32]) { instores[rM-32] = 1; last_prologue_pc = next_pc; } + else if (qp == 0 && 32 <= indirect && indirect < 40 && + !instores[indirect-32]) + { + /* Allow an indirect store of an input register. */ + instores[indirect-32] = 1; + last_prologue_pc = next_pc; + } } else if (it == M && ((instr & 0x1ff88000000LL) == 0x0cc80000000LL)) { @@ -1147,6 +1209,10 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) get_frame_extra_info (frame)->fp_reg = fp_reg; } + /* Try and trust the lim_pc value whenever possible. */ + if (trust_limit && lim_pc >= last_prologue_pc) + return lim_pc; + return last_prologue_pc; } @@ -1239,13 +1305,13 @@ ia64_get_saved_register (char *raw_buffer, if (regnum == SP_REGNUM && get_next_frame (frame)) { /* Handle SP values for all frames but the topmost. */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - get_frame_base (frame)); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), + get_frame_base (frame)); } else if (regnum == IA64_BSP_REGNUM) { - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - get_frame_extra_info (frame)->bsp); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), + get_frame_extra_info (frame)->bsp); } else if (regnum == IA64_VFP_REGNUM) { @@ -1255,11 +1321,11 @@ ia64_get_saved_register (char *raw_buffer, still provide a value since we know the size of the frame */ CORE_ADDR vfp = (get_frame_base (frame) + get_frame_extra_info (frame)->mem_stack_frame_size); - store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_VFP_REGNUM), vfp); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (IA64_VFP_REGNUM), vfp); } else if (IA64_PR0_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM) { - char *pr_raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); + char pr_raw_buffer[MAX_REGISTER_SIZE]; int pr_optim; enum lval_type pr_lval; CORE_ADDR pr_addr; @@ -1282,7 +1348,7 @@ ia64_get_saved_register (char *raw_buffer, } else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM) { - char *unat_raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); + char unat_raw_buffer[MAX_REGISTER_SIZE]; int unat_optim; enum lval_type unat_lval; CORE_ADDR unat_addr; @@ -1338,7 +1404,7 @@ ia64_get_saved_register (char *raw_buffer, { pc = read_pc (); } - store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_IP_REGNUM), pc); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (IA64_IP_REGNUM), pc); } else if (IA64_GR32_REGNUM <= regnum && regnum <= IA64_GR127_REGNUM) { @@ -1769,8 +1835,8 @@ find_func_descr (CORE_ADDR faddr, CORE_ADDR *fdaptr) if (global_pointer == 0) global_pointer = read_register (IA64_GR1_REGNUM); - store_address (buf, 8, faddr); - store_address (buf + 8, 8, global_pointer); + store_unsigned_integer (buf, 8, faddr); + store_unsigned_integer (buf + 8, 8, global_pointer); write_memory (fdesc, buf, 16); } @@ -1862,9 +1928,9 @@ ia64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, { char val_buf[8]; - store_address (val_buf, 8, - find_func_descr (extract_address (VALUE_CONTENTS (arg), 8), - &funcdescaddr)); + store_unsigned_integer (val_buf, 8, + find_func_descr (extract_address (VALUE_CONTENTS (arg), 8), + &funcdescaddr)); if (slotnum < rseslots) write_memory (rse_address_add (bsp, slotnum), val_buf, 8); else @@ -1920,9 +1986,9 @@ ia64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* Store the struct return value in r8 if necessary. */ if (struct_return) { - store_address (&deprecated_registers[REGISTER_BYTE (IA64_GR8_REGNUM)], - REGISTER_RAW_SIZE (IA64_GR8_REGNUM), - struct_addr); + store_unsigned_integer (&deprecated_registers[REGISTER_BYTE (IA64_GR8_REGNUM)], + REGISTER_RAW_SIZE (IA64_GR8_REGNUM), + struct_addr); } /* Sync gdb's idea of what the registers are with the target. */ @@ -2033,7 +2099,9 @@ ia64_pop_frame_regular (struct frame_info *frame) } static void -ia64_remote_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes, +ia64_remote_translate_xfer_address (struct gdbarch *gdbarch, + struct regcache *regcache, + CORE_ADDR memaddr, int nr_bytes, CORE_ADDR *targ_addr, int *targ_len) { *targ_addr = memaddr; @@ -2173,8 +2241,8 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fp0_regnum (gdbarch, IA64_FR0_REGNUM); set_gdbarch_register_name (gdbarch, ia64_register_name); - set_gdbarch_register_size (gdbarch, 8); - set_gdbarch_register_bytes (gdbarch, ia64_num_regs * 8 + 128*8); + 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_max_register_raw_size (gdbarch, 16); @@ -2217,8 +2285,8 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_push_return_address (gdbarch, ia64_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, ia64_pop_frame); - set_gdbarch_call_dummy_words (gdbarch, ia64_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (ia64_call_dummy_words)); + 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); diff --git a/gdb/infcall.c b/gdb/infcall.c index 1ce22fb..5f80e89 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -215,6 +215,144 @@ breakpoint_auto_delete_contents (void *arg) breakpoint_auto_delete (*(bpstat *) arg); } +static CORE_ADDR +legacy_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) +{ + /* CALL_DUMMY is an array of words (DEPRECATED_REGISTER_SIZE), but + each word is in host byte order. Before calling + DEPRECATED_FIX_CALL_DUMMY, we byteswap it and remove any extra + bytes which might exist because ULONGEST is bigger than + DEPRECATED_REGISTER_SIZE. */ + /* NOTE: This is pretty wierd, as the call dummy is actually a + sequence of instructions. But CISC machines will have to pack + the instructions into DEPRECATED_REGISTER_SIZE units (and so will + RISC machines for which INSTRUCTION_SIZE is not + DEPRECATED_REGISTER_SIZE). */ + /* NOTE: This is pretty stupid. CALL_DUMMY should be in strict + target byte order. */ + CORE_ADDR start_sp; + ULONGEST *dummy = alloca (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS); + int sizeof_dummy1 = (DEPRECATED_REGISTER_SIZE + * DEPRECATED_SIZEOF_CALL_DUMMY_WORDS + / sizeof (ULONGEST)); + char *dummy1 = alloca (sizeof_dummy1); + memcpy (dummy, DEPRECATED_CALL_DUMMY_WORDS, + DEPRECATED_SIZEOF_CALL_DUMMY_WORDS); + if (INNER_THAN (1, 2)) + { + /* Stack grows down */ + sp -= sizeof_dummy1; + start_sp = sp; + } + else + { + /* Stack grows up */ + start_sp = sp; + sp += sizeof_dummy1; + } + /* NOTE: cagney/2002-09-10: Don't bother re-adjusting the stack + after allocating space for the call dummy. A target can specify + a SIZEOF_DUMMY1 (via DEPRECATED_SIZEOF_CALL_DUMMY_WORDS) such + that all local alignment requirements are met. */ + /* Create a call sequence customized for this function and the + number of arguments for it. */ + { + int i; + for (i = 0; i < (int) (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS / sizeof (dummy[0])); + i++) + store_unsigned_integer (&dummy1[i * DEPRECATED_REGISTER_SIZE], + DEPRECATED_REGISTER_SIZE, + (ULONGEST) dummy[i]); + } + /* NOTE: cagney/2003-04-22: This computation of REAL_PC, BP_ADDR and + DUMMY_ADDR is pretty messed up. It comes from constant tinkering + with the values. Instead a DEPRECATED_FIX_CALL_DUMMY replacement + (PUSH_DUMMY_BREAKPOINT?) should just do everything. */ +#ifdef GDB_TARGET_IS_HPPA + real_pc = DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args, + value_type, using_gcc); +#else + if (DEPRECATED_FIX_CALL_DUMMY_P ()) + { + /* gdb_assert (CALL_DUMMY_LOCATION == ON_STACK) true? */ + DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args, + value_type, using_gcc); + } + (*real_pc) = start_sp; +#endif + /* Yes, the offset is applied to the real_pc and not the dummy addr. + Ulgh! Blame the HP/UX target. */ + (*bp_addr) = (*real_pc) + DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET; + /* Yes, the offset is applied to the real_pc and not the + dummy_addr. Ulgh! Blame the HP/UX target. */ + (*real_pc) += DEPRECATED_CALL_DUMMY_START_OFFSET; + write_memory (start_sp, (char *) dummy1, sizeof_dummy1); + if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) + generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1); + return sp; +} + +static CORE_ADDR +generic_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) +{ + /* Something here to findout the size of a breakpoint and then + allocate space for it on the stack. */ + int bplen; + /* This code assumes frame align. */ + gdb_assert (gdbarch_frame_align_p (gdbarch)); + /* Force the stack's alignment. The intent is to ensure that the SP + is aligned to at least a breakpoint instruction's boundary. */ + sp = gdbarch_frame_align (gdbarch, sp); + /* Allocate space for, and then position the breakpoint on the + stack. */ + if (gdbarch_inner_than (gdbarch, 1, 2)) + { + CORE_ADDR bppc = sp; + gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen); + sp = gdbarch_frame_align (gdbarch, sp - bplen); + (*bp_addr) = sp; + /* Should the breakpoint size/location be re-computed here? */ + } + else + { + (*bp_addr) = sp; + gdbarch_breakpoint_from_pc (gdbarch, bp_addr, &bplen); + sp = gdbarch_frame_align (gdbarch, sp + bplen); + } + /* Inferior resumes at the function entry point. */ + (*real_pc) = funaddr; + return sp; +} + +/* Provide backward compatibility. Once DEPRECATED_FIX_CALL_DUMMY is + eliminated, this can be simplified. */ + +static CORE_ADDR +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) +{ + if (gdbarch_push_dummy_code_p (gdbarch)) + return gdbarch_push_dummy_code (gdbarch, sp, funaddr, using_gcc, + args, nargs, value_type, real_pc, bp_addr); + else if (DEPRECATED_FIX_CALL_DUMMY_P ()) + return legacy_push_dummy_code (gdbarch, sp, funaddr, using_gcc, + args, nargs, value_type, real_pc, bp_addr); + else + return generic_push_dummy_code (gdbarch, sp, funaddr, using_gcc, + args, nargs, value_type, real_pc, bp_addr); +} + /* All this stuff with a dummy frame may seem unnecessarily complicated (why not just save registers in GDB?). The purpose of pushing a dummy frame which looks just like a real frame is so that if you call a @@ -362,98 +500,51 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) struct_return = using_struct_return (function, funaddr, value_type, using_gcc); + /* Determine the location of the breakpoint (and possibly other + stuff) that the called function will return to. The SPARC, for a + function returning a structure or union, needs to make space for + not just the breakpoint but also an extra word containing the + size (?) of the structure being passed. */ + + /* The actual breakpoint (at BP_ADDR) is inserted separatly so there + is no need to write that out. */ + switch (CALL_DUMMY_LOCATION) { case ON_STACK: - { - /* CALL_DUMMY is an array of words (REGISTER_SIZE), but each - word is in host byte order. Before calling FIX_CALL_DUMMY, - we byteswap it and remove any extra bytes which might exist - because ULONGEST is bigger than REGISTER_SIZE. */ - /* NOTE: This is pretty wierd, as the call dummy is actually a - sequence of instructions. But CISC machines will have to - pack the instructions into REGISTER_SIZE units (and so will - RISC machines for which INSTRUCTION_SIZE is not - REGISTER_SIZE). */ - /* NOTE: This is pretty stupid. CALL_DUMMY should be in - strict target byte order. */ - CORE_ADDR start_sp; - ULONGEST *dummy = alloca (SIZEOF_CALL_DUMMY_WORDS); - int sizeof_dummy1 = (REGISTER_SIZE * SIZEOF_CALL_DUMMY_WORDS - / sizeof (ULONGEST)); - char *dummy1 = alloca (sizeof_dummy1); - memcpy (dummy, CALL_DUMMY_WORDS, SIZEOF_CALL_DUMMY_WORDS); - if (INNER_THAN (1, 2)) - { - /* Stack grows down */ - sp -= sizeof_dummy1; - start_sp = sp; - } - else - { - /* Stack grows up */ - start_sp = sp; - sp += sizeof_dummy1; - } - /* NOTE: cagney/2002-09-10: Don't bother re-adjusting the - stack after allocating space for the call dummy. A target - can specify a SIZEOF_DUMMY1 (via SIZEOF_CALL_DUMMY_WORDS) - such that all local alignment requirements are met. */ - /* Create a call sequence customized for this function and the - number of arguments for it. */ + /* "dummy_addr" is here just to keep old targets happy. New + targets return that same information via "sp" and "bp_addr". */ + if (INNER_THAN (1, 2)) { - int i; - for (i = 0; i < (int) (SIZEOF_CALL_DUMMY_WORDS / sizeof (dummy[0])); - i++) - store_unsigned_integer (&dummy1[i * REGISTER_SIZE], - REGISTER_SIZE, - (ULONGEST) dummy[i]); + sp = push_dummy_code (current_gdbarch, sp, funaddr, + using_gcc, args, nargs, value_type, + &real_pc, &bp_addr); + dummy_addr = sp; } - /* NOTE: cagney/2003-04-22: This computation of REAL_PC, - BP_ADDR and DUMMY_ADDR is pretty messed up. It comes from - constant tinkering with the values. Instead a - FIX_CALL_DUMMY replacement (PUSH_DUMMY_BREAKPOINT?) should - just do everything. */ -#ifdef GDB_TARGET_IS_HPPA - real_pc = FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args, - value_type, using_gcc); -#else - if (FIX_CALL_DUMMY_P ()) - { - /* gdb_assert (CALL_DUMMY_LOCATION == ON_STACK) true? */ - FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args, value_type, - using_gcc); - } - real_pc = start_sp; -#endif - dummy_addr = start_sp; - /* Yes, the offset is applied to the real_pc and not the dummy - addr. Ulgh! Blame the HP/UX target. */ - bp_addr = real_pc + CALL_DUMMY_BREAKPOINT_OFFSET; - /* Yes, the offset is applied to the real_pc and not the - dummy_addr. Ulgh! Blame the HP/UX target. */ - real_pc += CALL_DUMMY_START_OFFSET; - write_memory (start_sp, (char *) dummy1, sizeof_dummy1); - if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) - generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1); - break; - } + else + { + dummy_addr = sp; + sp = push_dummy_code (current_gdbarch, sp, funaddr, + using_gcc, args, nargs, value_type, + &real_pc, &bp_addr); + } + break; case AT_ENTRY_POINT: real_pc = funaddr; dummy_addr = CALL_DUMMY_ADDRESS (); /* A call dummy always consists of just a single breakpoint, so it's address is the same as the address of the dummy. */ bp_addr = dummy_addr; - if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) - /* NOTE: cagney/2002-04-13: The entry point is going to be - modified with a single breakpoint. */ - generic_save_call_dummy_addr (CALL_DUMMY_ADDRESS (), - CALL_DUMMY_ADDRESS () + 1); break; default: internal_error (__FILE__, __LINE__, "bad switch"); } + if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) + /* Save where the breakpoint is going to be inserted so that the + dummy-frame code is later able to re-identify it. */ + generic_save_call_dummy_addr (bp_addr, bp_addr + 1); + if (nargs < TYPE_NFIELDS (ftype)) error ("too few arguments in function call"); @@ -646,7 +737,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name); 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, - dummy_addr, nargs, args, sp, struct_return, + bp_addr, nargs, args, sp, struct_return, struct_addr); else if (DEPRECATED_PUSH_ARGUMENTS_P ()) /* Keep old targets working. */ diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 5867655..de6c319 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1500,8 +1500,8 @@ default_print_registers_info (struct gdbarch *gdbarch, { int i; const int numregs = NUM_REGS + NUM_PSEUDO_REGS; - char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); - char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE); + char raw_buffer[MAX_REGISTER_SIZE]; + char virtual_buffer[MAX_REGISTER_SIZE]; if (DEPRECATED_DO_REGISTERS_INFO_P ()) { diff --git a/gdb/inferior.h b/gdb/inferior.h index e4286e4..1de3b25 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -485,13 +485,14 @@ extern int deprecated_pc_in_call_dummy_at_entry_point (CORE_ADDR pc, Note that this macro is intended for targets (like HP-UX) which require more than a single breakpoint in their call dummies, and - therefore cannot use the CALL_DUMMY_BREAKPOINT_OFFSET mechanism. - - If a target does define CALL_DUMMY_BREAKPOINT_OFFSET, then this - default implementation of CALL_DUMMY_HAS_COMPLETED is sufficient. - Else, a target may wish to supply an implementation that works in - the presense of multiple breakpoints in its call dummy. - */ + therefore cannot use the DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET + mechanism. + + If a target does define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET, + then this default implementation of CALL_DUMMY_HAS_COMPLETED is + sufficient. Else, a target may wish to supply an implementation + that works in the presense of multiple breakpoints in its call + dummy. */ #if !defined(CALL_DUMMY_HAS_COMPLETED) #define CALL_DUMMY_HAS_COMPLETED(pc, sp, frame_address) \ DEPRECATED_PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) diff --git a/gdb/infptrace.c b/gdb/infptrace.c index a142080..6147cbe 100644 --- a/gdb/infptrace.c +++ b/gdb/infptrace.c @@ -301,8 +301,8 @@ detach (int signal) errno = 0; ptrace (PT_DETACH, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) 1, signal); - if (errno && errno != ESRCH) - perror_with_name ("ptrace"); + if (errno) + print_sys_errmsg ("ptrace", errno); attach_flag = 0; } #endif /* ATTACH_DETACH */ @@ -359,7 +359,7 @@ fetch_register (int regno) char mess[128]; /* For messages */ register int i; unsigned int offset; /* Offset of registers within the u area. */ - char *buf = alloca (MAX_REGISTER_RAW_SIZE); + char buf[MAX_REGISTER_SIZE]; int tid; if (CANNOT_FETCH_REGISTER (regno)) @@ -424,7 +424,7 @@ store_register (int regno) register int i; unsigned int offset; /* Offset of registers within the u area. */ int tid; - char *buf = alloca (MAX_REGISTER_RAW_SIZE); + char buf[MAX_REGISTER_SIZE]; if (CANNOT_STORE_REGISTER (regno)) { diff --git a/gdb/infrun.c b/gdb/infrun.c index 9503b10..df17968 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -667,6 +667,12 @@ clear_proceed_status (void) bpstat_clear (&stop_bpstat); } + +/* 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 + over calls to it and cleared when the inferior is started. */ +static CORE_ADDR prev_pc; + /* Basic routine for continuing the program in various fashions. ADDR is the address to resume at, or -1 for resume where stopped. @@ -772,6 +778,30 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) inferior. */ gdb_flush (gdb_stdout); + /* Refresh prev_pc value just prior to resuming. This used to be + done in stop_stepping, however, setting prev_pc there did not handle + scenarios such as inferior function calls or returning from + a function via the return command. In those cases, the prev_pc + value was not set properly for subsequent commands. The prev_pc value + is used to initialize the starting line number in the ecs. With an + invalid value, the gdb next command ends up stopping at the position + represented by the next line table entry past our start position. + On platforms that generate one line table entry per line, this + is not a problem. However, on the ia64, the compiler generates + extraneous line table entries that do not increase the line number. + When we issue the gdb next command on the ia64 after an inferior call + or a return command, we often end up a few instructions forward, still + within the original line we started. + + An attempt was made to have init_execution_control_state () refresh + the prev_pc value before calculating the line number. This approach + did not work because on platforms that use ptrace, the pc register + cannot be read unless the inferior is stopped. At that point, we + are not guaranteed the inferior is stopped and so the read_pc () + call can fail. Setting the prev_pc value here ensures the value is + updated correctly when the inferior is stopped. */ + prev_pc = read_pc (); + /* Resume inferior. */ resume (oneproc || step || bpstat_should_step (), stop_signal); @@ -785,13 +815,6 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) normal_stop (); } } - -/* Record the pc and sp of the program the last time it stopped. - These are just used internally by wait_for_inferior, but need - to be preserved over calls to it and cleared when the inferior - is started. */ -static CORE_ADDR prev_pc; -static char *prev_func_name; /* Start remote-debugging of a machine over a serial link. */ @@ -829,7 +852,6 @@ init_wait_for_inferior (void) { /* These are meaningless until the first time through wait_for_inferior. */ prev_pc = 0; - prev_func_name = NULL; #ifdef HP_OS_BUG trap_expected_after_continue = 0; @@ -1116,7 +1138,7 @@ context_switch (struct execution_control_state *ecs) if (in_thread_list (inferior_ptid) && in_thread_list (ecs->ptid)) { /* Perform infrun state context switch: */ /* Save infrun state for the old thread. */ - save_infrun_state (inferior_ptid, prev_pc, prev_func_name, + save_infrun_state (inferior_ptid, prev_pc, trap_expected, step_resume_breakpoint, through_sigtramp_breakpoint, step_range_start, step_range_end, &step_frame_id, @@ -1127,7 +1149,7 @@ context_switch (struct execution_control_state *ecs) ecs->current_line, ecs->current_symtab, step_sp); /* Load infrun state for the new thread. */ - load_infrun_state (ecs->ptid, &prev_pc, &prev_func_name, + load_infrun_state (ecs->ptid, &prev_pc, &trap_expected, &step_resume_breakpoint, &through_sigtramp_breakpoint, &step_range_start, &step_range_end, &step_frame_id, @@ -1140,6 +1162,39 @@ context_switch (struct execution_control_state *ecs) inferior_ptid = ecs->ptid; } +/* Wrapper for PC_IN_SIGTRAMP that takes care of the need to find the + function's name. + + In a classic example of "left hand VS right hand", "infrun.c" was + trying to improve GDB's performance by caching the result of calls + to calls to find_pc_partial_funtion, while at the same time + find_pc_partial_function was also trying to ramp up performance by + caching its most recent return value. The below makes the the + function find_pc_partial_function solely responsibile for + performance issues (the local cache that relied on a global + variable - arrrggg - deleted). + + Using the testsuite and gcov, it was found that dropping the local + "infrun.c" cache and instead relying on find_pc_partial_function + increased the number of calls to 12000 (from 10000), but the number + of times find_pc_partial_function's cache missed (this is what + matters) was only increased by only 4 (to 3569). (A quick back of + envelope caculation suggests that the extra 2000 function calls + @1000 extra instructions per call make the 1 MIP VAX testsuite run + take two extra seconds, oops :-) + + Long term, this function can be eliminated, replaced by the code: + get_frame_type(current_frame()) == SIGTRAMP_FRAME (for new + architectures this is very cheap). */ + +static int +pc_in_sigtramp (CORE_ADDR pc) +{ + char *name; + find_pc_partial_function (pc, &name, NULL, NULL); + return PC_IN_SIGTRAMP (pc, name); +} + /* Given an execution control state that has been freshly filled in by an event from the inferior, figure out what it means and take @@ -2262,8 +2317,8 @@ process_event_stop_test: ecs->update_step_sp = 1; /* Did we just take a signal? */ - if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name) - && !PC_IN_SIGTRAMP (prev_pc, prev_func_name) + if (pc_in_sigtramp (stop_pc) + && !pc_in_sigtramp (prev_pc) && INNER_THAN (read_sp (), step_sp)) { /* We've just taken a signal; go until we are back to @@ -2373,7 +2428,7 @@ process_event_stop_test: { /* We're doing a "next". */ - if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name) + if (pc_in_sigtramp (stop_pc) && frame_id_inner (step_frame_id, frame_id_build (read_sp (), 0))) /* We stepped out of a signal handler, and into its @@ -2562,8 +2617,8 @@ static void check_sigtramp2 (struct execution_control_state *ecs) { if (trap_expected - && PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name) - && !PC_IN_SIGTRAMP (prev_pc, prev_func_name) + && pc_in_sigtramp (stop_pc) + && !pc_in_sigtramp (prev_pc) && INNER_THAN (read_sp (), step_sp)) { /* What has happened here is that we have just stepped the @@ -2727,15 +2782,6 @@ step_over_function (struct execution_control_state *ecs) static void stop_stepping (struct execution_control_state *ecs) { - if (target_has_execution) - { - /* Assuming the inferior still exists, set these up for next - time, just like we did above if we didn't break out of the - loop. */ - prev_pc = read_pc (); - prev_func_name = ecs->stop_func_name; - } - /* Let callers know we don't want to wait for the inferior anymore. */ ecs->wait_some_more = 0; } @@ -2749,7 +2795,6 @@ keep_going (struct execution_control_state *ecs) { /* Save the pc before execution, to compare with pc after stop. */ prev_pc = read_pc (); /* Might have been DECR_AFTER_BREAK */ - prev_func_name = ecs->stop_func_name; if (ecs->update_step_sp) step_sp = read_sp (); diff --git a/gdb/irix4-nat.c b/gdb/irix4-nat.c index b44c5bb..7635495 100644 --- a/gdb/irix4-nat.c +++ b/gdb/irix4-nat.c @@ -51,8 +51,8 @@ supply_gregset (gregset_t *gregsetp) { register int regi; register greg_t *regp = (greg_t *) (gregsetp->gp_regs); - char *zerobuf = alloca (max_register_size (current_gdbarch)); - memset (zerobuf, 0, max_register_size (current_gdbarch)); + char zerobuf[MAX_REGISTER_SIZE]; + memset (zerobuf, 0, MAX_REGISTER_SIZE); /* FIXME: somewhere, there should be a #define for the meaning of this magic number 32; we should use that. */ @@ -104,8 +104,8 @@ void supply_fpregset (fpregset_t *fpregsetp) { register int regi; - char *zerobuf = alloca (max_register_size (current_gdbarch)); - memset (zerobuf, 0, max_register_size (current_gdbarch)); + char zerobuf[MAX_REGISTER_SIZE]; + memset (zerobuf, 0, MAX_REGISTER_SIZE); for (regi = 0; regi < 32; regi++) supply_register (FP0_REGNUM + regi, @@ -178,7 +178,7 @@ static void fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, CORE_ADDR reg_addr) { - if (core_reg_size != REGISTER_BYTES) + if (core_reg_size != DEPRECATED_REGISTER_BYTES) { warning ("wrong size gregset struct in core file"); return; diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index 9e4f210..6128a04 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -196,7 +196,7 @@ static void fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, CORE_ADDR reg_addr) { - if (core_reg_size == REGISTER_BYTES) + if (core_reg_size == DEPRECATED_REGISTER_BYTES) { memcpy ((char *) deprecated_registers, core_reg_sect, core_reg_size); } diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index ff64e7d..99f7484 100644 --- a/gdb/jv-exp.y +++ b/gdb/jv-exp.y @@ -1235,7 +1235,7 @@ push_variable (name) char *tmp = copy_name (name); int is_a_field_of_this = 0; struct symbol *sym; - sym = lookup_symbol (tmp, expression_context_block, VAR_NAMESPACE, + sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN, &is_a_field_of_this, (struct symtab **) NULL); if (sym && SYMBOL_CLASS (sym) != LOC_TYPEDEF) { diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index 1a829af..144b3a7 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -152,7 +152,7 @@ add_class_symbol (struct type *type, CORE_ADDR addr) SYMBOL_CLASS (sym) = LOC_TYPEDEF; /* SYMBOL_VALUE (sym) = valu; */ SYMBOL_TYPE (sym) = type; - SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE; + SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN; SYMBOL_VALUE_ADDRESS (sym) = addr; return sym; } @@ -172,7 +172,7 @@ struct type * java_lookup_class (char *name) { struct symbol *sym; - sym = lookup_symbol (name, expression_context_block, STRUCT_NAMESPACE, + sym = lookup_symbol (name, expression_context_block, STRUCT_DOMAIN, (int *) 0, (struct symtab **) NULL); if (sym != NULL) return SYMBOL_TYPE (sym); @@ -580,7 +580,7 @@ get_java_object_type (void) if (java_object_type == NULL) { struct symbol *sym; - sym = lookup_symbol ("java.lang.Object", NULL, STRUCT_NAMESPACE, + sym = lookup_symbol ("java.lang.Object", NULL, STRUCT_DOMAIN, (int *) 0, (struct symtab **) NULL); if (sym == NULL) error ("cannot find java.lang.Object"); @@ -1058,6 +1058,8 @@ const struct language_defn java_language_defn = java_val_print, /* Print a value using appropriate syntax */ java_value_print, /* Print a top-level value */ NULL, /* Language specific skip_trampoline */ + value_of_this, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ java_demangle, /* Language specific symbol demangler */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index 8f888c3..78309c4 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -301,7 +301,6 @@ java_print_value_fields (struct type *type, char *valaddr, CORE_ADDR address, fprintf_filtered (stream, "<No data fields>"); else { - extern int inspect_it; int fields_seen = 0; for (i = n_baseclasses; i < len; i++) diff --git a/gdb/language.c b/gdb/language.c index aba597a..6271130 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -936,7 +936,7 @@ lang_bool_type (void) switch (current_language->la_language) { case language_fortran: - sym = lookup_symbol ("logical", NULL, VAR_NAMESPACE, NULL, NULL); + sym = lookup_symbol ("logical", NULL, VAR_DOMAIN, NULL, NULL); if (sym) { type = SYMBOL_TYPE (sym); @@ -947,9 +947,9 @@ lang_bool_type (void) case language_cplus: case language_pascal: if (current_language->la_language==language_cplus) - {sym = lookup_symbol ("bool", NULL, VAR_NAMESPACE, NULL, NULL);} + {sym = lookup_symbol ("bool", NULL, VAR_DOMAIN, NULL, NULL);} else - {sym = lookup_symbol ("boolean", NULL, VAR_NAMESPACE, NULL, NULL);} + {sym = lookup_symbol ("boolean", NULL, VAR_DOMAIN, NULL, NULL);} if (sym) { type = SYMBOL_TYPE (sym); @@ -958,7 +958,7 @@ lang_bool_type (void) } return builtin_type_bool; case language_java: - sym = lookup_symbol ("boolean", NULL, VAR_NAMESPACE, NULL, NULL); + sym = lookup_symbol ("boolean", NULL, VAR_DOMAIN, NULL, NULL); if (sym) { type = SYMBOL_TYPE (sym); @@ -1480,6 +1480,8 @@ const struct language_defn unknown_language_defn = unk_lang_val_print, /* Print a value using appropriate syntax */ unk_lang_value_print, /* Print a top-level value */ unk_lang_trampoline, /* Language specific skip_trampoline */ + value_of_this, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ unk_lang_demangle, /* Language specific symbol demangler */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ @@ -1512,6 +1514,8 @@ const struct language_defn auto_language_defn = unk_lang_val_print, /* Print a value using appropriate syntax */ unk_lang_value_print, /* Print a top-level value */ unk_lang_trampoline, /* Language specific skip_trampoline */ + value_of_this, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ unk_lang_demangle, /* Language specific symbol demangler */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ @@ -1543,6 +1547,8 @@ const struct language_defn local_language_defn = unk_lang_val_print, /* Print a value using appropriate syntax */ unk_lang_value_print, /* Print a top-level value */ unk_lang_trampoline, /* Language specific skip_trampoline */ + value_of_this, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ unk_lang_demangle, /* Language specific symbol demangler */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ diff --git a/gdb/language.h b/gdb/language.h index a873699..49c2cc8 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -211,6 +211,27 @@ struct language_defn if it isn't a language tramp for this language. */ CORE_ADDR (*skip_trampoline) (CORE_ADDR pc); + /* Now come some hooks for lookup_symbol. */ + + /* If this is non-NULL, lookup_symbol will do the 'field_of_this' + check, using this function to find the value of this. */ + + /* FIXME: carlton/2003-05-19: Audit all the language_defn structs + to make sure we're setting this appropriately: I'm sure it + could be NULL in more languages. */ + + struct value *(*la_value_of_this) (int complain); + + /* This is a function that lookup_symbol will call when it gets to + the part of symbol lookup where C looks up static and global + variables. */ + + struct symbol *(*la_lookup_symbol_nonlocal) (const char *, + const char *, + const struct block *, + const domain_enum, + struct symtab **); + /* Return demangled language symbol, or NULL. */ char *(*la_demangle) (const char *mangled, int options); diff --git a/gdb/linespec.c b/gdb/linespec.c index 230df36..1d00d79 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -776,7 +776,7 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, /* Set argptr to skip over the name. */ *argptr = (*next_component == '\'') ? next_component + 1 : next_component; /* Look up entire name. */ - sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab); + sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0, &sym_symtab); if (sym != NULL) return symbol_found (funfirstline, canonical, copy, @@ -899,9 +899,9 @@ locate_compound_sym (char **argptr, char *current_component, current_component++; *argptr = current_component; - return lookup_symbol_namespace (namespace, copy, NULL, - get_selected_block(0), - VAR_NAMESPACE, NULL); + return cp_lookup_symbol_namespace (namespace, copy, NULL, + get_selected_block(0), + VAR_DOMAIN, NULL); } /* Try to look up the symbol in the namespace NAMESPACE whose name @@ -930,9 +930,9 @@ decode_namespace (char **argptr, int funfirstline, copy[next_component - *argptr] = '\0'; *argptr = next_component; - sym = lookup_symbol_namespace (namespace, copy, NULL, - get_selected_block(0), - VAR_NAMESPACE, &sym_symtab); + sym = cp_lookup_symbol_namespace (namespace, copy, NULL, + get_selected_block(0), + VAR_DOMAIN, &sym_symtab); if (sym != NULL) { @@ -1110,7 +1110,7 @@ find_methods (struct type *class_type, char *method, unless we figure out how to get the physname without the name of the class, then the loop can't do any good. */ if (class_name != NULL - && (lookup_symbol (class_name, NULL, STRUCT_NAMESPACE, NULL, + && (lookup_symbol (class_name, NULL, STRUCT_DOMAIN, NULL, NULL) != NULL)) { int method_counter; @@ -1659,7 +1659,7 @@ decode_dollar (char **argptr, int funfirstline, struct symtab *default_symtab, struct minimal_symbol *msymbol; /* Look up entire name as a symbol first. */ - sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab); + sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0, &sym_symtab); if (sym != NULL) return symbol_found (funfirstline, canonical, copy, sym, NULL, sym_symtab); @@ -1754,7 +1754,7 @@ decode_variable (char **argptr, int funfirstline, char ***canonical, ? BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_symtab), STATIC_BLOCK) : get_selected_block (0)), - VAR_NAMESPACE, NULL, &sym_symtab); + VAR_DOMAIN, NULL, &sym_symtab); if (sym != NULL) { @@ -1840,7 +1840,7 @@ symbol_found (int funfirstline, char ***canonical, char *copy, { struct blockvector *bv = BLOCKVECTOR (sym_symtab); struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); - if (lookup_block_symbol (b, copy, NULL, VAR_NAMESPACE) != NULL) + if (lookup_block_symbol (b, copy, NULL, VAR_DOMAIN) != NULL) build_canonical_line_spec (values.sals, copy, canonical); } return values; diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c index 4be7fb8e..f425cb9 100644 --- a/gdb/lynx-nat.c +++ b/gdb/lynx-nat.c @@ -283,7 +283,7 @@ fetch_inferior_registers (int regno) if (whatregs & WHATREGS_GEN) { struct econtext ec; /* general regs */ - char *buf = alloca (max_register_size (current_gdbarch)); + char buf[MAX_REGISTER_SIZE]; int retval; int i; @@ -512,7 +512,7 @@ fetch_inferior_registers (int regno) ecp = registers_addr (PIDGET (inferior_ptid)); { - char *buf = alloca (max_register_size (current_gdbarch)); + char buf[MAX_REGISTER_SIZE]; for (regno = reglo; regno <= reghi; regno++) { int ptrace_fun = PTRACE_PEEKTHREAD; diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index 4ad3304..0e4ad02 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -542,7 +542,7 @@ block : fblock fblock : BLOCKNAME { struct symbol *sym = lookup_symbol (copy_name ($1), expression_context_block, - VAR_NAMESPACE, 0, NULL); + VAR_DOMAIN, 0, NULL); $$ = sym;} ; @@ -551,7 +551,7 @@ fblock : BLOCKNAME fblock : block COLONCOLON BLOCKNAME { struct symbol *tem = lookup_symbol (copy_name ($3), $1, - VAR_NAMESPACE, 0, NULL); + VAR_DOMAIN, 0, NULL); if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) error ("No function \"%s\" in specified context.", copy_name ($3)); @@ -575,7 +575,7 @@ variable: INTERNAL_VAR variable: block COLONCOLON NAME { struct symbol *sym; sym = lookup_symbol (copy_name ($3), $1, - VAR_NAMESPACE, 0, NULL); + VAR_DOMAIN, 0, NULL); if (sym == 0) error ("No symbol \"%s\" in specified context.", copy_name ($3)); @@ -594,7 +594,7 @@ variable: NAME sym = lookup_symbol (copy_name ($1), expression_context_block, - VAR_NAMESPACE, + VAR_DOMAIN, &is_a_field_of_this, NULL); if (sym) @@ -1019,7 +1019,7 @@ yylex () if (lookup_partial_symtab (tmp)) return BLOCKNAME; sym = lookup_symbol (tmp, expression_context_block, - VAR_NAMESPACE, 0, NULL); + VAR_DOMAIN, 0, NULL); if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK) return BLOCKNAME; if (lookup_typename (copy_name (yylval.sval), expression_context_block, 1)) diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index 4932cdf..528484f 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -116,7 +116,6 @@ m2_printstr (struct ui_file *stream, char *string, unsigned int length, unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; - extern int inspect_it; if (length == 0) { @@ -427,6 +426,8 @@ const struct language_defn m2_language_defn = m2_val_print, /* Print a value using appropriate syntax */ c_value_print, /* Print a top-level value */ NULL, /* Language specific skip_trampoline */ + value_of_this, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ NULL, /* Language specific symbol demangler */ {"", "", "", ""}, /* Binary format info */ {"%loB", "", "o", "B"}, /* Octal format info */ diff --git a/gdb/m3-nat.c b/gdb/m3-nat.c index 93ef57a..9e3f93b 100644 --- a/gdb/m3-nat.c +++ b/gdb/m3-nat.c @@ -2434,7 +2434,7 @@ // OBSOLETE // OBSOLETE sym = lookup_symbol (name, // OBSOLETE (struct block *) NULL, -// OBSOLETE VAR_NAMESPACE, +// OBSOLETE VAR_DOMAIN, // OBSOLETE (int *) NULL, // OBSOLETE (struct symtab **) NULL); // OBSOLETE diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 8b69c11..5d6e51e 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1373,16 +1373,15 @@ m68hc11_gdbarch_init (struct gdbarch_info info, 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_register_size (gdbarch, 2); - set_gdbarch_register_bytes (gdbarch, M68HC11_ALL_REGS * 2); + 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_pseudo_register_read (gdbarch, m68hc11_pseudo_register_read); set_gdbarch_pseudo_register_write (gdbarch, m68hc11_pseudo_register_write); set_gdbarch_call_dummy_address (gdbarch, m68hc11_call_dummy_address); - set_gdbarch_call_dummy_words (gdbarch, m68hc11_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, - sizeof (m68hc11_call_dummy_words)); + set_gdbarch_deprecated_call_dummy_words (gdbarch, m68hc11_call_dummy_words); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (m68hc11_call_dummy_words)); set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register); set_gdbarch_deprecated_extract_return_value (gdbarch, m68hc11_extract_return_value); set_gdbarch_deprecated_push_arguments (gdbarch, m68hc11_push_arguments); diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index 63d0768..087d0bb 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -29,6 +29,7 @@ #include "inferior.h" #include "regcache.h" #include "arch-utils.h" +#include "osabi.h" #include "m68k-tdep.h" @@ -429,9 +430,9 @@ void m68k_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p) { - bfd_putb32 (fun, (unsigned char *) dummy + CALL_DUMMY_START_OFFSET + 2); + bfd_putb32 (fun, (unsigned char *) dummy + DEPRECATED_CALL_DUMMY_START_OFFSET + 2); bfd_putb32 (nargs * 4, - (unsigned char *) dummy + CALL_DUMMY_START_OFFSET + 8); + (unsigned char *) dummy + DEPRECATED_CALL_DUMMY_START_OFFSET + 8); } @@ -1025,11 +1026,11 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 12); set_gdbarch_register_virtual_type (gdbarch, m68k_register_virtual_type); set_gdbarch_register_name (gdbarch, m68k_register_name); - set_gdbarch_register_size (gdbarch, 4); + set_gdbarch_deprecated_register_size (gdbarch, 4); set_gdbarch_register_byte (gdbarch, m68k_register_byte); set_gdbarch_num_regs (gdbarch, 29); set_gdbarch_register_bytes_ok (gdbarch, m68k_register_bytes_ok); - set_gdbarch_register_bytes (gdbarch, (16 * 4 + 8 + 8 * 12 + 3 * 4)); + set_gdbarch_deprecated_register_bytes (gdbarch, (16 * 4 + 8 + 8 * 12 + 3 * 4)); set_gdbarch_sp_regnum (gdbarch, M68K_SP_REGNUM); set_gdbarch_deprecated_fp_regnum (gdbarch, M68K_FP_REGNUM); set_gdbarch_pc_regnum (gdbarch, M68K_PC_REGNUM); @@ -1038,20 +1039,23 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); set_gdbarch_call_dummy_location (gdbarch, ON_STACK); - set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 24); + set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 24); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); - set_gdbarch_call_dummy_length (gdbarch, 28); - set_gdbarch_call_dummy_start_offset (gdbarch, 12); + set_gdbarch_deprecated_call_dummy_length (gdbarch, 28); + set_gdbarch_deprecated_call_dummy_start_offset (gdbarch, 12); - set_gdbarch_call_dummy_words (gdbarch, call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_words)); - set_gdbarch_fix_call_dummy (gdbarch, m68k_fix_call_dummy); + set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_words)); + set_gdbarch_deprecated_fix_call_dummy (gdbarch, m68k_fix_call_dummy); set_gdbarch_deprecated_push_dummy_frame (gdbarch, m68k_push_dummy_frame); 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); + /* Hook in ABI-specific overrides, if they have been registered. */ + gdbarch_init_osabi (info, gdbarch); + return gdbarch; } diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c index 0f0a7d1..e077dea 100644 --- a/gdb/m68klinux-nat.c +++ b/gdb/m68klinux-nat.c @@ -135,7 +135,7 @@ fetch_register (int regno) char mess[128]; /* For messages */ register int i; unsigned int offset; /* Offset of registers within the u area. */ - char *buf = alloca (max_register_size (current_gdbarch)); + char buf[MAX_REGISTER_SIZE]; int tid; if (CANNOT_FETCH_REGISTER (regno)) @@ -199,7 +199,7 @@ store_register (int regno) register int i; unsigned int offset; /* Offset of registers within the u area. */ int tid; - char *buf = alloca (MAX_REGISTER_RAW_SIZE); + char buf[MAX_REGISTER_SIZE]; if (CANNOT_STORE_REGISTER (regno)) { diff --git a/gdb/m68klinux-tdep.c b/gdb/m68klinux-tdep.c index afd2d2d..8b9193d 100644 --- a/gdb/m68klinux-tdep.c +++ b/gdb/m68klinux-tdep.c @@ -1,6 +1,6 @@ /* Motorola m68k target-dependent support for GNU/Linux. - Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, + Copyright 1996, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -24,7 +24,10 @@ #include "gdbcore.h" #include "frame.h" #include "target.h" - +#include "gdb_string.h" +#include "gdbtypes.h" +#include "osabi.h" +#include "m68k-tdep.h" /* Check whether insn1 and insn2 are parts of a signal trampoline. */ @@ -66,8 +69,8 @@ m68k_linux_in_sigtramp (CORE_ADDR pc) if (IS_RT_SIGTRAMP (insn0, insn1)) return 2; - insn0 = (insn0 << 16) | (insn1 >> 16); - insn1 = (insn1 << 16) | (insn2 >> 16); + insn0 = ((insn0 << 16) & 0xffffffff) | (insn1 >> 16); + insn1 = ((insn1 << 16) & 0xffffffff) | (insn2 >> 16); if (IS_SIGTRAMP (insn0, insn1)) return 1; if (IS_RT_SIGTRAMP (insn0, insn1)) @@ -93,9 +96,9 @@ m68k_linux_sigtramp_saved_pc (struct frame_info *frame) int sigcontext_offs = (2 * TARGET_INT_BIT) / TARGET_CHAR_BIT; /* Get sigcontext address, it is the third parameter on the stack. */ - if (frame->next) + if (get_next_frame (frame)) sigcontext_addr - = read_memory_unsigned_integer (FRAME_ARGS_ADDRESS (frame->next) + = read_memory_unsigned_integer (get_frame_base (get_next_frame (frame)) + FRAME_ARGS_SKIP + sigcontext_offs, ptrbytes); @@ -107,7 +110,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 (frame->pc) == 2) + if (m68k_linux_in_sigtramp (get_frame_pc (frame)) == 2) target_read_memory (sigcontext_addr + UCONTEXT_PC_OFFSET, buf, ptrbytes); else target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, ptrbytes); @@ -116,11 +119,89 @@ m68k_linux_sigtramp_saved_pc (struct frame_info *frame) /* Return the saved program counter for FRAME. */ -CORE_ADDR +static CORE_ADDR m68k_linux_frame_saved_pc (struct frame_info *frame) { if (get_frame_type (frame) == SIGTRAMP_FRAME) return m68k_linux_sigtramp_saved_pc (frame); - return read_memory_unsigned_integer (frame->frame + 4, 4); + return read_memory_unsigned_integer (get_frame_base (frame) + 4, 4); +} + +/* The following definitions are appropriate when using the ELF + format, where floating point values are returned in fp0, pointer + values in a0 and other values in d0. */ + +/* 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. */ + +static void +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); + } + else if (TYPE_CODE (type) == TYPE_CODE_PTR) + memcpy (valbuf, regbuf + REGISTER_BYTE (M68K_A0_REGNUM), + TYPE_LENGTH (type)); + else + memcpy (valbuf, + regbuf + (TYPE_LENGTH (type) >= 4 ? 0 : 4 - TYPE_LENGTH (type)), + TYPE_LENGTH (type)); +} + +/* Write into appropriate registers a function return value of type + TYPE, given in virtual format. */ + +static void +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_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), + raw_buffer, TYPE_LENGTH (type)); + } + else + { + if (TYPE_CODE (type) == TYPE_CODE_PTR) + deprecated_write_register_bytes (REGISTER_BYTE (M68K_A0_REGNUM), + valbuf, TYPE_LENGTH (type)); + deprecated_write_register_bytes (0, valbuf, TYPE_LENGTH (type)); + } +} + +/* 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. */ + +static CORE_ADDR +m68k_linux_extract_struct_value_address (char *regbuf) +{ + return *(CORE_ADDR *) (regbuf + REGISTER_BYTE (M68K_A0_REGNUM)); +} + +static void +m68k_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +{ + set_gdbarch_deprecated_frame_saved_pc (gdbarch, + m68k_linux_frame_saved_pc); + set_gdbarch_deprecated_extract_return_value (gdbarch, + m68k_linux_extract_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, + m68k_linux_store_return_value); + set_gdbarch_deprecated_extract_struct_value_address (gdbarch, + m68k_linux_extract_struct_value_address); +} + +void +_initialize_m68k_linux_tdep (void) +{ + gdbarch_register_osabi (bfd_arch_m68k, 0, GDB_OSABI_LINUX, + m68k_linux_init_abi); } diff --git a/gdb/maint.c b/gdb/maint.c index 2eb59ee..aa34239 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -434,18 +434,6 @@ maintenance_print_command (char *arg, int from_tty) help_list (maintenanceprintlist, "maintenance print ", -1, gdb_stdout); } -/* The "maintenance list" command is defined as a prefix, with - allow_unknown 0. Therefore, its own definition is called only for - "maintenance list" with no args. */ - -/* ARGSUSED */ -static void -maintenance_list_command (char *arg, int from_tty) -{ - printf_unfiltered ("\"maintenance list\" must be followed by the name of a list command.\n"); - help_list (maintenancelistlist, "maintenance list ", -1, gdb_stdout); -} - /* The "maintenance translate-address" command converts a section and address to a symbol. This can be called in two ways: maintenance translate-address <secname> <addr> @@ -744,11 +732,6 @@ lists all sections from all object files, including shared libraries.", &maintenanceprintlist, "maintenance print ", 0, &maintenancelist); - add_prefix_cmd ("list", class_maintenance, maintenance_list_command, - "Maintenance command for listing GDB internal state.", - &maintenancelistlist, "maintenance list ", 0, - &maintenancelist); - add_prefix_cmd ("set", class_maintenance, maintenance_set_cmd, "\ Set GDB internal variables used by the GDB maintainer.\n\ Configure variables internal to GDB that aid in GDB's maintenance", @@ -827,18 +810,18 @@ If a SOURCE file is specified, dump only that file's partial symbols.", "Print dump of current object file definitions.", &maintenanceprintlist); - add_cmd ("symtabs", class_maintenance, maintenance_list_symtabs, + add_cmd ("symtabs", class_maintenance, maintenance_info_symtabs, "List the full symbol tables for all object files.\n\ This does not include information about individual symbols, blocks, or\n\ linetables --- just the symbol table structures themselves.\n\ With an argument REGEXP, list the symbol tables whose names that match that.", - &maintenancelistlist); + &maintenanceinfolist); - add_cmd ("psymtabs", class_maintenance, maintenance_list_psymtabs, + add_cmd ("psymtabs", class_maintenance, maintenance_info_psymtabs, "List the partial symbol tables for all object files.\n\ This does not include information about individual partial symbols,\n\ just the symbol table structures themselves.", - &maintenancelistlist); + &maintenanceinfolist); add_cmd ("statistics", class_maintenance, maintenance_print_statistics, "Print statistics about internal gdb state.", diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index b80152b..ea97ec2 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -28,6 +28,7 @@ #include "inferior.h" #include "arch-utils.h" #include "gdb_string.h" +#include "disasm.h" /* Functions declared and used only in this file */ @@ -163,7 +164,7 @@ mcore_dump_insn (char *commnt, CORE_ADDR pc, int insn) { printf_filtered ("MCORE: %s %08x %08x ", commnt, (unsigned int) pc, (unsigned int) insn); - TARGET_PRINT_INSN (pc, &deprecated_tm_print_insn_info); + gdb_print_insn (pc, gdb_stdout); printf_filtered ("\n"); } } @@ -682,7 +683,8 @@ mcore_frame_chain (struct frame_info * fi) { /* The "FP" was saved on the stack. Don't forget to adjust the "FP" with the framesize to get a real FP. */ - callers_addr = read_memory_integer (get_frame_saved_regs (fi)[fp], REGISTER_SIZE) + callers_addr = read_memory_integer (get_frame_saved_regs (fi)[fp], + DEPRECATED_REGISTER_SIZE) + get_frame_extra_info (dummy)->framesize; } else @@ -766,7 +768,7 @@ mcore_find_callers_reg (struct frame_info *fi, int regnum) get_frame_base (fi), regnum); else if (get_frame_saved_regs (fi)[regnum] != 0) return read_memory_integer (get_frame_saved_regs (fi)[regnum], - REGISTER_SIZE); + DEPRECATED_REGISTER_SIZE); } return read_register (regnum); @@ -813,7 +815,7 @@ mcore_pop_frame (void) ULONGEST value; value = read_memory_unsigned_integer (get_frame_saved_regs (fi)[rn], - REGISTER_SIZE); + DEPRECATED_REGISTER_SIZE); write_register (rn, value); } } @@ -829,9 +831,9 @@ mcore_pop_frame (void) /* Setup arguments and PR for a call to the target. First six arguments go in FIRST_ARGREG -> LAST_ARGREG, subsequent args go on to the stack. - * Types with lengths greater than REGISTER_SIZE may not be split - between registers and the stack, and they must start in an even-numbered - register. Subsequent args will go onto the stack. + - Types with lengths greater than DEPRECATED_REGISTER_SIZE may not + be split between registers and the stack, and they must start in an + even-numbered register. Subsequent args will go onto the stack. * Structs may be split between registers and stack, left-aligned. @@ -883,21 +885,21 @@ mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp, numbered register. */ olen = len; - if (TYPE_CODE (type) != TYPE_CODE_STRUCT && len > REGISTER_SIZE && argreg % 2) + if (TYPE_CODE (type) != TYPE_CODE_STRUCT && len > DEPRECATED_REGISTER_SIZE && argreg % 2) { - mcore_insn_debug (("MCORE PUSH: %d > REGISTER_SIZE: and %s is not even\n", + mcore_insn_debug (("MCORE PUSH: %d > DEPRECATED_REGISTER_SIZE: and %s is not even\n", len, mcore_register_names[argreg])); argreg++; } - if ((argreg <= LAST_ARGREG && len <= (LAST_ARGREG - argreg + 1) * REGISTER_SIZE) + if ((argreg <= LAST_ARGREG && len <= (LAST_ARGREG - argreg + 1) * DEPRECATED_REGISTER_SIZE) || (TYPE_CODE (type) == TYPE_CODE_STRUCT)) { /* Something that will fit entirely into registers (or a struct which may be split between registers and stack). */ mcore_insn_debug (("MCORE PUSH: arg %d going into regs\n", argnum)); - if (TYPE_CODE (type) == TYPE_CODE_STRUCT && olen < REGISTER_SIZE) + if (TYPE_CODE (type) == TYPE_CODE_STRUCT && olen < DEPRECATED_REGISTER_SIZE) { /* Small structs must be right aligned within the register, the most significant bits are undefined. */ @@ -908,16 +910,16 @@ mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp, while (len > 0 && argreg <= LAST_ARGREG) { - write_register (argreg, extract_unsigned_integer (val, REGISTER_SIZE)); + write_register (argreg, extract_unsigned_integer (val, DEPRECATED_REGISTER_SIZE)); argreg++; - val += REGISTER_SIZE; - len -= REGISTER_SIZE; + val += DEPRECATED_REGISTER_SIZE; + len -= DEPRECATED_REGISTER_SIZE; } /* Any remainder for the stack is noted below... */ } else if (TYPE_CODE (VALUE_TYPE (args[argnum])) != TYPE_CODE_STRUCT - && len > REGISTER_SIZE) + && len > DEPRECATED_REGISTER_SIZE) { /* All subsequent args go onto the stack. */ mcore_insn_debug (("MCORE PUSH: does not fit into regs, going onto stack\n")); @@ -990,7 +992,7 @@ mcore_use_struct_convention (int gcc_p, struct type *type) CORE_ADDR mcore_extract_struct_value_address (char *regbuf) { - return extract_address (regbuf + REGISTER_BYTE (FIRST_ARGREG), REGISTER_SIZE); + return extract_address (regbuf + REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE); } /* Given a function which returns a value of type TYPE, extract the @@ -1028,7 +1030,7 @@ mcore_store_return_value (struct type *type, char *valbuf) value_size = TYPE_LENGTH (type); /* Return value fits into registers. */ - return_size = (value_size + REGISTER_SIZE - 1) & ~(REGISTER_SIZE - 1); + return_size = (value_size + DEPRECATED_REGISTER_SIZE - 1) & ~(DEPRECATED_REGISTER_SIZE - 1); offset = REGISTER_BYTE (RETVAL_REGNUM) + (return_size - value_size); zeros = alloca (return_size); memset (zeros, 0, return_size); @@ -1100,7 +1102,7 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Registers: */ /* All registers are 32 bits */ - set_gdbarch_register_size (gdbarch, MCORE_REG_SIZE); + set_gdbarch_deprecated_register_size (gdbarch, MCORE_REG_SIZE); set_gdbarch_deprecated_max_register_raw_size (gdbarch, MCORE_REG_SIZE); set_gdbarch_deprecated_max_register_virtual_size (gdbarch, MCORE_REG_SIZE); set_gdbarch_register_name (gdbarch, mcore_register_name); @@ -1108,7 +1110,7 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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_register_bytes (gdbarch, MCORE_REG_SIZE * MCORE_NUM_REGS); + 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); set_gdbarch_sp_regnum (gdbarch, 0); @@ -1116,8 +1118,8 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Call Dummies: */ - set_gdbarch_call_dummy_words (gdbarch, call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); + 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_saved_pc_after_call (gdbarch, mcore_saved_pc_after_call); set_gdbarch_function_start_offset (gdbarch, 0); diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index bf2ad80..04eefb5 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -296,7 +296,7 @@ static struct blockvector *new_bvect (int); static struct type *parse_type (int, union aux_ext *, unsigned int, int *, int, char *); -static struct symbol *mylookup_symbol (char *, struct block *, namespace_enum, +static struct symbol *mylookup_symbol (char *, struct block *, domain_enum, enum address_class); static void sort_blocks (struct symtab *); @@ -689,7 +689,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, SYMBOL_VALUE (s) = svalue; data: /* Common code for symbols describing data */ - SYMBOL_NAMESPACE (s) = VAR_NAMESPACE; + SYMBOL_DOMAIN (s) = VAR_DOMAIN; SYMBOL_CLASS (s) = class; add_symbol (s, b); @@ -712,7 +712,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, name = "this"; /* FIXME, not alloc'd in obstack */ s = new_symbol (name); - SYMBOL_NAMESPACE (s) = VAR_NAMESPACE; + SYMBOL_DOMAIN (s) = VAR_DOMAIN; switch (sh->sc) { case scRegister: @@ -741,7 +741,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, case stLabel: /* label, goes into current block */ s = new_symbol (name); - SYMBOL_NAMESPACE (s) = VAR_NAMESPACE; /* so that it can be used */ + SYMBOL_DOMAIN (s) = VAR_DOMAIN; /* so that it can be used */ SYMBOL_CLASS (s) = LOC_LABEL; /* but not misused */ SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value; SYMBOL_TYPE (s) = mdebug_type_int; @@ -783,7 +783,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, break; } s = new_symbol (name); - SYMBOL_NAMESPACE (s) = VAR_NAMESPACE; + SYMBOL_DOMAIN (s) = VAR_DOMAIN; SYMBOL_CLASS (s) = LOC_BLOCK; /* Type of the return value */ if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil) @@ -1109,7 +1109,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, ¤t_objfile->symbol_obstack); SYMBOL_CLASS (enum_sym) = LOC_CONST; SYMBOL_TYPE (enum_sym) = t; - SYMBOL_NAMESPACE (enum_sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (enum_sym) = VAR_DOMAIN; SYMBOL_VALUE (enum_sym) = tsym.value; if (SYMBOL_VALUE (enum_sym) < 0) unsigned_enum = 0; @@ -1139,7 +1139,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, } s = new_symbol (name); - SYMBOL_NAMESPACE (s) = STRUCT_NAMESPACE; + SYMBOL_DOMAIN (s) = STRUCT_DOMAIN; SYMBOL_CLASS (s) = LOC_TYPEDEF; SYMBOL_VALUE (s) = 0; SYMBOL_TYPE (s) = t; @@ -1195,7 +1195,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, /* Make up special symbol to contain procedure specific info */ s = new_symbol (MIPS_EFI_SYMBOL_NAME); - SYMBOL_NAMESPACE (s) = LABEL_NAMESPACE; + SYMBOL_DOMAIN (s) = LABEL_DOMAIN; SYMBOL_CLASS (s) = LOC_CONST; SYMBOL_TYPE (s) = mdebug_type_void; e = ((struct mips_extra_func_info *) @@ -1340,7 +1340,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, if (has_opaque_xref (cur_fdr, sh)) break; s = new_symbol (name); - SYMBOL_NAMESPACE (s) = VAR_NAMESPACE; + SYMBOL_DOMAIN (s) = VAR_DOMAIN; SYMBOL_CLASS (s) = LOC_TYPEDEF; SYMBOL_BLOCK_VALUE (s) = top_stack->cur_block; SYMBOL_TYPE (s) = t; @@ -1923,19 +1923,19 @@ parse_procedure (PDR *pr, struct symtab *search_symtab, the same name exists, lookup_symbol will eventually read in the symtab for the global function and clobber cur_fdr. */ FDR *save_cur_fdr = cur_fdr; - s = lookup_symbol (sh_name, NULL, VAR_NAMESPACE, 0, NULL); + s = lookup_symbol (sh_name, NULL, VAR_DOMAIN, 0, NULL); cur_fdr = save_cur_fdr; #else s = mylookup_symbol (sh_name, BLOCKVECTOR_BLOCK (BLOCKVECTOR (search_symtab), STATIC_BLOCK), - VAR_NAMESPACE, + VAR_DOMAIN, LOC_BLOCK); #endif } else s = mylookup_symbol (sh_name, top_stack->cur_block, - VAR_NAMESPACE, LOC_BLOCK); + VAR_DOMAIN, LOC_BLOCK); if (s != 0) { @@ -1949,7 +1949,7 @@ parse_procedure (PDR *pr, struct symtab *search_symtab, #else /* FIXME -- delete. We can't do symbol allocation now; it's all done. */ s = new_symbol (sh_name); - SYMBOL_NAMESPACE (s) = VAR_NAMESPACE; + SYMBOL_DOMAIN (s) = VAR_DOMAIN; SYMBOL_CLASS (s) = LOC_BLOCK; /* Donno its type, hope int is ok */ SYMBOL_TYPE (s) = lookup_function_type (mdebug_type_int); @@ -1967,7 +1967,7 @@ parse_procedure (PDR *pr, struct symtab *search_symtab, #endif } - i = mylookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_NAMESPACE, LOC_CONST); + i = mylookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_DOMAIN, LOC_CONST); if (i) { @@ -2999,7 +2999,7 @@ parse_partial_symbols (struct objfile *objfile) namestring = STATIC_TRANSFORM_NAME (namestring); #endif add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_STATIC, + VAR_DOMAIN, LOC_STATIC, &objfile->static_psymbols, 0, sh.value, psymtab_language, objfile); @@ -3009,7 +3009,7 @@ parse_partial_symbols (struct objfile *objfile) /* The addresses in these entries are reported to be wrong. See the code that reads 'G's for symtabs. */ add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_STATIC, + VAR_DOMAIN, LOC_STATIC, &objfile->global_psymbols, 0, sh.value, psymtab_language, objfile); @@ -3027,7 +3027,7 @@ parse_partial_symbols (struct objfile *objfile) && namestring[0] != ' ')) { add_psymbol_to_list (namestring, p - namestring, - STRUCT_NAMESPACE, LOC_TYPEDEF, + STRUCT_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, sh.value, 0, psymtab_language, objfile); @@ -3035,7 +3035,7 @@ parse_partial_symbols (struct objfile *objfile) { /* Also a typedef with the same name. */ add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_TYPEDEF, + VAR_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, sh.value, 0, psymtab_language, objfile); @@ -3051,7 +3051,7 @@ parse_partial_symbols (struct objfile *objfile) // OBSOLETE { // OBSOLETE /* Also a typedef with the same name. */ // OBSOLETE add_psymbol_to_list (namestring, p - namestring, -// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF, +// OBSOLETE VAR_DOMAIN, LOC_TYPEDEF, // OBSOLETE &objfile->static_psymbols, // OBSOLETE sh.value, 0, // OBSOLETE psymtab_language, objfile); @@ -3063,7 +3063,7 @@ parse_partial_symbols (struct objfile *objfile) if (p != namestring) /* a name is there, not just :T... */ { add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_TYPEDEF, + VAR_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, sh.value, 0, psymtab_language, objfile); @@ -3125,7 +3125,7 @@ parse_partial_symbols (struct objfile *objfile) /* Note that the value doesn't matter for enum constants in psymtabs, just in symtabs. */ add_psymbol_to_list (p, q - p, - VAR_NAMESPACE, LOC_CONST, + VAR_DOMAIN, LOC_CONST, &objfile->static_psymbols, 0, 0, psymtab_language, objfile); /* Point past the name. */ @@ -3142,7 +3142,7 @@ parse_partial_symbols (struct objfile *objfile) case 'c': /* Constant, e.g. from "const" in Pascal. */ add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_CONST, + VAR_DOMAIN, LOC_CONST, &objfile->static_psymbols, sh.value, 0, psymtab_language, objfile); continue; @@ -3159,7 +3159,7 @@ parse_partial_symbols (struct objfile *objfile) } sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->static_psymbols, 0, sh.value, psymtab_language, objfile); @@ -3180,7 +3180,7 @@ parse_partial_symbols (struct objfile *objfile) } sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->global_psymbols, 0, sh.value, psymtab_language, objfile); @@ -3415,12 +3415,12 @@ parse_partial_symbols (struct objfile *objfile) symbol table. */ if (sh.st == stProc) add_psymbol_to_list (name, strlen (name), - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->global_psymbols, 0, sh.value, psymtab_language, objfile); else add_psymbol_to_list (name, strlen (name), - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->static_psymbols, 0, sh.value, psymtab_language, objfile); @@ -3489,7 +3489,7 @@ parse_partial_symbols (struct objfile *objfile) && sh.index != cur_sdx + 2) { add_psymbol_to_list (name, strlen (name), - STRUCT_NAMESPACE, LOC_TYPEDEF, + STRUCT_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, 0, (CORE_ADDR) 0, psymtab_language, objfile); @@ -3530,7 +3530,7 @@ parse_partial_symbols (struct objfile *objfile) } /* Use this gdb symbol */ add_psymbol_to_list (name, strlen (name), - VAR_NAMESPACE, class, + VAR_DOMAIN, class, &objfile->static_psymbols, 0, sh.value, psymtab_language, objfile); skip: @@ -3606,7 +3606,7 @@ parse_partial_symbols (struct objfile *objfile) } name = debug_info->ssext + psh->iss; add_psymbol_to_list (name, strlen (name), - VAR_NAMESPACE, class, + VAR_DOMAIN, class, &objfile->global_psymbols, 0, svalue, psymtab_language, objfile); @@ -3776,7 +3776,7 @@ handle_psymbol_enumerators (struct objfile *objfile, FDR *fh, int stype, /* Note that the value doesn't matter for enum constants in psymtabs, just in symtabs. */ add_psymbol_to_list (name, strlen (name), - VAR_NAMESPACE, LOC_CONST, + VAR_DOMAIN, LOC_CONST, &objfile->static_psymbols, 0, (CORE_ADDR) 0, psymtab_language, objfile); ext_sym += external_sym_size; @@ -3969,7 +3969,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename) struct symbol *s = new_symbol (MIPS_EFI_SYMBOL_NAME); memset (e, 0, sizeof (struct mips_extra_func_info)); - SYMBOL_NAMESPACE (s) = LABEL_NAMESPACE; + SYMBOL_DOMAIN (s) = LABEL_DOMAIN; SYMBOL_CLASS (s) = LOC_CONST; SYMBOL_TYPE (s) = mdebug_type_void; SYMBOL_VALUE (s) = (long) e; @@ -4439,7 +4439,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, enum type_code type_cod static struct symbol * mylookup_symbol (char *name, register struct block *block, - namespace_enum namespace, enum address_class class) + domain_enum domain, enum address_class class) { struct dict_iterator iter; int inc; @@ -4449,7 +4449,7 @@ mylookup_symbol (char *name, register struct block *block, ALL_BLOCK_SYMBOLS (block, iter, sym) { if (DEPRECATED_SYMBOL_NAME (sym)[0] == inc - && SYMBOL_NAMESPACE (sym) == namespace + && SYMBOL_DOMAIN (sym) == domain && SYMBOL_CLASS (sym) == class && strcmp (DEPRECATED_SYMBOL_NAME (sym), name) == 0) return sym; @@ -4457,7 +4457,7 @@ mylookup_symbol (char *name, register struct block *block, block = BLOCK_SUPERBLOCK (block); if (block) - return mylookup_symbol (name, block, namespace, class); + return mylookup_symbol (name, block, domain, class); return 0; } @@ -4839,7 +4839,7 @@ fixup_sigtramp (void) * needed info. Note we make it a nested procedure of sigvec, * which is the way the (assembly) code is actually written. */ - SYMBOL_NAMESPACE (s) = VAR_NAMESPACE; + SYMBOL_DOMAIN (s) = VAR_DOMAIN; SYMBOL_CLASS (s) = LOC_BLOCK; SYMBOL_TYPE (s) = init_type (TYPE_CODE_FUNC, 4, 0, (char *) NULL, st->objfile); @@ -4881,7 +4881,7 @@ fixup_sigtramp (void) current_objfile = st->objfile; /* Keep new_symbol happy */ s = new_symbol (MIPS_EFI_SYMBOL_NAME); SYMBOL_VALUE (s) = (long) e; - SYMBOL_NAMESPACE (s) = LABEL_NAMESPACE; + SYMBOL_DOMAIN (s) = LABEL_DOMAIN; SYMBOL_CLASS (s) = LOC_CONST; SYMBOL_TYPE (s) = mdebug_type_void; current_objfile = NULL; diff --git a/gdb/mem-break.c b/gdb/mem-break.c index 9cf638e..96750c8 100644 --- a/gdb/mem-break.c +++ b/gdb/mem-break.c @@ -24,7 +24,8 @@ #include "defs.h" -/* This file is only useful if BREAKPOINT is set. If not, we punt. */ +/* This file is only useful if BREAKPOINT_FROM_PC is set. If not, we + punt. */ #include "symtab.h" #include "breakpoint.h" @@ -32,50 +33,6 @@ #include "target.h" -/* Use the program counter to determine the contents and size - of a breakpoint instruction. If no target-dependent macro - BREAKPOINT_FROM_PC has been defined to implement this function, - assume that the breakpoint doesn't depend on the PC, and - use the values of the BIG_BREAKPOINT and LITTLE_BREAKPOINT macros. - Return a pointer to a string of bytes that encode a breakpoint - instruction, stores the length of the string to *lenptr, - and optionally adjust the pc to point to the correct memory location - for inserting the breakpoint. */ - -const unsigned char * -memory_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) -{ - /* {BIG_,LITTLE_}BREAKPOINT is the sequence of bytes we insert for a - breakpoint. On some machines, breakpoints are handled by the - target environment and we don't have to worry about them here. */ -#ifdef BIG_BREAKPOINT - if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) - { - static unsigned char big_break_insn[] = BIG_BREAKPOINT; - *lenptr = sizeof (big_break_insn); - return big_break_insn; - } -#endif -#ifdef LITTLE_BREAKPOINT - if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG) - { - static unsigned char little_break_insn[] = LITTLE_BREAKPOINT; - *lenptr = sizeof (little_break_insn); - return little_break_insn; - } -#endif -#ifdef BREAKPOINT - { - static unsigned char break_insn[] = BREAKPOINT; - *lenptr = sizeof (break_insn); - return break_insn; - } -#endif - *lenptr = 0; - return NULL; -} - - /* Insert a breakpoint on targets that don't have any better breakpoint support. We read the contents of the target location and stash it, then overwrite it with a breakpoint instruction. ADDR is the target diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 069abfb..4451cb8 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,38 @@ +2003-05-16 Andrew Cagney <cagney@redhat.com> + + * mi-main.c (mi_setup_architecture_data): + +2003-05-12 Elena Zannoni <ezannoni@redhat.com> + + * mi-mi-cmd-stack.c (list_args_or_locals): Rename VAR_NAMESPACE to + VAR_DOMAIN. + +2003-05-11 Andrew Cagney <cagney@redhat.com> + + * mi-symbol-cmds.c: Rename "mi-cmd-symbol.c", avoid 8.3 problem. + +2003-05-08 Andrew Cagney <cagney@redhat.com> + + * mi-main.c (register_changed_p): Use MAX_REGISTER_SIZE instead of + MAX_REGISTER_RAW_SIZE. + +2003-05-08 Andrew Cagney <cagney@redhat.com> + + * mi-main.c (get_register): Use MAX_REGISTER_SIZE. + +2003-05-05 Andrew Cagney <cagney@redhat.com> + + * mi-main.c (mi_cmd_data_write_register_values): Replace + REGISTER_SIZE with DEPRECATED_REGISTER_SIZE. + +2003-05-03 J. Brobecker <brobecker@gnat.com> + + From Thierry Schneider <tpschneider1@yahoo.com>: + * mi-cmds.h (mi_cmd_symbol_list_lines): Add declaration. + * mi-cmds.c (mi_cmds): Add entry for new MI command. + * mi-cmd-symbol.c (mi_cmd_symbol_list_lines): New source file + for all symbol-related commands. + 2003-04-02 Bob Rossi <bob_rossi@cox.net> * mi-cmd-file.c: New file to implement mi file commands. diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index fa2fb5c..b968d84 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -281,7 +281,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi) struct symbol *sym2; if (!locals) sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym), - block, VAR_NAMESPACE, + block, VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); else diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c index d677842..9ec174f 100644 --- a/gdb/mi/mi-cmds.c +++ b/gdb/mi/mi-cmds.c @@ -119,6 +119,7 @@ struct mi_cmd mi_cmds[] = {"symbol-info-line", 0, 0}, {"symbol-info-symbol", 0, 0}, {"symbol-list-functions", 0, 0}, + {"symbol-list-lines", 0, 0, mi_cmd_symbol_list_lines}, {"symbol-list-types", 0, 0}, {"symbol-list-variables", 0, 0}, {"symbol-locate", 0, 0}, diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h index 47e1bbf..b0c8cb8 100644 --- a/gdb/mi/mi-cmds.h +++ b/gdb/mi/mi-cmds.h @@ -88,6 +88,7 @@ extern mi_cmd_argv_ftype mi_cmd_stack_list_args; extern mi_cmd_argv_ftype mi_cmd_stack_list_frames; extern mi_cmd_argv_ftype mi_cmd_stack_list_locals; extern mi_cmd_argv_ftype mi_cmd_stack_select_frame; +extern mi_cmd_argv_ftype mi_cmd_symbol_list_lines; extern mi_cmd_args_ftype mi_cmd_target_download; extern mi_cmd_args_ftype mi_cmd_target_select; extern mi_cmd_argv_ftype mi_cmd_thread_list_ids; diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 6ba0698..0e9cb24 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -398,7 +398,7 @@ mi_cmd_data_list_changed_registers (char *command, char **argv, int argc) static int register_changed_p (int regnum) { - char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); + char raw_buffer[MAX_REGISTER_SIZE]; if (! frame_register_read (deprecated_selected_frame, regnum, raw_buffer)) return -1; @@ -511,8 +511,8 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc) static int get_register (int regnum, int format) { - char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); - char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE); + char raw_buffer[MAX_REGISTER_SIZE]; + char virtual_buffer[MAX_REGISTER_SIZE]; int optim; int realnum; CORE_ADDR addr; @@ -636,9 +636,9 @@ mi_cmd_data_write_register_values (char *command, char **argv, int argc) /* Get the value as a number */ value = parse_and_eval_address (argv[i + 1]); /* Get the value into an array */ - buffer = xmalloc (REGISTER_SIZE); + buffer = xmalloc (DEPRECATED_REGISTER_SIZE); old_chain = make_cleanup (xfree, buffer); - store_signed_integer (buffer, REGISTER_SIZE, value); + store_signed_integer (buffer, DEPRECATED_REGISTER_SIZE, value); /* Write it down */ deprecated_write_register_bytes (REGISTER_BYTE (regnum), buffer, REGISTER_RAW_SIZE (regnum)); /* Free the buffer. */ @@ -1472,9 +1472,9 @@ mi_load_progress (const char *section_name, void mi_setup_architecture_data (void) { - /* don't trust REGISTER_BYTES to be zero. */ - old_regs = xmalloc (REGISTER_BYTES + 1); - memset (old_regs, 0, REGISTER_BYTES + 1); + /* don't trust DEPRECATED_REGISTER_BYTES to be zero. */ + old_regs = xmalloc (DEPRECATED_REGISTER_BYTES + 1); + memset (old_regs, 0, DEPRECATED_REGISTER_BYTES + 1); } void diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index ae4e689..b8072f1 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -91,7 +91,7 @@ mips_linux_get_longjmp_target (CORE_ADDR *pc) static void supply_32bit_reg (int regnum, const void *addr) { - char *buf = alloca (MAX_REGISTER_RAW_SIZE); + char buf[MAX_REGISTER_SIZE]; store_signed_integer (buf, REGISTER_RAW_SIZE (regnum), extract_signed_integer (addr, 4)); supply_register (regnum, buf); @@ -104,9 +104,9 @@ supply_gregset (elf_gregset_t *gregsetp) { int regi; elf_greg_t *regp = *gregsetp; - char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE); + char zerobuf[MAX_REGISTER_SIZE]; - memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE); + memset (zerobuf, 0, MAX_REGISTER_SIZE); for (regi = EF_REG0; regi <= EF_REG31; regi++) supply_32bit_reg ((regi - EF_REG0), (char *)(regp + regi)); @@ -192,9 +192,9 @@ void supply_fpregset (elf_fpregset_t *fpregsetp) { register int regi; - char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE); + char zerobuf[MAX_REGISTER_SIZE]; - memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE); + memset (zerobuf, 0, MAX_REGISTER_SIZE); for (regi = 0; regi < 32; regi++) supply_register (FP0_REGNUM + regi, @@ -379,9 +379,9 @@ mips64_supply_gregset (mips64_elf_gregset_t *gregsetp) { int regi; mips64_elf_greg_t *regp = *gregsetp; - char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE); + char zerobuf[MAX_REGISTER_SIZE]; - memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE); + memset (zerobuf, 0, MAX_REGISTER_SIZE); for (regi = MIPS64_EF_REG0; regi <= MIPS64_EF_REG31; regi++) supply_register ((regi - MIPS64_EF_REG0), (char *)(regp + regi)); @@ -467,9 +467,9 @@ static void mips64_supply_fpregset (mips64_elf_fpregset_t *fpregsetp) { register int regi; - char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE); + char zerobuf[MAX_REGISTER_SIZE]; - memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE); + memset (zerobuf, 0, MAX_REGISTER_SIZE); for (regi = 0; regi < 32; regi++) supply_register (FP0_REGNUM + regi, diff --git a/gdb/mips-nat.c b/gdb/mips-nat.c index 3aaaa91..e370534 100644 --- a/gdb/mips-nat.c +++ b/gdb/mips-nat.c @@ -51,16 +51,19 @@ /* Map gdb internal register number to ptrace ``address''. These ``addresses'' are defined in DECstation <sys/ptrace.h> */ -#define REGISTER_PTRACE_ADDR(regno) \ - (regno < 32 ? GPR_BASE + regno \ - : regno == PC_REGNUM ? PC \ - : regno == CAUSE_REGNUM ? CAUSE \ - : regno == HI_REGNUM ? MMHI \ - : regno == LO_REGNUM ? MMLO \ - : regno == FCRCS_REGNUM ? FPC_CSR \ - : regno == FCRIR_REGNUM ? FPC_EIR \ - : regno >= FP0_REGNUM ? FPR_BASE + (regno - FP0_REGNUM) \ - : 0) +static int +register_ptrace_addr (int regno) +{ + return (regno < 32 ? GPR_BASE + regno + : regno == PC_REGNUM ? PC + : regno == CAUSE_REGNUM ? CAUSE + : regno == HI_REGNUM ? MMHI + : regno == LO_REGNUM ? MMLO + : regno == FCRCS_REGNUM ? FPC_CSR + : regno == FCRIR_REGNUM ? FPC_EIR + : regno >= FP0_REGNUM ? FPR_BASE + (regno - FP0_REGNUM) + : 0); +} static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); @@ -70,16 +73,16 @@ void fetch_inferior_registers (int regno) { register unsigned int regaddr; - char *buf = alloca (max_register_size (current_gdbarch)); + char buf[MAX_REGISTER_SIZE]; register int i; - char *zerobuf = alloca (max_register_size (current_gdbarch)); - memset (zerobuf, 0, max_register_size (current_gdbarch)); + char zerobuf[MAX_REGISTER_SIZE]; + memset (zerobuf, 0, MAX_REGISTER_SIZE); deprecated_registers_fetched (); for (regno = 1; regno < NUM_REGS; regno++) { - regaddr = REGISTER_PTRACE_ADDR (regno); + regaddr = register_ptrace_addr (regno); for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) { *(int *) &buf[i] = ptrace (PT_READ_U, PIDGET (inferior_ptid), @@ -111,7 +114,7 @@ store_inferior_registers (int regno) || regno == FCRIR_REGNUM || regno == DEPRECATED_FP_REGNUM || (regno >= FIRST_EMBED_REGNUM && regno <= LAST_EMBED_REGNUM)) return; - regaddr = REGISTER_PTRACE_ADDR (regno); + regaddr = register_ptrace_addr (regno); errno = 0; ptrace (PT_WRITE_U, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr, read_register (regno)); @@ -174,8 +177,8 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, int bad_reg = -1; register reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */ - char *zerobuf = alloca (max_register_size (current_gdbarch)); - memset (zerobuf, 0, max_register_size (current_gdbarch)); + char zerobuf[MAX_REGISTER_SIZE]; + memset (zerobuf, 0, MAX_REGISTER_SIZE); /* If u.u_ar0 was an absolute address in the core file, relativize it now, diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index e04283c..23a5911 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -150,6 +150,36 @@ static const char *mips_saved_regsize_string = size_auto; #define MIPS_SAVED_REGSIZE (mips_saved_regsize()) +/* Return the contents of register REGNUM as a signed integer. */ + +static LONGEST +read_signed_register (int regnum) +{ + void *buf = alloca (REGISTER_RAW_SIZE (regnum)); + deprecated_read_register_gen (regnum, buf); + return (extract_signed_integer (buf, REGISTER_RAW_SIZE (regnum))); +} + +static LONGEST +read_signed_register_pid (int regnum, ptid_t ptid) +{ + ptid_t save_ptid; + LONGEST retval; + + if (ptid_equal (ptid, inferior_ptid)) + return read_signed_register (regnum); + + save_ptid = inferior_ptid; + + inferior_ptid = ptid; + + retval = read_signed_register (regnum); + + inferior_ptid = save_ptid; + + return retval; +} + /* Return the MIPS ABI associated with GDBARCH. */ enum mips_abi mips_abi (struct gdbarch *gdbarch) @@ -215,7 +245,7 @@ mips_xfer_register (struct regcache *regcache, int reg_num, int length, enum bfd_endian endian, bfd_byte *in, const bfd_byte *out, int buf_offset) { - bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE); + bfd_byte reg[MAX_REGISTER_SIZE]; int reg_offset = 0; /* Need to transfer the left or right part of the register, based on the targets byte order. */ @@ -1612,7 +1642,7 @@ read_next_frame_reg (struct frame_info *fi, int regno) CORE_ADDR addr; int realnum; enum lval_type lval; - void *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); + char raw_buffer[MAX_REGISTER_SIZE]; if (fi == NULL) { @@ -2359,7 +2389,7 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr) return NULL; } - sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_NAMESPACE, 0, NULL); + sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_DOMAIN, 0, NULL); /* If we never found a PDR for this function in symbol reading, then examine prologues to find the information. */ @@ -2721,7 +2751,7 @@ mips_eabi_push_arguments (int nargs, for (argnum = 0; argnum < nargs; argnum++) { char *val; - char *valbuf = alloca (MAX_REGISTER_RAW_SIZE); + char valbuf[MAX_REGISTER_SIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (VALUE_TYPE (arg)); int len = TYPE_LENGTH (arg_type); @@ -2737,7 +2767,7 @@ mips_eabi_push_arguments (int nargs, if (len > MIPS_SAVED_REGSIZE && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)) { - store_address (valbuf, MIPS_SAVED_REGSIZE, VALUE_ADDRESS (arg)); + store_unsigned_integer (valbuf, MIPS_SAVED_REGSIZE, VALUE_ADDRESS (arg)); typecode = TYPE_CODE_PTR; len = MIPS_SAVED_REGSIZE; val = valbuf; @@ -2972,7 +3002,7 @@ mips_n32n64_push_arguments (int nargs, for (argnum = 0; argnum < nargs; argnum++) { char *val; - char *valbuf = alloca (MAX_REGISTER_RAW_SIZE); + char valbuf[MAX_REGISTER_SIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (VALUE_TYPE (arg)); int len = TYPE_LENGTH (arg_type); @@ -3195,7 +3225,7 @@ mips_o32_push_arguments (int nargs, for (argnum = 0; argnum < nargs; argnum++) { char *val; - char *valbuf = alloca (MAX_REGISTER_RAW_SIZE); + char valbuf[MAX_REGISTER_SIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (VALUE_TYPE (arg)); int len = TYPE_LENGTH (arg_type); @@ -3494,7 +3524,7 @@ mips_o64_push_arguments (int nargs, for (argnum = 0; argnum < nargs; argnum++) { char *val; - char *valbuf = alloca (MAX_REGISTER_RAW_SIZE); + char valbuf[MAX_REGISTER_SIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (VALUE_TYPE (arg)); int len = TYPE_LENGTH (arg_type); @@ -4014,7 +4044,7 @@ mips_print_fp_register (int regnum) static void mips_print_register (int regnum, int all) { - char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); + char raw_buffer[MAX_REGISTER_SIZE]; int offset; if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT) @@ -4070,7 +4100,7 @@ static int do_gp_register_row (int regnum) { /* do values for GP (int) regs */ - char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); + char raw_buffer[MAX_REGISTER_SIZE]; int ncols = (MIPS_REGSIZE == 8 ? 4 : 8); /* display cols per row */ int col, byte; int start_regnum = regnum; @@ -4531,7 +4561,7 @@ return_value_location (struct type *valtype, static void mips_eabi_extract_return_value (struct type *valtype, - char regbuf[REGISTER_BYTES], + char regbuf[], char *valbuf) { struct return_value_word lo; @@ -4550,7 +4580,7 @@ mips_eabi_extract_return_value (struct type *valtype, static void mips_o64_extract_return_value (struct type *valtype, - char regbuf[REGISTER_BYTES], + char regbuf[], char *valbuf) { struct return_value_word lo; @@ -4573,7 +4603,7 @@ mips_o64_extract_return_value (struct type *valtype, static void mips_eabi_store_return_value (struct type *valtype, char *valbuf) { - char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); + char raw_buffer[MAX_REGISTER_SIZE]; struct return_value_word lo; struct return_value_word hi; return_value_location (valtype, &hi, &lo); @@ -4595,7 +4625,7 @@ mips_eabi_store_return_value (struct type *valtype, char *valbuf) static void mips_o64_store_return_value (struct type *valtype, char *valbuf) { - char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); + char raw_buffer[MAX_REGISTER_SIZE]; struct return_value_word lo; struct return_value_word hi; return_value_location (valtype, &hi, &lo); @@ -4677,7 +4707,7 @@ mips_o32_xfer_return_value (struct type *type, /* A struct that contains one or two floats. Each value is part in the least significant part of their floating point register.. */ - bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE); + bfd_byte reg[MAX_REGISTER_SIZE]; int regnum; int field; for (field = 0, regnum = FP0_REGNUM; @@ -4789,7 +4819,7 @@ mips_n32n64_xfer_return_value (struct type *type, /* A struct that contains one or two floats. Each value is part in the least significant part of their floating point register.. */ - bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE); + bfd_byte reg[MAX_REGISTER_SIZE]; int regnum; int field; for (field = 0, regnum = FP0_REGNUM; @@ -5089,19 +5119,6 @@ gdb_print_insn_mips (bfd_vma memaddr, disassemble_info *info) return print_insn_little_mips (memaddr, info); } -/* Old-style breakpoint macros. - The IDT board uses an unusual breakpoint value, and sometimes gets - confused when it sees the usual MIPS breakpoint instruction. */ - -#define BIG_BREAKPOINT {0, 0x5, 0, 0xd} -#define LITTLE_BREAKPOINT {0xd, 0, 0x5, 0} -#define PMON_BIG_BREAKPOINT {0, 0, 0, 0xd} -#define PMON_LITTLE_BREAKPOINT {0xd, 0, 0, 0} -#define IDT_BIG_BREAKPOINT {0, 0, 0x0a, 0xd} -#define IDT_LITTLE_BREAKPOINT {0xd, 0x0a, 0, 0} -#define MIPS16_BIG_BREAKPOINT {0xe8, 0xa5} -#define MIPS16_LITTLE_BREAKPOINT {0xa5, 0xe8} - /* This function implements the BREAKPOINT_FROM_PC macro. It uses the program counter value to determine whether a 16- or 32-bit breakpoint should be used. It returns a pointer to a string of bytes that encode a breakpoint @@ -5116,17 +5133,19 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) { if (pc_is_mips16 (*pcptr)) { - static unsigned char mips16_big_breakpoint[] = - MIPS16_BIG_BREAKPOINT; + static unsigned char mips16_big_breakpoint[] = {0xe8, 0xa5}; *pcptr = UNMAKE_MIPS16_ADDR (*pcptr); *lenptr = sizeof (mips16_big_breakpoint); return mips16_big_breakpoint; } else { - static unsigned char big_breakpoint[] = BIG_BREAKPOINT; - static unsigned char pmon_big_breakpoint[] = PMON_BIG_BREAKPOINT; - static unsigned char idt_big_breakpoint[] = IDT_BIG_BREAKPOINT; + /* The IDT board uses an unusual breakpoint value, and + sometimes gets confused when it sees the usual MIPS + breakpoint instruction. */ + static unsigned char big_breakpoint[] = {0, 0x5, 0, 0xd}; + static unsigned char pmon_big_breakpoint[] = {0, 0, 0, 0xd}; + static unsigned char idt_big_breakpoint[] = {0, 0, 0x0a, 0xd}; *lenptr = sizeof (big_breakpoint); @@ -5144,19 +5163,16 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) { if (pc_is_mips16 (*pcptr)) { - static unsigned char mips16_little_breakpoint[] = - MIPS16_LITTLE_BREAKPOINT; + static unsigned char mips16_little_breakpoint[] = {0xa5, 0xe8}; *pcptr = UNMAKE_MIPS16_ADDR (*pcptr); *lenptr = sizeof (mips16_little_breakpoint); return mips16_little_breakpoint; } else { - static unsigned char little_breakpoint[] = LITTLE_BREAKPOINT; - static unsigned char pmon_little_breakpoint[] = - PMON_LITTLE_BREAKPOINT; - static unsigned char idt_little_breakpoint[] = - IDT_LITTLE_BREAKPOINT; + static unsigned char little_breakpoint[] = {0xd, 0, 0x5, 0}; + static unsigned char pmon_little_breakpoint[] = {0xd, 0, 0, 0}; + static unsigned char idt_little_breakpoint[] = {0xd, 0x0a, 0, 0}; *lenptr = sizeof (little_breakpoint); @@ -5412,7 +5428,7 @@ mips_get_saved_register (char *raw_buffer, /* Only MIPS_SAVED_REGSIZE bytes of GP registers are saved. */ LONGEST val = read_memory_integer ((*addrp), MIPS_SAVED_REGSIZE); - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), val); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), val); } } } @@ -5908,9 +5924,9 @@ mips_gdbarch_init (struct gdbarch_info info, 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_fix_call_dummy (gdbarch, mips_fix_call_dummy); - set_gdbarch_call_dummy_words (gdbarch, mips_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (mips_call_dummy_words)); + 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); @@ -6108,8 +6124,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) "mips_dump_tdep: BADVADDR_REGNUM = %d\n", BADVADDR_REGNUM); fprintf_unfiltered (file, - "mips_dump_tdep: BIG_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: CAUSE_REGNUM = %d\n", CAUSE_REGNUM); fprintf_unfiltered (file, @@ -6140,10 +6154,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) "mips_dump_tdep: HI_REGNUM = %d\n", HI_REGNUM); fprintf_unfiltered (file, - "mips_dump_tdep: IDT_BIG_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, - "mips_dump_tdep: IDT_LITTLE_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: IGNORE_HELPER_CALL # %s\n", XSTRING (IGNORE_HELPER_CALL (PC))); fprintf_unfiltered (file, @@ -6158,8 +6168,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) "mips_dump_tdep: LAST_EMBED_REGNUM = %d\n", LAST_EMBED_REGNUM); fprintf_unfiltered (file, - "mips_dump_tdep: LITTLE_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: LO_REGNUM = %d\n", LO_REGNUM); #ifdef MACHINE_CPROC_FP_OFFSET @@ -6180,13 +6188,9 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "mips_dump_tdep: MAKE_MIPS16_ADDR = FIXME!\n"); fprintf_unfiltered (file, - "mips_dump_tdep: MIPS16_BIG_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: MIPS16_INSTLEN = %d\n", MIPS16_INSTLEN); fprintf_unfiltered (file, - "mips_dump_tdep: MIPS16_LITTLE_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: MIPS_DEFAULT_ABI = FIXME!\n"); fprintf_unfiltered (file, "mips_dump_tdep: MIPS_EFI_SYMBOL_NAME = multi-arch!!\n"); @@ -6210,10 +6214,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "mips_dump_tdep: OP_LDGPR = used?\n"); fprintf_unfiltered (file, - "mips_dump_tdep: PMON_BIG_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, - "mips_dump_tdep: PMON_LITTLE_BREAKPOINT = delete?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: PRID_REGNUM = %d\n", PRID_REGNUM); fprintf_unfiltered (file, diff --git a/gdb/mipsv4-nat.c b/gdb/mipsv4-nat.c index 874bef4..65ffa0d 100644 --- a/gdb/mipsv4-nat.c +++ b/gdb/mipsv4-nat.c @@ -47,8 +47,8 @@ supply_gregset (gregset_t *gregsetp) { register int regi; register greg_t *regp = &(*gregsetp)[0]; - char *zerobuf = alloca (max_register_size (current_gdbarch)); - memset (zerobuf, 0, max_register_size (current_gdbarch)); + char zerobuf[MAX_REGISTER_SIZE]; + memset (zerobuf, 0, MAX_REGISTER_SIZE); for (regi = 0; regi <= CXT_RA; regi++) supply_register (regi, (char *) (regp + regi)); @@ -102,8 +102,8 @@ void supply_fpregset (fpregset_t *fpregsetp) { register int regi; - char *zerobuf = alloca (max_register_size (current_gdbarch)); - memset (zerobuf, 0, max_register_size (current_gdbarch)); + char zerobuf[MAX_REGISTER_SIZE]; + memset (zerobuf, 0, MAX_REGISTER_SIZE); for (regi = 0; regi < 32; regi++) supply_register (FP0_REGNUM + regi, diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 8d7de77..c7bc58c 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -695,7 +695,8 @@ mn10300_frame_chain (struct frame_info *fi) /* Our caller has a frame pointer. So find the frame in $a3 or in the stack. */ if (get_frame_saved_regs (fi)[A3_REGNUM]) - return (read_memory_integer (get_frame_saved_regs (fi)[A3_REGNUM], REGISTER_SIZE)); + return (read_memory_integer (get_frame_saved_regs (fi)[A3_REGNUM], + DEPRECATED_REGISTER_SIZE)); else return read_register (A3_REGNUM); } @@ -879,7 +880,8 @@ mn10300_frame_saved_pc (struct frame_info *fi) { int adjust = saved_regs_size (fi); - return (read_memory_integer (get_frame_base (fi) + adjust, REGISTER_SIZE)); + return (read_memory_integer (get_frame_base (fi) + adjust, + DEPRECATED_REGISTER_SIZE)); } /* Function: mn10300_init_extra_frame_info @@ -1008,7 +1010,7 @@ mn10300_dwarf2_reg_to_regnum (int dwarf2) static void mn10300_print_register (const char *name, int regnum, int reg_width) { - char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); + char raw_buffer[MAX_REGISTER_SIZE]; if (reg_width) printf_filtered ("%*s: ", reg_width, name); @@ -1144,9 +1146,8 @@ mn10300_gdbarch_init (struct gdbarch_info info, /* Registers. */ set_gdbarch_num_regs (gdbarch, num_regs); set_gdbarch_register_name (gdbarch, register_name); - set_gdbarch_register_size (gdbarch, 4); - set_gdbarch_register_bytes (gdbarch, - num_regs * gdbarch_register_size (gdbarch)); + 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); @@ -1186,9 +1187,8 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_deprecated_target_read_fp (gdbarch, generic_target_read_sp); /* Calling functions in the inferior from GDB. */ - set_gdbarch_call_dummy_words (gdbarch, mn10300_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, - sizeof (mn10300_call_dummy_words)); + set_gdbarch_deprecated_call_dummy_words (gdbarch, mn10300_call_dummy_words); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (mn10300_call_dummy_words)); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_deprecated_push_arguments (gdbarch, mn10300_push_arguments); set_gdbarch_reg_struct_has_addr (gdbarch, mn10300_reg_struct_has_addr); diff --git a/gdb/monitor.c b/gdb/monitor.c index f58ed2a..eabbbd9 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -896,7 +896,7 @@ char * monitor_supply_register (int regno, char *valstr) { ULONGEST val; - unsigned char *regbuf = alloca (max_register_size (current_gdbarch)); + unsigned char regbuf[MAX_REGISTER_SIZE]; char *p; val = 0; @@ -1181,9 +1181,9 @@ monitor_fetch_register (int regno) char *regbuf; int i; - regbuf = alloca (MAX_REGISTER_RAW_SIZE * 2 + 1); - zerobuf = alloca (MAX_REGISTER_RAW_SIZE); - memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE); + regbuf = alloca (MAX_REGISTER_SIZE * 2 + 1); + zerobuf = alloca (MAX_REGISTER_SIZE); + memset (zerobuf, 0, MAX_REGISTER_SIZE); if (current_monitor->regname != NULL) name = current_monitor->regname (regno); @@ -2098,7 +2098,7 @@ monitor_insert_breakpoint (CORE_ADDR addr, char *shadow) addr = ADDR_BITS_REMOVE (addr); /* Determine appropriate breakpoint size for this address. */ - bp = memory_breakpoint_from_pc (&addr, &bplen); + bp = gdbarch_breakpoint_from_pc (current_gdbarch, &addr, &bplen); for (i = 0; i < current_monitor->num_breakpoints; i++) { diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c index 27d7599..46c175c 100644 --- a/gdb/ns32k-tdep.c +++ b/gdb/ns32k-tdep.c @@ -512,7 +512,7 @@ ns32k_gdbarch_init_32082 (struct gdbarch *gdbarch) set_gdbarch_num_regs (gdbarch, NS32K_NUM_REGS_32082); set_gdbarch_register_name (gdbarch, ns32k_register_name_32082); - set_gdbarch_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32082); + set_gdbarch_deprecated_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32082); set_gdbarch_register_byte (gdbarch, ns32k_register_byte_32082); } @@ -522,7 +522,7 @@ ns32k_gdbarch_init_32382 (struct gdbarch *gdbarch) set_gdbarch_num_regs (gdbarch, NS32K_NUM_REGS_32382); set_gdbarch_register_name (gdbarch, ns32k_register_name_32382); - set_gdbarch_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32382); + set_gdbarch_deprecated_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32382); set_gdbarch_register_byte (gdbarch, ns32k_register_byte_32382); } @@ -556,7 +556,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, NS32K_PC_REGNUM); set_gdbarch_num_regs (gdbarch, NS32K_PS_REGNUM); - set_gdbarch_register_size (gdbarch, NS32K_REGISTER_SIZE); + set_gdbarch_deprecated_register_size (gdbarch, NS32K_REGISTER_SIZE); set_gdbarch_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); @@ -595,11 +595,11 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_push_dummy_frame (gdbarch, ns32k_push_dummy_frame); set_gdbarch_deprecated_pop_frame (gdbarch, ns32k_pop_frame); set_gdbarch_call_dummy_location (gdbarch, ON_STACK); - set_gdbarch_call_dummy_words (gdbarch, ns32k_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof_ns32k_call_dummy_words); - set_gdbarch_fix_call_dummy (gdbarch, ns32k_fix_call_dummy); - set_gdbarch_call_dummy_start_offset (gdbarch, 3); - set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 15); + set_gdbarch_deprecated_call_dummy_words (gdbarch, ns32k_call_dummy_words); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof_ns32k_call_dummy_words); + set_gdbarch_deprecated_fix_call_dummy (gdbarch, ns32k_fix_call_dummy); + set_gdbarch_deprecated_call_dummy_start_offset (gdbarch, 3); + set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 15); set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y index 329ddde..cd6fe63 100644 --- a/gdb/objc-exp.y +++ b/gdb/objc-exp.y @@ -635,7 +635,7 @@ block : BLOCKNAME block : block COLONCOLON name { struct symbol *tem = lookup_symbol (copy_name ($3), $1, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) error ("No function \"%s\" in specified context.", @@ -646,7 +646,7 @@ block : block COLONCOLON name variable: block COLONCOLON name { struct symbol *sym; sym = lookup_symbol (copy_name ($3), $1, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); if (sym == 0) error ("No symbol \"%s\" in specified context.", @@ -708,7 +708,7 @@ variable: qualified_name sym = lookup_symbol (name, (const struct block *) NULL, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); if (sym) { @@ -1663,7 +1663,7 @@ yylex () need_this = (int *) NULL; sym = lookup_symbol (tmp, expression_context_block, - VAR_NAMESPACE, + VAR_DOMAIN, need_this, (struct symtab **) NULL); /* Call lookup_symtab, not lookup_partial_symtab, in case there @@ -1742,7 +1742,7 @@ yylex () tmp1[p - namestart] = '\0'; cur_sym = lookup_symbol (ncopy, expression_context_block, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); if (cur_sym) { diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 1fe761b..77fec6a 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -116,7 +116,7 @@ lookup_struct_typedef (char *name, struct block *block, int noerr) { register struct symbol *sym; - sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0, + sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0, (struct symtab **) NULL); if (sym == NULL) @@ -372,7 +372,6 @@ objc_printstr (struct ui_file *stream, char *string, unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; - extern int inspect_it; /* If the string was not truncated due to `set print elements', and the last byte of it is a null, we don't print that, in @@ -702,6 +701,8 @@ const struct language_defn objc_language_defn = { c_val_print, /* Print a value using appropriate syntax */ c_value_print, /* Print a top-level value */ objc_skip_trampoline, /* Language specific skip_trampoline */ + value_of_this, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ objc_demangle, /* Language specific symbol demangler */ {"", "", "", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ @@ -1459,7 +1460,7 @@ char *find_imps (struct symtab *symtab, struct block *block, if (tmp == NULL) return NULL; - sym = lookup_symbol (selector, block, VAR_NAMESPACE, 0, NULL); + sym = lookup_symbol (selector, block, VAR_DOMAIN, 0, NULL); if (sym != NULL) { if (syms) diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 448b73d..2c525f6 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -668,7 +668,7 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) fixup_symbol_section (sym, objfile); /* The RS6000 code from which this was taken skipped - any symbols in STRUCT_NAMESPACE or UNDEF_NAMESPACE. + any symbols in STRUCT_DOMAIN or UNDEF_DOMAIN. But I'm leaving out that test, on the theory that they can't possibly pass the tests below. */ if ((SYMBOL_CLASS (sym) == LOC_LABEL @@ -683,7 +683,7 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) /* Relocate Extra Function Info for ecoff. */ else if (SYMBOL_CLASS (sym) == LOC_CONST - && SYMBOL_NAMESPACE (sym) == LABEL_NAMESPACE + && SYMBOL_DOMAIN (sym) == LABEL_DOMAIN && strcmp (DEPRECATED_SYMBOL_NAME (sym), MIPS_EFI_SYMBOL_NAME) == 0) ecoff_relocate_efi (sym, ANOFFSET (delta, s->block_line_section)); diff --git a/gdb/p-exp.y b/gdb/p-exp.y index 4863947..abb4433 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -560,7 +560,7 @@ block : BLOCKNAME block : block COLONCOLON name { struct symbol *tem = lookup_symbol (copy_name ($3), $1, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) error ("No function \"%s\" in specified context.", @@ -571,7 +571,7 @@ block : block COLONCOLON name variable: block COLONCOLON name { struct symbol *sym; sym = lookup_symbol (copy_name ($3), $1, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); if (sym == 0) error ("No symbol \"%s\" in specified context.", @@ -609,7 +609,7 @@ variable: qualified_name sym = lookup_symbol (name, (const struct block *) NULL, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); if (sym) { @@ -1399,7 +1399,7 @@ yylex () static const char this_name[] = "this"; if (lookup_symbol (this_name, expression_context_block, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL)) return THIS; } @@ -1440,7 +1440,7 @@ yylex () sym = NULL; else sym = lookup_symbol (tmp, expression_context_block, - VAR_NAMESPACE, + VAR_DOMAIN, &is_a_field_of_this, (struct symtab **) NULL); /* second chance uppercased (as Free Pascal does). */ @@ -1457,7 +1457,7 @@ yylex () sym = NULL; else sym = lookup_symbol (tmp, expression_context_block, - VAR_NAMESPACE, + VAR_DOMAIN, &is_a_field_of_this, (struct symtab **) NULL); if (sym || is_a_field_of_this || is_a_field) @@ -1487,7 +1487,7 @@ yylex () sym = NULL; else sym = lookup_symbol (tmp, expression_context_block, - VAR_NAMESPACE, + VAR_DOMAIN, &is_a_field_of_this, (struct symtab **) NULL); if (sym || is_a_field_of_this || is_a_field) @@ -1584,7 +1584,7 @@ yylex () memcpy (tmp1, namestart, p - namestart); tmp1[p - namestart] = '\0'; cur_sym = lookup_symbol (ncopy, expression_context_block, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); if (cur_sym) { diff --git a/gdb/p-lang.c b/gdb/p-lang.c index 827fa0e..59e196a 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -28,6 +28,7 @@ #include "language.h" #include "p-lang.h" #include "valprint.h" +#include "value.h" #include <ctype.h> extern void _initialize_pascal_language (void); @@ -161,7 +162,6 @@ pascal_printstr (struct ui_file *stream, char *string, unsigned int length, unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; - extern int inspect_it; /* If the string was not truncated due to `set print elements', and the last byte of it is a null, we don't print that, in traditional C @@ -462,6 +462,8 @@ const struct language_defn pascal_language_defn = pascal_val_print, /* Print a value using appropriate syntax */ pascal_value_print, /* Print a top-level value */ NULL, /* Language specific skip_trampoline */ + value_of_this, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ NULL, /* Language specific symbol demangler */ {"", "%", "b", ""}, /* Binary format info */ {"0%lo", "0", "o", ""}, /* Octal format info */ diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 3d2023e..9cfa4d7 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -226,7 +226,7 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset, if (msymbol != NULL) wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), block, - VAR_NAMESPACE, &is_this_fld, NULL); + VAR_DOMAIN, &is_this_fld, NULL); if (wsym) { @@ -754,7 +754,6 @@ pascal_object_print_value_fields (struct type *type, char *valaddr, fprintf_filtered (stream, "<No data fields>"); else { - extern int inspect_it; int fields_seen = 0; if (dont_print_statmem == 0) diff --git a/gdb/parse.c b/gdb/parse.c index 6c3a8e5..16724ac 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -646,17 +646,17 @@ parse_nested_classes_for_hpacc (char *name, int len, char **token, if (!done) { /* More tokens to process, so this must be a class/namespace */ - sym_class = lookup_symbol (prefix, 0, STRUCT_NAMESPACE, + sym_class = lookup_symbol (prefix, 0, STRUCT_DOMAIN, 0, (struct symtab **) NULL); } else { /* No more tokens, so try as a variable first */ - sym_var = lookup_symbol (prefix, 0, VAR_NAMESPACE, + sym_var = lookup_symbol (prefix, 0, VAR_DOMAIN, 0, (struct symtab **) NULL); /* If failed, try as class/namespace */ if (!sym_var) - sym_class = lookup_symbol (prefix, 0, STRUCT_NAMESPACE, + sym_class = lookup_symbol (prefix, 0, STRUCT_DOMAIN, 0, (struct symtab **) NULL); } diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 4561e4d..20c8add 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -204,7 +204,7 @@ fetch_register (int tid, int regno) char mess[128]; /* For messages */ register int i; unsigned int offset; /* Offset of registers within the u area. */ - char *buf = alloca (MAX_REGISTER_RAW_SIZE); + char buf[MAX_REGISTER_SIZE]; CORE_ADDR regaddr = ppc_register_u_addr (regno); if (altivec_register_p (regno)) @@ -364,7 +364,7 @@ store_register (int tid, int regno) char mess[128]; /* For messages */ register int i; unsigned int offset; /* Offset of registers within the u area. */ - char *buf = alloca (MAX_REGISTER_RAW_SIZE); + char buf[MAX_REGISTER_SIZE]; if (altivec_register_p (regno)) { diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index 9894a58..6e8216c 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -180,7 +180,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, write_register (SP_REGNUM, sp); /* write the backchain */ - store_address (old_sp_buf, 4, saved_sp); + store_unsigned_integer (old_sp_buf, 4, saved_sp); write_memory (sp, old_sp_buf, 4); argoffset = 8; @@ -261,7 +261,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, || TYPE_CODE (type) == TYPE_CODE_UNION) { write_memory (sp + structoffset, val, len); - store_address (val_buf, 4, sp + structoffset); + store_unsigned_integer (val_buf, 4, sp + structoffset); structoffset += round2 (len, 8); } else diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 6804e76..8968234 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -43,6 +43,7 @@ #include "gdb_assert.h" #include "block.h" #include "dictionary.h" +#include "disasm.h" extern int asm_demangle; /* Whether to demangle syms in asm printouts */ extern int addressprint; /* Whether to print hex addresses in HLL " */ @@ -176,8 +177,6 @@ static void print_formatted (struct value *, int, int, struct ui_file *); static struct format_data decode_format (char **, int, int); -static int print_insn (CORE_ADDR, struct ui_file *); - static void sym_info (char *, int); @@ -311,7 +310,7 @@ print_formatted (struct value *val, register int format, int size, /* We often wrap here if there are long symbolic names. */ wrap_here (" "); next_address = VALUE_ADDRESS (val) - + print_insn (VALUE_ADDRESS (val), stream); + + gdb_print_insn (VALUE_ADDRESS (val), stream); next_section = VALUE_BFD_SECTION (val); break; @@ -1079,7 +1078,7 @@ address_info (char *exp, int from_tty) if (exp == 0) error ("Argument required."); - sym = lookup_symbol (exp, get_selected_block (0), VAR_NAMESPACE, + sym = lookup_symbol (exp, get_selected_block (0), VAR_DOMAIN, &is_a_field_of_this, (struct symtab **) NULL); if (sym == NULL) { @@ -1844,7 +1843,7 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num, struct symbol *nsym; nsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym), - b, VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL); + 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 @@ -2239,31 +2238,6 @@ printf_command (char *arg, int from_tty) do_cleanups (old_cleanups); } -/* Print the instruction at address MEMADDR in debugged memory, - on STREAM. Returns length of the instruction, in bytes. */ - -/* FIXME: cagney/2003-04-28: Should instead be using the generic - disassembler but first need to clean that up and stop it trying to - access the exec file. */ - -static int -print_insn (CORE_ADDR memaddr, struct ui_file *stream) -{ - if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) - deprecated_tm_print_insn_info.endian = BFD_ENDIAN_BIG; - else - deprecated_tm_print_insn_info.endian = BFD_ENDIAN_LITTLE; - - if (TARGET_ARCHITECTURE != NULL) - deprecated_tm_print_insn_info.mach = TARGET_ARCHITECTURE->mach; - /* else: should set .mach=0 but some disassemblers don't grok this */ - - deprecated_tm_print_insn_info.stream = stream; - - return TARGET_PRINT_INSN (memaddr, &deprecated_tm_print_insn_info); -} - - void _initialize_printcmd (void) { diff --git a/gdb/proc-api.c b/gdb/proc-api.c index 2d4fe81..208b984 100644 --- a/gdb/proc-api.c +++ b/gdb/proc-api.c @@ -574,16 +574,6 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line) break; default: { -#ifdef BREAKPOINT - static unsigned char break_insn[] = BREAKPOINT; - - if (len == sizeof (break_insn) && - memcmp (arg, &break_insn, len) == 0) - fprintf (procfs_file ? procfs_file : stdout, - "write (<breakpoint at 0x%08lx>) \n", - (unsigned long) lseek_offset); - else -#endif if (rw_table[i].name) fprintf (procfs_file ? procfs_file : stdout, "write (%s) %s\n", diff --git a/gdb/regcache.c b/gdb/regcache.c index e0a0b89..09b48f0 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -78,9 +78,6 @@ struct regcache_descr long *register_offset; long *sizeof_register; - /* Useful constant. Largest of all the registers. */ - long max_register_size; - /* Cached table containing the type of each register. */ struct type **register_type; }; @@ -109,7 +106,6 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch, read_register_bytes() and write_register_bytes() registers. */ descr->sizeof_register = XCALLOC (descr->nr_cooked_registers, long); descr->register_offset = XCALLOC (descr->nr_cooked_registers, long); - descr->max_register_size = 0; for (i = 0; i < descr->nr_cooked_registers; i++) { /* FIXME: cagney/2001-12-04: This code shouldn't need to use @@ -119,19 +115,18 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch, entirely avoid this uglyness. */ descr->register_offset[i] = REGISTER_BYTE (i); descr->sizeof_register[i] = REGISTER_RAW_SIZE (i); - if (descr->max_register_size < REGISTER_RAW_SIZE (i)) - descr->max_register_size = REGISTER_RAW_SIZE (i); - if (descr->max_register_size < REGISTER_VIRTUAL_SIZE (i)) - descr->max_register_size = REGISTER_VIRTUAL_SIZE (i); + gdb_assert (MAX_REGISTER_SIZE >= REGISTER_RAW_SIZE (i)); + gdb_assert (MAX_REGISTER_SIZE >= REGISTER_VIRTUAL_SIZE (i)); } /* Compute the real size of the register buffer. Start out by - trusting REGISTER_BYTES, but then adjust it upwards should that - be found to not be sufficient. */ - /* FIXME: cagney/2002-11-05: Instead of using REGISTER_BYTES, this - code should, as is done in init_regcache_descr(), compute the - total number of register bytes using the accumulated offsets. */ - descr->sizeof_cooked_registers = REGISTER_BYTES; /* OK use. */ + trusting DEPRECATED_REGISTER_BYTES, but then adjust it upwards + should that be found to not be sufficient. */ + /* FIXME: cagney/2002-11-05: Instead of using the macro + DEPRECATED_REGISTER_BYTES, this code should, as is done in + init_regcache_descr(), compute the total number of register bytes + using the accumulated offsets. */ + descr->sizeof_cooked_registers = DEPRECATED_REGISTER_BYTES; /* OK */ for (i = 0; i < descr->nr_cooked_registers; i++) { long regend; @@ -187,6 +182,12 @@ init_regcache_descr (struct gdbarch *gdbarch) && !gdbarch_pseudo_register_write_p (gdbarch) && !gdbarch_register_type_p (gdbarch)) { + /* NOTE: cagney/2003-05-02: Don't add a test for REGISTER_BYTE_P + to the above. Doing that would cause all the existing + architectures to revert back to the legacy regcache + mechanisms, and that is not a good thing. Instead just, + later, check that the register cache's layout is consistent + with REGISTER_BYTE. */ descr->legacy_p = 1; init_legacy_regcache_descr (gdbarch, descr); return descr; @@ -213,14 +214,12 @@ init_regcache_descr (struct gdbarch *gdbarch) long offset = 0; descr->sizeof_register = XCALLOC (descr->nr_cooked_registers, long); descr->register_offset = XCALLOC (descr->nr_cooked_registers, long); - descr->max_register_size = 0; for (i = 0; i < descr->nr_cooked_registers; i++) { descr->sizeof_register[i] = TYPE_LENGTH (descr->register_type[i]); descr->register_offset[i] = offset; offset += descr->sizeof_register[i]; - if (descr->max_register_size < descr->sizeof_register[i]) - descr->max_register_size = descr->sizeof_register[i]; + gdb_assert (MAX_REGISTER_SIZE >= descr->sizeof_register[i]); } /* Set the real size of the register cache buffer. */ descr->sizeof_cooked_registers = offset; @@ -233,21 +232,19 @@ init_regcache_descr (struct gdbarch *gdbarch) buffer. Ulgh! */ descr->sizeof_raw_registers = descr->sizeof_cooked_registers; -#if 0 - /* Sanity check. Confirm that the assumptions about gdbarch are - true. The REGCACHE_DESCR_HANDLE is set before doing the checks - so that targets using the generic methods supplied by regcache - don't go into infinite recursion trying to, again, create the - regcache. */ - set_gdbarch_data (gdbarch, regcache_descr_handle, descr); + /* Sanity check. Confirm that there is agreement between the + regcache and the target's redundant REGISTER_BYTE (new targets + should not even be defining it). */ for (i = 0; i < descr->nr_cooked_registers; i++) { + if (REGISTER_BYTE_P ()) + gdb_assert (descr->register_offset[i] == REGISTER_BYTE (i)); +#if 0 gdb_assert (descr->sizeof_register[i] == REGISTER_RAW_SIZE (i)); gdb_assert (descr->sizeof_register[i] == REGISTER_VIRTUAL_SIZE (i)); - gdb_assert (descr->register_offset[i] == REGISTER_BYTE (i)); - } - /* gdb_assert (descr->sizeof_raw_registers == REGISTER_BYTES (i)); */ #endif + } + /* gdb_assert (descr->sizeof_raw_registers == DEPRECATED_REGISTER_BYTES (i)); */ return descr; } @@ -286,31 +283,6 @@ register_type (struct gdbarch *gdbarch, int regnum) the regcache descr. */ int -max_register_size (struct gdbarch *gdbarch) -{ - struct regcache_descr *descr = regcache_descr (gdbarch); - return descr->max_register_size; -} - -int -legacy_max_register_raw_size (void) -{ - if (DEPRECATED_MAX_REGISTER_RAW_SIZE_P ()) - return DEPRECATED_MAX_REGISTER_RAW_SIZE; - else - return max_register_size (current_gdbarch); -} - -int -legacy_max_register_virtual_size (void) -{ - if (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P ()) - return DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE; - else - return max_register_size (current_gdbarch); -} - -int register_size (struct gdbarch *gdbarch, int regnum) { struct regcache_descr *descr = regcache_descr (gdbarch); @@ -393,7 +365,7 @@ regcache_save (struct regcache *dst, regcache_cooked_read_ftype *cooked_read, void *src) { struct gdbarch *gdbarch = dst->descr->gdbarch; - void *buf = alloca (max_register_size (gdbarch)); + char buf[MAX_REGISTER_SIZE]; int regnum; /* The DST should be `read-only', if it wasn't then the save would end up trying to write the register values back out to the @@ -427,7 +399,7 @@ regcache_restore (struct regcache *dst, void *src) { struct gdbarch *gdbarch = dst->descr->gdbarch; - void *buf = alloca (max_register_size (gdbarch)); + char buf[MAX_REGISTER_SIZE]; int regnum; /* The dst had better not be read-only. If it is, the `restore' doesn't make much sense. */ @@ -528,12 +500,6 @@ deprecated_grub_regcache_for_registers (struct regcache *regcache) return regcache->registers; } -char * -deprecated_grub_regcache_for_register_valid (struct regcache *regcache) -{ - return regcache->register_valid_p; -} - /* Global structure containing the current regcache. */ /* FIXME: cagney/2002-05-11: The two global arrays registers[] and deprecated_register_valid[] currently point into this structure. */ @@ -681,7 +647,7 @@ deprecated_read_register_bytes (int in_start, char *in_buf, int in_len) { int in_end = in_start + in_len; int regnum; - char *reg_buf = alloca (MAX_REGISTER_RAW_SIZE); + char reg_buf[MAX_REGISTER_SIZE]; /* See if we are trying to read bytes from out-of-date registers. If so, update just those registers. */ @@ -1071,7 +1037,7 @@ deprecated_write_register_bytes (int myregstart, char *myaddr, int inlen) /* The register partially overlaps the range being written. */ else { - char *regbuf = (char*) alloca (MAX_REGISTER_RAW_SIZE); + char regbuf[MAX_REGISTER_SIZE]; /* What's the overlap between this register's bytes and those the caller wants to write? */ int overlapstart = max (regstart, myregstart); @@ -1104,7 +1070,7 @@ regcache_xfer_part (struct regcache *regcache, int regnum, regcache_read_ftype *read, regcache_write_ftype *write) { struct regcache_descr *descr = regcache->descr; - bfd_byte *reg = alloca (descr->max_register_size); + bfd_byte reg[MAX_REGISTER_SIZE]; gdb_assert (offset >= 0 && offset <= descr->sizeof_register[regnum]); gdb_assert (len >= 0 && offset + len <= descr->sizeof_register[regnum]); /* Something to do? */ @@ -1213,36 +1179,6 @@ read_register_pid (int regnum, ptid_t ptid) return retval; } -/* Return the contents of register REGNUM as a signed integer. */ - -LONGEST -read_signed_register (int regnum) -{ - void *buf = alloca (REGISTER_RAW_SIZE (regnum)); - deprecated_read_register_gen (regnum, buf); - return (extract_signed_integer (buf, REGISTER_RAW_SIZE (regnum))); -} - -LONGEST -read_signed_register_pid (int regnum, ptid_t ptid) -{ - ptid_t save_ptid; - LONGEST retval; - - if (ptid_equal (ptid, inferior_ptid)) - return read_signed_register (regnum); - - save_ptid = inferior_ptid; - - inferior_ptid = ptid; - - retval = read_signed_register (regnum); - - inferior_ptid = save_ptid; - - return retval; -} - /* Store VALUE into the raw contents of register number REGNUM. */ void @@ -1483,7 +1419,7 @@ build_regcache (void) current_regcache = regcache_xmalloc (current_gdbarch); current_regcache->readonly_p = 0; deprecated_registers = deprecated_grub_regcache_for_registers (current_regcache); - deprecated_register_valid = deprecated_grub_regcache_for_register_valid (current_regcache); + deprecated_register_valid = current_regcache->register_valid_p; } static void @@ -1524,7 +1460,7 @@ regcache_dump (struct regcache *regcache, struct ui_file *file, int footnote_register_offset = 0; int footnote_register_type_name_null = 0; long register_offset = 0; - unsigned char *buf = alloca (regcache->descr->max_register_size); + unsigned char buf[MAX_REGISTER_SIZE]; #if 0 fprintf_unfiltered (file, "legacy_p %d\n", regcache->descr->legacy_p); @@ -1536,8 +1472,6 @@ regcache_dump (struct regcache *regcache, struct ui_file *file, regcache->descr->sizeof_raw_registers); fprintf_unfiltered (file, "sizeof_raw_register_valid_p %ld\n", regcache->descr->sizeof_raw_register_valid_p); - fprintf_unfiltered (file, "max_register_size %ld\n", - regcache->descr->max_register_size); fprintf_unfiltered (file, "NUM_REGS %d\n", NUM_REGS); fprintf_unfiltered (file, "NUM_PSEUDO_REGS %d\n", NUM_PSEUDO_REGS); #endif diff --git a/gdb/regcache.h b/gdb/regcache.h index 3fb43c4..f848205 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -127,12 +127,6 @@ extern int register_offset_hack (struct gdbarch *gdbarch, int regnum); extern struct type *register_type (struct gdbarch *gdbarch, int regnum); -/* Return the size of the largest register. Used when allocating - space for an aribtrary register value. */ - -extern int max_register_size (struct gdbarch *gdbarch); - - /* Return the size of register REGNUM. All registers should have only one size. @@ -202,7 +196,6 @@ extern void regcache_cpy_no_passthrough (struct regcache *dest, struct regcache parameterized with FRAME or REGCACHE. */ extern char *deprecated_grub_regcache_for_registers (struct regcache *); -extern char *deprecated_grub_regcache_for_register_valid (struct regcache *); extern void deprecated_read_register_gen (int regnum, char *myaddr); extern void deprecated_write_register_gen (int regnum, char *myaddr); extern void deprecated_read_register_bytes (int regbyte, char *myaddr, @@ -247,10 +240,6 @@ extern ULONGEST read_register (int regnum); /* Rename to read_unsigned_register_pid()? */ extern ULONGEST read_register_pid (int regnum, ptid_t ptid); -extern LONGEST read_signed_register (int regnum); - -extern LONGEST read_signed_register_pid (int regnum, ptid_t ptid); - extern void write_register (int regnum, LONGEST val); extern void write_register_pid (int regnum, CORE_ADDR val, ptid_t ptid); diff --git a/gdb/remote-array.c b/gdb/remote-array.c index da9bfc7..ff56881 100644 --- a/gdb/remote-array.c +++ b/gdb/remote-array.c @@ -80,11 +80,12 @@ 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 REGISTER_BYTES). */ +/* 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 /* @@ -731,7 +732,7 @@ array_wait (ptid_t ptid, struct target_waitstatus *status) static void array_fetch_registers (int ignored) { - char *reg = alloca (MAX_REGISTER_RAW_SIZE); + char reg[MAX_REGISTER_SIZE]; int regno; char *p; char *packet = alloca (PBUFSIZ); diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c index 3b9a941..643c6b6 100644 --- a/gdb/remote-e7000.c +++ b/gdb/remote-e7000.c @@ -785,7 +785,7 @@ void fetch_regs_from_dump (int (*nextchar) (), char *want) { int regno; - char *buf = alloca (max_register_size (current_gdbarch)); + char buf[MAX_REGISTER_SIZE]; int thischar = nextchar (); diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 17994f9..e290849 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -1791,7 +1791,7 @@ mips_wait (ptid_t ptid, struct target_waitstatus *status) &rpc, &rfp, &rsp, flags); if (nfields >= 3) { - char *buf = alloca (max_register_size (current_gdbarch)); + char buf[MAX_REGISTER_SIZE]; store_unsigned_integer (buf, REGISTER_RAW_SIZE (PC_REGNUM), rpc); supply_register (PC_REGNUM, buf); @@ -1972,7 +1972,7 @@ mips_fetch_registers (int regno) } { - char *buf = alloca (max_register_size (current_gdbarch)); + char buf[MAX_REGISTER_SIZE]; /* We got the number the register holds, but gdb expects to see a value in the target byte ordering. */ @@ -2251,13 +2251,13 @@ mips_mourn_inferior (void) /* We can write a breakpoint and read the shadow contents in one operation. */ -/* Insert a breakpoint. On targets that don't have built-in breakpoint - support, we read the contents of the target location and stash it, - then overwrite it with a breakpoint instruction. ADDR is the target - location in the target machine. CONTENTS_CACHE is a pointer to - memory allocated for saving the target contents. It is guaranteed - by the caller to be long enough to save sizeof BREAKPOINT bytes (this - is accomplished via BREAKPOINT_MAX). */ +/* Insert a breakpoint. On targets that don't have built-in + breakpoint support, we read the contents of the target location and + stash it, then overwrite it with a breakpoint instruction. ADDR is + the target location in the target machine. CONTENTS_CACHE is a + pointer to memory allocated for saving the target contents. It is + guaranteed by the caller to be long enough to save the breakpoint + length returned by BREAKPOINT_FROM_PC. */ static int mips_insert_breakpoint (CORE_ADDR addr, char *contents_cache) diff --git a/gdb/remote-rdp.c b/gdb/remote-rdp.c index 3f956e7..a9dba9a 100644 --- a/gdb/remote-rdp.c +++ b/gdb/remote-rdp.c @@ -550,7 +550,7 @@ rdp_fetch_one_fpu_register (int mask, char *buf) send_rdp ("bbw-SWWWWZ", RDP_COPRO_READ, FPU_COPRO_NUMBER, mask, buf + 0, buf + 4, buf + 8, &dummy); } #endif - memset (buf, 0, MAX_REGISTER_RAW_SIZE); + memset (buf, 0, MAX_REGISTER_SIZE); } diff --git a/gdb/remote-sds.c b/gdb/remote-sds.c index ac97cde..ae397e6 100644 --- a/gdb/remote-sds.c +++ b/gdb/remote-sds.c @@ -473,10 +473,10 @@ sds_fetch_registers (int regno) { unsigned char buf[PBUFSIZ]; int i, retlen; - char regs[REGISTER_BYTES]; + char *regs = alloca (DEPRECATED_REGISTER_BYTES); /* Unimplemented registers read as all bits zero. */ - memset (regs, 0, REGISTER_BYTES); + memset (regs, 0, DEPRECATED_REGISTER_BYTES); buf[0] = 18; buf[1] = 1; @@ -509,7 +509,7 @@ static void sds_prepare_to_store (void) { /* Make sure the entire registers array is valid. */ - deprecated_read_register_bytes (0, (char *) NULL, REGISTER_BYTES); + deprecated_read_register_bytes (0, (char *) NULL, DEPRECATED_REGISTER_BYTES); } /* Store register REGNO, or all registers if REGNO == -1, from the contents diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index f934bd4..f7b9e89 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -304,9 +304,9 @@ gdbsim_fetch_register (int regno) { /* For moment treat a `does not exist' register the same way as an ``unavailable'' register. */ - char *buf = alloca (MAX_REGISTER_RAW_SIZE); + char buf[MAX_REGISTER_SIZE]; int nr_bytes; - memset (buf, 0, MAX_REGISTER_RAW_SIZE); + memset (buf, 0, MAX_REGISTER_SIZE); supply_register (regno, buf); set_register_cached (regno, -1); break; @@ -314,10 +314,10 @@ gdbsim_fetch_register (int regno) default: { static int warn_user = 1; - char *buf = alloca (MAX_REGISTER_RAW_SIZE); + char buf[MAX_REGISTER_SIZE]; int nr_bytes; gdb_assert (regno >= 0 && regno < NUM_REGS); - memset (buf, 0, MAX_REGISTER_RAW_SIZE); + memset (buf, 0, MAX_REGISTER_SIZE); nr_bytes = sim_fetch_register (gdbsim_desc, REGISTER_SIM_REGNO (regno), buf, REGISTER_RAW_SIZE (regno)); @@ -359,7 +359,7 @@ gdbsim_store_register (int regno) } else if (REGISTER_SIM_REGNO (regno) >= 0) { - char *tmp = alloca (max_register_size (current_gdbarch)); + char tmp[MAX_REGISTER_SIZE]; int nr_bytes; deprecated_read_register_gen (regno, tmp); nr_bytes = sim_store_register (gdbsim_desc, diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c index d9650e3..b3fb7f2 100644 --- a/gdb/remote-vx.c +++ b/gdb/remote-vx.c @@ -466,7 +466,7 @@ static void vx_prepare_to_store (void) { /* Fetch all registers, if any of them are not yet fetched. */ - deprecated_read_register_bytes (0, NULL, REGISTER_BYTES); + deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES); } /* Copy LEN bytes to or from remote inferior's memory starting at MEMADDR diff --git a/gdb/remote.c b/gdb/remote.c index 205ae0c..a724963 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -263,7 +263,7 @@ init_remote_state (struct gdbarch *gdbarch) /* Start out by having the remote protocol mimic the existing behavour - just copy in the description of the register cache. */ - rs->sizeof_g_packet = REGISTER_BYTES; /* OK use. */ + rs->sizeof_g_packet = DEPRECATED_REGISTER_BYTES; /* OK */ /* Assume a 1:1 regnum<->pnum table. */ rs->regs = xcalloc (NUM_REGS + NUM_PSEUDO_REGS, sizeof (struct packet_reg)); @@ -2951,7 +2951,7 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status) case 'T': /* Status with PC, SP, FP, ... */ { int i; - char* regs = (char*) alloca (MAX_REGISTER_RAW_SIZE); + char regs[MAX_REGISTER_SIZE]; /* Expedited reply, containing Signal, {regno, reg} repeat */ /* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where @@ -3202,7 +3202,7 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status) case 'T': /* Status with PC, SP, FP, ... */ { int i; - char* regs = (char*) alloca (MAX_REGISTER_RAW_SIZE); + char regs[MAX_REGISTER_SIZE]; /* Expedited reply, containing Signal, {regno, reg} repeat */ /* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where @@ -3532,7 +3532,7 @@ remote_prepare_to_store (void) forcing the register cache to read its and not the target registers. */ deprecated_read_register_bytes (0, (char *) NULL, - REGISTER_BYTES); /* OK use. */ + DEPRECATED_REGISTER_BYTES); /* OK */ break; case PACKET_ENABLE: break; @@ -3549,7 +3549,7 @@ store_register_using_P (int regnum) struct packet_reg *reg = packet_reg_from_regnum (rs, regnum); /* Try storing a single register. */ char *buf = alloca (rs->remote_packet_size); - char *regp = alloca (MAX_REGISTER_RAW_SIZE); + char regp[MAX_REGISTER_SIZE]; char *p; int i; @@ -3976,7 +3976,10 @@ remote_xfer_memory (CORE_ADDR mem_addr, char *buffer, int mem_len, int targ_len; int res; - REMOTE_TRANSLATE_XFER_ADDRESS (mem_addr, mem_len, &targ_addr, &targ_len); + /* Should this be the selected frame? */ + gdbarch_remote_translate_xfer_address (current_gdbarch, current_regcache, + mem_addr, mem_len, + &targ_addr, &targ_len); if (targ_len <= 0) return 0; @@ -4624,11 +4627,12 @@ 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. 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. */ +/* 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 @@ -4652,13 +4656,13 @@ static unsigned char little_break_insn[] = LITTLE_REMOTE_BREAKPOINT; #endif /* REMOTE_BREAKPOINT */ -/* Insert a breakpoint on targets that don't have any better breakpoint - support. We read the contents of the target location and stash it, - then overwrite it with a breakpoint instruction. ADDR is the target - location in the target machine. CONTENTS_CACHE is a pointer to - memory allocated for saving the target contents. It is guaranteed - by the caller to be long enough to save sizeof BREAKPOINT bytes (this - is accomplished via BREAKPOINT_MAX). */ +/* Insert a breakpoint on targets that don't have any better + breakpoint support. We read the contents of the target location + and stash it, then overwrite it with a breakpoint instruction. + ADDR is the target location in the target machine. CONTENTS_CACHE + is a pointer to memory allocated for saving the target contents. + It is guaranteed by the caller to be long enough to save the number + of bytes returned by BREAKPOINT_FROM_PC. */ static int remote_insert_breakpoint (CORE_ADDR addr, char *contents_cache) diff --git a/gdb/rom68k-rom.c b/gdb/rom68k-rom.c index 57c0a18..6b0926b 100644 --- a/gdb/rom68k-rom.c +++ b/gdb/rom68k-rom.c @@ -88,7 +88,7 @@ static char * rom68k_supply_one_register (int regno, unsigned char *hex) { ULONGEST value; - unsigned char *regbuf = alloca (max_register_size (current_gdbarch)); + unsigned char regbuf[MAX_REGISTER_SIZE]; value = 0; while (*hex != '\0') diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index 4aed8d8..c5a0ea7 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -218,7 +218,7 @@ rs6000_ptrace64 (int req, int id, long long addr, int data, int *buf) static void fetch_register (int regno) { - int *addr = alloca (MAX_REGISTER_RAW_SIZE); + int addr[MAX_REGISTER_SIZE]; int nr, isfloat; /* Retrieved values may be -1, so infer errors from errno. */ @@ -275,7 +275,7 @@ fetch_register (int regno) static void store_register (int regno) { - int *addr = alloca (MAX_REGISTER_RAW_SIZE); + int addr[MAX_REGISTER_SIZE]; int nr, isfloat; /* Fetch the register's value from the register cache. */ diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 0192849..9776697 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -305,14 +305,11 @@ branch_dest (int opcode, int instr, CORE_ADDR pc, CORE_ADDR safety) /* Sequence of bytes for breakpoint instruction. */ -#define BIG_BREAKPOINT { 0x7d, 0x82, 0x10, 0x08 } -#define LITTLE_BREAKPOINT { 0x08, 0x10, 0x82, 0x7d } - const static unsigned char * rs6000_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size) { - static unsigned char big_breakpoint[] = BIG_BREAKPOINT; - static unsigned char little_breakpoint[] = LITTLE_BREAKPOINT; + static unsigned char big_breakpoint[] = { 0x7d, 0x82, 0x10, 0x08 }; + static unsigned char little_breakpoint[] = { 0x08, 0x10, 0x82, 0x7d }; *bp_size = 4; if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) return big_breakpoint; @@ -984,7 +981,7 @@ rs6000_pop_frame (void) } /* Make sure that all registers are valid. */ - deprecated_read_register_bytes (0, NULL, REGISTER_BYTES); + deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES); /* Figure out previous %pc value. If the function is frameless, it is still in the link register, otherwise walk the frames and retrieve the @@ -1269,7 +1266,7 @@ ran_out_of_registers_for_arguments: write_register (SP_REGNUM, sp); /* set back chain properly */ - store_address (tmp_buffer, 4, saved_sp); + store_unsigned_integer (tmp_buffer, 4, saved_sp); write_memory (sp, tmp_buffer, 4); target_store_registers (-1); @@ -1739,7 +1736,7 @@ frame_initial_stack_address (struct frame_info *fi) /* There is an alloca register, use its value, in the current frame, as the initial stack pointer. */ { - char *tmpbuf = alloca (MAX_REGISTER_RAW_SIZE); + char tmpbuf[MAX_REGISTER_SIZE]; if (frame_register_read (fi, fdata.alloca_reg, tmpbuf)) { get_frame_extra_info (fi)->initial_sp @@ -1921,7 +1918,7 @@ e500_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, { int base_regnum; int offset = 0; - char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); + char temp_buffer[MAX_REGISTER_SIZE]; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (reg_nr >= tdep->ppc_gp0_regnum @@ -1944,7 +1941,7 @@ e500_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, { int base_regnum; int offset = 0; - char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); + char temp_buffer[MAX_REGISTER_SIZE]; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (reg_nr >= tdep->ppc_gp0_regnum @@ -2878,8 +2875,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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_register_size (gdbarch, wordsize); - set_gdbarch_register_bytes (gdbarch, off); + 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_max_register_raw_size (gdbarch, 16); @@ -2900,7 +2897,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); set_gdbarch_char_signed (gdbarch, 0); - set_gdbarch_fix_call_dummy (gdbarch, rs6000_fix_call_dummy); + 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_push_return_address (gdbarch, ppc_push_return_address); diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index f5a424d..c7dce06 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -1150,7 +1150,7 @@ void s390_store_return_value (struct type *valtype, char *valbuf) { int arglen; - char *reg_buff = alloca (max (S390_FPR_SIZE, REGISTER_SIZE)), *value; + char *reg_buff = alloca (max (S390_FPR_SIZE, DEPRECATED_REGISTER_SIZE)), *value; if (TYPE_CODE (valtype) == TYPE_CODE_FLT) { @@ -1825,9 +1825,9 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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); - /* Amount PC must be decremented by after a breakpoint. - This is often the number of bytes in BREAKPOINT - but not always. */ + /* Amount PC must be decremented by after a breakpoint. This is + often the number of bytes returned by BREAKPOINT_FROM_PC but not + always. */ set_gdbarch_decr_pc_after_break (gdbarch, 2); set_gdbarch_deprecated_pop_frame (gdbarch, s390_pop_frame); /* Stack grows downward. */ @@ -1876,23 +1876,22 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); set_gdbarch_deprecated_push_return_address (gdbarch, s390_push_return_address); - set_gdbarch_sizeof_call_dummy_words (gdbarch, - sizeof (s390_call_dummy_words)); - set_gdbarch_call_dummy_words (gdbarch, s390_call_dummy_words); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (s390_call_dummy_words)); + set_gdbarch_deprecated_call_dummy_words (gdbarch, s390_call_dummy_words); switch (info.bfd_arch_info->mach) { case bfd_mach_s390_31: - set_gdbarch_register_size (gdbarch, 4); + 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_addr_bits_remove (gdbarch, s390_addr_bits_remove); - set_gdbarch_register_bytes (gdbarch, S390_REGISTER_BYTES); + set_gdbarch_deprecated_register_bytes (gdbarch, S390_REGISTER_BYTES); break; case bfd_mach_s390_64: - set_gdbarch_register_size (gdbarch, 8); + 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, @@ -1901,7 +1900,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_long_bit (gdbarch, 64); set_gdbarch_long_long_bit (gdbarch, 64); set_gdbarch_ptr_bit (gdbarch, 64); - set_gdbarch_register_bytes (gdbarch, S390X_REGISTER_BYTES); + set_gdbarch_deprecated_register_bytes (gdbarch, S390X_REGISTER_BYTES); set_gdbarch_address_class_type_flags (gdbarch, s390_address_class_type_flags); set_gdbarch_address_class_type_flags_to_name (gdbarch, diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c index 1af501d..0a59ea9 100644 --- a/gdb/scm-lang.c +++ b/gdb/scm-lang.c @@ -167,7 +167,7 @@ scm_lookup_name (char *str) if (in_eval_c () && (sym = lookup_symbol ("env", expression_context_block, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL)) != NULL) args[2] = value_of_variable (sym, expression_context_block); else @@ -181,7 +181,7 @@ scm_lookup_name (char *str) sym = lookup_symbol (str, expression_context_block, - VAR_NAMESPACE, (int *) NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); if (sym) return value_of_variable (sym, NULL); @@ -252,6 +252,8 @@ const struct language_defn scm_language_defn = scm_val_print, /* Print a value using appropriate syntax */ scm_value_print, /* Print a top-level value */ NULL, /* Language specific skip_trampoline */ + value_of_this, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ NULL, /* Language specific symbol demangler */ {"", "", "", ""}, /* Binary format info */ {"#o%lo", "#o", "o", ""}, /* Octal format info */ diff --git a/gdb/sentinel-frame.c b/gdb/sentinel-frame.c index dab1647..dcc583e 100644 --- a/gdb/sentinel-frame.c +++ b/gdb/sentinel-frame.c @@ -56,7 +56,7 @@ sentinel_frame_prev_register (struct frame_info *next_frame, onto the corresponding hardware register. */ *optimized = 0; *lvalp = lval_register; - *addrp = REGISTER_BYTE (regnum); + *addrp = register_offset_hack (current_gdbarch, regnum); *realnum = regnum; /* If needed, find and return the value of the register. */ diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c index bca0e54..38f8e78 100644 --- a/gdb/ser-pipe.c +++ b/gdb/ser-pipe.c @@ -138,7 +138,7 @@ void _initialize_ser_pipe (void) { struct serial_ops *ops = XMALLOC (struct serial_ops); - memset (ops, sizeof (struct serial_ops), 0); + memset (ops, 0, sizeof (struct serial_ops)); ops->name = "pipe"; ops->next = 0; ops->open = pipe_open; diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index c6ae19d..a9a8714 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -208,7 +208,7 @@ void _initialize_ser_tcp (void) { struct serial_ops *ops = XMALLOC (struct serial_ops); - memset (ops, sizeof (struct serial_ops), 0); + memset (ops, 0, sizeof (struct serial_ops)); ops->name = "tcp"; ops->next = 0; ops->open = net_open; diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c index f7ab28a..e7a5d93 100644 --- a/gdb/ser-unix.c +++ b/gdb/ser-unix.c @@ -1337,7 +1337,7 @@ void _initialize_ser_hardwire (void) { struct serial_ops *ops = XMALLOC (struct serial_ops); - memset (ops, sizeof (struct serial_ops), 0); + memset (ops, 0, sizeof (struct serial_ops)); ops->name = "hardwire"; ops->next = 0; ops->open = hardwire_open; diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 6bb0237..cbaaa36 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -1770,7 +1770,7 @@ sh_init_extra_frame_info (int fromleaf, struct frame_info *fi) get_frame_extra_info (fi)->return_pc = deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), PC_REGNUM); - get_frame_extra_info (fi)->f_offset = -(CALL_DUMMY_LENGTH + 4); + get_frame_extra_info (fi)->f_offset = -(DEPRECATED_CALL_DUMMY_LENGTH + 4); get_frame_extra_info (fi)->leaf_function = 0; return; } @@ -1801,7 +1801,7 @@ sh64_init_extra_frame_info (int fromleaf, struct frame_info *fi) get_frame_extra_info (fi)->return_pc = deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), PC_REGNUM); - get_frame_extra_info (fi)->f_offset = -(CALL_DUMMY_LENGTH + 4); + get_frame_extra_info (fi)->f_offset = -(DEPRECATED_CALL_DUMMY_LENGTH + 4); get_frame_extra_info (fi)->leaf_function = 0; return; } @@ -1873,8 +1873,8 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, if (regnum == SP_REGNUM) { if (raw_buffer) /* SP register treated specially */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - get_frame_saved_regs (frame)[regnum]); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), + get_frame_saved_regs (frame)[regnum]); } else { /* any other register */ @@ -3481,7 +3481,7 @@ sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, void *buffer) { int base_regnum, portion; - char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); + char temp_buffer[MAX_REGISTER_SIZE]; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (reg_nr >= tdep->DR0_REGNUM @@ -3520,7 +3520,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int base_regnum; int portion; int offset = 0; - char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); + char temp_buffer[MAX_REGISTER_SIZE]; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (reg_nr >= tdep->DR0_REGNUM @@ -3684,7 +3684,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, const void *buffer) { int base_regnum, portion; - char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); + char temp_buffer[MAX_REGISTER_SIZE]; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (reg_nr >= tdep->DR0_REGNUM @@ -3721,7 +3721,7 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, { int base_regnum, portion; int offset; - char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); + char temp_buffer[MAX_REGISTER_SIZE]; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (reg_nr >= tdep->DR0_REGNUM @@ -4087,7 +4087,7 @@ sh64_do_pseudo_register (int regnum) static void sh_do_register (int regnum) { - char *raw_buffer = alloca (max_register_size (current_gdbarch)); + char raw_buffer[MAX_REGISTER_SIZE]; fputs_filtered (REGISTER_NAME (regnum), gdb_stdout); print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), gdb_stdout); @@ -4367,8 +4367,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sp_regnum (gdbarch, 15); set_gdbarch_deprecated_fp_regnum (gdbarch, 14); set_gdbarch_pc_regnum (gdbarch, 16); - set_gdbarch_register_size (gdbarch, 4); - set_gdbarch_register_bytes (gdbarch, SH_DEFAULT_NUM_REGS * 4); + set_gdbarch_deprecated_register_size (gdbarch, 4); + set_gdbarch_deprecated_register_bytes (gdbarch, SH_DEFAULT_NUM_REGS * 4); set_gdbarch_deprecated_do_registers_info (gdbarch, sh_do_registers_info); set_gdbarch_breakpoint_from_pc (gdbarch, sh_breakpoint_from_pc); set_gdbarch_deprecated_frame_chain (gdbarch, sh_frame_chain); @@ -4586,10 +4586,10 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* the number of real registers is the same whether we are in ISA16(compact) or ISA32(media). */ set_gdbarch_num_regs (gdbarch, SIM_SH64_NR_REGS); - set_gdbarch_register_size (gdbarch, 8); /*????*/ - set_gdbarch_register_bytes (gdbarch, - ((SIM_SH64_NR_FP_REGS + 1) * 4) - + (SIM_SH64_NR_REGS - SIM_SH64_NR_FP_REGS -1) * 8); + set_gdbarch_deprecated_register_size (gdbarch, 8); /*????*/ + set_gdbarch_deprecated_register_bytes (gdbarch, + ((SIM_SH64_NR_FP_REGS + 1) * 4) + + (SIM_SH64_NR_REGS - SIM_SH64_NR_FP_REGS -1) * 8); sh_register_name = sh_sh64_register_name; sh_show_regs = sh64_show_regs; @@ -4652,8 +4652,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); - set_gdbarch_call_dummy_words (gdbarch, sh_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (sh_call_dummy_words)); + set_gdbarch_deprecated_call_dummy_words (gdbarch, sh_call_dummy_words); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (sh_call_dummy_words)); set_gdbarch_deprecated_push_return_address (gdbarch, sh_push_return_address); diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index e1157ae..3ae0b65 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -647,9 +647,9 @@ sol_thread_store_registers (int regno) if (regno != -1) { /* Not writing all the regs */ /* save new register value */ - char* old_value = (char*) alloca (REGISTER_SIZE); + char* old_value = (char*) alloca (DEPRECATED_REGISTER_SIZE); memcpy (old_value, &deprecated_registers[REGISTER_BYTE (regno)], - REGISTER_SIZE); + DEPRECATED_REGISTER_SIZE); val = p_td_thr_getgregs (&thandle, gregset); if (val != TD_OK) @@ -662,7 +662,7 @@ sol_thread_store_registers (int regno) /* restore new register value */ memcpy (&deprecated_registers[REGISTER_BYTE (regno)], old_value, - REGISTER_SIZE); + DEPRECATED_REGISTER_SIZE); #if 0 /* thread_db doesn't seem to handle this right */ diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 07c1269..6735b08 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -151,6 +151,14 @@ int deferred_stores = 0; /* Accumulated stores we want to do eventually. */ #endif +const unsigned char * +sparc_breakpoint_from_pc (CORE_ADDR *pc, int *len) +{ + static const char breakpoint[] = {0x91, 0xd0, 0x20, 0x01}; + (*len) = sizeof (breakpoint); + return breakpoint; +} + /* Fetch a single instruction. Even on bi-endian machines such as sparc86x, instructions are always big-endian. */ @@ -317,9 +325,7 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi) deprecated_read_fp() to create_new_frame. */ if (get_next_frame (fi)) { - char *buf; - - buf = alloca (MAX_REGISTER_RAW_SIZE); + char buf[MAX_REGISTER_SIZE]; /* Compute ->frame as if not flat. If it is flat, we'll change it later. */ @@ -368,9 +374,7 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi) && X_OP3 (insn) == 4 && X_RS1 (insn) == 14) { - char *buf; - - buf = alloca (MAX_REGISTER_RAW_SIZE); + char buf[MAX_REGISTER_SIZE]; /* We definitely have a flat frame now. */ get_frame_extra_info (fi)->flat = 1; @@ -474,10 +478,9 @@ sparc_extract_struct_value_address (char *regbuf) CORE_ADDR sparc_frame_saved_pc (struct frame_info *frame) { - char *buf; + char buf[MAX_REGISTER_SIZE]; CORE_ADDR addr; - buf = alloca (MAX_REGISTER_RAW_SIZE); if ((get_frame_type (frame) == SIGTRAMP_FRAME)) { /* This is the signal trampoline frame. @@ -864,7 +867,7 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, if (raw_buffer != NULL) { /* Put it back in target format. */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), get_frame_pc (frame)); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), get_frame_pc (frame)); } if (addrp != NULL) *addrp = 0; @@ -972,7 +975,7 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, if (raw_buffer != NULL) { /* Put it back in target format. */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), addr); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), addr); } if (addrp != NULL) *addrp = 0; @@ -1266,7 +1269,7 @@ sparc_pop_frame (void) int regnum; fsr = alloca (NUM_REGS * sizeof (CORE_ADDR)); - raw_buffer = alloca (REGISTER_BYTES); + raw_buffer = alloca (DEPRECATED_REGISTER_BYTES); sparc_frame_find_saved_regs (frame, &fsr[0]); if (SPARC_HAS_FPU) { @@ -2070,8 +2073,8 @@ sparc_print_registers (struct gdbarch *gdbarch, { int i; const int numregs = NUM_REGS + NUM_PSEUDO_REGS; - char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); - char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE); + char raw_buffer[MAX_REGISTER_SIZE]; + char virtual_buffer[MAX_REGISTER_SIZE]; for (i = 0; i < numregs; i++) { @@ -2311,9 +2314,7 @@ void sparc_store_return_value (struct type *type, char *valbuf) { int regno; - char *buffer; - - buffer = alloca (MAX_REGISTER_RAW_SIZE); + char buffer[MAX_REGISTER_SIZE]; if (TYPE_CODE (type) == TYPE_CODE_FLT && SPARC_HAS_FPU) /* Floating-point values are returned in the register pair */ @@ -2357,9 +2358,10 @@ sparc_store_return_value (struct type *type, char *valbuf) For structs and unions, if the function was compiled with Sun cc, it expects 'unimp' after the call. But gcc doesn't use that - (twisted) convention. So leave a nop there for gcc (FIX_CALL_DUMMY - can assume it is operating on a pristine CALL_DUMMY, not one that - has already been customized for a different function). */ + (twisted) convention. So leave a nop there for gcc + (DEPRECATED_FIX_CALL_DUMMY can assume it is operating on a pristine + CALL_DUMMY, not one that has already been customized for a + different function). */ void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, @@ -2392,10 +2394,10 @@ sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, { store_unsigned_integer (dummy + CALL_DUMMY_CALL_OFFSET + 8, 4, TYPE_LENGTH (value_type) & 0x1fff); - set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 0x30); + set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 0x30); } else - set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 0x2c); + set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 0x2c); if (!(GDB_TARGET_IS_SPARC64)) { @@ -3054,7 +3056,7 @@ sparc_gdbarch_fix_call_dummy (char *dummy, static CORE_ADDR sparc_call_dummy_address (void) { - return (CALL_DUMMY_START_OFFSET) + CALL_DUMMY_BREAKPOINT_OFFSET; + return (DEPRECATED_CALL_DUMMY_START_OFFSET) + DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET; } /* Supply the Y register number to those that need it. */ @@ -3159,11 +3161,11 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* First set settings that are common for all sparc architectures. */ set_gdbarch_believe_pcc_promotion (gdbarch, 1); - set_gdbarch_breakpoint_from_pc (gdbarch, memory_breakpoint_from_pc); + 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_fix_call_dummy (gdbarch, sparc_gdbarch_fix_call_dummy); + 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); @@ -3221,10 +3223,18 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) #ifdef SPARC32_CALL_DUMMY_ON_STACK set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address); - set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0x30); - set_gdbarch_call_dummy_length (gdbarch, 0x38); - - /* NOTE: cagney/2002-04-26: Based from info posted by Peter + set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 0x30); + set_gdbarch_deprecated_call_dummy_length (gdbarch, 0x38); + + /* NOTE: cagney/2003-05-01: Using the just added push_dummy_code + architecture method, it is now possible to implement a + generic dummy frames based inferior function call that stores + the breakpoint (and struct info) on the stack. Further, by + treating a SIGSEG at a breakpoint as equivalent to a SIGTRAP + it is even possible to make this work when the stack is + no-execute. + + NOTE: cagney/2002-04-26: Based from info posted by Peter Schauer around Oct '99. Briefly, due to aspects of the SPARC ABI, it isn't possible to use ON_STACK with a strictly compliant compiler. @@ -3268,10 +3278,10 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) are explained in Appendix D.3. */ set_gdbarch_call_dummy_location (gdbarch, ON_STACK); - set_gdbarch_call_dummy_words (gdbarch, call_dummy_32); + set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_32); #else set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); - set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil); + set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_nil); #endif set_gdbarch_deprecated_call_dummy_stack_adjust (gdbarch, 68); set_gdbarch_frame_args_skip (gdbarch, 68); @@ -3285,14 +3295,14 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_byte (gdbarch, sparc32_register_byte); set_gdbarch_register_raw_size (gdbarch, sparc32_register_size); - set_gdbarch_register_size (gdbarch, 4); + 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); #ifdef SPARC32_CALL_DUMMY_ON_STACK - set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_32)); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_32)); #else - set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0); #endif set_gdbarch_stack_align (gdbarch, sparc32_stack_align); set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1); @@ -3315,14 +3325,14 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) #ifdef SPARC64_CALL_DUMMY_ON_STACK set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address); - set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 8 * 4); - set_gdbarch_call_dummy_length (gdbarch, 192); + set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 8 * 4); + set_gdbarch_deprecated_call_dummy_length (gdbarch, 192); set_gdbarch_call_dummy_location (gdbarch, ON_STACK); - set_gdbarch_call_dummy_start_offset (gdbarch, 148); - set_gdbarch_call_dummy_words (gdbarch, call_dummy_64); + set_gdbarch_deprecated_call_dummy_start_offset (gdbarch, 148); + set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_64); #else set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); - set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil); + set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_nil); #endif set_gdbarch_deprecated_call_dummy_stack_adjust (gdbarch, 128); set_gdbarch_frame_args_skip (gdbarch, 136); @@ -3339,14 +3349,14 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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_register_size (gdbarch, 8); + 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); #ifdef SPARC64_CALL_DUMMY_ON_STACK - set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_64)); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_64)); #else - set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0); #endif set_gdbarch_stack_align (gdbarch, sparc64_stack_align); set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1); @@ -3371,7 +3381,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) case bfd_mach_sparc: set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value); set_gdbarch_num_regs (gdbarch, 72); - set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4); + 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 @@ -3407,7 +3417,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) case bfd_mach_sparc_v8plus: set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value); set_gdbarch_num_regs (gdbarch, 72); - set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4); + 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; @@ -3419,7 +3429,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) case bfd_mach_sparc_v8plusa: set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value); set_gdbarch_num_regs (gdbarch, 72); - set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4); + 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 @@ -3443,7 +3453,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) case bfd_mach_sparc_v9: set_gdbarch_deprecated_extract_return_value (gdbarch, sparc64_extract_return_value); set_gdbarch_num_regs (gdbarch, 125); - set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8); + set_gdbarch_deprecated_register_bytes (gdbarch, 32*8 + 32*8 + 45*8); set_gdbarch_register_name (gdbarch, sparc64_register_name); set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value); #if 0 @@ -3455,7 +3465,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) case bfd_mach_sparc_v9a: set_gdbarch_deprecated_extract_return_value (gdbarch, sparc64_extract_return_value); set_gdbarch_num_regs (gdbarch, 125); - set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8); + set_gdbarch_deprecated_register_bytes (gdbarch, 32*8 + 32*8 + 45*8); set_gdbarch_register_name (gdbarch, sparc64_register_name); set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value); #if 0 diff --git a/gdb/stabsread.c b/gdb/stabsread.c index dffd593..4e3c8ec 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -418,7 +418,7 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs, sizeof (struct symbol)); memset (sym, 0, sizeof (struct symbol)); - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT; DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, pp - name, &objfile->symbol_obstack); @@ -677,7 +677,7 @@ read_type_number (register char **pp, register int *typenums) // OBSOLETE return 1; // OBSOLETE } // OBSOLETE /* FIXME! attach base info to type */ -// OBSOLETE bsym = lookup_symbol (bname, 0, STRUCT_NAMESPACE, 0, 0); /*demangled_name */ +// OBSOLETE bsym = lookup_symbol (bname, 0, STRUCT_DOMAIN, 0, 0); /*demangled_name */ // OBSOLETE if (bsym) // OBSOLETE { // OBSOLETE new->field.type = SYMBOL_TYPE (bsym); @@ -750,7 +750,7 @@ read_type_number (register char **pp, register int *typenums) // OBSOLETE sublist_count++; // OBSOLETE fname++; // OBSOLETE } -// OBSOLETE ref_func = lookup_symbol (fname, 0, VAR_NAMESPACE, 0, 0); /* demangled name */ +// OBSOLETE ref_func = lookup_symbol (fname, 0, VAR_DOMAIN, 0, 0); /* demangled name */ // OBSOLETE if (!ref_func) // OBSOLETE { // OBSOLETE complaint (&symfile_complaints, @@ -946,7 +946,7 @@ read_type_number (register char **pp, register int *typenums) // OBSOLETE /* Find symbol's internal gdb reference using demangled_name. // OBSOLETE This is the real sym that we want; // OBSOLETE sym was a temp hack to make debugger happy */ -// OBSOLETE ref_sym = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym), 0, STRUCT_NAMESPACE, 0, 0); +// OBSOLETE ref_sym = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym), 0, STRUCT_DOMAIN, 0, 0); // OBSOLETE type = SYMBOL_TYPE (ref_sym); @@ -1379,7 +1379,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, { SYMBOL_CLASS (sym) = LOC_CONST; SYMBOL_TYPE (sym) = error_type (&p, objfile); - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, &file_symbols); return sym; } @@ -1472,7 +1472,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_TYPE (sym) = error_type (&p, objfile); } } - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, &file_symbols); return sym; @@ -1480,7 +1480,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, /* The name of a caught exception. */ SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_CLASS (sym) = LOC_LABEL; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_VALUE_ADDRESS (sym) = valu; add_symbol_to_list (sym, &local_symbols); break; @@ -1489,7 +1489,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, /* A static function definition. */ SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_CLASS (sym) = LOC_BLOCK; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, &file_symbols); /* fall into process_function_types. */ @@ -1560,7 +1560,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, /* A global function definition. */ SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_CLASS (sym) = LOC_BLOCK; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, &global_symbols); goto process_function_types; @@ -1571,7 +1571,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, These definitions appear at the end of the namelist. */ SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_CLASS (sym) = LOC_STATIC; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; /* Don't add symbol references to global_sym_chain. Symbol references don't have valid names and wont't match up with minimal symbols when the global_sym_chain is relocated. @@ -1593,7 +1593,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_CLASS (sym) = LOC_LOCAL; SYMBOL_VALUE (sym) = valu; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, &local_symbols); break; @@ -1613,7 +1613,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_CLASS (sym) = LOC_ARG; SYMBOL_VALUE (sym) = valu; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, &local_symbols); if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG) @@ -1725,7 +1725,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_PRINT_NAME (sym)); SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */ } - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, &local_symbols); break; @@ -1741,7 +1741,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_PRINT_NAME (sym)); SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */ } - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; if (within_function) { /* Sun cc uses a pair of symbols, one 'p' and one 'r' with the same @@ -1812,7 +1812,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, } } #endif - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, &file_symbols); break; @@ -1827,7 +1827,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_CLASS (sym) = LOC_TYPEDEF; SYMBOL_VALUE (sym) = valu; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; /* C++ vagaries: we may have a type which is derived from a base type which did not have its name defined when the derived class was output. We fill in the derived class's @@ -1928,7 +1928,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_CLASS (sym) = LOC_TYPEDEF; SYMBOL_VALUE (sym) = valu; - SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE; + SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN; if (TYPE_TAG_NAME (SYMBOL_TYPE (sym)) == 0) TYPE_TAG_NAME (SYMBOL_TYPE (sym)) = obconcat (&objfile->type_obstack, "", "", DEPRECATED_SYMBOL_NAME (sym)); @@ -1942,7 +1942,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, *typedef_sym = *sym; SYMBOL_CLASS (typedef_sym) = LOC_TYPEDEF; SYMBOL_VALUE (typedef_sym) = valu; - SYMBOL_NAMESPACE (typedef_sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN; if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) TYPE_NAME (SYMBOL_TYPE (sym)) = obconcat (&objfile->type_obstack, "", "", DEPRECATED_SYMBOL_NAME (sym)); @@ -1967,7 +1967,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, } } #endif - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, &local_symbols); break; @@ -1976,7 +1976,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_CLASS (sym) = LOC_REF_ARG; SYMBOL_VALUE (sym) = valu; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, &local_symbols); break; @@ -1992,7 +1992,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_PRINT_NAME (sym)); SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */ } - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, &local_symbols); break; @@ -2004,7 +2004,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_CLASS (sym) = LOC_LOCAL; SYMBOL_VALUE (sym) = valu; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, &local_symbols); break; #if 0 /* OBSOLETE CFront */ @@ -2027,7 +2027,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, // OBSOLETE SYMBOL_TYPE (sym) = error_type (&p, objfile); /* FIXME! change later */ // OBSOLETE SYMBOL_CLASS (sym) = LOC_CONST; // OBSOLETE SYMBOL_VALUE (sym) = 0; -// OBSOLETE SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; +// OBSOLETE SYMBOL_DOMAIN (sym) = VAR_DOMAIN; // OBSOLETE /* Don't add to list - we'll delete it later when // OBSOLETE we add the continuation to the real sym */ // OBSOLETE return sym; @@ -2038,7 +2038,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_TYPE (sym) = error_type (&p, objfile); SYMBOL_CLASS (sym) = LOC_CONST; SYMBOL_VALUE (sym) = 0; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, &file_symbols); break; } @@ -2393,7 +2393,7 @@ again: struct symbol *sym = ppt->symbol[i]; if (SYMBOL_CLASS (sym) == LOC_TYPEDEF - && SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE + && SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN && (TYPE_CODE (SYMBOL_TYPE (sym)) == code) && STREQ (DEPRECATED_SYMBOL_NAME (sym), type_name)) { @@ -4068,7 +4068,7 @@ attach_fn_fields_to_type (struct field_info *fip, register struct type *type) // OBSOLETE STABS_CONTINUE (pp, objfile); /* handle \\ */ // OBSOLETE while (**pp != ';' && (sname = get_substring (pp, ' '), sname)) // OBSOLETE { -// OBSOLETE ref_static = lookup_symbol (sname, 0, VAR_NAMESPACE, 0, 0); /*demangled_name */ +// OBSOLETE ref_static = lookup_symbol (sname, 0, VAR_DOMAIN, 0, 0); /*demangled_name */ // OBSOLETE if (!ref_static) // OBSOLETE { // OBSOLETE complaint (&symfile_complaints, @@ -4500,7 +4500,7 @@ read_enum_type (register char **pp, register struct type *type, DEPRECATED_SYMBOL_NAME (sym) = name; SYMBOL_LANGUAGE (sym) = current_subfile->language; SYMBOL_CLASS (sym) = LOC_CONST; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_VALUE (sym) = n; if (n < 0) unsigned_enum = 0; @@ -5187,7 +5187,7 @@ cleanup_undefined_types (void) struct symbol *sym = ppt->symbol[i]; if (SYMBOL_CLASS (sym) == LOC_TYPEDEF - && SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE + && SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN && (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE (*type)) && STREQ (DEPRECATED_SYMBOL_NAME (sym), typename)) diff --git a/gdb/stack.c b/gdb/stack.c index d0dbc59..f99d88c 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -615,10 +615,25 @@ frame_info (char *addr_exp, int from_tty) int i, count, numregs; const char *funname = 0; enum language funlang = language_unknown; + const char *pc_regname; if (!target_has_stack) error ("No stack."); + /* Name of the value returned by get_frame_pc(). Per comments, "pc" + is not a good name. */ + if (PC_REGNUM >= 0) + /* OK, this is weird. The PC_REGNUM hardware register's value can + easily not match that of the internal value returned by + get_frame_pc(). */ + pc_regname = REGISTER_NAME (PC_REGNUM); + else + /* But then, this is weird to. Even without PC_REGNUM, an + architectures will often have a hardware register called "pc", + and that register's value, again, can easily not match + get_frame_pc(). */ + pc_regname = "pc"; + fi = parse_frame_specification (addr_exp); if (fi == NULL) error ("Invalid frame specified."); @@ -681,7 +696,7 @@ frame_info (char *addr_exp, int from_tty) print_address_numeric (get_frame_base (fi), 1, gdb_stdout); printf_filtered (":\n"); } - printf_filtered (" %s = ", REGISTER_NAME (PC_REGNUM)); + printf_filtered (" %s = ", pc_regname); print_address_numeric (get_frame_pc (fi), 1, gdb_stdout); wrap_here (" "); @@ -696,7 +711,7 @@ frame_info (char *addr_exp, int from_tty) printf_filtered (" (%s:%d)", sal.symtab->filename, sal.line); puts_filtered ("; "); wrap_here (" "); - printf_filtered ("saved %s ", REGISTER_NAME (PC_REGNUM)); + printf_filtered ("saved %s ", pc_regname); print_address_numeric (frame_pc_unwind (fi), 1, gdb_stdout); printf_filtered ("\n"); @@ -800,11 +815,14 @@ frame_info (char *addr_exp, int from_tty) &realnum, NULL); if (!optimized && lval == not_lval) { - void *value = alloca (MAX_REGISTER_RAW_SIZE); + char value[MAX_REGISTER_SIZE]; CORE_ADDR sp; frame_register_unwind (fi, SP_REGNUM, &optimized, &lval, &addr, &realnum, value); - sp = extract_address (value, REGISTER_RAW_SIZE (SP_REGNUM)); + /* NOTE: cagney/2003-05-22: This is assuming that the + stack pointer was packed as an unsigned integer. That + may or may not be valid. */ + sp = extract_unsigned_integer (value, REGISTER_RAW_SIZE (SP_REGNUM)); printf_filtered (" Previous frame's sp is "); print_address_numeric (sp, 1, gdb_stdout); printf_filtered ("\n"); @@ -1319,7 +1337,7 @@ print_frame_arg_vars (register struct frame_info *fi, are not combined in symbol-reading. */ sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym), - b, VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL); + b, VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); print_variable_value (sym2, fi, stream); fprintf_filtered (stream, "\n"); break; diff --git a/gdb/std-regs.c b/gdb/std-regs.c index 9f6f9ac..93d5102 100644 --- a/gdb/std-regs.c +++ b/gdb/std-regs.c @@ -98,20 +98,19 @@ value_of_builtin_frame_fp_reg (struct frame_info *frame) static struct value * value_of_builtin_frame_pc_reg (struct frame_info *frame) { -#ifdef PC_REGNUM if (PC_REGNUM >= 0) return value_of_register (PC_REGNUM, frame); -#endif - { - struct value *val = allocate_value (builtin_type_void_data_ptr); - char *buf = VALUE_CONTENTS_RAW (val); - if (frame == NULL) - memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0); - else - ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, - get_frame_pc (frame)); - return val; - } + else + { + struct value *val = allocate_value (builtin_type_void_data_ptr); + char *buf = VALUE_CONTENTS_RAW (val); + if (frame == NULL) + memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0); + else + ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, + get_frame_pc (frame)); + return val; + } } static struct value * diff --git a/gdb/symfile.c b/gdb/symfile.c index aa831fb..fb36ddb 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2615,7 +2615,7 @@ start_psymtab_common (struct objfile *objfile, things will happen if you modify them. */ const struct partial_symbol * -add_psymbol_to_list (char *name, int namelength, namespace_enum namespace, +add_psymbol_to_list (char *name, int namelength, domain_enum domain, enum address_class class, struct psymbol_allocation_list *list, long val, /* Value as a long */ CORE_ADDR coreaddr, /* Value as a CORE_ADDR */ @@ -2642,7 +2642,7 @@ add_psymbol_to_list (char *name, int namelength, namespace_enum namespace, } SYMBOL_SECTION (&psymbol) = 0; SYMBOL_LANGUAGE (&psymbol) = language; - PSYMBOL_NAMESPACE (&psymbol) = namespace; + PSYMBOL_DOMAIN (&psymbol) = domain; PSYMBOL_CLASS (&psymbol) = class; SYMBOL_SET_NAMES (&psymbol, buf, namelength, objfile); @@ -2667,7 +2667,7 @@ add_psymbol_to_list (char *name, int namelength, namespace_enum namespace, void add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name, - int dem_namelength, namespace_enum namespace, + int dem_namelength, domain_enum domain, enum address_class class, struct psymbol_allocation_list *list, long val, /* Value as a long */ CORE_ADDR coreaddr, /* Value as a CORE_ADDR */ @@ -2712,7 +2712,7 @@ add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name, } SYMBOL_SECTION (&psymbol) = 0; SYMBOL_LANGUAGE (&psymbol) = language; - PSYMBOL_NAMESPACE (&psymbol) = namespace; + PSYMBOL_DOMAIN (&psymbol) = domain; PSYMBOL_CLASS (&psymbol) = class; SYMBOL_INIT_LANGUAGE_SPECIFIC (&psymbol, language); diff --git a/gdb/symfile.h b/gdb/symfile.h index 06dfd7d..2416ec2 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -149,12 +149,12 @@ extern void extend_psymbol_list (struct psymbol_allocation_list *, /* #include "demangle.h" */ extern const struct partial_symbol * -add_psymbol_to_list (char *, int, namespace_enum, enum address_class, +add_psymbol_to_list (char *, int, domain_enum, enum address_class, struct psymbol_allocation_list *, long, CORE_ADDR, enum language, struct objfile *); extern void -add_psymbol_with_dem_name_to_list (char *, int, char *, int, namespace_enum, +add_psymbol_with_dem_name_to_list (char *, int, char *, int, domain_enum, enum address_class, struct psymbol_allocation_list *, long, CORE_ADDR, diff --git a/gdb/symmisc.c b/gdb/symmisc.c index acd83b4..6997cb5 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -616,7 +616,7 @@ print_symbol (void *args) struct ui_file *outfile = ((struct print_symbol_args *) args)->outfile; print_spaces (depth, outfile); - if (SYMBOL_NAMESPACE (symbol) == LABEL_NAMESPACE) + if (SYMBOL_DOMAIN (symbol) == LABEL_DOMAIN) { fprintf_filtered (outfile, "label %s at ", SYMBOL_PRINT_NAME (symbol)); print_address_numeric (SYMBOL_VALUE_ADDRESS (symbol), 1, outfile); @@ -628,7 +628,7 @@ print_symbol (void *args) fprintf_filtered (outfile, "\n"); return 1; } - if (SYMBOL_NAMESPACE (symbol) == STRUCT_NAMESPACE) + if (SYMBOL_DOMAIN (symbol) == STRUCT_DOMAIN) { if (TYPE_TAG_NAME (SYMBOL_TYPE (symbol))) { @@ -855,22 +855,22 @@ print_partial_symbols (struct partial_symbol **p, int count, char *what, fprintf_filtered (outfile, " `%s'", SYMBOL_DEMANGLED_NAME (*p)); } fputs_filtered (", ", outfile); - switch (SYMBOL_NAMESPACE (*p)) + switch (SYMBOL_DOMAIN (*p)) { - case UNDEF_NAMESPACE: - fputs_filtered ("undefined namespace, ", outfile); + case UNDEF_DOMAIN: + fputs_filtered ("undefined domain, ", outfile); break; - case VAR_NAMESPACE: + case VAR_DOMAIN: /* This is the usual thing -- don't print it */ break; - case STRUCT_NAMESPACE: - fputs_filtered ("struct namespace, ", outfile); + case STRUCT_DOMAIN: + fputs_filtered ("struct domain, ", outfile); break; - case LABEL_NAMESPACE: - fputs_filtered ("label namespace, ", outfile); + case LABEL_DOMAIN: + fputs_filtered ("label domain, ", outfile); break; default: - fputs_filtered ("<invalid namespace>, ", outfile); + fputs_filtered ("<invalid domain>, ", outfile); break; } switch (SYMBOL_CLASS (*p)) @@ -1004,9 +1004,9 @@ maintenance_print_objfiles (char *ignore, int from_tty) } -/* List all the symbol tables. */ +/* List all the symbol tables whose names match REGEXP (optional). */ void -maintenance_list_symtabs (char *regexp, int from_tty) +maintenance_info_symtabs (char *regexp, int from_tty) { struct objfile *objfile; @@ -1053,9 +1053,9 @@ maintenance_list_symtabs (char *regexp, int from_tty) } -/* List all the partial symbol tables. */ +/* List all the partial symbol tables whose names match REGEXP (optional). */ void -maintenance_list_psymtabs (char *regexp, int from_tty) +maintenance_info_psymtabs (char *regexp, int from_tty) { struct objfile *objfile; @@ -1168,7 +1168,7 @@ maintenance_check_symtabs (char *ignore, int from_tty) while (length--) { sym = lookup_block_symbol (b, DEPRECATED_SYMBOL_NAME (*psym), - NULL, SYMBOL_NAMESPACE (*psym)); + NULL, SYMBOL_DOMAIN (*psym)); if (!sym) { printf_filtered ("Static symbol `"); @@ -1185,7 +1185,7 @@ maintenance_check_symtabs (char *ignore, int from_tty) while (length--) { sym = lookup_block_symbol (b, DEPRECATED_SYMBOL_NAME (*psym), - NULL, SYMBOL_NAMESPACE (*psym)); + NULL, SYMBOL_DOMAIN (*psym)); if (!sym) { printf_filtered ("Global symbol `"); diff --git a/gdb/symtab.c b/gdb/symtab.c index 27623fd..42bd140 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -55,7 +55,6 @@ #include <ctype.h> #include "cp-abi.h" #include "cp-support.h" -#include "gdb_assert.h" /* Prototypes for local functions */ @@ -83,12 +82,12 @@ char *operator_chars (char *p, char **end); static struct partial_symbol *lookup_partial_symbol (struct partial_symtab *, const char *, const char *, int, - namespace_enum); + domain_enum); static struct symbol *lookup_symbol_aux (const char *name, const char *linkage_name, const struct block *block, - const namespace_enum namespace, + const domain_enum domain, int *is_a_field_of_this, struct symtab **symtab); @@ -96,53 +95,31 @@ static struct symbol *lookup_symbol_aux_local (const char *name, const char *linkage_name, const struct block *block, - const namespace_enum namespace, + const domain_enum domain, struct symtab **symtab); static -struct symbol *lookup_symbol_aux_block (const char *name, - const char *linkage_name, - const struct block *block, - const namespace_enum namespace, - struct symtab **symtab); - -static -struct symbol *lookup_symbol_aux_nonlocal (int block_index, - const char *name, - const char *linkage_name, - const namespace_enum namespace, - struct symtab **symtab); - -static -struct symbol *lookup_symbol_aux_file (const char *name, - const char *linkage_name, - const struct block *block, - const namespace_enum namespace, - struct symtab **symtab, - int anonymous_namespace); - -static struct symbol *lookup_symbol_aux_symtabs (int block_index, const char *name, const char *linkage_name, - const namespace_enum namespace, + const domain_enum domain, struct symtab **symtab); static struct symbol *lookup_symbol_aux_psymtabs (int block_index, const char *name, const char *linkage_name, - const namespace_enum namespace, + const domain_enum domain, struct symtab **symtab); +#if 0 static -struct symbol *lookup_symbol_aux_namespace_scope (const char *name, - const char *linkage_name, - const struct block *block, - namespace_enum namespace, - struct symtab **symtab, - const char *scope, - int scope_len); +struct symbol *lookup_symbol_aux_minsyms (const char *name, + const char *linkage_name, + const domain_enum domain, + int *is_a_field_of_this, + struct symtab **symtab); +#endif static struct symbol *find_active_alias (struct symbol *sym, CORE_ADDR addr); @@ -154,12 +131,12 @@ static void fixup_section (struct general_symbol_info *, struct objfile *); static int file_matches (char *, char **, int); -static void print_symbol_info (namespace_enum, +static void print_symbol_info (domain_enum, struct symtab *, struct symbol *, int, char *); static void print_msymbol_info (struct minimal_symbol *); -static void symtab_symbol_info (char *, namespace_enum, int); +static void symtab_symbol_info (char *, domain_enum, int); static void overload_list_add_symbol (struct symbol *sym, const char *oload_name); @@ -218,10 +195,10 @@ got_symtab: { return s; } - + /* If the user gave us an absolute path, try to find the file in this symtab and use its absolute path. */ - + if (full_path != NULL) { const char *fp = symtab_to_filename (s); @@ -234,7 +211,7 @@ got_symtab: if (real_path != NULL) { char *rp = gdb_realpath (symtab_to_filename (s)); - make_cleanup (xfree, rp); + make_cleanup (xfree, rp); if (FILENAME_CMP (real_path, rp) == 0) { return s; @@ -322,14 +299,14 @@ lookup_partial_symtab (const char *name) if (real_path != NULL) { - char *rp = NULL; + char *rp = NULL; if (pst->fullname == NULL) source_full_path_of (pst->filename, &pst->fullname); - if (pst->fullname != NULL) - { - rp = gdb_realpath (pst->fullname); - make_cleanup (xfree, rp); - } + if (pst->fullname != NULL) + { + rp = gdb_realpath (pst->fullname); + make_cleanup (xfree, rp); + } if (rp != NULL && FILENAME_CMP (real_path, rp) == 0) { return pst; @@ -417,13 +394,13 @@ gdb_mangle_name (struct type *type, int method_id, int signature_id) mangled_name_len = ((is_constructor ? 0 : strlen (field_name)) + strlen (buf) + len + strlen (physname) + 1); - { - mangled_name = (char *) xmalloc (mangled_name_len); - if (is_constructor) - mangled_name[0] = '\0'; - else - strcpy (mangled_name, field_name); - } + { + mangled_name = (char *) xmalloc (mangled_name_len); + if (is_constructor) + mangled_name[0] = '\0'; + else + strcpy (mangled_name, field_name); + } strcat (mangled_name, buf); /* If the class doesn't have a name, i.e. newname NULL, then we just mangle it using 0 for the length of the class. Thus it gets mangled @@ -668,7 +645,6 @@ symbol_init_demangled_name (struct general_symbol_info *gsymbol, xfree (demangled); } } - /* Return the source code name of a symbol. In languages where demangling is necessary, this is the demangled name. */ @@ -719,7 +695,7 @@ init_sal (struct symtab_and_line *sal) /* Find which partial symtab on contains PC and SECTION. Return 0 if none. */ struct partial_symtab * -find_pc_sect_psymtab (CORE_ADDR pc, asection * section) +find_pc_sect_psymtab (CORE_ADDR pc, asection *section) { register struct partial_symtab *pst; register struct objfile *objfile; @@ -733,7 +709,8 @@ find_pc_sect_psymtab (CORE_ADDR pc, asection * section) && (msymbol->type == mst_data || msymbol->type == mst_bss || msymbol->type == mst_abs - || msymbol->type == mst_file_data || msymbol->type == mst_file_bss)) + || msymbol->type == mst_file_data + || msymbol->type == mst_file_bss)) return NULL; ALL_PSYMTABS (objfile, pst) @@ -746,7 +723,8 @@ find_pc_sect_psymtab (CORE_ADDR pc, asection * section) many partial symbol tables containing the PC, but we want the partial symbol table that contains the function containing the PC. */ - if (!(objfile->flags & OBJF_REORDERED) && section == 0) /* can't validate section this way */ + if (!(objfile->flags & OBJF_REORDERED) && + section == 0) /* can't validate section this way */ return (pst); if (msymbol == NULL) @@ -785,7 +763,7 @@ find_pc_psymtab (CORE_ADDR pc) struct partial_symbol * find_pc_sect_psymbol (struct partial_symtab *psymtab, CORE_ADDR pc, - asection * section) + asection *section) { struct partial_symbol *best = NULL, *p, **pp; CORE_ADDR best_pc; @@ -802,12 +780,12 @@ find_pc_sect_psymbol (struct partial_symtab *psymtab, CORE_ADDR pc, find_pc_partial_function doesn't use a minimal symbol and thus cache a bad endaddr. */ for (pp = psymtab->objfile->global_psymbols.list + psymtab->globals_offset; - (pp - - (psymtab->objfile->global_psymbols.list + psymtab->globals_offset) < - psymtab->n_global_syms); pp++) + (pp - (psymtab->objfile->global_psymbols.list + psymtab->globals_offset) + < psymtab->n_global_syms); + pp++) { p = *pp; - if (SYMBOL_NAMESPACE (p) == VAR_NAMESPACE + if (SYMBOL_DOMAIN (p) == VAR_DOMAIN && SYMBOL_CLASS (p) == LOC_BLOCK && pc >= SYMBOL_VALUE_ADDRESS (p) && (SYMBOL_VALUE_ADDRESS (p) > best_pc @@ -826,12 +804,12 @@ find_pc_sect_psymbol (struct partial_symtab *psymtab, CORE_ADDR pc, } for (pp = psymtab->objfile->static_psymbols.list + psymtab->statics_offset; - (pp - - (psymtab->objfile->static_psymbols.list + psymtab->statics_offset) < - psymtab->n_static_syms); pp++) + (pp - (psymtab->objfile->static_psymbols.list + psymtab->statics_offset) + < psymtab->n_static_syms); + pp++) { p = *pp; - if (SYMBOL_NAMESPACE (p) == VAR_NAMESPACE + if (SYMBOL_DOMAIN (p) == VAR_DOMAIN && SYMBOL_CLASS (p) == LOC_BLOCK && pc >= SYMBOL_VALUE_ADDRESS (p) && (SYMBOL_VALUE_ADDRESS (p) > best_pc @@ -905,19 +883,16 @@ fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile) return psym; } -/* Find the definition for a specified symbol name NAME in namespace - NAMESPACE, visible from lexical block BLOCK. Returns the struct - symbol pointer, or zero if no symbol is found. If SYMTAB is - non-NULL, store the symbol table in which the symbol was found - there. - +/* Find the definition for a specified symbol name NAME + in domain DOMAIN, visible from lexical block BLOCK. + Returns the struct symbol pointer, or zero if no symbol is found. + If SYMTAB is non-NULL, store the symbol table in which the + symbol was found there, or NULL if not found. C++: if IS_A_FIELD_OF_THIS is nonzero on entry, check to see if NAME is a field of the current implied argument `this'. If so set - *IS_A_FIELD_OF_THIS to 1, otherwise set it to zero. - - BLOCK_FOUND is set to the block in which NAME is found (in the case - of a field of `this', value_of_this sets BLOCK_FOUND to the proper - value.) */ + *IS_A_FIELD_OF_THIS to 1, otherwise set it to zero. + BLOCK_FOUND is set to the block in which NAME is found (in the case of + a field of `this', value_of_this sets BLOCK_FOUND to the proper value.) */ /* This function has a bunch of loops in it and it would seem to be attractive to put in some QUIT's (though I'm not really sure @@ -935,7 +910,7 @@ fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile) struct symbol * lookup_symbol (const char *name, const struct block *block, - const namespace_enum namespace, int *is_a_field_of_this, + const domain_enum domain, int *is_a_field_of_this, struct symtab **symtab) { const char *modified_name = name; @@ -954,76 +929,36 @@ lookup_symbol (const char *name, const struct block *block, } return lookup_symbol_aux (modified_name, NULL, block, - namespace, is_a_field_of_this, symtab); + domain, is_a_field_of_this, symtab); } +/* Behave like lookup_symbol_aux except that NAME is the natural name + of the symbol that we're looking for and, if LINKAGE_NAME is + non-NULL, ensure that the symbol's linkage name matches as + well. */ + static struct symbol * lookup_symbol_aux (const char *name, const char *linkage_name, - const struct block *block, const namespace_enum namespace, + const struct block *block, const domain_enum domain, int *is_a_field_of_this, struct symtab **symtab) { struct symbol *sym; - const struct block *static_block; /* Search specified block and its superiors. Don't search STATIC_BLOCK or GLOBAL_BLOCK. */ - sym = lookup_symbol_aux_local (name, linkage_name, block, namespace, + sym = lookup_symbol_aux_local (name, linkage_name, block, domain, symtab); if (sym != NULL) return sym; -#if 0 - /* NOTE: carlton/2002-11-05: At the time that this code was - #ifdeffed out, the value of 'block' was always NULL at this - point, hence the bemused comments below. */ - - /* FIXME: this code is never executed--block is always NULL at this - point. What is it trying to do, anyway? We already should have - checked the STATIC_BLOCK above (it is the superblock of top-level - blocks). Why is VAR_NAMESPACE special-cased? */ - /* Don't need to mess with the psymtabs; if we have a block, - that file is read in. If we don't, then we deal later with - all the psymtab stuff that needs checking. */ - /* Note (RT): The following never-executed code looks unnecessary to me also. - * If we change the code to use the original (passed-in) - * value of 'block', we could cause it to execute, but then what - * would it do? The STATIC_BLOCK of the symtab containing the passed-in - * 'block' was already searched by the above code. And the STATIC_BLOCK's - * of *other* symtabs (those files not containing 'block' lexically) - * should not contain 'block' address-wise. So we wouldn't expect this - * code to find any 'sym''s that were not found above. I vote for - * deleting the following paragraph of code. - */ - if (namespace == VAR_NAMESPACE && block != NULL) - { - struct block *b; - /* Find the right symtab. */ - ALL_SYMTABS (objfile, s) - { - bv = BLOCKVECTOR (s); - b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); - if (BLOCK_START (b) <= BLOCK_START (block) - && BLOCK_END (b) > BLOCK_START (block)) - { - sym = lookup_block_symbol (b, name, linkage_name, VAR_NAMESPACE); - if (sym) - { - block_found = b; - if (symtab != NULL) - *symtab = s; - return fixup_symbol_section (sym, objfile); - } - } - } - } -#endif /* 0 */ + /* If requested to do so by the caller and if appropriate for the + current language, check to see if NAME is a field of `this'. */ - /* C++/Java/Objective-C: If requested to do so by the caller, - check to see if NAME is a field of `this'. */ - if (is_a_field_of_this) + if (current_language->la_value_of_this != NULL + && is_a_field_of_this != NULL) { - struct value *v = value_of_this (0); + struct value *v = current_language->la_value_of_this (0); *is_a_field_of_this = 0; if (v && check_field (v, name)) @@ -1035,20 +970,28 @@ lookup_symbol_aux (const char *name, const char *linkage_name, } } - /* Now search this block's static block, and all the global blocks. - In the C++ case, do lookup in namespace scope. */ + /* Now do whatever is appropriate for the current language to look + up static and global variables. */ - sym = lookup_symbol_aux_namespace_scope (name, linkage_name, block, - namespace, symtab, - block_scope (block), 0); + sym = current_language->la_lookup_symbol_nonlocal (name, linkage_name, + block, domain, + symtab); if (sym != NULL) return sym; /* Now search all static file-level symbols. Not strictly correct, - but more useful than an error. */ + but more useful than an error. Do the symtabs first, then check + the psymtabs. If a psymtab indicates the existence of the + desired name as a file-level static, then do psymtab-to-symtab + conversion on the fly and return the found symbol. */ - sym = lookup_symbol_aux_nonlocal (STATIC_BLOCK, name, linkage_name, - namespace, symtab); + sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, linkage_name, + domain, symtab); + if (sym != NULL) + return sym; + + sym = lookup_symbol_aux_psymtabs (STATIC_BLOCK, name, linkage_name, + domain, symtab); if (sym != NULL) return sym; @@ -1058,26 +1001,25 @@ lookup_symbol_aux (const char *name, const char *linkage_name, } /* Check to see if the symbol is defined in BLOCK or its superiors. - Don't search STATIC_BLOCK or GLOBAL_BLOCK. If we don't find a - match, store the address of STATIC_BLOCK in static_block. */ + Don't search STATIC_BLOCK or GLOBAL_BLOCK. */ static struct symbol * lookup_symbol_aux_local (const char *name, const char *linkage_name, const struct block *block, - const namespace_enum namespace, + const domain_enum domain, struct symtab **symtab) { struct symbol *sym; const struct block *static_block = block_static_block (block); - /* Either no block is specified or it's a global block. */ + /* Check if either no block is specified or it's a global block. */ if (static_block == NULL) return NULL; while (block != static_block) { - sym = lookup_symbol_aux_block (name, linkage_name, block, namespace, + sym = lookup_symbol_aux_block (name, linkage_name, block, domain, symtab); if (sym != NULL) return sym; @@ -1092,10 +1034,10 @@ lookup_symbol_aux_local (const char *name, const char *linkage_name, /* Look up a symbol in a block; if found, locate its symtab, fixup the symbol, and set block_found appropriately. */ -static struct symbol * +struct symbol * lookup_symbol_aux_block (const char *name, const char *linkage_name, const struct block *block, - const namespace_enum namespace, + const domain_enum domain, struct symtab **symtab) { struct symbol *sym; @@ -1104,7 +1046,7 @@ lookup_symbol_aux_block (const char *name, const char *linkage_name, struct block *b; struct symtab *s = NULL; - sym = lookup_block_symbol (block, name, linkage_name, namespace); + sym = lookup_block_symbol (block, name, linkage_name, domain); if (sym) { block_found = block; @@ -1130,113 +1072,6 @@ lookup_symbol_aux_block (const char *name, const char *linkage_name, return NULL; } - -/* Check to see if the symbol is defined in one of the symtabs or - psymtabs. BLOCK_INDEX should be either GLOBAL_BLOCK or - STATIC_BLOCK, depending on whether or not we want to search global - symbols or static symbols. */ - -static struct symbol * -lookup_symbol_aux_nonlocal (int block_index, - const char *name, - const char *linkage_name, - const namespace_enum namespace, - struct symtab **symtab) -{ - struct symbol *sym; - - sym = lookup_symbol_aux_symtabs (block_index, name, linkage_name, - namespace, symtab); - if (sym != NULL) - return sym; - - sym = lookup_symbol_aux_psymtabs (block_index, name, linkage_name, - namespace, symtab); - if (sym != NULL) - return sym; - - return NULL; -} - -/* Look up NAME in BLOCK's static block and in global blocks. If - ANONYMOUS_NAMESPACE is nonzero, don't look in other files' global - blocks, just in the one belonging to this file. */ - -static struct symbol * -lookup_symbol_aux_file (const char *name, - const char *linkage_name, - const struct block *block, - const namespace_enum namespace, - struct symtab **symtab, - int anonymous_namespace) -{ - struct symbol *sym = NULL; - const struct block *static_block = block_static_block (block); - - if (static_block != NULL) - { - sym = lookup_symbol_aux_block (name, linkage_name, static_block, - namespace, symtab); - if (sym != NULL) - return sym; - } - - if (anonymous_namespace) - { - const struct block *global_block = NULL; - if (static_block != NULL) - global_block = BLOCK_SUPERBLOCK (static_block); - else if (block != NULL) - global_block = block; - - if (global_block != NULL) - sym = lookup_symbol_aux_block (name, linkage_name, global_block, - namespace, symtab); - - if (sym == NULL || global_block == NULL) - sym = cp_lookup_namespace_symbol (name); - } - else - { - sym = lookup_symbol_aux_nonlocal (GLOBAL_BLOCK, name, linkage_name, - namespace, symtab); - } - - if (sym != NULL) - return sym; - - /* Now call "cp_lookup_possible_namespace_symbol". Symbols in here - claim to be associated to namespaces, whereas the names in - question might actually correspond to either namespaces or to - classes. But if they correspond to classes, then we should have - found a match to them above. So if we find them now, they should - be genuine. */ - - /* FIXME: carlton/2002-12-18: This is a hack and should eventually - be deleted: see cp-support.c. */ - - /* FIXME: carlton/2003-01-06: Searching this seems a bit fishy if - anonymous_namespace is nonzero, since we might return a namespace - that's really a class that doesn't happen to be mentioned in the - current file. Sigh. Still, I don't think anything catastrophic - should happen in that case. Probably the right thing to do is to - move anonymous namespace symbols to files' static blocks. */ - - if (namespace == VAR_NAMESPACE) - { - sym = cp_lookup_possible_namespace_symbol (name); - if (sym != NULL) - { - if (symtab != NULL) - *symtab = NULL; - return sym; - } - } - - return NULL; -} - - /* Check to see if the symbol is defined in one of the symtabs. BLOCK_INDEX should be either GLOBAL_BLOCK or STATIC_BLOCK, depending on whether or not we want to search global symbols or @@ -1245,7 +1080,7 @@ lookup_symbol_aux_file (const char *name, static struct symbol * lookup_symbol_aux_symtabs (int block_index, const char *name, const char *linkage_name, - const namespace_enum namespace, + const domain_enum domain, struct symtab **symtab) { struct symbol *sym; @@ -1258,7 +1093,7 @@ lookup_symbol_aux_symtabs (int block_index, { bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, block_index); - sym = lookup_block_symbol (block, name, linkage_name, namespace); + sym = lookup_block_symbol (block, name, linkage_name, domain); if (sym) { block_found = block; @@ -1279,7 +1114,7 @@ lookup_symbol_aux_symtabs (int block_index, static struct symbol * lookup_symbol_aux_psymtabs (int block_index, const char *name, const char *linkage_name, - const namespace_enum namespace, + const domain_enum domain, struct symtab **symtab) { struct symbol *sym; @@ -1294,12 +1129,12 @@ lookup_symbol_aux_psymtabs (int block_index, const char *name, { if (!ps->readin && lookup_partial_symbol (ps, name, linkage_name, - psymtab_index, namespace)) + psymtab_index, domain)) { s = PSYMTAB_TO_SYMTAB (ps); bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, block_index); - sym = lookup_block_symbol (block, name, linkage_name, namespace); + sym = lookup_block_symbol (block, name, linkage_name, domain); if (!sym) { /* This shouldn't be necessary, but as a last resort try @@ -1316,7 +1151,7 @@ lookup_symbol_aux_psymtabs (int block_index, const char *name, block = BLOCKVECTOR_BLOCK (bv, block_index == GLOBAL_BLOCK ? STATIC_BLOCK : GLOBAL_BLOCK); - sym = lookup_block_symbol (block, name, linkage_name, namespace); + sym = lookup_block_symbol (block, name, linkage_name, domain); if (!sym) error ("Internal: %s symbol `%s' found in %s psymtab but not in symtab.\n%s may be an inlined function, or may be a template function\n(if a template, try specifying an instantiation: %s<type>).", block_index == GLOBAL_BLOCK ? "global" : "static", @@ -1331,121 +1166,141 @@ lookup_symbol_aux_psymtabs (int block_index, const char *name, return NULL; } -/* Lookup NAME at namespace scope (or, in C terms, in static and - global variables). SCOPE is the namespace that the current - function is defined within; only consider namespaces whose length - is at least SCOPE_LEN. (This is to make the recursion easier.) */ +#if 0 +/* Check for the possibility of the symbol being a function or a + mangled variable that is stored in one of the minimal symbol + tables. Eventually, all global symbols might be resolved in this + way. */ + +/* NOTE: carlton/2002-12-05: At one point, this function was part of + lookup_symbol_aux, and what are now 'return' statements within + lookup_symbol_aux_minsyms returned from lookup_symbol_aux, even if + sym was NULL. As far as I can tell, this was basically accidental; + it didn't happen every time that msymbol was non-NULL, but only if + some additional conditions held as well, and it caused problems + with HP-generated symbol tables. */ + +/* NOTE: carlton/2003-05-14: This function was once used as part of + lookup_symbol. It is currently unnecessary for correctness + reasons, however, and using it doesn't seem to be any faster than + using lookup_symbol_aux_psymtabs, so I'm commenting it out. */ static struct symbol * -lookup_symbol_aux_namespace_scope (const char *name, - const char *linkage_name, - const struct block *block, - namespace_enum namespace, - struct symtab **symtab, - const char *scope, - int scope_len) +lookup_symbol_aux_minsyms (const char *name, + const char *linkage_name, + const domain_enum domain, + int *is_a_field_of_this, + struct symtab **symtab) { - char *cp_namespace; + struct symbol *sym; + struct blockvector *bv; + const struct block *block; + struct minimal_symbol *msymbol; + struct symtab *s; - if (scope[scope_len] != '\0') + if (domain == VAR_DOMAIN) { - struct symbol *sym; - int new_scope_len = scope_len; + msymbol = lookup_minimal_symbol (name, NULL, NULL); - /* If the current scope is followed by "::", skip past that. */ - if (new_scope_len != 0) + if (msymbol != NULL) { - gdb_assert (scope[new_scope_len] == ':'); - new_scope_len += 2; - } - new_scope_len += cp_find_first_component (scope + new_scope_len); - sym = lookup_symbol_aux_namespace_scope (name, linkage_name, block, - namespace, symtab, - scope, new_scope_len); - if (sym != NULL) - return sym; - } - - cp_namespace = alloca (scope_len + 1); - strncpy (cp_namespace, scope, scope_len); - cp_namespace[scope_len] = '\0'; - return lookup_symbol_namespace (cp_namespace, name, linkage_name, - block, namespace, symtab); -} - -/* This tries to look up NAME in the C++ namespace CP_NAMESPACE. It - applies the using directives that are active in BLOCK. Otherwise, - arguments are as in lookup_symbol_aux. */ - -struct symbol * -lookup_symbol_namespace (const char *cp_namespace, - const char *name, - const char *linkage_name, - const struct block *block, - namespace_enum gdb_namespace, - struct symtab **symtab) -{ - struct block_using_iterator iter; - const struct using_direct *current; - struct symbol *sym; - - /* First, go through the using directives. If any of them add new - names to the namespace we're searching in, see if we can find a - match by applying them. */ + /* OK, we found a minimal symbol in spite of not finding any + symbol. There are various possible explanations for + this. One possibility is the symbol exists in code not + compiled -g. Another possibility is that the 'psymtab' + isn't doing its job. A third possibility, related to #2, + is that we were confused by name-mangling. For instance, + maybe the psymtab isn't doing its job because it only + know about demangled names, but we were given a mangled + name... */ + + /* We first use the address in the msymbol to try to locate + the appropriate symtab. Note that find_pc_sect_symtab() + has a side-effect of doing psymtab-to-symtab expansion, + for the found symtab. */ + s = find_pc_sect_symtab (SYMBOL_VALUE_ADDRESS (msymbol), + SYMBOL_BFD_SECTION (msymbol)); + if (s != NULL) + { + /* This is a function which has a symtab for its address. */ + bv = BLOCKVECTOR (s); + block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); + + /* This call used to pass `DEPRECATED_SYMBOL_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 + unmangled name. */ + sym = + lookup_block_symbol (block, name, linkage_name, domain); + /* We kept static functions in minimal symbol table as well as + in static scope. We want to find them in the symbol table. */ + if (!sym) + { + block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); + sym = lookup_block_symbol (block, name, + linkage_name, domain); + } - for (current = block_using_iterator_first (block, &iter); - current != NULL; - current = block_using_iterator_next (&iter)) - { - if (strcmp (cp_namespace, current->outer) == 0) - { - sym = lookup_symbol_namespace (current->inner, - name, - linkage_name, - block, - gdb_namespace, - symtab); - if (sym != NULL) - return sym; + /* NOTE: carlton/2002-12-04: The following comment was + taken from a time when two versions of this function + were part of the body of lookup_symbol_aux: this + comment was taken from the version of the function + that was #ifdef HPUXHPPA, and the comment was right + before the 'return NULL' part of lookup_symbol_aux. + (Hence the "Fall through and return 0" comment.) + Elena did some digging into the situation for + Fortran, and she reports: + + "I asked around (thanks to Jeff Knaggs), and I think + the story for Fortran goes like this: + + "Apparently, in older Fortrans, '_' was not part of + the user namespace. g77 attached a final '_' to + procedure names as the exported symbols for linkage + (foo_) , but the symbols went in the debug info just + like 'foo'. The rationale behind this is not + completely clear, and maybe it was done to other + symbols as well, not just procedures." */ + + /* If we get here with sym == 0, the symbol was + found in the minimal symbol table + but not in the symtab. + Fall through and return 0 to use the msymbol + definition of "foo_". + (Note that outer code generally follows up a call + to this routine with a call to lookup_minimal_symbol(), + so a 0 return means we'll just flow into that other routine). + + This happens for Fortran "foo_" symbols, + which are "foo" in the symtab. + + This can also happen if "asm" is used to make a + regular symbol but not a debugging symbol, e.g. + asm(".globl _main"); + asm("_main:"); + */ + + if (symtab != NULL && sym != NULL) + *symtab = s; + return fixup_symbol_section (sym, s->objfile); + } } } - /* We didn't find anything by applying any of the using directives - that are still applicable; so let's see if we've got a match - using the current namespace. */ - - if (cp_namespace[0] == '\0') - { - return lookup_symbol_aux_file (name, linkage_name, block, - gdb_namespace, symtab, - 0); - } - else - { - char *concatenated_name - = alloca (strlen (cp_namespace) + 2 + strlen (name) + 1); - strcpy (concatenated_name, cp_namespace); - strcat (concatenated_name, "::"); - strcat (concatenated_name, name); - sym = lookup_symbol_aux_file (concatenated_name, linkage_name, - block, gdb_namespace, symtab, - cp_is_anonymous (cp_namespace)); - return sym; - } + return NULL; } +#endif /* 0 */ /* Lookup the symbol associated to a minimal symbol, if there is one. */ +/* FIXME: carlton/2003-05-23: Delete: I don't really believe in this + any more. Just use lookup_symbol_linkage. */ + struct symbol * lookup_symbol_minsym (const struct minimal_symbol *minsym) { - int block_index = minsym_static (minsym) ? STATIC_BLOCK : GLOBAL_BLOCK; - - return lookup_symbol_aux_nonlocal (block_index, - SYMBOL_NATURAL_NAME (minsym), - SYMBOL_LINKAGE_NAME (minsym), - VAR_NAMESPACE, - NULL); + return lookup_symbol_linkage (SYMBOL_LINKAGE_NAME (minsym)); } /* Lookup the symbol with a given linkage name. */ @@ -1476,8 +1331,16 @@ lookup_symbol_linkage (const char *linkage_name) because that might apply namespace stuff, defeating the purpose of searching on a specific linkage name. */ - sym = lookup_symbol_aux_nonlocal (GLOBAL_BLOCK, name, linkage_name, - VAR_NAMESPACE, NULL); + sym = lookup_symbol_global (name, linkage_name, VAR_DOMAIN, NULL); + + if (sym != NULL) + { + xfree (demangled_name); + return sym; + } + + sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, linkage_name, + VAR_DOMAIN, NULL); if (sym != NULL) { @@ -1485,18 +1348,19 @@ lookup_symbol_linkage (const char *linkage_name) return sym; } - sym = lookup_symbol_aux_nonlocal (STATIC_BLOCK, name, linkage_name, - VAR_NAMESPACE, NULL); + sym = lookup_symbol_aux_psymtabs (STATIC_BLOCK, name, linkage_name, + VAR_DOMAIN, NULL); xfree (demangled_name); return sym; } - /* Look up a type named NESTED_NAME that is nested inside the C++ class or namespace given by PARENT_TYPE, from within the context given by BLOCK. */ +/* FIXME: Move to cp-namespace.c. */ + struct type * lookup_nested_type (struct type *parent_type, const char *nested_name, @@ -1521,12 +1385,12 @@ lookup_nested_type (struct type *parent_type, not the parent name. Sigh. Blame it on stabs, or something. */ const char *parent_name = TYPE_TAG_NAME (parent_type); - struct symbol *sym = lookup_symbol_namespace (parent_name, - nested_name, - NULL, - block, - VAR_NAMESPACE, - NULL); + struct symbol *sym = cp_lookup_symbol_namespace (parent_name, + nested_name, + NULL, + block, + VAR_DOMAIN, + NULL); if (sym == NULL || SYMBOL_CLASS (sym) != LOC_TYPEDEF) return NULL; else @@ -1538,6 +1402,93 @@ lookup_nested_type (struct type *parent_type, } } +/* A default version of lookup_symbol_nonlocal for use by languages + that can't think of anything better to do. This implements the C + lookup rules. */ + +struct symbol * +basic_lookup_symbol_nonlocal (const char *name, + const char *linkage_name, + const struct block *block, + const domain_enum domain, + struct symtab **symtab) +{ + struct symbol *sym; + + /* NOTE: carlton/2003-05-19: The comments below were written when + this (or what turned into this) was part of lookup_symbol_aux; + I'm much less worried about these questions now, since these + decisions have turned out well, but I leave these comments here + for posterity. */ + + /* NOTE: carlton/2002-12-05: There is a question as to whether or + not it would be appropriate to search the current global block + here as well. (That's what this code used to do before the + is_a_field_of_this check was moved up.) On the one hand, it's + redundant with the lookup_symbol_aux_symtabs search that happens + next. On the other hand, if decode_line_1 is passed an argument + like filename:var, then the user presumably wants 'var' to be + searched for in filename. On the third hand, there shouldn't be + multiple global variables all of which are named 'var', and it's + not like decode_line_1 has ever restricted its search to only + global variables in a single filename. All in all, only + searching the static block here seems best: it's correct and it's + cleanest. */ + + /* NOTE: carlton/2002-12-05: There's also a possible performance + issue here: if you usually search for global symbols in the + current file, then it would be slightly better to search the + current global block before searching all the symtabs. But there + are other factors that have a much greater effect on performance + than that one, so I don't think we should worry about that for + now. */ + + sym = lookup_symbol_static (name, linkage_name, block, domain, symtab); + if (sym != NULL) + return sym; + + return lookup_symbol_global (name, linkage_name, domain, symtab); +} + +/* Lookup a symbol in the static block associated to BLOCK, if there + is one; do nothing if BLOCK is NULL or a global block. */ + +struct symbol * +lookup_symbol_static (const char *name, + const char *linkage_name, + const struct block *block, + const domain_enum domain, + struct symtab **symtab) +{ + const struct block *static_block = block_static_block (block); + + if (static_block != NULL) + return lookup_symbol_aux_block (name, linkage_name, static_block, + domain, symtab); + else + return NULL; +} + +/* Lookup a symbol in all files' global blocks (searching psymtabs if + necessary). */ + +struct symbol * +lookup_symbol_global (const char *name, + const char *linkage_name, + const domain_enum domain, + struct symtab **symtab) +{ + struct symbol *sym; + + sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, linkage_name, + domain, symtab); + if (sym != NULL) + return sym; + + return lookup_symbol_aux_psymtabs (GLOBAL_BLOCK, name, linkage_name, + domain, symtab); +} + /* Look, in partial_symtab PST, for symbol whose natural name is NAME. If LINKAGE_NAME is non-NULL, check in addition that the symbol's linkage name matches it. Check the global symbols if GLOBAL, the @@ -1546,14 +1497,14 @@ lookup_nested_type (struct type *parent_type, static struct partial_symbol * lookup_partial_symbol (struct partial_symtab *pst, const char *name, const char *linkage_name, int global, - namespace_enum namespace) + domain_enum domain) { struct partial_symbol *temp; struct partial_symbol **start, **psym; struct partial_symbol **top, **real_top, **bottom, **center; int length = (global ? pst->n_global_syms : pst->n_static_syms); int do_linear_search = 1; - + if (length == 0) { return (NULL); @@ -1561,7 +1512,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, start = (global ? pst->objfile->global_psymbols.list + pst->globals_offset : pst->objfile->static_psymbols.list + pst->statics_offset); - + if (global) /* This means we can use a binary search. */ { do_linear_search = 0; @@ -1570,7 +1521,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, pointing at the earliest partial symbol whose name might be correct. At that point *all* partial symbols with an appropriate name will be checked against the correct - namespace. */ + domain. */ bottom = start; top = start + length - 1; @@ -1579,8 +1530,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, { center = bottom + (top - bottom) / 2; if (!(center < top)) - internal_error (__FILE__, __LINE__, - "failed internal consistency check"); + internal_error (__FILE__, __LINE__, "failed internal consistency check"); if (!do_linear_search && (SYMBOL_LANGUAGE (*center) == language_java)) { @@ -1596,17 +1546,16 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, } } if (!(top == bottom)) - internal_error (__FILE__, __LINE__, - "failed internal consistency check"); + internal_error (__FILE__, __LINE__, "failed internal consistency check"); while (top <= real_top && (linkage_name != NULL ? strcmp (SYMBOL_LINKAGE_NAME (*top), linkage_name) == 0 - : strcmp_iw (SYMBOL_NATURAL_NAME (*top), name) == 0)) + : SYMBOL_MATCHES_NATURAL_NAME (*top,name))) { - if (SYMBOL_NAMESPACE (*top) == namespace) + if (SYMBOL_DOMAIN (*top) == domain) { - return (*top); + return (*top); } top++; } @@ -1616,14 +1565,14 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, we should also do a linear search. */ if (do_linear_search) - { + { for (psym = start; psym < start + length; psym++) { - if (namespace == SYMBOL_NAMESPACE (*psym)) + if (domain == SYMBOL_DOMAIN (*psym)) { if (linkage_name != NULL ? strcmp (SYMBOL_LINKAGE_NAME (*psym), linkage_name) == 0 - : strcmp_iw (SYMBOL_NATURAL_NAME (*psym), name) == 0) + : SYMBOL_MATCHES_NATURAL_NAME (*psym, name)) { return (*psym); } @@ -1634,12 +1583,12 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, return (NULL); } -/* Look up a type named NAME in the struct_namespace. The type returned +/* Look up a type named NAME in the struct_domain. The type returned must not be opaque -- i.e., must have at least one field defined This code was modelled on lookup_symbol -- the parts not relevant to looking up types were just left out. In particular it's assumed here that types - are available in struct_namespace and only at file-static or global blocks. */ + are available in struct_domain and only at file-static or global blocks. */ /* FIXME: carlton/2002-10-25: This function duplicates too much of lookup_symbol_aux's code: it's a maintenance burden. That should @@ -1674,7 +1623,7 @@ lookup_transparent_type (const char *name) { bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); - sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE); + sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN); if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym))) { return SYMBOL_TYPE (sym); @@ -1684,12 +1633,12 @@ lookup_transparent_type (const char *name) ALL_PSYMTABS (objfile, ps) { if (!ps->readin && lookup_partial_symbol (ps, name, NULL, - 1, STRUCT_NAMESPACE)) + 1, STRUCT_DOMAIN)) { s = PSYMTAB_TO_SYMTAB (ps); bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); - sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE); + sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN); if (!sym) { /* This shouldn't be necessary, but as a last resort @@ -1698,7 +1647,7 @@ lookup_transparent_type (const char *name) * the psymtab gets it wrong in some cases. */ block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); - sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE); + sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN); if (!sym) error ("Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\ %s may be an inlined function, or may be a template function\n\ @@ -1722,7 +1671,7 @@ lookup_transparent_type (const char *name) { bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); - sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE); + sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN); if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym))) { return SYMBOL_TYPE (sym); @@ -1731,12 +1680,12 @@ lookup_transparent_type (const char *name) ALL_PSYMTABS (objfile, ps) { - if (!ps->readin && lookup_partial_symbol (ps, name, NULL, 0, STRUCT_NAMESPACE)) + if (!ps->readin && lookup_partial_symbol (ps, name, NULL, 0, STRUCT_DOMAIN)) { s = PSYMTAB_TO_SYMTAB (ps); bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); - sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE); + sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN); if (!sym) { /* This shouldn't be necessary, but as a last resort @@ -1745,7 +1694,7 @@ lookup_transparent_type (const char *name) * the psymtab gets it wrong in some cases. */ block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); - sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE); + sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN); if (!sym) error ("Internal: static symbol `%s' found in %s psymtab but not in symtab.\n\ %s may be an inlined function, or may be a template function\n\ @@ -1772,7 +1721,7 @@ find_main_psymtab (void) ALL_PSYMTABS (objfile, pst) { - if (lookup_partial_symbol (pst, main_name (), NULL, 1, VAR_NAMESPACE)) + if (lookup_partial_symbol (pst, main_name (), NULL, 1, VAR_DOMAIN)) { return (pst); } @@ -1780,7 +1729,7 @@ find_main_psymtab (void) return (NULL); } -/* Search BLOCK for symbol NAME in NAMESPACE. +/* Search BLOCK for symbol NAME in DOMAIN. Note that if NAME is the demangled form of a C++ symbol, we will fail to find a match during the binary search of the non-encoded names, but @@ -1791,13 +1740,14 @@ find_main_psymtab (void) symbol (language_cplus or language_objc set) has both the encoded and non-encoded names tested for a match. - If LINKAGE_NAME is non-NULL, verify that any symbol we find has - this particular linkage name. + If LINKAGE_NAME is non-NULL, verify that any symbol we find has this + particular mangled name. */ struct symbol * lookup_block_symbol (register const struct block *block, const char *name, - const char *linkage_name, const namespace_enum namespace) + const char *linkage_name, + const domain_enum domain) { struct dict_iterator iter; struct symbol *sym; @@ -1807,7 +1757,7 @@ lookup_block_symbol (register const struct block *block, const char *name, for (sym = dict_iter_name_first (BLOCK_DICT (block), name, &iter); sym; sym = dict_iter_name_next (name, &iter)) { - if (SYMBOL_NAMESPACE (sym) == namespace + if (SYMBOL_DOMAIN (sym) == domain && (linkage_name ? strcmp (SYMBOL_LINKAGE_NAME (sym), linkage_name) == 0 : 1)) return sym; @@ -1827,7 +1777,7 @@ lookup_block_symbol (register const struct block *block, const char *name, for (sym = dict_iter_name_first (BLOCK_DICT (block), name, &iter); sym; sym = dict_iter_name_next (name, &iter)) { - if (SYMBOL_NAMESPACE (sym) == namespace + if (SYMBOL_DOMAIN (sym) == domain && (linkage_name ? strcmp (SYMBOL_LINKAGE_NAME (sym), linkage_name) == 0 : 1)) @@ -1908,7 +1858,7 @@ find_active_alias (struct symbol *sym, CORE_ADDR addr) psymtabs and read in another symtab if necessary. */ struct symtab * -find_pc_sect_symtab (CORE_ADDR pc, asection * section) +find_pc_sect_symtab (CORE_ADDR pc, asection *section) { register struct block *b; struct blockvector *bv; @@ -1929,7 +1879,8 @@ find_pc_sect_symtab (CORE_ADDR pc, asection * section) && (msymbol->type == mst_data || msymbol->type == mst_bss || msymbol->type == mst_abs - || msymbol->type == mst_file_data || msymbol->type == mst_file_bss)) + || msymbol->type == mst_file_data + || msymbol->type == mst_file_bss)) return NULL; /* Search all symtabs for the one whose file contains our address, and which @@ -1954,7 +1905,8 @@ find_pc_sect_symtab (CORE_ADDR pc, asection * section) if (BLOCK_START (b) <= pc && BLOCK_END (b) > pc - && (distance == 0 || BLOCK_END (b) - BLOCK_START (b) < distance)) + && (distance == 0 + || BLOCK_END (b) - BLOCK_START (b) < distance)) { /* For an objfile that has its functions reordered, find_pc_psymtab will find the proper partial symbol table @@ -1999,7 +1951,8 @@ find_pc_sect_symtab (CORE_ADDR pc, asection * section) will cause a core dump), but maybe we can successfully continue, so let's not. */ warning ("\ -(Internal error: pc 0x%s in read in psymtab, but not in symtab.)\n", paddr_nz (pc)); +(Internal error: pc 0x%s in read in psymtab, but not in symtab.)\n", + paddr_nz (pc)); s = PSYMTAB_TO_SYMTAB (ps); } return (s); @@ -2227,9 +2180,9 @@ find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent) /* If another line (denoted by ITEM) is in the linetable and its PC is after BEST's PC, but before the current BEST_END, then - use ITEM's PC as the new best_end. */ + use ITEM's PC as the new best_end. */ if (best && i < len && item->pc > best->pc - && (best_end == 0 || best_end > item->pc)) + && (best_end == 0 || best_end > item->pc)) best_end = item->pc; } @@ -2256,8 +2209,8 @@ find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent) else if (best->line == 0) { /* If our best fit is in a range of PC's for which no line - number info is available (line number is zero) then we didn't - find any valid line information. */ + number info is available (line number is zero) then we didn't + find any valid line information. */ val.pc = pc; } else @@ -2300,8 +2253,7 @@ find_pc_line (CORE_ADDR pc, int notcurrent) If not found, return NULL. */ struct symtab * -find_line_symtab (struct symtab *symtab, int line, int *index, - int *exact_match) +find_line_symtab (struct symtab *symtab, int line, int *index, int *exact_match) { int exact; @@ -2520,7 +2472,8 @@ find_function_start_sal (struct symbol *sym, int funfirstline) asection *section = SYMBOL_BFD_SECTION (sym); /* If function is in an unmapped overlay, use its unmapped LMA address, so that SKIP_PROLOGUE has something unique to work on */ - if (section_is_overlay (section) && !section_is_mapped (section)) + if (section_is_overlay (section) && + !section_is_mapped (section)) pc = overlay_unmapped_address (pc, section); pc += FUNCTION_START_OFFSET; @@ -2587,12 +2540,12 @@ operator_chars (char *p, char **end) while (*p) switch (*p) { - case '\\': /* regexp quoting */ + case '\\': /* regexp quoting */ if (p[1] == '*') { if (p[2] == '=') /* 'operator\*=' */ *end = p + 3; - else /* 'operator\*' */ + else /* 'operator\*' */ *end = p + 2; return p; } @@ -2608,7 +2561,7 @@ operator_chars (char *p, char **end) else error ("nothing is allowed between '[' and ']'"); } - else + else { /* Gratuitous qoute: skip it and move on. */ p++; @@ -2662,20 +2615,17 @@ operator_chars (char *p, char **end) return p; case '(': if (p[1] != ')') - error - ("`operator ()' must be specified without whitespace in `()'"); + error ("`operator ()' must be specified without whitespace in `()'"); *end = p + 2; return p; case '?': if (p[1] != ':') - error - ("`operator ?:' must be specified without whitespace in `?:'"); + error ("`operator ?:' must be specified without whitespace in `?:'"); *end = p + 2; return p; case '[': if (p[1] != ']') - error - ("`operator []' must be specified without whitespace in `[]'"); + error ("`operator []' must be specified without whitespace in `[]'"); *end = p + 2; return p; default: @@ -2789,8 +2739,7 @@ sources_info (char *ignore, int from_tty) } printf_filtered ("\n\n"); - printf_filtered - ("Source files for which symbols will be read in on demand:\n\n"); + printf_filtered ("Source files for which symbols will be read in on demand:\n\n"); first = 1; ALL_PSYMTABS (objfile, ps) @@ -2898,10 +2847,10 @@ sort_search_symbols (struct symbol_search *prevtail, int nfound) returning the results in *MATCHES. Only symbols of KIND are searched: - FUNCTIONS_NAMESPACE - search all functions - TYPES_NAMESPACE - search all type names - METHODS_NAMESPACE - search all methods NOT IMPLEMENTED - VARIABLES_NAMESPACE - search all symbols, excluding functions, type names, + FUNCTIONS_DOMAIN - search all functions + TYPES_DOMAIN - search all type names + METHODS_DOMAIN - search all methods NOT IMPLEMENTED + VARIABLES_DOMAIN - search all symbols, excluding functions, type names, and constants (enums) free_search_symbols should be called when *MATCHES is no longer needed. @@ -2914,7 +2863,7 @@ sort_search_symbols (struct symbol_search *prevtail, int nfound) tweaking. */ void -search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[], +search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[], struct symbol_search **matches) { register struct symtab *s; @@ -2947,13 +2896,13 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[], struct symbol_search *tail; struct cleanup *old_chain = NULL; - if (kind < VARIABLES_NAMESPACE) - error ("must search on specific namespace"); + if (kind < VARIABLES_DOMAIN) + error ("must search on specific domain"); - ourtype = types[(int) (kind - VARIABLES_NAMESPACE)]; - ourtype2 = types2[(int) (kind - VARIABLES_NAMESPACE)]; - ourtype3 = types3[(int) (kind - VARIABLES_NAMESPACE)]; - ourtype4 = types4[(int) (kind - VARIABLES_NAMESPACE)]; + ourtype = types[(int) (kind - VARIABLES_DOMAIN)]; + ourtype2 = types2[(int) (kind - VARIABLES_DOMAIN)]; + ourtype3 = types3[(int) (kind - VARIABLES_DOMAIN)]; + ourtype4 = types4[(int) (kind - VARIABLES_DOMAIN)]; sr = *matches = NULL; tail = NULL; @@ -3037,11 +2986,11 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[], if (file_matches (ps->filename, files, nfiles) && ((regexp == NULL || re_exec (SYMBOL_NATURAL_NAME (*psym)) != 0) - && ((kind == VARIABLES_NAMESPACE && SYMBOL_CLASS (*psym) != LOC_TYPEDEF + && ((kind == VARIABLES_DOMAIN && SYMBOL_CLASS (*psym) != LOC_TYPEDEF && SYMBOL_CLASS (*psym) != LOC_BLOCK) - || (kind == FUNCTIONS_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_BLOCK) - || (kind == TYPES_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_TYPEDEF) - || (kind == METHODS_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_BLOCK)))) + || (kind == FUNCTIONS_DOMAIN && SYMBOL_CLASS (*psym) == LOC_BLOCK) + || (kind == TYPES_DOMAIN && SYMBOL_CLASS (*psym) == LOC_TYPEDEF) + || (kind == METHODS_DOMAIN && SYMBOL_CLASS (*psym) == LOC_BLOCK)))) { PSYMTAB_TO_SYMTAB (ps); keep_going = 0; @@ -3062,8 +3011,7 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[], any matching symbols without debug info. */ - if (nfiles == 0 - && (kind == VARIABLES_NAMESPACE || kind == FUNCTIONS_NAMESPACE)) + if (nfiles == 0 && (kind == VARIABLES_DOMAIN || kind == FUNCTIONS_DOMAIN)) { ALL_MSYMBOLS (objfile, msymbol) { @@ -3077,7 +3025,7 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[], { if (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol))) { - if (kind == FUNCTIONS_NAMESPACE + if (kind == FUNCTIONS_DOMAIN || lookup_symbol_minsym (msymbol) == NULL) found_misc = 1; } @@ -3106,12 +3054,12 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[], if (file_matches (s->filename, files, nfiles) && ((regexp == NULL || re_exec (SYMBOL_NATURAL_NAME (sym)) != 0) - && ((kind == VARIABLES_NAMESPACE && SYMBOL_CLASS (sym) != LOC_TYPEDEF + && ((kind == VARIABLES_DOMAIN && SYMBOL_CLASS (sym) != LOC_TYPEDEF && SYMBOL_CLASS (sym) != LOC_BLOCK && SYMBOL_CLASS (sym) != LOC_CONST) - || (kind == FUNCTIONS_NAMESPACE && SYMBOL_CLASS (sym) == LOC_BLOCK) - || (kind == TYPES_NAMESPACE && SYMBOL_CLASS (sym) == LOC_TYPEDEF) - || (kind == METHODS_NAMESPACE && SYMBOL_CLASS (sym) == LOC_BLOCK)))) + || (kind == FUNCTIONS_DOMAIN && SYMBOL_CLASS (sym) == LOC_BLOCK) + || (kind == TYPES_DOMAIN && SYMBOL_CLASS (sym) == LOC_TYPEDEF) + || (kind == METHODS_DOMAIN && SYMBOL_CLASS (sym) == LOC_BLOCK)))) { /* match */ psr = (struct symbol_search *) xmalloc (sizeof (struct symbol_search)); @@ -3150,7 +3098,7 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[], /* If there are no eyes, avoid all contact. I mean, if there are no debug symbols, then print directly from the msymbol_vector. */ - if (found_misc || kind != FUNCTIONS_NAMESPACE) + if (found_misc || kind != FUNCTIONS_DOMAIN) { ALL_MSYMBOLS (objfile, msymbol) { @@ -3163,7 +3111,7 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[], || re_exec (SYMBOL_NATURAL_NAME (msymbol)) != 0) { /* Functions: Look up by address. */ - if (kind != FUNCTIONS_NAMESPACE || + if (kind != FUNCTIONS_DOMAIN || (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol)))) { /* Variables/Absolutes: Look up by name */ @@ -3203,7 +3151,7 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[], regarding the match to gdb_stdout. */ static void -print_symbol_info (namespace_enum kind, struct symtab *s, struct symbol *sym, +print_symbol_info (domain_enum kind, struct symtab *s, struct symbol *sym, int block, char *last) { if (last == NULL || strcmp (last, s->filename) != 0) @@ -3213,16 +3161,17 @@ print_symbol_info (namespace_enum kind, struct symtab *s, struct symbol *sym, fputs_filtered (":\n", gdb_stdout); } - if (kind != TYPES_NAMESPACE && block == STATIC_BLOCK) + if (kind != TYPES_DOMAIN && block == STATIC_BLOCK) printf_filtered ("static "); /* Typedef that is not a C++ class */ - if (kind == TYPES_NAMESPACE && SYMBOL_NAMESPACE (sym) != STRUCT_NAMESPACE) + if (kind == TYPES_DOMAIN + && SYMBOL_DOMAIN (sym) != STRUCT_DOMAIN) typedef_print (SYMBOL_TYPE (sym), sym, gdb_stdout); /* variable, func, or typedef-that-is-c++-class */ - else if (kind < TYPES_NAMESPACE || - (kind == TYPES_NAMESPACE && - SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE)) + else if (kind < TYPES_DOMAIN || + (kind == TYPES_DOMAIN && + SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN)) { type_print (SYMBOL_TYPE (sym), (SYMBOL_CLASS (sym) == LOC_TYPEDEF @@ -3243,7 +3192,8 @@ print_msymbol_info (struct minimal_symbol *msymbol) if (TARGET_ADDR_BIT <= 32) tmp = local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol) - & (CORE_ADDR) 0xffffffff, "08l"); + & (CORE_ADDR) 0xffffffff, + "08l"); else tmp = local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol), "016l"); @@ -3257,9 +3207,11 @@ print_msymbol_info (struct minimal_symbol *msymbol) matches. */ static void -symtab_symbol_info (char *regexp, namespace_enum kind, int from_tty) +symtab_symbol_info (char *regexp, domain_enum kind, int from_tty) { - static char *classnames[] = { "variable", "function", "type", "method" }; + static char *classnames[] + = + {"variable", "function", "type", "method"}; struct symbol_search *symbols; struct symbol_search *p; struct cleanup *old_chain; @@ -3273,7 +3225,7 @@ symtab_symbol_info (char *regexp, namespace_enum kind, int from_tty) printf_filtered (regexp ? "All %ss matching regular expression \"%s\":\n" : "All defined %ss:\n", - classnames[(int) (kind - VARIABLES_NAMESPACE)], regexp); + classnames[(int) (kind - VARIABLES_DOMAIN)], regexp); for (p = symbols; p != NULL; p = p->next) { @@ -3291,7 +3243,10 @@ symtab_symbol_info (char *regexp, namespace_enum kind, int from_tty) else { print_symbol_info (kind, - p->symtab, p->symbol, p->block, last_filename); + p->symtab, + p->symbol, + p->block, + last_filename); last_filename = p->symtab->filename; } } @@ -3302,20 +3257,20 @@ symtab_symbol_info (char *regexp, namespace_enum kind, int from_tty) static void variables_info (char *regexp, int from_tty) { - symtab_symbol_info (regexp, VARIABLES_NAMESPACE, from_tty); + symtab_symbol_info (regexp, VARIABLES_DOMAIN, from_tty); } static void functions_info (char *regexp, int from_tty) { - symtab_symbol_info (regexp, FUNCTIONS_NAMESPACE, from_tty); + symtab_symbol_info (regexp, FUNCTIONS_DOMAIN, from_tty); } static void types_info (char *regexp, int from_tty) { - symtab_symbol_info (regexp, TYPES_NAMESPACE, from_tty); + symtab_symbol_info (regexp, TYPES_DOMAIN, from_tty); } /* Breakpoint all functions matching regular expression. */ @@ -3333,7 +3288,7 @@ rbreak_command (char *regexp, int from_tty) struct symbol_search *p; struct cleanup *old_chain; - search_symbols (regexp, FUNCTIONS_NAMESPACE, 0, (char **) NULL, &ss); + search_symbols (regexp, FUNCTIONS_DOMAIN, 0, (char **) NULL, &ss); old_chain = make_cleanup_free_search_symbols (ss); for (p = ss; p != NULL; p = p->next) @@ -3348,9 +3303,11 @@ rbreak_command (char *regexp, int from_tty) strcat (string, DEPRECATED_SYMBOL_NAME (p->symbol)); strcat (string, "'"); break_command (string, from_tty); - print_symbol_info (FUNCTIONS_NAMESPACE, + print_symbol_info (FUNCTIONS_DOMAIN, p->symtab, - p->symbol, p->block, p->symtab->filename); + p->symbol, + p->block, + p->symtab->filename); } else { @@ -3388,8 +3345,7 @@ static char **return_val; characters. If so, add it to the current completion list. */ static void -completion_list_add_name (const char *symname, char *sym_text, - int sym_text_len, +completion_list_add_name (const char *symname, char *sym_text, int sym_text_len, char *text, char *word) { int newsize; @@ -3437,6 +3393,112 @@ completion_list_add_name (const char *symname, char *sym_text, } } +/* ObjC: In case we are completing on a selector, look as the msymbol + again and feed all the selectors into the mill. */ + +static void +completion_list_objc_symbol (struct minimal_symbol *msymbol, char *sym_text, + int sym_text_len, char *text, char *word) +{ + static char *tmp = NULL; + static unsigned int tmplen = 0; + + char *method, *category, *selector; + char *tmp2 = NULL; + + method = SYMBOL_NATURAL_NAME (msymbol); + + /* Is it a method? */ + if ((method[0] != '-') && (method[0] != '+')) + return; + + if (sym_text[0] == '[') + /* Complete on shortened method method. */ + completion_list_add_name (method + 1, sym_text, sym_text_len, text, word); + + while ((strlen (method) + 1) >= tmplen) + { + if (tmplen == 0) + tmplen = 1024; + else + tmplen *= 2; + tmp = xrealloc (tmp, tmplen); + } + selector = strchr (method, ' '); + if (selector != NULL) + selector++; + + category = strchr (method, '('); + + if ((category != NULL) && (selector != NULL)) + { + memcpy (tmp, method, (category - method)); + tmp[category - method] = ' '; + memcpy (tmp + (category - method) + 1, selector, strlen (selector) + 1); + completion_list_add_name (tmp, sym_text, sym_text_len, text, word); + if (sym_text[0] == '[') + completion_list_add_name (tmp + 1, sym_text, sym_text_len, text, word); + } + + if (selector != NULL) + { + /* Complete on selector only. */ + strcpy (tmp, selector); + tmp2 = strchr (tmp, ']'); + if (tmp2 != NULL) + *tmp2 = '\0'; + + completion_list_add_name (tmp, sym_text, sym_text_len, text, word); + } +} + +/* Break the non-quoted text based on the characters which are in + symbols. FIXME: This should probably be language-specific. */ + +static char * +language_search_unquoted_string (char *text, char *p) +{ + for (; p > text; --p) + { + if (isalnum (p[-1]) || p[-1] == '_' || p[-1] == '\0') + continue; + else + { + if ((current_language->la_language == language_objc)) + { + if (p[-1] == ':') /* might be part of a method name */ + continue; + else if (p[-1] == '[' && (p[-2] == '-' || p[-2] == '+')) + p -= 2; /* beginning of a method name */ + else if (p[-1] == ' ' || p[-1] == '(' || p[-1] == ')') + { /* might be part of a method name */ + char *t = p; + + /* Seeing a ' ' or a '(' is not conclusive evidence + that we are in the middle of a method name. However, + finding "-[" or "+[" should be pretty un-ambiguous. + Unfortunately we have to find it now to decide. */ + + while (t > text) + if (isalnum (t[-1]) || t[-1] == '_' || + t[-1] == ' ' || t[-1] == ':' || + t[-1] == '(' || t[-1] == ')') + --t; + else + break; + + if (t[-1] == '[' && (t[-2] == '-' || t[-2] == '+')) + p = t - 2; /* method name detected */ + /* else we leave with p unchanged */ + } + } + break; + } + } + return p; +} + + /* Return a NULL terminated array of all symbols (regardless of class) which begin by matching TEXT. If the answer is no symbols, then the return value is an array which contains only a NULL pointer. @@ -3533,21 +3595,21 @@ make_symbol_completion_list (char *text, char *word) for (psym = objfile->global_psymbols.list + ps->globals_offset; psym < (objfile->global_psymbols.list + ps->globals_offset - + ps->n_global_syms); psym++) + + ps->n_global_syms); + psym++) { /* If interrupted, then quit. */ QUIT; - COMPLETION_LIST_ADD_SYMBOL (*psym, sym_text, sym_text_len, text, - word); + COMPLETION_LIST_ADD_SYMBOL (*psym, sym_text, sym_text_len, text, word); } for (psym = objfile->static_psymbols.list + ps->statics_offset; psym < (objfile->static_psymbols.list + ps->statics_offset - + ps->n_static_syms); psym++) + + ps->n_static_syms); + psym++) { QUIT; - COMPLETION_LIST_ADD_SYMBOL (*psym, sym_text, sym_text_len, text, - word); + COMPLETION_LIST_ADD_SYMBOL (*psym, sym_text, sym_text_len, text, word); } } @@ -3560,6 +3622,8 @@ make_symbol_completion_list (char *text, char *word) { QUIT; COMPLETION_LIST_ADD_SYMBOL (msymbol, sym_text, sym_text_len, text, word); + + completion_list_objc_symbol (msymbol, sym_text, sym_text_len, text, word); } /* Search upwards from currently selected frame (so that we can @@ -3569,7 +3633,7 @@ make_symbol_completion_list (char *text, char *word) { if (!BLOCK_SUPERBLOCK (b)) { - surrounding_static_block = b; /* For elmin of dups */ + surrounding_static_block = b; /* For elmin of dups */ } /* Also catch fields of types defined in this places which match our @@ -3683,16 +3747,8 @@ make_file_symbol_completion_list (char *text, char *word, char *srcfile) } else { - /* It is not a quoted string. Break it based on the characters - which are in symbols. */ - while (p > text) - { - if (isalnum (p[-1]) || p[-1] == '_' || p[-1] == '\0') - --p; - else - break; - } - sym_text = p; + /* Not a quoted string. */ + sym_text = language_search_unquoted_string (text, p); } } @@ -3709,7 +3765,7 @@ make_file_symbol_completion_list (char *text, char *word, char *srcfile) if (s == NULL) { /* Maybe they typed the file with leading directories, while the - symbol tables record only its basename. */ + symbol tables record only its basename. */ const char *tail = lbasename (srcfile); if (tail > srcfile) @@ -3784,7 +3840,7 @@ static int not_interesting_fname (const char *fname) { static const char *illegal_aliens[] = { - "_globals_", /* inserted by coff_symtab_read */ + "_globals_", /* inserted by coff_symtab_read */ NULL }; int i; @@ -3821,77 +3877,78 @@ make_source_files_completion_list (char *text, char *word) return list; ALL_SYMTABS (objfile, s) - { - if (not_interesting_fname (s->filename)) - continue; - if (!filename_seen (s->filename, 1, &first) -#if HAVE_DOS_BASED_FILE_SYSTEM - && strncasecmp (s->filename, text, text_len) == 0 -#else - && strncmp (s->filename, text, text_len) == 0 -#endif - ) - { - /* This file matches for a completion; add it to the current - list of matches. */ - add_filename_to_list (s->filename, text, word, - &list, &list_used, &list_alloced); - } - else - { - /* NOTE: We allow the user to type a base name when the - debug info records leading directories, but not the other - way around. This is what subroutines of breakpoint - command do when they parse file names. */ - base_name = lbasename (s->filename); - if (base_name != s->filename && !filename_seen (base_name, 1, &first) + { + if (not_interesting_fname (s->filename)) + continue; + if (!filename_seen (s->filename, 1, &first) #if HAVE_DOS_BASED_FILE_SYSTEM - && strncasecmp (base_name, text, text_len) == 0 + && strncasecmp (s->filename, text, text_len) == 0 #else - && strncmp (base_name, text, text_len) == 0 + && strncmp (s->filename, text, text_len) == 0 #endif ) - add_filename_to_list (base_name, text, word, + { + /* This file matches for a completion; add it to the current + list of matches. */ + add_filename_to_list (s->filename, text, word, &list, &list_used, &list_alloced); - } - } - - ALL_PSYMTABS (objfile, ps) - { - if (not_interesting_fname (ps->filename)) - continue; - if (!ps->readin) - { - if (!filename_seen (ps->filename, 1, &first) + } + else + { + /* NOTE: We allow the user to type a base name when the + debug info records leading directories, but not the other + way around. This is what subroutines of breakpoint + command do when they parse file names. */ + base_name = lbasename (s->filename); + if (base_name != s->filename + && !filename_seen (base_name, 1, &first) #if HAVE_DOS_BASED_FILE_SYSTEM - && strncasecmp (ps->filename, text, text_len) == 0 + && strncasecmp (base_name, text, text_len) == 0 #else - && strncmp (ps->filename, text, text_len) == 0 + && strncmp (base_name, text, text_len) == 0 #endif - ) - { - /* This file matches for a completion; add it to the - current list of matches. */ - add_filename_to_list (ps->filename, text, word, + ) + add_filename_to_list (base_name, text, word, &list, &list_used, &list_alloced); + } + } - } - else - { - base_name = lbasename (ps->filename); - if (base_name != ps->filename - && !filename_seen (base_name, 1, &first) + ALL_PSYMTABS (objfile, ps) + { + if (not_interesting_fname (ps->filename)) + continue; + if (!ps->readin) + { + if (!filename_seen (ps->filename, 1, &first) #if HAVE_DOS_BASED_FILE_SYSTEM - && strncasecmp (base_name, text, text_len) == 0 + && strncasecmp (ps->filename, text, text_len) == 0 #else - && strncmp (base_name, text, text_len) == 0 + && strncmp (ps->filename, text, text_len) == 0 #endif ) - add_filename_to_list (base_name, text, word, + { + /* This file matches for a completion; add it to the + current list of matches. */ + add_filename_to_list (ps->filename, text, word, &list, &list_used, &list_alloced); - } - } - } + + } + else + { + base_name = lbasename (ps->filename); + if (base_name != ps->filename + && !filename_seen (base_name, 1, &first) +#if HAVE_DOS_BASED_FILE_SYSTEM + && strncasecmp (base_name, text, text_len) == 0 +#else + && strncmp (base_name, text, text_len) == 0 +#endif + ) + add_filename_to_list (base_name, text, word, + &list, &list_used, &list_alloced); + } + } + } return list; } @@ -3913,28 +3970,28 @@ in_prologue (CORE_ADDR pc, CORE_ADDR func_start) /* We have several sources of information we can consult to figure this out. - Compilers usually emit line number info that marks the prologue - as its own "source line". So the ending address of that "line" - is the end of the prologue. If available, this is the most - reliable method. + as its own "source line". So the ending address of that "line" + is the end of the prologue. If available, this is the most + reliable method. - The minimal symbols and partial symbols, which can usually tell - us the starting and ending addresses of a function. + us the starting and ending addresses of a function. - If we know the function's start address, we can call the - architecture-defined SKIP_PROLOGUE function to analyze the - instruction stream and guess where the prologue ends. + architecture-defined SKIP_PROLOGUE function to analyze the + instruction stream and guess where the prologue ends. - Our `func_start' argument; if non-zero, this is the caller's - best guess as to the function's entry point. At the time of - this writing, handle_inferior_event doesn't get this right, so - it should be our last resort. */ + best guess as to the function's entry point. At the time of + this writing, handle_inferior_event doesn't get this right, so + it should be our last resort. */ /* Consult the partial symbol table, to find which function the PC is in. */ - if (!find_pc_partial_function (pc, NULL, &func_addr, &func_end)) + if (! find_pc_partial_function (pc, NULL, &func_addr, &func_end)) { CORE_ADDR prologue_end; /* We don't even have minsym information, so fall back to using func_start, if given. */ - if (!func_start) + if (! func_start) return 1; /* We *might* be in a prologue. */ prologue_end = SKIP_PROLOGUE (func_start); @@ -3954,11 +4011,13 @@ in_prologue (CORE_ADDR pc, CORE_ADDR func_start) line, the line number information doesn't always end up this way. So we must verify that our purported end-of-prologue address is *within* the function, not at its start or end. */ - if (sal.line == 0 || sal.end <= func_addr || func_end <= sal.end) + if (sal.line == 0 + || sal.end <= func_addr + || func_end <= sal.end) { /* We don't have any good line number info, so use the minsym - information, together with the architecture-specific prologue - scanning code. */ + information, together with the architecture-specific prologue + scanning code. */ CORE_ADDR prologue_end = SKIP_PROLOGUE (func_addr); return func_addr <= pc && pc < prologue_end; @@ -3992,10 +4051,10 @@ remove_params (const char *demangled_name) while (argp-- > demangled_name) { if (*argp == ')') - depth++; + depth ++; else if (*argp == '(') { - depth--; + depth --; if (depth == 0) break; @@ -4005,7 +4064,7 @@ remove_params (const char *demangled_name) internal_error (__FILE__, __LINE__, "bad demangled name %s\n", demangled_name); while (argp[-1] == ' ' && argp > demangled_name) - argp--; + argp --; new_name = xmalloc (argp - demangled_name + 1); memcpy (new_name, demangled_name, argp - demangled_name); @@ -4058,8 +4117,7 @@ overload_list_add_symbol (struct symbol *sym, const char *oload_name) 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 = (struct symbol **) xrealloc ((char *) sym_return_val, newsize); } sym_return_val[sym_return_val_index++] = sym; sym_return_val[sym_return_val_index] = NULL; @@ -4108,16 +4166,15 @@ make_symbol_overload_list_using (const char *func_name, const char *namespace, const struct block *block) { - struct block_using_iterator iter; 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_iterator_first (block, &iter); + for (current = block_using (block); current != NULL; - current = block_using_iterator_next (&iter)) + current = current->next) { if (strcmp (namespace, current->outer) == 0) { @@ -4235,9 +4292,9 @@ read_in_psymtabs (const char *func_name) if (ps->readin) continue; - if ((lookup_partial_symbol (ps, func_name, NULL, 1, VAR_NAMESPACE) + if ((lookup_partial_symbol (ps, func_name, NULL, 1, VAR_DOMAIN) != NULL) - || (lookup_partial_symbol (ps, func_name, NULL, 0, VAR_NAMESPACE) + || (lookup_partial_symbol (ps, func_name, NULL, 0, VAR_DOMAIN) != NULL)) psymtab_to_symtab (ps); } @@ -4250,16 +4307,17 @@ decode_line_spec (char *string, int funfirstline) { struct symtabs_and_lines sals; struct symtab_and_line cursal; - + if (string == 0) error ("Empty line specification."); - + /* We use whatever is set as the current source line. We do not try - and get a default or it will recursively call us! */ + and get a default or it will recursively call us! */ cursal = get_current_source_symtab_and_line (); - + sals = decode_line_1 (&string, funfirstline, - cursal.symtab, cursal.line, (char ***) NULL); + cursal.symtab, cursal.line, + (char ***) NULL); if (*string) error ("Junk at end of line specification: %s", string); @@ -4297,15 +4355,15 @@ void _initialize_symtab (void) { add_info ("variables", variables_info, - "All global and static variable names, or those matching REGEXP."); + "All global and static variable names, or those matching REGEXP."); if (dbx_commands) add_com ("whereis", class_info, variables_info, - "All global and static variable names, or those matching REGEXP."); + "All global and static variable names, or those matching REGEXP."); add_info ("functions", functions_info, "All function names, or those matching REGEXP."); - + /* FIXME: This command has at least the following problems: 1. It prints builtin types (in a very strange and confusing fashion). 2. It doesn't print right, e.g. with @@ -4314,7 +4372,8 @@ _initialize_symtab (void) print "struct foo *". I also think "ptype" or "whatis" is more likely to be useful (but if there is much disagreement "info types" can be fixed). */ - add_info ("types", types_info, "All type names, or those matching REGEXP."); + add_info ("types", types_info, + "All type names, or those matching REGEXP."); add_info ("sources", sources_info, "Source files in the program."); @@ -4326,7 +4385,7 @@ _initialize_symtab (void) { add_com ("lf", class_info, sources_info, "Source files in the program"); add_com ("lg", class_info, variables_info, - "All global and static variable names, or those matching REGEXP."); + "All global and static variable names, or those matching REGEXP."); } /* Initialize the one built-in type that isn't language dependent... */ diff --git a/gdb/symtab.h b/gdb/symtab.h index a893890..d83add3 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -213,6 +213,21 @@ extern const char *symbol_demangled_name (const struct general_symbol_info #define SYMBOL_PRINT_NAME(symbol) \ (demangle ? SYMBOL_NATURAL_NAME (symbol) : SYMBOL_LINKAGE_NAME (symbol)) +/* Macro that tests a symbol for a match against a specified name string. + First test the unencoded name, then looks for and test a C++ encoded + name if it exists. Note that whitespace is ignored while attempting to + match a C++ encoded name, so that "foo::bar(int,long)" is the same as + "foo :: bar (int, long)". + Evaluates to zero if the match fails, or nonzero if it succeeds. */ + +/* Macro that tests a symbol for a match against a specified name + string. It tests against SYMBOL_NATURAL_NAME, and it ignores + whitespace and trailing parentheses. (See strcmp_iw for details + about its behavior.) */ + +#define SYMBOL_MATCHES_NATURAL_NAME(symbol, name) \ + (strcmp_iw (SYMBOL_NATURAL_NAME (symbol), (name)) == 0) + /* Define a simple structure used to hold some very basic information about all defined global symbols (text, data, bss, abs, etc). The only required information is the general_symbol_info. @@ -304,53 +319,53 @@ struct minimal_symbol /* Represent one symbol name; a variable, constant, function or typedef. */ -/* Different name spaces for symbols. Looking up a symbol specifies a - namespace and ignores symbol definitions in other name spaces. */ +/* Different name domains for symbols. Looking up a symbol specifies a + domain and ignores symbol definitions in other name domains. */ /* FIXME: carlton/2002-11-22: This name me crazy when doing C++ namespace stuff. Maybe name_space_enum and XXX_NAME_SPACE? */ typedef enum { - /* UNDEF_NAMESPACE is used when a namespace has not been discovered or + /* UNDEF_DOMAIN is used when a domain has not been discovered or none of the following apply. This usually indicates an error either in the symbol information or in gdb's handling of symbols. */ - UNDEF_NAMESPACE, + UNDEF_DOMAIN, - /* VAR_NAMESPACE is the usual namespace. In C, this contains variables, + /* VAR_DOMAIN is the usual domain. In C, this contains variables, function names, typedef names and enum type values. */ - VAR_NAMESPACE, + VAR_DOMAIN, - /* STRUCT_NAMESPACE is used in C to hold struct, union and enum type names. + /* STRUCT_DOMAIN is used in C to hold struct, union and enum type names. Thus, if `struct foo' is used in a C program, it produces a symbol named - `foo' in the STRUCT_NAMESPACE. */ + `foo' in the STRUCT_DOMAIN. */ - STRUCT_NAMESPACE, + STRUCT_DOMAIN, - /* LABEL_NAMESPACE may be used for names of labels (for gotos); + /* LABEL_DOMAIN may be used for names of labels (for gotos); currently it is not used and labels are not recorded at all. */ - LABEL_NAMESPACE, + LABEL_DOMAIN, - /* Searching namespaces. These overlap with VAR_NAMESPACE, providing + /* Searching domains. These overlap with VAR_DOMAIN, providing some granularity with the search_symbols function. */ - /* Everything in VAR_NAMESPACE minus FUNCTIONS_-, TYPES_-, and - METHODS_NAMESPACE */ - VARIABLES_NAMESPACE, + /* Everything in VAR_DOMAIN minus FUNCTIONS_-, TYPES_-, and + METHODS_DOMAIN */ + VARIABLES_DOMAIN, /* All functions -- for some reason not methods, though. */ - FUNCTIONS_NAMESPACE, + FUNCTIONS_DOMAIN, /* All defined types */ - TYPES_NAMESPACE, + TYPES_DOMAIN, /* All class methods -- why is this separated out? */ - METHODS_NAMESPACE + METHODS_DOMAIN } -namespace_enum; +domain_enum; /* An address-class says where to find the value of a symbol. */ @@ -406,8 +421,8 @@ enum address_class LOC_LOCAL, - /* Value not used; definition in SYMBOL_TYPE. Symbols in the namespace - STRUCT_NAMESPACE all have this class. */ + /* Value not used; definition in SYMBOL_TYPE. Symbols in the domain + STRUCT_DOMAIN all have this class. */ LOC_TYPEDEF, @@ -574,14 +589,9 @@ struct symbol struct type *type; - /* Name space code. */ + /* Domain code. */ -#ifdef __MFC4__ - /* FIXME: don't conflict with C++'s namespace */ - /* would be safer to do a global change for all namespace identifiers. */ -#define namespace _namespace -#endif - namespace_enum namespace BYTE_BITFIELD; + domain_enum domain BYTE_BITFIELD; /* Address class */ @@ -637,7 +647,7 @@ struct symbol }; -#define SYMBOL_NAMESPACE(symbol) (symbol)->namespace +#define SYMBOL_DOMAIN(symbol) (symbol)->domain #define SYMBOL_CLASS(symbol) (symbol)->aclass #define SYMBOL_TYPE(symbol) (symbol)->type #define SYMBOL_LINE(symbol) (symbol)->line @@ -648,7 +658,7 @@ struct symbol #define SYMBOL_LOCATION_BATON(symbol) (symbol)->aux_value.loc.baton #define SYMBOL_LOCATION_FUNCS(symbol) (symbol)->aux_value.loc.funcs -/* A partial_symbol records the name, namespace, and address class of +/* A partial_symbol records the name, domain, and address class of symbols whose types we have not parsed yet. For functions, it also contains their memory address, so we can find them from a PC value. Each partial_symbol sits in a partial_symtab, all of which are chained @@ -664,7 +674,7 @@ struct partial_symbol /* Name space code. */ - namespace_enum namespace BYTE_BITFIELD; + domain_enum domain BYTE_BITFIELD; /* Address class (for info_symbols) */ @@ -672,7 +682,7 @@ struct partial_symbol }; -#define PSYMBOL_NAMESPACE(psymbol) (psymbol)->namespace +#define PSYMBOL_DOMAIN(psymbol) (psymbol)->domain #define PSYMBOL_CLASS(psymbol) (psymbol)->aclass @@ -983,18 +993,9 @@ extern struct symtab *lookup_symtab (const char *); /* lookup a symbol by name (optional block, optional symtab) */ extern struct symbol *lookup_symbol (const char *, const struct block *, - const namespace_enum, int *, + const domain_enum, int *, struct symtab **); -/* Lookup a symbol within a namespace. */ - -extern struct symbol *lookup_symbol_namespace (const char *cp_namespace, - const char *name, - const char *mangled_name, - const struct block *block, - namespace_enum gdb_namespace, - struct symtab **symtab); - /* Lookup the symbol associated to a minimal symbol. */ extern struct symbol *lookup_symbol_minsym (const struct minimal_symbol @@ -1010,11 +1011,50 @@ extern struct type *lookup_nested_type (struct type *parent_type, const char *nested_name, const struct block *block); +/* A default version of lookup_symbol_nonlocal for use by languages + that can't think of anything better to do. */ + +extern struct symbol *basic_lookup_symbol_nonlocal (const char *, + const char *, + const struct block *, + const domain_enum, + struct symtab **); + +/* Some helper functions for languages that need to write their own + lookup_symbol_nonlocal functions. */ + +/* Lookup a symbol in the static block associated to BLOCK, if there + is one; do nothing if BLOCK is NULL or a global block. */ + +extern struct symbol *lookup_symbol_static (const char *name, + const char *linkage_name, + const struct block *block, + const domain_enum domain, + struct symtab **symtab); + +/* Lookup a symbol in all files' global blocks (searching psymtabs if + necessary). */ + +extern struct symbol *lookup_symbol_global (const char *name, + const char *linkage_name, + const domain_enum domain, + struct symtab **symtab); + +/* Lookup a symbol within the block BLOCK. This, unlike + lookup_symbol_block, will set SYMTAB and BLOCK_FOUND correctly, and + will fix up the symbol if necessary. */ + +extern struct symbol *lookup_symbol_aux_block (const char *name, + const char *linkage_name, + const struct block *block, + const domain_enum domain, + struct symtab **symtab); + /* lookup a symbol by name, within a specified block */ extern struct symbol *lookup_block_symbol (const struct block *, const char *, const char *, - const namespace_enum); + const domain_enum); /* lookup a [struct, union, enum] by name, within a specified block */ @@ -1246,9 +1286,9 @@ void maintenance_print_msymbols (char *, int); void maintenance_print_objfiles (char *, int); -void maintenance_list_symtabs (char *, int); +void maintenance_info_symtabs (char *, int); -void maintenance_list_psymtabs (char *, int); +void maintenance_info_psymtabs (char *, int); void maintenance_check_symtabs (char *, int); @@ -1337,7 +1377,7 @@ struct symbol_search struct symbol_search *next; }; -extern void search_symbols (char *, namespace_enum, int, char **, +extern void search_symbols (char *, domain_enum, int, char **, struct symbol_search **); extern void free_search_symbols (struct symbol_search *); extern struct cleanup *make_cleanup_free_search_symbols (struct symbol_search diff --git a/gdb/target.c b/gdb/target.c index 4de246c..fd0165a 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1215,7 +1215,7 @@ find_default_create_inferior (char *exec_file, char *allargs, char **env) static int default_region_size_ok_for_hw_watchpoint (int byte_count) { - return (byte_count <= REGISTER_SIZE); + return (byte_count <= DEPRECATED_REGISTER_SIZE); } static int @@ -1640,7 +1640,7 @@ debug_print_register (const char * func, int regno) if (regno >= 0) { int i; - unsigned char *buf = alloca (MAX_REGISTER_RAW_SIZE); + unsigned char buf[MAX_REGISTER_SIZE]; deprecated_read_register_gen (regno, buf); fprintf_unfiltered (gdb_stdlog, " = "); for (i = 0; i < REGISTER_RAW_SIZE (regno); i++) diff --git a/gdb/target.h b/gdb/target.h index e757b67..cd82279 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -552,11 +552,11 @@ extern void print_section_info (struct target_ops *, bfd *); #define target_files_info() \ (*current_target.to_files_info) (¤t_target) -/* Insert a breakpoint at address ADDR in the target machine. - SAVE is a pointer to memory allocated for saving the - target contents. It is guaranteed by the caller to be long enough - to save "sizeof BREAKPOINT" bytes. Result is 0 for success, or - an errno value. */ +/* Insert a breakpoint at address ADDR in the target machine. SAVE is + a pointer to memory allocated for saving the target contents. It + is guaranteed by the caller to be long enough to save the number of + breakpoint bytes indicated by BREAKPOINT_FROM_PC. Result is 0 for + success, or an errno value. */ #define target_insert_breakpoint(addr, save) \ (*current_target.to_insert_breakpoint) (addr, save) @@ -1126,9 +1126,6 @@ extern int default_memory_remove_breakpoint (CORE_ADDR, char *); extern int default_memory_insert_breakpoint (CORE_ADDR, char *); -extern const unsigned char *memory_breakpoint_from_pc (CORE_ADDR *pcptr, - int *lenptr); - /* From target.c */ diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 0410311..1d74b6f 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,77 @@ +2003-05-22 Jim Blandy <jimb@redhat.com> + + * gdb.base/corefile.exp: Tolerate stuff after argument parens in + backtrace. + +2003-05-20 David Carlton <carlton@math.stanford.edu> + + * gdb.c++/namespace1.cc: Actually do 'cvs add' before committing + this time. + +2003-05-19 David Carlton <carlton@bactrian.org> + + * gdb.c++/rtti.exp: New file, containing tests for PR c++/488. + * gdb.c++/rtti.h, gdb.c++/rtti1.cc, gdb.c++/rtti2.cc: Ditto. + +2003-05-19 David Carlton <carlton@bactrian.org> + + * gdb.c++/namespace.exp: Add namespace scope and anonymous + namespace tests. + Bump copyright date. + * gdb.c++/namespace.cc: Add anonymous namespace and namespace C. + (main): Call C::D::marker2. + * gdb.c++/namespace1.cc: New file. + +2003-05-14 Jeff Johnston <jjohnstn@redhat.com> + + Roland McGrath <roland@redhat.com> + * gdb.threads/linux-dp.exp: Account for fact that in nptl model + there is no manager thread. + +2003-05-08 Jeff Johnston <jjohnstn@redhat.com> + + * gdb.threads/schedlock.exp: Remove assumption that all threads + will run in a particular small time slice. Also ensure we break + in one of the child threads rather than the main thread. + +2003-05-07 Jim Blandy <jimb@redhat.com> + + Add support for assembly source testing on the s390x. + * gdb.asm/asm-source.exp: Add a case for the s390x-*-* + architecture. + * gdb.asm/s390x.inc: New file. + + * gdb.asm/asm-source.exp: Use a 'switch -glob' statement, not a + succession of 'if' statements. + +2003-05-05 Andrew Cagney <cagney@redhat.com> + + * gdb.base/maint.exp: Add tests for "maint print dummy-frames". + +2003-05-05 Andrew Cagney <cagney@redhat.com> + + * gdb.base/watchpoint.exp: Rename CALL_DUMMY_BREAKPOINT_OFFSET to + DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET in comments. + +2003-05-02 Elena Zannoni <ezannoni@redhat.com> + + * gdb.base/charset.exp: Update based on new behavior of set/show + charset commands. + +2003-05-01 Andrew Cagney <cagney@redhat.com> + + * gdb.asm/asm-source.exp: Check that "disassm" and "x/i" of a + variable do not give memory errors. + +2003-04-30 Adam Fedor <fedor@gnu.org> + + * Makefile.in (ALL_SUBDIRS): Add gdb.objc + * configure.in (AC_OUTPUT): Add gdb.objc/Makefile + * gdb.objc/Makefile.in, gdb.objc/basicclass.exp, + gdb.objc/basicclass.m: : New files + + * lib/gdb.exp (gdb_compile_objc): New procedure. + 2003-05-16 David Carlton <carlton@bactrian.org> * gdb.c++/rtti.exp: Convert the gdb/488 kfail into a fail, and diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in index c0ba9ab..898e6ed 100644 --- a/gdb/testsuite/Makefile.in +++ b/gdb/testsuite/Makefile.in @@ -36,7 +36,7 @@ EXEEXT = @EXEEXT@ SUBDIRS = @subdirs@ RPATH_ENVVAR = @RPATH_ENVVAR@ ALL_SUBDIRS = gdb.arch gdb.asm gdb.base gdb.c++ gdb.disasm gdb.java gdb.mi \ - gdb.threads gdb.trace $(SUBDIRS) + gdb.objc gdb.threads gdb.trace $(SUBDIRS) EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \ echo $${rootme}/../../expect/expect ; \ diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure index 2a2494e..31e3a07 100755 --- a/gdb/testsuite/configure +++ b/gdb/testsuite/configure @@ -34,7 +34,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -149,7 +148,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -320,11 +318,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -490,16 +483,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -560,7 +549,7 @@ ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:564: checking build system type" >&5 +echo "configure:553: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -584,7 +573,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:588: checking host system type" >&5 +echo "configure:577: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -605,7 +594,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:609: checking target system type" >&5 +echo "configure:598: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -720,7 +709,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:724: checking how to run the C preprocessor" >&5 +echo "configure:713: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -735,13 +724,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 739 "configure" +#line 728 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:734: \"$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 : @@ -752,13 +741,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 756 "configure" +#line 745 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:751: \"$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 : @@ -769,13 +758,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 773 "configure" +#line 762 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:768: \"$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 : @@ -803,17 +792,17 @@ for ac_hdr in pthread.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:807: checking for $ac_hdr" >&5 +echo "configure:796: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 812 "configure" +#line 801 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:806: \"$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* @@ -841,12 +830,12 @@ done echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:845: checking for Cygwin environment" >&5 +echo "configure:834: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 850 "configure" +#line 839 "configure" #include "confdefs.h" int main() { @@ -857,7 +846,7 @@ int main() { return __CYGWIN__; ; return 0; } EOF -if { (eval echo configure:861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -874,19 +863,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:878: checking for mingw32 environment" >&5 +echo "configure:867: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 883 "configure" +#line 872 "configure" #include "confdefs.h" int main() { return __MINGW32__; ; return 0; } EOF -if { (eval echo configure:890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:879: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -905,7 +894,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:909: checking for executable suffix" >&5 +echo "configure:898: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -915,10 +904,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1040,7 +1029,7 @@ ac_given_srcdir=$srcdir trap 'rm -fr `echo "Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ gdb.c++/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \ - gdb.threads/Makefile gdb.trace/Makefile config.h:config.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 + gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile config.h:config.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <<EOF @@ -1134,7 +1123,7 @@ cat >> $CONFIG_STATUS <<EOF CONFIG_FILES=\${CONFIG_FILES-"Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ gdb.c++/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \ - gdb.threads/Makefile gdb.trace/Makefile"} + gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile"} EOF cat >> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/gdb/testsuite/configure.in b/gdb/testsuite/configure.in index 8ba930f..f80b623 100644 --- a/gdb/testsuite/configure.in +++ b/gdb/testsuite/configure.in @@ -115,4 +115,4 @@ AC_EXEEXT AC_CONFIG_SUBDIRS($configdirs) AC_OUTPUT([Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ gdb.c++/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \ - gdb.threads/Makefile gdb.trace/Makefile]) + gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile]) diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp index ac1bcd2..e4aa7be 100644 --- a/gdb/testsuite/gdb.asm/asm-source.exp +++ b/gdb/testsuite/gdb.asm/asm-source.exp @@ -35,60 +35,66 @@ set asm-arch "" set asm-flags "" set link-flags "" -if [istarget "*arm-*-*"] then { - set asm-arch arm -} -if [istarget "xscale-*-*"] then { - set asm-arch arm -} -if [istarget "d10v-*-*"] then { - set asm-arch d10v -} -if [istarget "s390-*-*"] then { - set asm-arch s390 -} -if [istarget "x86_64-*-*"] then { - set asm-arch x86_64 - set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}" -} -if [istarget "i\[3456\]86-*-*"] then { - set asm-arch i386 - if [istarget "*-*-cygwin*"] then { - set link-flags "--entry _start" +switch -glob -- [istarget] { + "*arm-*-*" { + set asm-arch arm + } + "xscale-*-*" { + set asm-arch arm + } + "d10v-*-*" { + set asm-arch d10v + } + "s390-*-*" { + set asm-arch s390 + } + "s390x-*-*" { + set asm-arch s390x + } + "x86_64-*-*" { + set asm-arch x86_64 + set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}" + } + "i\[3456\]86-*-*" { + set asm-arch i386 + if [istarget "*-*-cygwin*"] then { + set link-flags "--entry _start" + } + } + "m32r*-*" { + set asm-arch m32r + } + "m6811-*-*" { + set asm-arch m68hc11 + set asm-flags "-mshort-double -m68hc11 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}" + } + "m6812-*-*" { + set asm-arch m68hc11 + set asm-flags "-mshort-double -m68hc12 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}" + } + "mips*-*" { + set asm-arch mips + } + "powerpc*-*" { + set asm-arch powerpc + } + "sparc-*-*" { + set asm-arch sparc + } + "sparc64-*-*" { + set asm-arch sparc64 + set asm-flags "-xarch=v9 -gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}" + } + "xstormy16-*-*" { + set asm-arch xstormy16 + set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}" + } + "v850-*-*" { + set asm-arch v850 + set gdb_wrapper_initialized 1 } } -if [istarget "m32r*-*"] then { - set asm-arch m32r -} -if [istarget "m6811-*-*"] then { - set asm-arch m68hc11 - set asm-flags "-mshort-double -m68hc11 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}" -} -if [istarget "m6812-*-*"] then { - set asm-arch m68hc11 - set asm-flags "-mshort-double -m68hc12 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}" -} -if [istarget "mips*-*"] then { - set asm-arch mips -} -if [istarget "powerpc*-*"] then { - set asm-arch powerpc -} -if [istarget "sparc-*-*"] then { - set asm-arch sparc -} -if [istarget "sparc64-*-*"] then { - set asm-arch sparc64 - set asm-flags "-xarch=v9 -gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}" -} -if [istarget "xstormy16-*-*"] then { - set asm-arch xstormy16 - set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}" -} -if [istarget "v850-*-*"] then { - set asm-arch v850 - set gdb_wrapper_initialized 1 -} + if { "${asm-arch}" == "" } { gdb_suppress_entire_file "Assembly source test -- not implemented for this target." } @@ -293,11 +299,35 @@ gdb_test "next" "17\[ \t\]+gdbasm_leave" "next over foo3" gdb_test "return" "\#0 main .*37\[ \t\]+gdbasm_exit0" "return from foo2" \ "Make (foo2|selected stack frame) return now\?.*" "y" -# See if we can look at a global variable +# Disassemble something, check the output +proc test_dis { command var } { + global gdb_prompt + send_gdb "${command}\n" + gdb_expect { + -re "${var}.*:.*Cannot access" { + # The "disassembler" was only accessing the local + # executable and that would cause attempts to disassemble + # variables to fail (memory not valid). + fail "${command} (memory read error)" + } + -re "${var}.*:.*${gdb_prompt}" { + pass "${command}" + } + timeout { + fail "${command} (timeout)" + } + } +} + +# 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 "disassem &globalvar &globalvar+1" "globalvar" -# See if we can look at a static variable +# See if we can look at a static variable, three ways gdb_test "print staticvar" ".* = 5" "look at static variable" +test_dis "x/i &staticvar" "staticvar" +test_dis "disassem &staticvar &staticvar+1" "staticvar" # See if we can look at a static function gdb_test "disassem foostatic" ".*<foostatic\\+0>:.*End of assembler dump." \ diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp index 8e765aa..e17bb14 100644 --- a/gdb/testsuite/gdb.base/charset.exp +++ b/gdb/testsuite/gdb.base/charset.exp @@ -48,11 +48,23 @@ proc parse_show_charset_output {testname} { -re "The current host and target character set is `(.*)'\\.\[\r\n\]+$gdb_prompt $" { set host_charset $expect_out(1,string) set target_charset $expect_out(1,string) + set retlist [list $host_charset $target_charset] pass $testname } -re "The current host character set is `(.*)'\\.\[\r\n\]+The current target character set is `(.*)'\\.\[\r\n\]+$gdb_prompt $" { set host_charset $expect_out(1,string) set target_charset $expect_out(2,string) + set retlist [list $host_charset $target_charset] + pass $testname + } + -re "The host character set is \"(.*)\"\\.\[\r\n\]+$gdb_prompt $" { + set host_charset $expect_out(1,string) + set retlist [list $host_charset] + pass $testname + } + -re "The target character set is \"(.*)\"\\.\[\r\n\]+$gdb_prompt $" { + set target_charset $expect_out(1,string) + set retlist [list $target_charset] pass $testname } -re ".*$gdb_prompt $" { @@ -63,7 +75,7 @@ proc parse_show_charset_output {testname} { } } - return [list $host_charset $target_charset] + return $retlist } @@ -77,7 +89,7 @@ set show_charset [parse_show_charset_output "show charset"] send_gdb "show target-charset\n" set show_target_charset [parse_show_charset_output "show target-charset"] -if {! [string compare $show_charset $show_target_charset]} { +if {[lsearch $show_charset $show_target_charset] >= 0} { pass "check `show target-charset' against `show charset'" } else { fail "check `show target-charset' against `show charset'" @@ -86,21 +98,71 @@ if {! [string compare $show_charset $show_target_charset]} { send_gdb "show host-charset\n" set show_host_charset [parse_show_charset_output "show host-charset"] -if {! [string compare $show_charset $show_host_charset]} { +if {[lsearch $show_charset $show_host_charset] >= 0} { pass "check `show host-charset' against `show charset'" } else { fail "check `show host-charset' against `show charset'" } -# Get the list of supported charsets. -send_gdb "set charset\n" +# Get the list of supported (host) charsets as possible completions. +send_gdb "set charset \t\t" -# True iff we've seen the "Valid character sets are:" message. -set seen_valid 0 +# Check that we can at least use ASCII as a host character set. +sleep 1 +gdb_expect { + -re "^set charset .*\r\nASCII.*\r\n$gdb_prompt set charset " { + # We got the output that we wanted, including ASCII as possible + # charset. Send a newline to get us back to the prompt. This will + # also generate an error message. Let's not check here that the error + # message makes sense, we do that below, as a separate testcase. + send_gdb "\n" + gdb_expect { + -re ".*Requires an argument.*$gdb_prompt $" { + pass "get valid character sets" + } + -re ".*$gdb_prompt $" { + send_gdb "\n" + gdb_expect { + -re ".*$gdb_prompt $" { + fail "get valid character sets" + } + } + } + timeout { + fail "(timeout) get valid character sets" + } + } + } + -re ".*$gdb_prompt $" { + # We got some output that ended with a regular prompt + fail "get valid character sets" + } + -re "^set charset.*$" { + # We got some other output, send a cntrl-c to gdb to get us back + # to the prompt. + send_gdb "\003" + fail "get valid character sets" + } + timeout { + fail "get valid character sets (timeout)" + } +} + +# Try a malformed `set charset'. +gdb_test "set charset" \ + "Requires an argument. Valid arguments are.*" \ + "try malformed `set charset'" + +# Try using `set host-charset' on an invalid character set. +gdb_test "set host-charset my_grandma_bonnie" \ + "Undefined item: \"my_grandma_bonnie\"." \ + "try `set host-charset' with invalid charset" -# True iff we've seen the "can be used as a host character set" message. -set seen_can_host 0 +# Try using `set target-charset' on an invalid character set. +gdb_test "set target-charset my_grandma_bonnie" \ + "Undefined item: \"my_grandma_bonnie\"." \ + "try `set target-charset' with invalid charset" # A Tcl array mapping the names of all the character sets we've seen # to "1" if the character set can be used as a host character set, or @@ -113,73 +175,73 @@ proc all_charset_names {} { return [array names charsets] } -proc charset_exists {charset} { - global charsets - return [info exists charsets($charset)] -} - proc valid_host_charset {charset} { global charsets return $charsets($charset) } +send_gdb "set host-charset\n" gdb_expect { - -re "Valid character sets are:\[\r\n\]+" { - # There's no ^ at the beginning of the pattern above, so that - # expect can skip the echoed `set charset' command. - set seen_valid 1 - exp_continue + -re "Requires an argument. Valid arguments are (\[^ \t\n\r,.\]*)" { + #set host_charset_list $expect_out(1,string) + set charsets($expect_out(1,string)) 1 + exp_continue + #pass "capture valid host charsets" } - -re "^ (\[^ \t\n\]*) \\*\[\r\n\]+" { - set charsets($expect_out(1,string)) 1 - exp_continue - } - -re "^ (\[^ \t\n\]*)\[ \t\]*\[\r\n\]+" { - set charsets($expect_out(1,string)) 0 - exp_continue + + -re ", (\[^ \t\n\r,.\]*)" { + #set host_charset_list $expect_out(1,string) + set charsets($expect_out(1,string)) 1 + exp_continue + #pass "capture valid host charsets" } - -re "^\\* - can be used as a host character set\[\r\n\]+" { - set seen_can_host 1 - exp_continue + + -re "\\.\r\n$gdb_prompt $" { + #set host_charset_list $expect_out(1,string) + set charsets($expect_out(1,string)) 1 + pass "capture valid host charsets" } - -re ".*${gdb_prompt} $" { - # We don't do an exp_continue here. + + -re ".*$gdb_prompt $" { + fail "capture valid host charsets" } timeout { - fail "get valid character sets (timeout)" + fail "(timeout) capture valid host charsets" } } -# Check that we've seen all the right pieces of the output, and that -# we can at least use ASCII as a host character set. -if {$seen_valid && $seen_can_host && [charset_exists ascii]} { - # We can't do the below as part of the test above, since all the - # [] substitution takes place before any expression evaluation - # takes place; && doesn't really short circuit things the way - # you'd like. We'd get an "can't read $charsets(ascii)" error - # even when `info exists' had returned zero. - if {[valid_host_charset ascii]} { - pass "get valid character sets" - } else { - fail "get valid character sets" +send_gdb "set target-charset\n" +gdb_expect { + -re "Requires an argument. Valid arguments are (\[^ \t\n\r,.\]*)" { + set target_charset $expect_out(1,string) + if {! [info exists charsets($target_charset)]} { + set charsets($target_charset) 0 + } + exp_continue } -} else { - fail "get valid character sets (no ascii charset)" -} + -re ", (\[^ \t\n\r,.\]*)" { + set target_charset $expect_out(1,string) + if {! [info exists charsets($target_charset)]} { + set charsets($target_charset) 0 + } + exp_continue + } -# Try using `set host-charset' on an invalid character set. -gdb_test "set host-charset my_grandma_bonnie" \ - "GDB doesn't know of any character set named `my_grandma_bonnie'." \ - "try `set host-charset' with invalid charset" + -re "\\.\r\n$gdb_prompt $" { + pass "capture valid target charsets" + } -# Try using `set target-charset' on an invalid character set. -gdb_test "set target-charset my_grandma_bonnie" \ - "GDB doesn't know of any character set named `my_grandma_bonnie'." \ - "try `set target-charset' with invalid charset" + -re ".*$gdb_prompt $" { + fail "capture valid target charsets" + } + timeout { + fail "(timeout) capture valid target charsets" + } +} # Make sure that GDB supports every host/target charset combination. foreach host_charset [all_charset_names] { @@ -341,7 +403,7 @@ gdb_expect { } -gdb_test "set host-charset ascii" "" +gdb_test "set host-charset ASCII" "" foreach target_charset [all_charset_names] { send_gdb "set target-charset $target_charset\n" gdb_expect { diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp index e25c03c..7321777 100644 --- a/gdb/testsuite/gdb.base/corefile.exp +++ b/gdb/testsuite/gdb.base/corefile.exp @@ -227,6 +227,6 @@ gdb_expect { gdb_load ${binfile} setup_xfail "*-*-*" CLLbs17002 -gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\)" "up in corefile.exp (reinit)" +gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\).*" "up in corefile.exp (reinit)" gdb_test "core" "No core file now." diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index d828650..f82bf02 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -35,6 +35,7 @@ #maintenance info -- Commands for showing internal info about the program being debugged #maintenance internal-error -- Give GDB an internal error. # +#maintenance print dummy-frames -- Print the dummy frame stack #maintenance print statistics -- Print statistics about internal gdb state #maintenance print objfiles -- Print dump of current object file definitions #maintenance print psymbols -- Print dump of current partial symbol definitions @@ -186,6 +187,9 @@ gdb_expect { timeout { fail "(timeout) maint print statistics" } } +# There aren't any ... +gdb_test "maint print dummy-frames" "" + send_gdb "maint print objfiles\n" # To avoid timeouts, we avoid expects with many .* patterns that match @@ -524,6 +528,9 @@ gdb_expect { timeout { fail "(timeout) help maint print statistics" } } +gdb_test "help maint print dummy-frames" \ + "Print the contents of the internal dummy-frame stack." + send_gdb "help maint print objfiles\n" gdb_expect { -re "Print dump of current object file definitions\\..*$gdb_prompt $"\ diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp index c5e37d4..fd5d8f2 100644 --- a/gdb/testsuite/gdb.base/watchpoint.exp +++ b/gdb/testsuite/gdb.base/watchpoint.exp @@ -377,7 +377,7 @@ proc test_stepping {} { # The problem is that GDB confuses stepping through the call # dummy with hitting the breakpoint at the end of the call dummy. # Will be fixed once all architectures define - # CALL_DUMMY_BREAKPOINT_OFFSET. + # DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET. setup_xfail "*-*-*" # This doesn't occur if the call dummy starts with a call, # because we are out of the dummy by the first time the inferior @@ -388,7 +388,7 @@ proc test_stepping {} { clear_xfail "m68*-*-*" clear_xfail "i*86*-*-*" clear_xfail "vax-*-*" - # The following architectures define CALL_DUMMY_BREAKPOINT_OFFSET. + # The following architectures define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET. clear_xfail "alpha-*-*" clear_xfail "mips*-*-*" clear_xfail "sparc-*-*" diff --git a/gdb/testsuite/gdb.c++/namespace.cc b/gdb/testsuite/gdb.c++/namespace.cc index d9c9593..ad2d982 100644 --- a/gdb/testsuite/gdb.c++/namespace.cc +++ b/gdb/testsuite/gdb.c++/namespace.cc @@ -188,7 +188,7 @@ namespace C void marker2 (void) { - // NOTE: carlton/2002-10-11: I'm listing the expressions that I + // NOTE: carlton/2003-04-23: I'm listing the expressions that I // plan to have GDB try to print out, just to make sure that the // compiler and I agree which ones should be legal! It's easy // to screw up when testing the boundaries of namespace stuff. @@ -205,6 +205,8 @@ namespace C F::cXfX; X; G::Xg; + //cXOtherFile; + //XOtherFile; G::XgX; I::h; j; @@ -215,6 +217,7 @@ namespace C //o; r1; //r2; + return; } @@ -246,6 +249,6 @@ int main () c1 = cl.xyzq('e'); marker1(); - + C::D::marker2 (); } diff --git a/gdb/testsuite/gdb.c++/namespace.exp b/gdb/testsuite/gdb.c++/namespace.exp index 9d739cb..5bf976b 100644 --- a/gdb/testsuite/gdb.c++/namespace.exp +++ b/gdb/testsuite/gdb.c++/namespace.exp @@ -1,4 +1,4 @@ -# Copyright 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright 1997, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -39,21 +39,26 @@ if { [skip_cplus_tests] } { continue } set testfile "namespace" set srcfile ${testfile}.cc +set objfile ${objdir}/${subdir}/${testfile}.o set srcfile1 ${testfile}1.cc +set objfile1 ${objdir}/${subdir}/${testfile}1.o set binfile ${objdir}/${subdir}/${testfile} if [get_compiler_info ${binfile}] { return -1; } - - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1}" "${binfile}" executable {debug c++}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will a -utomatically fail." +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug c++}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } +if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${objfile1}" object {debug c++}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} +if { [gdb_compile "${objfile} ${objfile1}" "${binfile}" executable {debug c++}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} gdb_exit gdb_start @@ -260,6 +265,7 @@ gdb_test "ptype C::NestedClass" "No symbol \"NestedClass\" in namespace \"C::C\" # Tests involving multiple files +gdb_test "print cOtherFile" "\\$\[0-9\].* = 316" gdb_test "ptype OtherFileClass" "type = class C::OtherFileClass \{\r\n public:\r\n int z;\r\n\}" gdb_test "ptype ::C::OtherFileClass" "type = class C::OtherFileClass \{\r\n public:\r\n int z;\r\n\}" gdb_test "ptype C::OtherFileClass" "No symbol \"OtherFileClass\" in namespace \"C::C\"." diff --git a/gdb/testsuite/gdb.c++/namespace1.cc b/gdb/testsuite/gdb.c++/namespace1.cc index 6d9a0e0..15b3429 100644 --- a/gdb/testsuite/gdb.c++/namespace1.cc +++ b/gdb/testsuite/gdb.c++/namespace1.cc @@ -1,3 +1,22 @@ +/* Copyright 2003 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + 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. + + Please email any bugs, comments, and/or additions to this file to: + bug-gdb@prep.ai.mit.edu */ + namespace C { class OtherFileClass { @@ -8,6 +27,8 @@ namespace C namespace { int cXOtherFile = 29; }; + + int cOtherFile = 316; } namespace { diff --git a/gdb/testsuite/gdb.c++/rtti.exp b/gdb/testsuite/gdb.c++/rtti.exp index 1bc9b7a..3eba24b 100644 --- a/gdb/testsuite/gdb.c++/rtti.exp +++ b/gdb/testsuite/gdb.c++/rtti.exp @@ -19,10 +19,10 @@ # This contains tests for GDB's use of RTTI information. This stems # from a bug reported in PR gdb/488 and other places, which leads to # statements like 'warning: can't find class named 'C::D', as given by -# C++ RTTI. It arises from GDB not knowing about classes that are +# C++ RTTI'. It arises from GDB not knowing about classes that are # defined in namespaces. -# NOTE: carlton/2003-05-02: I suspect it could arise from nested class +# NOTE: carlton/2003-05-16: I suspect it could arise from nested class # issues, too, and even once we fix that, there might be situations # (involving templates, in particular) where this problem triggers # because GDB and GCC have different ideas what a class is called. @@ -91,13 +91,15 @@ gdb_test_multiple "print *e1" "print *e1" { } } -# NOTE: carlton/2003-05-02: This test fails on my branch because, -# within rtt1.cc, GDB has no way of knowing that the class is called -# 'n2::D2' instead of just 'D2'. This is an artifical test case, -# though: if we were using these classes in a more substantial way, -# G++ would emit more debug info. Arguably, the "incomplete type" -# kfail should really be an xfail, because it works using a compiler -# that generates DW_TAG_namespace tags. +# NOTE: carlton/2003-05-16: This test fails on my branch with an +# "<incomplete type>" message because, within rtt1.cc, GDB has no way +# of knowing that the class is called 'n2::D2' instead of just 'D2'. +# This is an artifical test case, though: if we were using these +# classes in a more substantial way, G++ would emit more debug info. +# As is, I don't think there's anything that GDB can do about this +# case until G++ starts emitting DW_TAG_namespace info; when that part +# of the branch gets merged in, then we'll probably want to convert +# that fail branch to an xfail. gdb_test_multiple "print *e2" "print *e2" { -re "warning: can't find class named `n2::D2', as given by C\\+\\+ RTTI.*$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.mi/ChangeLog b/gdb/testsuite/gdb.mi/ChangeLog index d2aae78..e4aec35 100644 --- a/gdb/testsuite/gdb.mi/ChangeLog +++ b/gdb/testsuite/gdb.mi/ChangeLog @@ -1,3 +1,9 @@ +2003-05-03 J. Brobecker <brobecker@gnat.com> + + From Thierry Schneider <tpschneider1@yahoo.com>: + * mi1-symbol.exp (-symbol-list-lines): New test file to + validate all symbol-related commands + 2003-04-08 Andrew Cagney <cagney@redhat.com> * gdb792.exp: Skip when C++. diff --git a/gdb/testsuite/gdb.threads/linux-dp.exp b/gdb/testsuite/gdb.threads/linux-dp.exp index 6d48b0d..e6baffe 100644 --- a/gdb/testsuite/gdb.threads/linux-dp.exp +++ b/gdb/testsuite/gdb.threads/linux-dp.exp @@ -64,11 +64,23 @@ gdb_test "info threads" "" "info threads 1" # Try stepping over the thread creation function. gdb_breakpoint [gdb_get_line_number "linuxthreads.exp: create philosopher"] +set expect_manager -1 for {set i 0} {$i < 5} {incr i} { gdb_continue_to_breakpoint "about to create philosopher: $i" send_gdb "next\n" gdb_expect { + -re "\\\[New .*\\\].*\\\[New .*\\\].*$gdb_prompt $" { + # Two threads are created the first time in LinuxThreads, + # where the second is the manager thread. In NPTL, there is none. + if {$i == 0} { + set expect_manager 1 + } + pass "create philosopher: $i" + } -re "\\\[New .*\\\].*$gdb_prompt $" { + if {$i == 0} { + set expect_manager 0 + } pass "create philosopher: $i" } -re "Program received signal.*(Unknown signal|SIGUSR|Real-time event).*$gdb_prompt $" { @@ -87,15 +99,25 @@ for {set i 0} {$i < 5} {incr i} { } } +if {$expect_manager} { + set nthreads 7 +} else { + set nthreads 6 +} + # Run until there are some threads. gdb_breakpoint [gdb_get_line_number "linuxthreads.exp: info threads 2"] gdb_continue_to_breakpoint "main thread's sleep" -gdb_test "info threads" "7 Thread .*6 Thread .*5 Thread .*4 Thread .*3 Thread .*2 Thread .*1 Thread .*" "info threads 2" +set info_threads_ptn "" +for {set i $nthreads} {$i > 0} {incr i -1} { + append info_threads_ptn "$i Thread .*" +} +gdb_test "info threads" $info_threads_ptn "info threads 2" # Try setting a thread-specific breakpoint. gdb_breakpoint "print_philosopher thread 5" gdb_continue_to_breakpoint "thread 5's print" -gdb_test "where" "print_philosopher.*philosopher.*pthread_start_thread.*" \ +gdb_test "where" "print_philosopher.*philosopher.* from .*libpthread.*" \ "first thread-specific breakpoint hit" # Make sure it's catching the right thread. Try hitting the @@ -154,7 +176,7 @@ proc check_philosopher_stack {thread seen_name} { global gdb_prompt upvar $seen_name seen global main_seen - global manager_seen + global expect_manager manager_seen set name "philosopher is distinct: $thread" set interesting 0 @@ -216,7 +238,7 @@ proc check_philosopher_stack {thread seen_name} { set any_interesting 0 array set seen {} unset seen -for {set i 1} {$i <= 7} {incr i} { +for {set i 1} {$i <= $nthreads} {incr i} { if [check_philosopher_stack $i seen] { set any_interesting 1 } @@ -227,3 +249,9 @@ if {$any_interesting} { } else { fail "found an interesting thread" } + +if {$manager_seen == $expect_manager} { + pass "manager thread found (not found) when expected" +} else { + fail "manager thread found (not found) when expected" +} diff --git a/gdb/testsuite/gdb.threads/schedlock.exp b/gdb/testsuite/gdb.threads/schedlock.exp index 28298c6..4478580 100644 --- a/gdb/testsuite/gdb.threads/schedlock.exp +++ b/gdb/testsuite/gdb.threads/schedlock.exp @@ -112,8 +112,8 @@ proc my_continue { msg } { stop_process "stop all threads ($msg)" - # Make sure we're in one of the looping threads. - gdb_breakpoint [gdb_get_line_number "schedlock.exp: main loop"] + # Make sure we're in one of the non-main looping threads. + gdb_breakpoint [concat [gdb_get_line_number "schedlock.exp: main loop"] " if arg != 5"] gdb_continue_to_breakpoint "return to loop ($msg)" delete_breakpoints } @@ -230,12 +230,11 @@ if {$curthread == $newthread} { set start_args $cont_args set cont_args [get_args] +set num_other_threads 0 for {set i 0} {[expr $i < 6]} {set i [expr $i + 1]} { if {[lindex $start_args $i] == [lindex $cont_args $i]} { if {$i == $curthread} { fail "current thread stepped (didn't run)" - } else { - fail "other thread $i ran (didn't run) (1)" } } else { if {$i == $curthread} { @@ -245,10 +244,15 @@ for {set i 0} {[expr $i < 6]} {set i [expr $i + 1]} { fail "current thread stepped (wrong amount)" } } else { - pass "other thread $i ran (1)" + set num_other_threads [expr $num_other_threads + 1] } } } +if {$num_other_threads > 0} { + pass "other threads ran (1)" +} else { + fail "other threads ran (no other threads ran) (1)" +} # Test continue with scheduler locking gdb_test "set scheduler-locking on" "" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 4dfbf76..a16b0fa 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1283,6 +1283,46 @@ proc gdb_compile_pthreads {source dest type options} { } } +# This is just like gdb_compile_pthreads, above, except that we always add the +# objc library for compiling Objective-C programs +proc gdb_compile_objc {source dest type options} { + set built_binfile 0 + set why_msg "unrecognized error" + foreach lib {-lobjc -lpthreads -lpthread -lthread solaris} { + # This kind of wipes out whatever libs the caller may have + # set. Or maybe theirs will override ours. How infelicitous. + if { $lib == "solaris" } { + set lib "-lpthread -lposix4" + } + if { $lib != "-lobjc" } { + set lib "-lobjc $lib" + } + set options_with_lib [concat $options [list libs=$lib quiet]] + set ccout [gdb_compile $source $dest $type $options_with_lib] + switch -regexp -- $ccout { + ".*no posix threads support.*" { + set why_msg "missing threads include file" + break + } + ".*cannot open -lpthread.*" { + set why_msg "missing runtime threads library" + } + ".*Can't find library for -lpthread.*" { + set why_msg "missing runtime threads library" + } + {^$} { + pass "successfully compiled objc with posix threads test case" + set built_binfile 1 + break + } + } + } + if {!$built_binfile} { + unsupported "Couldn't compile $source: ${why_msg}" + return -1 + } +} + proc send_gdb { string } { global suppress_flag; if { $suppress_flag } { diff --git a/gdb/thread-db.c b/gdb/thread-db.c index bac4641..0a6138b 100644 --- a/gdb/thread-db.c +++ b/gdb/thread-db.c @@ -945,7 +945,7 @@ thread_db_store_registers (int regno) if (regno != -1) { - char *raw = alloca (max_register_size (current_gdbarch)); + char raw[MAX_REGISTER_SIZE]; deprecated_read_register_gen (regno, raw); thread_db_fetch_registers (-1); diff --git a/gdb/thread.c b/gdb/thread.c index 53a2d4f..315f33b 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -292,7 +292,6 @@ gdb_list_thread_ids (struct ui_out *uiout) void load_infrun_state (ptid_t ptid, CORE_ADDR *prev_pc, - char **prev_func_name, int *trap_expected, struct breakpoint **step_resume_breakpoint, struct breakpoint **through_sigtramp_breakpoint, @@ -316,7 +315,6 @@ load_infrun_state (ptid_t ptid, return; *prev_pc = tp->prev_pc; - *prev_func_name = tp->prev_func_name; *trap_expected = tp->trap_expected; *step_resume_breakpoint = tp->step_resume_breakpoint; *through_sigtramp_breakpoint = tp->through_sigtramp_breakpoint; @@ -340,7 +338,6 @@ load_infrun_state (ptid_t ptid, void save_infrun_state (ptid_t ptid, CORE_ADDR prev_pc, - char *prev_func_name, int trap_expected, struct breakpoint *step_resume_breakpoint, struct breakpoint *through_sigtramp_breakpoint, @@ -364,7 +361,6 @@ save_infrun_state (ptid_t ptid, return; tp->prev_pc = prev_pc; - tp->prev_func_name = prev_func_name; tp->trap_expected = trap_expected; tp->step_resume_breakpoint = step_resume_breakpoint; tp->through_sigtramp_breakpoint = through_sigtramp_breakpoint; diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 20472c0..314f0cc 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -1116,7 +1116,7 @@ memrange_sortmerge (struct collection_list *memranges) { if (memranges->list[a].type == memranges->list[b].type && memranges->list[b].start - memranges->list[a].end <= - MAX_REGISTER_VIRTUAL_SIZE) + MAX_REGISTER_SIZE) { /* memrange b starts before memrange a ends; merge them. */ if (memranges->list[b].end > memranges->list[a].end) diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index 3de8973..f44f9aa 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,3 +1,13 @@ +2003-05-08 Andrew Cagney <cagney@redhat.com> + + * tuiRegs.c: Use MAX_REGISTER_SIZE instead of + MAX_REGISTER_RAW_SIZE. + +2003-05-03 Andrew Cagney <cagney@redhat.com> + + * tuiDisassem.c (tui_disassemble): Call gdb_print_insn, instead of + TARGET_PRINT_INSN. Do not initialize a disassemble_info object. + 2003-04-30 Andrew Cagney <cagney@redhat.com> * tuiDisassem.c (tui_disassemble): Use diff --git a/gdb/tui/tuiDisassem.c b/gdb/tui/tuiDisassem.c index eaf75df..0ddf32c 100644 --- a/gdb/tui/tuiDisassem.c +++ b/gdb/tui/tuiDisassem.c @@ -68,26 +68,10 @@ static CORE_ADDR tui_disassemble (struct tui_asm_line* lines, CORE_ADDR pc, int count) { struct ui_file *gdb_dis_out; - disassemble_info asm_info; /* now init the ui_file structure */ gdb_dis_out = tui_sfileopen (256); - /* FIXME: cagney/2003-04-28: Should instead be using the generic - disassembler but first need to clean that up and stop it trying - to access the exec file. */ - - memcpy (&asm_info, &deprecated_tm_print_insn_info, sizeof (asm_info)); - asm_info.stream = gdb_dis_out; - - if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) - asm_info.endian = BFD_ENDIAN_BIG; - else - asm_info.endian = BFD_ENDIAN_LITTLE; - - if (TARGET_ARCHITECTURE != NULL) - asm_info.mach = TARGET_ARCHITECTURE->mach; - /* Now construct each line */ for (; count > 0; count--, lines++) { @@ -102,7 +86,7 @@ tui_disassemble (struct tui_asm_line* lines, CORE_ADDR pc, int count) ui_file_rewind (gdb_dis_out); - pc = pc + TARGET_PRINT_INSN (pc, &asm_info); + pc = pc + gdb_print_insn (pc, gdb_dis_out); lines->insn = xstrdup (tui_file_get_strbuf (gdb_dis_out)); diff --git a/gdb/tui/tuiRegs.c b/gdb/tui/tuiRegs.c index 6920d80..61b9334 100644 --- a/gdb/tui/tuiRegs.c +++ b/gdb/tui/tuiRegs.c @@ -489,7 +489,7 @@ tuiCheckRegisterValues (struct frame_info *frame) else { int i, j; - char rawBuf[MAX_REGISTER_RAW_SIZE]; + char rawBuf[MAX_REGISTER_SIZE]; for (i = 0; (i < dataWin->detail.dataDisplayInfo.regsContentCount); i++) @@ -766,7 +766,7 @@ _tuiRegValueHasChanged (TuiDataElementPtr dataElement, if (dataElement->itemNo != UNDEFINED_ITEM && _tuiRegisterName (dataElement->itemNo) != (char *) NULL) { - char rawBuf[MAX_REGISTER_RAW_SIZE]; + char rawBuf[MAX_REGISTER_SIZE]; int i; if (_tuiGetRegisterRawValue ( @@ -830,7 +830,7 @@ _tuiSetRegisterElement (int regNum, struct frame_info *frame, dataElement->highlight = FALSE; } if (dataElement->value == (Opaque) NULL) - dataElement->value = (Opaque) xmalloc (MAX_REGISTER_RAW_SIZE); + dataElement->value = (Opaque) xmalloc (MAX_REGISTER_SIZE); if (dataElement->value != (Opaque) NULL) _tuiGetRegisterRawValue (regNum, dataElement->value, frame); } diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index a5b5fc6..0f896a4 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -613,8 +613,8 @@ v850_scan_prologue (CORE_ADDR pc, struct prologue_info *pi) int insn2 = -1; /* dummy value */ #ifdef DEBUG - printf_filtered ("0x%.8lx ", (long) current_pc); - TARGET_PRINT_INSN (current_pc, &deprecated_tm_print_insn_info); + fprintf_filtered (gdb_stdlog, "0x%.8lx ", (long) current_pc); + gdb_print_insn (current_pc, gdb_stdlog); #endif insn = read_memory_unsigned_integer (current_pc, 2); @@ -958,7 +958,7 @@ v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp, if (!v850_type_is_scalar (VALUE_TYPE (*args)) && TYPE_LENGTH (VALUE_TYPE (*args)) > E_MAX_RETTYPE_SIZE_IN_REGS) { - store_address (valbuf, 4, VALUE_ADDRESS (*args)); + store_unsigned_integer (valbuf, 4, VALUE_ADDRESS (*args)); len = 4; val = valbuf; } @@ -1229,8 +1229,8 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_fp_regnum (gdbarch, E_FP_REGNUM); set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM); set_gdbarch_register_name (gdbarch, v850_register_name); - set_gdbarch_register_size (gdbarch, v850_reg_size); - set_gdbarch_register_bytes (gdbarch, E_ALL_REGS_SIZE); + 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_max_register_raw_size (gdbarch, v850_reg_size); @@ -1277,9 +1277,9 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_store_return_value (gdbarch, v850_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, v850_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, v850_use_struct_convention); - set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil); - set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); - set_gdbarch_fix_call_dummy (gdbarch, v850_fix_call_dummy); + set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_nil); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0); + set_gdbarch_deprecated_fix_call_dummy (gdbarch, v850_fix_call_dummy); set_gdbarch_breakpoint_from_pc (gdbarch, v850_breakpoint_from_pc); set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT); diff --git a/gdb/valops.c b/gdb/valops.c index b555bb1..0bc8807 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -536,7 +536,7 @@ value_assign (struct value *toval, struct value *fromval) { register struct type *type; struct value *val; - char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); + char raw_buffer[MAX_REGISTER_SIZE]; int use_buffer = 0; struct frame_id old_frame; @@ -690,8 +690,7 @@ value_assign (struct value *toval, struct value *fromval) amount_to_copy = byte_offset + TYPE_LENGTH (type); /* And a bounce buffer. Be slightly over generous. */ - buffer = (char *) alloca (amount_to_copy - + MAX_REGISTER_RAW_SIZE); + buffer = (char *) alloca (amount_to_copy + MAX_REGISTER_SIZE); /* Copy it in. */ for (regno = reg_offset, amount_copied = 0; @@ -1018,8 +1017,8 @@ value_ind (struct value *arg1) CORE_ADDR push_word (CORE_ADDR sp, ULONGEST word) { - register int len = REGISTER_SIZE; - char *buffer = alloca (MAX_REGISTER_RAW_SIZE); + register int len = DEPRECATED_REGISTER_SIZE; + char buffer[MAX_REGISTER_SIZE]; store_unsigned_integer (buffer, len, word); if (INNER_THAN (1, 2)) @@ -2708,8 +2707,8 @@ value_maybe_namespace_elt (const struct type *curtype, const char *namespace_name = TYPE_TAG_NAME (curtype); const struct symbol *sym; - sym = lookup_symbol_namespace (namespace_name, name, NULL, - block, VAR_NAMESPACE, NULL); + sym = cp_lookup_symbol_namespace (namespace_name, name, NULL, + block, VAR_DOMAIN, NULL); if (sym == NULL) return NULL; @@ -2840,7 +2839,7 @@ value_of_local (const char *name, int complain) /* Calling lookup_block_symbol is necessary to get the LOC_REGISTER symbol instead of the LOC_ARG one (if both exist). */ - sym = lookup_block_symbol (b, name, NULL, VAR_NAMESPACE); + sym = lookup_block_symbol (b, name, NULL, VAR_DOMAIN); if (sym == NULL) { if (complain) diff --git a/gdb/value.h b/gdb/value.h index 34e80e3..4c54536 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -1,4 +1,5 @@ /* Definitions for values of C expressions, for GDB. + Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. @@ -23,105 +24,109 @@ #if !defined (VALUE_H) #define VALUE_H 1 -struct ui_file; +#include "doublest.h" + +struct block; struct expression; +struct regcache; struct symbol; struct type; -struct regcache; -struct block; - -#include "doublest.h" +struct ui_file; -/* - * The structure which defines the type of a value. It should never - * be possible for a program lval value to survive over a call to the inferior - * (ie to be put into the history list or an internal variable). - */ +/* The structure which defines the type of a value. It should never + be possible for a program lval value to survive over a call to the + inferior (i.e. to be put into the history list or an internal + variable). */ struct value +{ + /* Type of value; either not an lval, or one of the various + different possible kinds of lval. */ + enum lval_type lval; + + /* Is it modifiable? Only relevant if lval != not_lval. */ + int modifiable; + + /* Location of value (if lval). */ + union { - /* Type of value; either not an lval, or one of the various - different possible kinds of lval. */ - enum lval_type lval; - /* Is it modifiable? Only relevant if lval != not_lval. */ - int modifiable; - /* Location of value (if lval). */ - union - { - /* If lval == lval_memory, this is the address in the inferior. - If lval == lval_register, this is the byte offset into the - registers structure. */ - CORE_ADDR address; - /* Pointer to internal variable. */ - struct internalvar *internalvar; - /* Number of register. Only used with - lval_reg_frame_relative. */ - int regnum; - } - location; - /* Describes offset of a value within lval of a structure in bytes. - If lval == lval_memory, this is an offset to the address. - If lval == lval_register, this is a further offset from - location.address within the registers structure. - Note also the member embedded_offset below. */ - int offset; - /* Only used for bitfields; number of bits contained in them. */ - int bitsize; - /* Only used for bitfields; position of start of field. - For BITS_BIG_ENDIAN=0 targets, it is the position of the LSB. - For BITS_BIG_ENDIAN=1 targets, it is the position of the MSB. */ + /* If lval == lval_memory, this is the address in the inferior. + If lval == lval_register, this is the byte offset into the + registers structure. */ + CORE_ADDR address; + + /* Pointer to internal variable. */ + struct internalvar *internalvar; + + /* Number of register. Only used with lval_reg_frame_relative. */ + int regnum; + } location; + + /* Describes offset of a value within lval of a structure in bytes. + If lval == lval_memory, this is an offset to the address. + If lval == lval_register, this is a further offset from + location.address within the registers structure. + Note also the member embedded_offset below. */ + int offset; + + /* Only used for bitfields; number of bits contained in them. */ + int bitsize; + + /* Only used for bitfields; position of start of field. + For BITS_BIG_ENDIAN=0 targets, it is the position of the LSB. + 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; - - /* Type of the value. */ - struct type *type; - - /* If a value represents a C++ object, then the `type' field gives - the object's compile-time type. If the object actually belongs - to some class derived from `type', perhaps with other base - classes and additional members, then `type' is just a subobject - of the real thing, and the full object is probably larger than - `type' would suggest. - - If `type' is a dynamic class (i.e. one with a vtable), then GDB - can actually determine the object's run-time type by looking at - the run-time type information in the vtable. When this - information is available, we may elect to read in the entire - object, for several reasons: - - - When printing the value, the user would probably rather see - the full object, not just the limited portion apparent from - the compile-time type. - - - If `type' has virtual base classes, then even printing - `type' alone may require reaching outside the `type' - portion of the object to wherever the virtual base class - has been stored. - - When we store the entire object, `enclosing_type' is the - run-time type --- the complete object --- and `embedded_offset' - is the offset of `type' within that larger type, in bytes. The - VALUE_CONTENTS macro takes `embedded_offset' into account, so - most GDB code continues to see the `type' portion of the value, - just as the inferior would. - - If `type' is a pointer to an object, then `enclosing_type' is a - pointer to the object's run-time type, and `pointed_to_offset' - is the offset in bytes from the full object to the pointed-to - object --- that is, the value `embedded_offset' would have if - we followed the pointer and fetched the complete object. (I - don't really see the point. Why not just determine the - run-time type when you indirect, and avoid the special case? - The contents don't matter until you indirect anyway.) - - If we're not doing anything fancy, `enclosing_type' is equal to - `type', and `embedded_offset' is zero, so everything works - normally. */ + + /* 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; + + /* Type of the value. */ + struct type *type; + + /* If a value represents a C++ object, then the `type' field gives + the object's compile-time type. If the object actually belongs + to some class derived from `type', perhaps with other base + classes and additional members, then `type' is just a subobject + of the real thing, and the full object is probably larger than + `type' would suggest. + + If `type' is a dynamic class (i.e. one with a vtable), then GDB + can actually determine the object's run-time type by looking at + the run-time type information in the vtable. When this + information is available, we may elect to read in the entire + object, for several reasons: + + - When printing the value, the user would probably rather see the + full object, not just the limited portion apparent from the + compile-time type. + + - If `type' has virtual base classes, then even printing `type' + alone may require reaching outside the `type' portion of the + object to wherever the virtual base class has been stored. + + When we store the entire object, `enclosing_type' is the run-time + type -- the complete object -- and `embedded_offset' is the + offset of `type' within that larger type, in bytes. The + VALUE_CONTENTS macro takes `embedded_offset' into account, so + most GDB code continues to see the `type' portion of the value, + just as the inferior would. + + If `type' is a pointer to an object, then `enclosing_type' is a + pointer to the object's run-time type, and `pointed_to_offset' is + the offset in bytes from the full object to the pointed-to object + -- that is, the value `embedded_offset' would have if we + followed the pointer and fetched the complete object. (I don't + really see the point. Why not just determine the run-time type + when you indirect, and avoid the special case? The contents + don't matter until you indirect anyway.) + + If we're not doing anything fancy, `enclosing_type' is equal to + `type', and `embedded_offset' is zero, so everything works + normally. */ struct type *enclosing_type; int embedded_offset; int pointed_to_offset; @@ -134,10 +139,11 @@ struct value /* Register number if the value is from a register. */ short regno; - /* If zero, contents of this value are in the contents field. - If nonzero, contents are in inferior memory at address - in the location.address field plus the offset field - (and the lval field should be lval_memory). + + /* If zero, contents of this value are in the contents field. If + nonzero, contents are in inferior memory at address in the + location.address field plus the offset field (and the lval + field should be lval_memory). WARNING: This field is used by the code which handles watchpoints (see breakpoint.c) to decide whether a particular @@ -150,53 +156,59 @@ struct value lazy flag is set and reset, be sure to consider this use as well! */ char lazy; + /* If nonzero, this is the value of a variable which does not actually exist in the program. */ char optimized_out; + /* The BFD section associated with this value. */ asection *bfd_section; + /* Actual contents of the value. For use of this value; setting it uses the stuff above. Not valid if lazy is nonzero. Target byte-order. We force it to be aligned properly for any possible value. Note that a value therefore extends beyond what is declared here. */ union - { - long contents[1]; - DOUBLEST force_doublest_align; - LONGEST force_longest_align; - CORE_ADDR force_core_addr_align; - void *force_pointer_align; - } - aligner; - /* Do not add any new members here -- contents above will trash them */ - }; + { + long contents[1]; + DOUBLEST force_doublest_align; + LONGEST force_longest_align; + CORE_ADDR force_core_addr_align; + void *force_pointer_align; + } aligner; + /* Do not add any new members here -- contents above will trash them. */ +}; #define VALUE_TYPE(val) (val)->type #define VALUE_ENCLOSING_TYPE(val) (val)->enclosing_type #define VALUE_LAZY(val) (val)->lazy + /* VALUE_CONTENTS and VALUE_CONTENTS_RAW both return the address of - the gdb buffer used to hold a copy of the contents of the lval. - VALUE_CONTENTS is used when the contents of the buffer are needed -- - it uses value_fetch_lazy() to load the buffer from the process being - debugged if it hasn't already been loaded. VALUE_CONTENTS_RAW is - used when data is being stored into the buffer, or when it is - certain that the contents of the buffer are valid. + the gdb buffer used to hold a copy of the contents of the lval. + VALUE_CONTENTS is used when the contents of the buffer are needed + -- it uses value_fetch_lazy() to load the buffer from the process + being debugged if it hasn't already been loaded. + VALUE_CONTENTS_RAW is used when data is being stored into the + buffer, or when it is certain that the contents of the buffer are + valid. + Note: The contents pointer is adjusted by the offset required to get to the real subobject, if the value happens to represent - something embedded in a larger run-time object. */ + something embedded in a larger run-time object. */ -#define VALUE_CONTENTS_RAW(val) ((char *) (val)->aligner.contents + (val)->embedded_offset) -#define VALUE_CONTENTS(val) ((void)(VALUE_LAZY(val) && value_fetch_lazy(val)),\ - VALUE_CONTENTS_RAW(val)) +#define VALUE_CONTENTS_RAW(val) \ + ((char *) (val)->aligner.contents + (val)->embedded_offset) +#define VALUE_CONTENTS(val) \ + ((void)(VALUE_LAZY(val) && value_fetch_lazy(val)), VALUE_CONTENTS_RAW(val)) /* The ALL variants of the above two macros do not adjust the returned - pointer by the embedded_offset value. */ + pointer by the embedded_offset value. */ #define VALUE_CONTENTS_ALL_RAW(val) ((char *) (val)->aligner.contents) -#define VALUE_CONTENTS_ALL(val) ((void) (VALUE_LAZY(val) && value_fetch_lazy(val)),\ - VALUE_CONTENTS_ALL_RAW(val)) - +#define VALUE_CONTENTS_ALL(val) \ + ((void) (VALUE_LAZY(val) && value_fetch_lazy(val)), \ + VALUE_CONTENTS_ALL_RAW(val)) extern int value_fetch_lazy (struct value *val); @@ -215,16 +227,17 @@ extern int value_fetch_lazy (struct value *val); #define VALUE_POINTED_TO_OFFSET(val) ((val)->pointed_to_offset) #define VALUE_BFD_SECTION(val) ((val)->bfd_section) -/* Convert a REF to the object referenced. */ +/* Convert a REF to the object referenced. */ -#define COERCE_REF(arg) \ -do { struct type *value_type_arg_tmp = check_typedef (VALUE_TYPE (arg));\ - if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF) \ - arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp), \ - unpack_pointer (VALUE_TYPE (arg), \ - VALUE_CONTENTS (arg)), \ - VALUE_BFD_SECTION (arg)); \ - } while (0) +#define COERCE_REF(arg) \ + do { \ + struct type *value_type_arg_tmp = check_typedef (VALUE_TYPE (arg)); \ + if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF) \ + arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp), \ + unpack_pointer (VALUE_TYPE (arg), \ + VALUE_CONTENTS (arg)), \ + VALUE_BFD_SECTION (arg)); \ + } while (0) /* If ARG is an array, convert it to a pointer. If ARG is an enum, convert it to an integer. @@ -232,17 +245,18 @@ do { struct type *value_type_arg_tmp = check_typedef (VALUE_TYPE (arg));\ References are dereferenced. */ -#define COERCE_ARRAY(arg) \ -do { COERCE_REF(arg); \ - if (current_language->c_style_arrays \ - && TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ARRAY) \ - arg = value_coerce_array (arg); \ - if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_FUNC) \ - arg = value_coerce_function (arg); \ -} while (0) +#define COERCE_ARRAY(arg) \ + do { \ + COERCE_REF(arg); \ + if (current_language->c_style_arrays \ + && TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ARRAY) \ + arg = value_coerce_array (arg); \ + if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_FUNC) \ + arg = value_coerce_function (arg); \ + } while (0) -#define COERCE_NUMBER(arg) \ - do { COERCE_ARRAY(arg); COERCE_ENUM(arg); } while (0) +#define COERCE_NUMBER(arg) \ + do { COERCE_ARRAY(arg); COERCE_ENUM(arg); } while (0) /* NOTE: cagney/2002-12-17: This macro was handling a chill language problem but that language has gone away. */ @@ -250,22 +264,23 @@ do { COERCE_REF(arg); \ /* If ARG is an enum, convert it to an integer. */ -#define COERCE_ENUM(arg) { \ - if (TYPE_CODE (check_typedef (VALUE_TYPE (arg))) == TYPE_CODE_ENUM) \ - arg = value_cast (builtin_type_unsigned_int, arg); \ -} +#define COERCE_ENUM(arg) \ + do { \ + if (TYPE_CODE (check_typedef (VALUE_TYPE (arg))) == TYPE_CODE_ENUM) \ + arg = value_cast (builtin_type_unsigned_int, arg); \ + } while (0) /* Internal variables (variables for convenience of use of debugger) are recorded as a chain of these structures. */ struct internalvar - { - struct internalvar *next; - char *name; - struct value *value; - }; +{ + struct internalvar *next; + char *name; + struct value *value; +}; -/* Pointer to member function. Depends on compiler implementation. */ +/* Pointer to member function. Depends on compiler implementation. */ #define METHOD_PTR_IS_VIRTUAL(ADDR) ((ADDR) & 0x80000000) #define METHOD_PTR_FROM_VOFFSET(OFFSET) (0x80000000 + (OFFSET)) @@ -282,32 +297,23 @@ struct fn_field; extern void print_address_demangle (CORE_ADDR, struct ui_file *, int); extern LONGEST value_as_long (struct value *val); - extern DOUBLEST value_as_double (struct value *val); - extern CORE_ADDR value_as_address (struct value *val); extern LONGEST unpack_long (struct type *type, const char *valaddr); - extern DOUBLEST unpack_double (struct type *type, const char *valaddr, int *invp); - extern CORE_ADDR unpack_pointer (struct type *type, const char *valaddr); - extern LONGEST unpack_field_as_long (struct type *type, const char *valaddr, int fieldno); extern struct value *value_from_longest (struct type *type, LONGEST num); - extern struct value *value_from_pointer (struct type *type, CORE_ADDR addr); - extern struct value *value_from_double (struct type *type, DOUBLEST num); - extern struct value *value_from_string (char *string); extern struct value *value_at (struct type *type, CORE_ADDR addr, asection * sect); - extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr, asection * sect); diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index 4f1fcc9..814fedd 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -50,33 +50,6 @@ static gdbarch_deprecated_extract_struct_value_address_ftype vax_extract_struct_value_address; static gdbarch_deprecated_push_dummy_frame_ftype vax_push_dummy_frame; -static gdbarch_fix_call_dummy_ftype vax_fix_call_dummy; - -/* Return 1 if P points to an invalid floating point value. - LEN is the length in bytes -- not relevant on the Vax. */ - -/* FIXME: cagney/2002-01-19: The macro below was originally defined in - tm-vax.h and used in values.c. Two problems. Firstly this is a - very non-portable and secondly it is wrong. The VAX should be - using floatformat and associated methods to identify and handle - invalid floating-point values. Adding to the poor target's woes - there is no floatformat_vax_{f,d} and no TARGET_FLOAT_FORMAT - et.al.. */ - -/* FIXME: cagney/2002-01-19: It turns out that the only thing that - uses this macro is the vax disassembler code (so how old is this - target?). This target should instead be using the opcodes - disassembler. That allowing the macro to be eliminated. */ - -#define INVALID_FLOAT(p, len) ((*(short *) p & 0xff80) == 0x8000) - -/* Vax instructions are never longer than this. */ -#define MAXLEN 62 - -/* Number of elements in the opcode table. */ -#define NOPCODES (sizeof votstrs / sizeof votstrs[0]) - -static unsigned char *print_insn_arg (); static const char * vax_register_name (int regno) @@ -374,228 +347,6 @@ vax_saved_pc_after_call (struct frame_info *frame) return (DEPRECATED_FRAME_SAVED_PC(frame)); } -/* Print the vax instruction at address MEMADDR in debugged memory, - from disassembler info INFO. - Returns length of the instruction, in bytes. */ - -static int -vax_print_insn (CORE_ADDR memaddr, disassemble_info *info) -{ - unsigned char buffer[MAXLEN]; - register int i; - register unsigned char *p; - const char *d; - - int status = (*info->read_memory_func) (memaddr, buffer, MAXLEN, info); - if (status != 0) - { - (*info->memory_error_func) (status, memaddr, info); - return -1; - } - - for (i = 0; i < NOPCODES; i++) - if (votstrs[i].detail.code == buffer[0] - || votstrs[i].detail.code == *(unsigned short *) buffer) - break; - - /* Handle undefined instructions. */ - if (i == NOPCODES) - { - (*info->fprintf_func) (info->stream, "0%o", buffer[0]); - return 1; - } - - (*info->fprintf_func) (info->stream, "%s", votstrs[i].name); - - /* Point at first byte of argument data, - and at descriptor for first argument. */ - p = buffer + 1 + (votstrs[i].detail.code >= 0x100); - d = votstrs[i].detail.args; - - if (*d) - (*info->fprintf_func) (info->stream, " "); - - while (*d) - { - p = print_insn_arg (d, p, memaddr + (p - buffer), info); - d += 2; - if (*d) - (*info->fprintf_func) (info->stream, ","); - } - return p - buffer; -} - -static unsigned char * -print_insn_arg (char *d, register char *p, CORE_ADDR addr, - disassemble_info *info) -{ - register int regnum = *p & 0xf; - float floatlitbuf; - - if (*d == 'b') - { - if (d[1] == 'b') - (*info->fprintf_func) (info->stream, "0x%x", addr + *p++ + 1); - else - { - (*info->fprintf_func) (info->stream, "0x%x", addr + *(short *) p + 2); - p += 2; - } - } - else - switch ((*p++ >> 4) & 0xf) - { - case 0: - case 1: - case 2: - case 3: /* Literal mode */ - if (d[1] == 'd' || d[1] == 'f' || d[1] == 'g' || d[1] == 'h') - { - *(int *) &floatlitbuf = 0x4000 + ((p[-1] & 0x3f) << 4); - (*info->fprintf_func) (info->stream, "$%f", floatlitbuf); - } - else - (*info->fprintf_func) (info->stream, "$%d", p[-1] & 0x3f); - break; - - case 4: /* Indexed */ - p = (char *) print_insn_arg (d, p, addr + 1, info); - (*info->fprintf_func) (info->stream, "[%s]", REGISTER_NAME (regnum)); - break; - - case 5: /* Register */ - (*info->fprintf_func) (info->stream, REGISTER_NAME (regnum)); - break; - - case 7: /* Autodecrement */ - (*info->fprintf_func) (info->stream, "-"); - case 6: /* Register deferred */ - (*info->fprintf_func) (info->stream, "(%s)", REGISTER_NAME (regnum)); - break; - - case 9: /* Autoincrement deferred */ - (*info->fprintf_func) (info->stream, "@"); - if (regnum == PC_REGNUM) - { - (*info->fprintf_func) (info->stream, "#"); - info->target = *(long *) p; - (*info->print_address_func) (info->target, info); - p += 4; - break; - } - case 8: /* Autoincrement */ - if (regnum == PC_REGNUM) - { - (*info->fprintf_func) (info->stream, "#"); - switch (d[1]) - { - case 'b': - (*info->fprintf_func) (info->stream, "%d", *p++); - break; - - case 'w': - (*info->fprintf_func) (info->stream, "%d", *(short *) p); - p += 2; - break; - - case 'l': - (*info->fprintf_func) (info->stream, "%d", *(long *) p); - p += 4; - break; - - case 'q': - (*info->fprintf_func) (info->stream, "0x%x%08x", - ((long *) p)[1], ((long *) p)[0]); - p += 8; - break; - - case 'o': - (*info->fprintf_func) (info->stream, "0x%x%08x%08x%08x", - ((long *) p)[3], ((long *) p)[2], - ((long *) p)[1], ((long *) p)[0]); - p += 16; - break; - - case 'f': - if (INVALID_FLOAT (p, 4)) - (*info->fprintf_func) (info->stream, - "<<invalid float 0x%x>>", - *(int *) p); - else - (*info->fprintf_func) (info->stream, "%f", *(float *) p); - p += 4; - break; - - case 'd': - if (INVALID_FLOAT (p, 8)) - (*info->fprintf_func) (info->stream, - "<<invalid float 0x%x%08x>>", - ((long *) p)[1], ((long *) p)[0]); - else - (*info->fprintf_func) (info->stream, "%f", *(double *) p); - p += 8; - break; - - case 'g': - (*info->fprintf_func) (info->stream, "g-float"); - p += 8; - break; - - case 'h': - (*info->fprintf_func) (info->stream, "h-float"); - p += 16; - break; - - } - } - else - (*info->fprintf_func) (info->stream, "(%s)+", REGISTER_NAME (regnum)); - break; - - case 11: /* Byte displacement deferred */ - (*info->fprintf_func) (info->stream, "@"); - case 10: /* Byte displacement */ - if (regnum == PC_REGNUM) - { - info->target = addr + *p + 2; - (*info->print_address_func) (info->target, info); - } - else - (*info->fprintf_func) (info->stream, "%d(%s)", *p, REGISTER_NAME (regnum)); - p += 1; - break; - - case 13: /* Word displacement deferred */ - (*info->fprintf_func) (info->stream, "@"); - case 12: /* Word displacement */ - if (regnum == PC_REGNUM) - { - info->target = addr + *(short *) p + 3; - (*info->print_address_func) (info->target, info); - } - else - (*info->fprintf_func) (info->stream, "%d(%s)", - *(short *) p, REGISTER_NAME (regnum)); - p += 2; - break; - - case 15: /* Long displacement deferred */ - (*info->fprintf_func) (info->stream, "@"); - case 14: /* Long displacement */ - if (regnum == PC_REGNUM) - { - info->target = addr + *(short *) p + 5; - (*info->print_address_func) (info->target, info); - } - else - (*info->fprintf_func) (info->stream, "%d(%s)", - *(long *) p, REGISTER_NAME (regnum)); - p += 4; - } - - return (unsigned char *) 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. @@ -627,8 +378,8 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_ps_regnum (gdbarch, VAX_PS_REGNUM); set_gdbarch_register_name (gdbarch, vax_register_name); - set_gdbarch_register_size (gdbarch, VAX_REGISTER_SIZE); - set_gdbarch_register_bytes (gdbarch, VAX_REGISTER_BYTES); + 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_max_register_raw_size (gdbarch, VAX_MAX_REGISTER_RAW_SIZE); @@ -667,10 +418,10 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_push_dummy_frame (gdbarch, vax_push_dummy_frame); set_gdbarch_deprecated_pop_frame (gdbarch, vax_pop_frame); set_gdbarch_call_dummy_location (gdbarch, ON_STACK); - set_gdbarch_call_dummy_words (gdbarch, vax_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof_vax_call_dummy_words); - set_gdbarch_fix_call_dummy (gdbarch, vax_fix_call_dummy); - set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 7); + set_gdbarch_deprecated_call_dummy_words (gdbarch, vax_call_dummy_words); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof_vax_call_dummy_words); + set_gdbarch_deprecated_fix_call_dummy (gdbarch, vax_fix_call_dummy); + set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 7); set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); @@ -688,6 +439,8 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); + set_gdbarch_print_insn (gdbarch, print_insn_vax); + return (gdbarch); } @@ -695,6 +448,4 @@ void _initialize_vax_tdep (void) { gdbarch_register (bfd_arch_vax, vax_gdbarch_init, NULL); - - deprecated_tm_print_insn = vax_print_insn; } diff --git a/gdb/version.in b/gdb/version.in index 08b7d9e..0729879 100644 --- a/gdb/version.in +++ b/gdb/version.in @@ -1 +1 @@ -2003-04-30-cvs +2003-05-23-cvs diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index 5872d54..121c85e 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -112,7 +112,7 @@ static struct register_info x86_64_register_info_table[] = { 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, 1, 2, 3, /* RAX - RDX */ + 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 */ @@ -954,14 +954,14 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) in use on any of the supported x86-64 targets. */ set_gdbarch_register_name (gdbarch, x86_64_register_name); - set_gdbarch_register_size (gdbarch, 8); + set_gdbarch_deprecated_register_size (gdbarch, 8); /* 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_register_bytes (gdbarch, sum); + set_gdbarch_deprecated_register_bytes (gdbarch, sum); set_gdbarch_register_raw_size (gdbarch, x86_64_register_raw_size); set_gdbarch_register_byte (gdbarch, x86_64_register_byte); diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index e7ccb43..94c9a1c 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -1469,7 +1469,7 @@ process_xcoff_symbol (register struct coff_symbol *cs, struct objfile *objfile) /* default assumptions */ SYMBOL_VALUE_ADDRESS (sym) = cs->c_value + off; - SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_SECTION (sym) = secnum_to_section (cs->c_secnum, objfile); if (ISFCN (cs->c_type)) @@ -2592,7 +2592,7 @@ scan_xcoff_symtab (struct objfile *objfile) namestring = STATIC_TRANSFORM_NAME (namestring); #endif add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_STATIC, + VAR_DOMAIN, LOC_STATIC, &objfile->static_psymbols, 0, symbol.n_value, psymtab_language, objfile); @@ -2603,7 +2603,7 @@ scan_xcoff_symtab (struct objfile *objfile) /* The addresses in these entries are reported to be wrong. See the code that reads 'G's for symtabs. */ add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_STATIC, + VAR_DOMAIN, LOC_STATIC, &objfile->global_psymbols, 0, symbol.n_value, psymtab_language, objfile); @@ -2621,7 +2621,7 @@ scan_xcoff_symtab (struct objfile *objfile) && namestring[0] != ' ')) { add_psymbol_to_list (namestring, p - namestring, - STRUCT_NAMESPACE, LOC_TYPEDEF, + STRUCT_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, symbol.n_value, 0, psymtab_language, objfile); @@ -2629,7 +2629,7 @@ scan_xcoff_symtab (struct objfile *objfile) { /* Also a typedef with the same name. */ add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_TYPEDEF, + VAR_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, symbol.n_value, 0, psymtab_language, objfile); @@ -2645,7 +2645,7 @@ scan_xcoff_symtab (struct objfile *objfile) // OBSOLETE { // OBSOLETE /* Also a typedef with the same name. */ // OBSOLETE add_psymbol_to_list (namestring, p - namestring, -// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF, +// OBSOLETE VAR_DOMAIN, LOC_TYPEDEF, // OBSOLETE &objfile->static_psymbols, // OBSOLETE symbol.n_value, 0, // OBSOLETE psymtab_language, objfile); @@ -2658,7 +2658,7 @@ scan_xcoff_symtab (struct objfile *objfile) if (p != namestring) /* a name is there, not just :T... */ { add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_TYPEDEF, + VAR_DOMAIN, LOC_TYPEDEF, &objfile->static_psymbols, symbol.n_value, 0, psymtab_language, objfile); @@ -2720,7 +2720,7 @@ scan_xcoff_symtab (struct objfile *objfile) /* Note that the value doesn't matter for enum constants in psymtabs, just in symtabs. */ add_psymbol_to_list (p, q - p, - VAR_NAMESPACE, LOC_CONST, + VAR_DOMAIN, LOC_CONST, &objfile->static_psymbols, 0, 0, psymtab_language, objfile); /* Point past the name. */ @@ -2738,7 +2738,7 @@ scan_xcoff_symtab (struct objfile *objfile) case 'c': /* Constant, e.g. from "const" in Pascal. */ add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_CONST, + VAR_DOMAIN, LOC_CONST, &objfile->static_psymbols, symbol.n_value, 0, psymtab_language, objfile); continue; @@ -2755,7 +2755,7 @@ scan_xcoff_symtab (struct objfile *objfile) } symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->static_psymbols, 0, symbol.n_value, psymtab_language, objfile); @@ -2776,7 +2776,7 @@ scan_xcoff_symtab (struct objfile *objfile) } symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); add_psymbol_to_list (namestring, p - namestring, - VAR_NAMESPACE, LOC_BLOCK, + VAR_DOMAIN, LOC_BLOCK, &objfile->global_psymbols, 0, symbol.n_value, psymtab_language, objfile); diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index 1ff96a4..f792423 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -648,7 +648,7 @@ xstormy16_skip_prologue (CORE_ADDR pc) return plg_end; /* Found a function. */ - sym = lookup_symbol (func_name, NULL, VAR_NAMESPACE, NULL, NULL); + sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL, NULL); /* Don't use line number debug info for assembly source files. */ if (sym && SYMBOL_LANGUAGE (sym) != language_asm) { @@ -985,7 +985,7 @@ xstormy16_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr) if (addr2) addr = addr2; } - store_address (buf, TYPE_LENGTH (type), addr); + store_unsigned_integer (buf, TYPE_LENGTH (type), addr); } static CORE_ADDR @@ -1038,8 +1038,8 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_fp_regnum (gdbarch, E_FP_REGNUM); set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM); set_gdbarch_register_name (gdbarch, xstormy16_register_name); - set_gdbarch_register_size (gdbarch, xstormy16_reg_size); - set_gdbarch_register_bytes (gdbarch, E_ALL_REGS_SIZE); + 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_max_register_raw_size (gdbarch, xstormy16_pc_size); @@ -1092,8 +1092,8 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, xstormy16_use_struct_convention); - set_gdbarch_call_dummy_words (gdbarch, call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); + set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words); + set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0); set_gdbarch_breakpoint_from_pc (gdbarch, xstormy16_breakpoint_from_pc); set_gdbarch_char_signed (gdbarch, 0); diff --git a/include/ChangeLog b/include/ChangeLog index 6d18714..8dfa46f 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,24 @@ +2003-05-21 Nick Clifton <nickc@redhat.com> + + * bfdlink.h (struct bfd_link_hash_table): Fix typo in comment. + +2003-05-15 Jim Blandy <jimb@redhat.com> + + * libiberty.h (hex_value): Make the value an unsigned int, to + avoid unexpected sign-extension when cast to unsigned types larger + than int --- like bfd_vma, on some platforms. + (_hex_value): Update declaration. + +2003-05-09 Alan Modra <amodra@bigpond.net.au> + + * xtensa-isa-internal.h (xtensa_isa_module_struct): Remove const on + gen_num_opcodes_fn return type. + +2003-05-07 Jason Merrill <jason@redhat.com> + + * hashtab.h (iterative_hash): Prototype. + (iterative_hash_object): New macro. + 2003-04-28 H.J. Lu <hjl@gnu.org> * bfdlink.h (bfd_link_info): Add relax_finalizing. diff --git a/include/bfdlink.h b/include/bfdlink.h index 380923a..89d916e 100644 --- a/include/bfdlink.h +++ b/include/bfdlink.h @@ -163,7 +163,7 @@ struct bfd_link_hash_table struct bfd_link_hash_entry *undefs; /* Entries are added to the tail of the undefs list. */ struct bfd_link_hash_entry *undefs_tail; - /* The type of the ink hash table. */ + /* The type of the link hash table. */ enum bfd_link_hash_table_type type; }; diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index 945ce63..59e05e3 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,4 +1,14 @@ -2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.com> +2003-05-15 Roland McGrath <roland@redhat.com> + + * common.h (NT_AUXV, AT_*): New macros. + * external.h (Elf32_External_Auxv, Elf64_External_Auxv): New types. + * internal.h (Elf_Internal_Auxv): New type. + +2003-05-14 Michael Snyder <msnyder@redhat.com> + From Bernd Schmidt <bernds@redhat.com> + * h8.h (E_H8_MACH_H8300SX): New. + +2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.com> * elf/h8.h (E_H8_MACH_H8300HN, E_H8_MACH_H8300SN): New @@ -26,7 +36,7 @@ 2003-03-25 Stan Cox <scox@redhat.com> Nick Clifton <nickc@redhat.com> - + Contribute support for Intel's iWMMXt chip - an ARM variant: * arm.h (ARM_NOTE_SECTION): Define. diff --git a/include/elf/common.h b/include/elf/common.h index ca79342..f342d57 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -253,7 +253,7 @@ #define EM_CYGNUS_FRV 0x5441 /* Ubicom IP2xxx; no ABI */ -#define EM_IP2K_OLD 0x8217 +#define EM_IP2K_OLD 0x8217 /* MSP430 magic number Written in the absense everything. */ @@ -364,6 +364,7 @@ #define NT_FPREGSET 2 /* Contains copy of fpregset struct */ #define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ #define NT_TASKSTRUCT 4 /* Contains copy of task struct */ +#define NT_AUXV 6 /* Contains copy of Elfxx_auxv_t */ #define NT_PRXFPREG 0x46e62b7f /* Contains a user_xfpregs_struct; */ /* note name must be "LINUX". */ @@ -471,7 +472,7 @@ /* The following constants control how a symbol may be accessed once it has become part of an executable or shared library. */ - + #define STV_DEFAULT 0 /* Visibility is specified by binding type */ #define STV_INTERNAL 1 /* OS specific version of STV_HIDDEN */ #define STV_HIDDEN 2 /* Can only be seen inside currect component */ @@ -687,4 +688,35 @@ #define GRP_COMDAT 0x1 /* A COMDAT group */ +/* Auxv a_type values. */ + +#define AT_NULL 0 /* End of vector */ +#define AT_IGNORE 1 /* Entry should be ignored */ +#define AT_EXECFD 2 /* File descriptor of program */ +#define AT_PHDR 3 /* Program headers for program */ +#define AT_PHENT 4 /* Size of program header entry */ +#define AT_PHNUM 5 /* Number of program headers */ +#define AT_PAGESZ 6 /* System page size */ +#define AT_BASE 7 /* Base address of interpreter */ +#define AT_FLAGS 8 /* Flags */ +#define AT_ENTRY 9 /* Entry point of program */ +#define AT_NOTELF 10 /* Program is not ELF */ +#define AT_UID 11 /* Real uid */ +#define AT_EUID 12 /* Effective uid */ +#define AT_GID 13 /* Real gid */ +#define AT_EGID 14 /* Effective gid */ +#define AT_CLKTCK 17 /* Frequency of times() */ +#define AT_PLATFORM 15 /* String identifying platform. */ +#define AT_HWCAP 16 /* Machine dependent hints about + processor capabilities. */ +#define AT_FPUCW 18 /* Used FPU control word. */ +#define AT_DCACHEBSIZE 19 /* Data cache block size. */ +#define AT_ICACHEBSIZE 20 /* Instruction cache block size. */ +#define AT_UCACHEBSIZE 21 /* Unified cache block size. */ +#define AT_IGNOREPPC 22 /* Entry should be ignored */ +/* Pointer to the global system page used for system calls and other + nice things. */ +#define AT_SYSINFO 32 +#define AT_SYSINFO_EHDR 33 + #endif /* _ELF_COMMON_H */ diff --git a/include/elf/external.h b/include/elf/external.h index 403ee62..a171439 100644 --- a/include/elf/external.h +++ b/include/elf/external.h @@ -258,4 +258,19 @@ typedef struct unsigned char si_flags[2]; } Elf_External_Syminfo; + +/* This structure appears on the stack and in NT_AUXV core file notes. */ +typedef struct +{ + unsigned char a_type[4]; + unsigned char a_val[4]; +} Elf32_External_Auxv; + +typedef struct +{ + unsigned char a_type[8]; + unsigned char a_val[8]; +} Elf64_External_Auxv; + + #endif /* _ELF_EXTERNAL_H */ diff --git a/include/elf/h8.h b/include/elf/h8.h index 5fdf62c..79c0a34 100644 --- a/include/elf/h8.h +++ b/include/elf/h8.h @@ -94,5 +94,6 @@ END_RELOC_NUMBERS (R_H8_max) #define E_H8_MACH_H8300S 0x00820000 #define E_H8_MACH_H8300HN 0x00830000 #define E_H8_MACH_H8300SN 0x00840000 +#define E_H8_MACH_H8300SX 0x00850000 #endif diff --git a/include/elf/internal.h b/include/elf/internal.h index 45d682a..a7299d9 100644 --- a/include/elf/internal.h +++ b/include/elf/internal.h @@ -214,6 +214,13 @@ typedef struct unsigned short int si_flags; } Elf_Internal_Syminfo; +/* This structure appears on the stack and in NT_AUXV core file notes. */ +typedef struct +{ + bfd_vma a_type; + bfd_vma a_val; +} Elf_Internal_Auxv; + /* This structure is used to describe how sections should be assigned to program segments. */ diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog index 9a216a0..77a8551 100644 --- a/include/gdb/ChangeLog +++ b/include/gdb/ChangeLog @@ -1,3 +1,9 @@ +2003-05-07 Andrew Cagney <cagney@redhat.com> + + * sim-d10v.h (sim_d10v_translate_addr): Add regcache parameter. + (sim_d10v_translate_imap_addr): Add regcache parameter. + (sim_d10v_translate_dmap_addr): Ditto. + 2003-03-27 Nick Clifton <nickc@redhat.com> * sim-arm.h (sim_arm_regs): Add iWMMXt registers. diff --git a/include/gdb/sim-d10v.h b/include/gdb/sim-d10v.h index f153a41..8294b14 100644 --- a/include/gdb/sim-d10v.h +++ b/include/gdb/sim-d10v.h @@ -58,20 +58,23 @@ extern unsigned long sim_d10v_translate_dmap_addr (unsigned long offset, int nr_bytes, unsigned long *phys, - unsigned long (*dmap_register) (int reg_nr)); + void *regcache, + unsigned long (*dmap_register) (void *regcache, int reg_nr)); extern unsigned long sim_d10v_translate_imap_addr (unsigned long offset, int nr_bytes, unsigned long *phys, - unsigned long (*imap_register) (int reg_nr)); + void *regcache, + unsigned long (*imap_register) (void *regcache, int reg_nr)); extern unsigned long sim_d10v_translate_addr (unsigned long vaddr, int nr_bytes, unsigned long *phys, - unsigned long (*dmap_register) (int reg_nr), - unsigned long (*imap_register) (int reg_nr)); + void *regcache, + unsigned long (*dmap_register) (void *regcache, int reg_nr), + unsigned long (*imap_register) (void *regcache, int reg_nr)); /* The simulator makes use of the following register information. */ diff --git a/include/hashtab.h b/include/hashtab.h index 7acb5eb..f7bd4ae 100644 --- a/include/hashtab.h +++ b/include/hashtab.h @@ -183,6 +183,11 @@ extern htab_eq htab_eq_pointer; /* A hash function for null-terminated strings. */ extern hashval_t htab_hash_string PARAMS ((const PTR)); +/* An iterative hash function for arbitrary data. */ +extern hashval_t iterative_hash PARAMS ((const PTR, size_t, hashval_t)); +/* Shorthand for hashing something with an intrinsic size. */ +#define iterative_hash_object(OB,INIT) iterative_hash (&OB, sizeof (OB), INIT) + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/include/libiberty.h b/include/libiberty.h index 676ceab..761b2cf 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -254,12 +254,12 @@ extern double physmem_available PARAMS ((void)); #define _hex_array_size 256 #define _hex_bad 99 -extern const char _hex_value[_hex_array_size]; +extern const unsigned char _hex_value[_hex_array_size]; extern void hex_init PARAMS ((void)); #define hex_p(c) (hex_value (c) != _hex_bad) /* If you change this, note well: Some code relies on side effects in the argument being performed exactly once. */ -#define hex_value(c) (_hex_value[(unsigned char) (c)]) +#define hex_value(c) ((unsigned int) _hex_value[(unsigned char) (c)]) /* Definitions used by the pexecute routine. */ diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index 8080909..48004d0 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,3 +1,27 @@ +2003-05-20 Jason Eckhardt <jle@rice.edu> + + opcode/i860.h (flush): Set lower 3 bits properly and use 'L' + for the immediate operand type instead of 'i'. + +2003-05-20 Jason Eckhardt <jle@rice.edu> + + opcode/i860.h (fzchks): Both S and R bits must be set. + (pfzchks): Likewise. + (faddp): Likewise. + (pfaddp): Likewise. + (fix.ss): Remove (invalid instruction). + (pfix.ss): Likewise. + (ftrunc.ss): Likewise. + (pftrunc.ss): Likewise. + +2003-05-18 Jason Eckhardt <jle@rice.edu> + + * i860.h (form, pform): Add missing .dd suffix. + +2003-05-13 Stephane Carrez <stcarrez@nerim.fr> + + * m68hc11.h (M68HC12_BANK_VIRT): Define to 0x010000 + 2003-04-07 Michael Snyder <msnyder@redhat.com> * h8300.h (ldc/stc): Fix up src/dst swaps. diff --git a/include/opcode/i860.h b/include/opcode/i860.h index 2d6ea19..6fdcdba 100644 --- a/include/opcode/i860.h +++ b/include/opcode/i860.h @@ -1,5 +1,5 @@ /* Table of opcodes for the i860. - Copyright 1989, 1991, 2000 Free Software Foundation, Inc. + Copyright 1989, 1991, 2000, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler, and GDB, the GNU disassembler. @@ -176,8 +176,8 @@ static const struct i860_opcode i860_opcodes[] = { "trap", 0x44000000, 0xb8000000, "1,2,d", 0 }, /* trap isrc1ni,isrc2,idest */ -{ "flush", 0x34000000, 0xc81f0001, "i(2)", E_ADDR }, /* flush #const(isrc2) */ -{ "flush", 0x34000001, 0xc81f0000, "i(2)++", E_ADDR }, /* flush #const(isrc2)++ */ +{ "flush", 0x34000004, 0xc81f0003, "L(2)", E_ADDR }, /* flush #const(isrc2) */ +{ "flush", 0x34000005, 0xc81f0002, "L(2)++", E_ADDR }, /* flush #const(isrc2)++ */ { "and", 0xc0000000, 0x3c000000, "1,2,d", 0 }, /* and isrc1,isrc2,idest */ { "and", 0xc4000000, 0x38000000, "i,2,d", E_AND }, /* and #const,isrc2,idest */ @@ -433,10 +433,8 @@ static const struct i860_opcode i860_opcodes[] = { "pfsub.ss", 0x48000431, 0xb40001ce, "e,f,g", 0 }, /* pfsub.p fsrc1,fsrc2,fdest */ { "pfsub.sd", 0x480004b1, 0xb400014e, "e,f,g", 0 }, /* pfsub.p fsrc1,fsrc2,fdest */ { "pfsub.dd", 0x480005b1, 0xb400004e, "e,f,g", 0 }, /* pfsub.p fsrc1,fsrc2,fdest */ -{ "fix.ss", 0x48000032, 0xb40005cd, "e,g", 0 }, /* fix.p fsrc1,fdest */ { "fix.sd", 0x480000b2, 0xb400054d, "e,g", 0 }, /* fix.p fsrc1,fdest */ { "fix.dd", 0x480001b2, 0xb400044d, "e,g", 0 }, /* fix.p fsrc1,fdest */ -{ "pfix.ss", 0x48000432, 0xb40001cd, "e,g", 0 }, /* pfix.p fsrc1,fdest */ { "pfix.sd", 0x480004b2, 0xb400014d, "e,g", 0 }, /* pfix.p fsrc1,fdest */ { "pfix.dd", 0x480005b2, 0xb400004d, "e,g", 0 }, /* pfix.p fsrc1,fdest */ { "famov.ss", 0x48000033, 0xb40005cc, "e,g", 0 }, /* famov.p fsrc1,fdest */ @@ -455,10 +453,8 @@ static const struct i860_opcode i860_opcodes[] = { "pfle.dd", 0x480005b4, 0xb400004b, "e,f,g", 0 }, /* pfle.p fsrc1,fsrc2,fdest */ { "pfeq.ss", 0x48000435, 0xb40001ca, "e,f,g", 0 }, /* pfeq.p fsrc1,fsrc2,fdest */ { "pfeq.dd", 0x48000535, 0xb40000ca, "e,f,g", 0 }, /* pfeq.p fsrc1,fsrc2,fdest */ -{ "ftrunc.ss", 0x4800003a, 0xb40005c5, "e,g", 0 }, /* ftrunc.p fsrc1,fdest */ { "ftrunc.sd", 0x480000ba, 0xb4000545, "e,g", 0 }, /* ftrunc.p fsrc1,fdest */ { "ftrunc.dd", 0x480001ba, 0xb4000445, "e,g", 0 }, /* ftrunc.p fsrc1,fdest */ -{ "pftrunc.ss", 0x4800043a, 0xb40001c5, "e,g", 0 }, /* pftrunc.p fsrc1,fdest */ { "pftrunc.sd", 0x480004ba, 0xb4000145, "e,g", 0 }, /* pftrunc.p fsrc1,fdest */ { "pftrunc.dd", 0x480005ba, 0xb4000045, "e,g", 0 }, /* pftrunc.p fsrc1,fdest */ { "fxfr", 0x48000040, 0xb40005bf, "e,d", 0 }, /* fxfr fsrc1,idest */ @@ -472,10 +468,10 @@ static const struct i860_opcode i860_opcodes[] = { "pfisub.dd", 0x480005cd, 0xb4000032, "e,f,g", 0 }, /* pfisub.w fsrc1,fsrc2,fdest */ { "fzchkl", 0x480001d7, 0xb4000428, "e,f,g", 0 }, /* fzchkl fsrc1,fsrc2,fdest */ { "pfzchkl", 0x480005d7, 0xb4000028, "e,f,g", 0 }, /* pfzchkl fsrc1,fsrc2,fdest */ -{ "fzchks", 0x4800015f, 0xb4000420, "e,f,g", 0 }, /* fzchks fsrc1,fsrc2,fdest */ -{ "pfzchks", 0x4800055f, 0xb4000020, "e,f,g", 0 }, /* pfzchks fsrc1,fsrc2,fdest */ -{ "faddp", 0x48000050, 0xb40005af, "e,f,g", 0 }, /* faddp fsrc1,fsrc2,fdest */ -{ "pfaddp", 0x48000450, 0xb40001af, "e,f,g", 0 }, /* pfaddp fsrc1,fsrc2,fdest */ +{ "fzchks", 0x480001df, 0xb4000420, "e,f,g", 0 }, /* fzchks fsrc1,fsrc2,fdest */ +{ "pfzchks", 0x480005df, 0xb4000020, "e,f,g", 0 }, /* pfzchks fsrc1,fsrc2,fdest */ +{ "faddp", 0x480001d0, 0xb400042f, "e,f,g", 0 }, /* faddp fsrc1,fsrc2,fdest */ +{ "pfaddp", 0x480005d0, 0xb400002f, "e,f,g", 0 }, /* pfaddp fsrc1,fsrc2,fdest */ { "faddz", 0x480001d1, 0xb400042e, "e,f,g", 0 }, /* faddz fsrc1,fsrc2,fdest */ { "pfaddz", 0x480005d1, 0xb400002e, "e,f,g", 0 }, /* pfaddz fsrc1,fsrc2,fdest */ { "form", 0x480001da, 0xb4000425, "e,g", 0 }, /* form fsrc1,fdest */ diff --git a/include/opcode/m68hc11.h b/include/opcode/m68hc11.h index 5d2fc9b..648c23b 100644 --- a/include/opcode/m68hc11.h +++ b/include/opcode/m68hc11.h @@ -378,7 +378,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * #define M6811_OP_HIGH_ADDR 0x01000000 /* Used internally by gas. */ #define M6811_OP_LOW_ADDR 0x02000000 -#define M68HC12_BANK_VIRT 0x01000000 +#define M68HC12_BANK_VIRT 0x010000 #define M68HC12_BANK_MASK 0x00003fff #define M68HC12_BANK_BASE 0x00008000 #define M68HC12_BANK_SHIFT 14 diff --git a/include/xtensa-isa-internal.h b/include/xtensa-isa-internal.h index d2244c5..7f221ea 100644 --- a/include/xtensa-isa-internal.h +++ b/include/xtensa-isa-internal.h @@ -104,7 +104,7 @@ typedef struct xtensa_isa_internal_struct typedef struct xtensa_isa_module_struct { - const int (*get_num_opcodes_fn) (void); + int (*get_num_opcodes_fn) (void); xtensa_opcode_internal **(*get_opcodes_fn) (void); int (*decode_insn_fn) (const xtensa_insnbuf); struct config_struct *(*get_config_table_fn) (void); diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index ae5a7c5..d26d5ef 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,37 @@ +2003-05-19 Kelley Cook <kelleycook@wideopenwest.com> + + * config.table: Accept i[345867]86 variant. + +2003-05-15 Jim Blandy <jimb@redhat.com> + + * hex.c (_hex_value): Make this unsigned. + (hex_value): Update documentation for new return type. hex_value + now expands to an unsigned int expression, to avoid unexpected + sign extension when we store it in a bfd_vma, which is larger than + int on some platforms. + * functions.texi: Regenerated. + +2003-05-07 Josef Zlomek <zlomekj@suse.cz> + + * splay-tree.c (splay_tree_predecessor): Fix comment. + (splay_tree_successor): Fix comment. + +2003-05-07 Jason Merrill <jason@redhat.com> + + * hashtab.c (iterative_hash): New fn. + * configure.in: Add AC_C_BIGENDIAN_CROSS. + * aclocal.m4: Include accross.m4. + * configure, config.in: Regenerate. + +2003-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * configure.in (AC_CHECK_FUNCS): Don't make multiple calls. + * configure: Regenerate. + +2003-05-03 Carlo Wood <carlo@alinoe.com> + + * cp-demangle.c: Fix typo in "char_traints" string-literal. + 2003-04-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * vsnprintf.c (vsnprintf): Don't pad string with extra nulls. diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4 index 6c5dc6a..a3349f3 100644 --- a/libiberty/aclocal.m4 +++ b/libiberty/aclocal.m4 @@ -1,3 +1,5 @@ +sinclude(../config/accross.m4) + dnl See whether strncmp reads past the end of its string parameters. dnl On some versions of SunOS4 at least, strncmp reads a word at a time dnl but erroneously reads past the end of strings. This can cause diff --git a/libiberty/config.in b/libiberty/config.in index 1cc6d61..14ab379 100644 --- a/libiberty/config.in +++ b/libiberty/config.in @@ -291,6 +291,16 @@ /* Define if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H +/* whether byteorder is bigendian */ +#undef WORDS_BIGENDIAN + +/* Define if the host machine stores words of multi-word integers in + big-endian order. */ +#undef HOST_WORDS_BIG_ENDIAN + +/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ +#undef BYTEORDER + /* Define if errno must be declared even when <errno.h> is included. */ #undef NEED_DECLARATION_ERRNO diff --git a/libiberty/config.table b/libiberty/config.table index df48ce9..1867cfe 100644 --- a/libiberty/config.table +++ b/libiberty/config.table @@ -11,7 +11,7 @@ case "${host}" in *-*-freebsd2.1.*) frag=mh-fbsd21 ;; *-*-freebsd2.2.[012]) frag=mh-fbsd21 ;; i370-*-opened*) frag=mh-openedition ;; - i[345]86-*-windows*) frag=mh-windows ;; + i[34567]86-*-windows*) frag=mh-windows ;; esac if [ -n "${frag}" ]; then @@ -34,7 +34,7 @@ if [ "${shared}" = "yes" ]; then alpha*-*-linux*) frag=mh-elfalphapic ;; arm*-*-*) frag=mh-armpic ;; hppa*-*-*) frag=mh-papic ;; - i[3456]86-*-* | x86_64-*-*) + i[34567]86-*-* | x86_64-*-*) frag=mh-x86pic ;; powerpc*-*-aix*) ;; powerpc*-*-*) frag=mh-ppcpic ;; diff --git a/libiberty/configure b/libiberty/configure index f1ba0c8..d0899a2 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -1198,6 +1198,142 @@ EOF ;; esac +echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 +echo "configure:1203: checking whether byte ordering is bigendian" >&5 +if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_bigendian=unknown +# See if sys/param.h defines the BYTE_ORDER macro. +cat > conftest.$ac_ext <<EOF +#line 1210 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/param.h> +int main() { + +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif +; return 0; } +EOF +if { (eval echo configure:1221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + # It does; now see whether it defined to BIG_ENDIAN or not. +cat > conftest.$ac_ext <<EOF +#line 1225 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/param.h> +int main() { + +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +; return 0; } +EOF +if { (eval echo configure:1236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_bigendian=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_bigendian=no +fi +rm -f conftest* +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +if test $ac_cv_c_bigendian = unknown; then +if test "$cross_compiling" = yes; then + echo $ac_n "cross-compiling... " 2>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1256 "configure" +#include "confdefs.h" +main () { + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +EOF +if { (eval echo configure:1269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_c_bigendian=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_c_bigendian=yes +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_c_bigendian" 1>&6 +if test $ac_cv_c_bigendian = unknown; then +echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 +echo "configure:1287: checking to probe for byte ordering" >&5 + +cat >conftest.c <<EOF +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; } +int main() { _ascii (); _ebcdic (); return 0; } +EOF + if test -f conftest.c ; then + if ${CC-cc} ${CFLAGS} conftest.c -o conftest.o && test -f conftest.o ; then + if test `grep -l BIGenDianSyS conftest.o` ; then + echo $ac_n ' big endian probe OK, ' 1>&6 + ac_cv_c_bigendian=yes + fi + if test `grep -l LiTTleEnDian conftest.o` ; then + echo $ac_n ' little endian probe OK, ' 1>&6 + if test $ac_cv_c_bigendian = yes ; then + ac_cv_c_bigendian=unknown; + else + ac_cv_c_bigendian=no + fi + fi + echo $ac_n 'guessing bigendian ... ' >&6 + fi + fi +echo "$ac_t""$ac_cv_c_bigendian" 1>&6 +fi +if test $ac_cv_c_bigendian = yes; then + cat >> confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 +EOF + + cat >> confdefs.h <<\EOF +#define HOST_WORDS_BIG_ENDIAN 1 +EOF + + BYTEORDER=4321 +else + BYTEORDER=1234 +fi +cat >> confdefs.h <<EOF +#define BYTEORDER $BYTEORDER +EOF + +if test $ac_cv_c_bigendian = unknown; then + { echo "configure: error: unknown endianess - sorry" 1>&2; exit 1; } +fi + @@ -1216,7 +1352,7 @@ esac # 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:1220: checking for a BSD compatible install" >&5 +echo "configure:1356: 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 @@ -1277,7 +1413,7 @@ host_makefile_frag=${frag} # able to link anything, it had better be able to at least compile # something. echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1281: checking how to run the C preprocessor" >&5 +echo "configure:1417: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1292,13 +1428,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1296 "configure" +#line 1432 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1438: \"$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 : @@ -1309,13 +1445,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1313 "configure" +#line 1449 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1319: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1455: \"$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 : @@ -1326,13 +1462,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 1330 "configure" +#line 1466 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1472: \"$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 : @@ -1360,17 +1496,17 @@ for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1364: checking for $ac_hdr" >&5 +echo "configure:1500: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1369 "configure" +#line 1505 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1510: \"$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* @@ -1397,12 +1533,12 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:1401: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:1537: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1406 "configure" +#line 1542 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/wait.h> @@ -1418,7 +1554,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:1422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -1439,12 +1575,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1443: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1579: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1448 "configure" +#line 1584 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -1453,7 +1589,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1475,19 +1611,19 @@ fi echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6 -echo "configure:1479: checking whether errno must be declared" >&5 +echo "configure:1615: checking whether errno must be declared" >&5 if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1484 "configure" +#line 1620 "configure" #include "confdefs.h" #include <errno.h> int main() { int x = errno; ; return 0; } EOF -if { (eval echo configure:1491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libiberty_cv_declare_errno=no else @@ -1509,12 +1645,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1513: checking for ANSI C header files" >&5 +echo "configure:1649: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1518 "configure" +#line 1654 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -1522,7 +1658,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1662: \"$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* @@ -1539,7 +1675,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1543 "configure" +#line 1679 "configure" #include "confdefs.h" #include <string.h> EOF @@ -1557,7 +1693,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1561 "configure" +#line 1697 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -1578,7 +1714,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 1582 "configure" +#line 1718 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1589,7 +1725,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1613,12 +1749,12 @@ EOF fi echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6 -echo "configure:1617: checking for uintptr_t" >&5 +echo "configure:1753: checking for uintptr_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1622 "configure" +#line 1758 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -1654,12 +1790,12 @@ EOF echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:1658: checking for pid_t" >&5 +echo "configure:1794: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1663 "configure" +#line 1799 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -1748,455 +1884,23 @@ checkfuncs="$checkfuncs getsysinfo table sysctl" # These are neither executed nor required, but they help keep # autoheader happy without adding a bunch of text to acconfig.h. if test "x" = "y"; then - for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1755: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1760 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in getcwd getpagesize index insque mkstemps memchr memcmp memcpy -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1810: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1815 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in memmove mempcpy memset putenv random rename rindex sigsetmask -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1865: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1870 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1920: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1925 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in strtod strtol strtoul tmpnam vasprintf vfprintf vprintf -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1975: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1980 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in vsprintf waitpid getrusage on_exit psignal strerror strsignal -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2030: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2035 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in sysconf times sbrk gettimeofday ffs snprintf vsnprintf -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2085: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2090 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2140: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2145 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in realpath canonicalize_file_name + for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock \ + getcwd getpagesize index insque mkstemps memchr memcmp memcpy \ + memmove mempcpy memset putenv random rename rindex sigsetmask \ + strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr \ + strtod strtol strtoul tmpnam vasprintf vfprintf vprintf \ + vsprintf waitpid getrusage on_exit psignal strerror strsignal \ + sysconf times sbrk gettimeofday ffs snprintf vsnprintf \ + pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl \ + realpath canonicalize_file_name do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2195: checking for $ac_func" >&5 +echo "configure:1899: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2200 "configure" +#line 1904 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2219,7 +1923,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1927: \"$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 @@ -2453,7 +2157,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:2457: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2161: 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. @@ -2464,12 +2168,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2468 "configure" +#line 2172 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2177: \"$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 @@ -2495,19 +2199,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:2499: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2203: 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:2506: checking for $ac_func" >&5 +echo "configure:2210: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2511 "configure" +#line 2215 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2530,7 +2234,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2238: \"$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 @@ -2557,12 +2261,12 @@ done echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2561: checking whether alloca needs Cray hooks" >&5 +echo "configure:2265: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2566 "configure" +#line 2270 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -2587,12 +2291,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2591: checking for $ac_func" >&5 +echo "configure:2295: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2596 "configure" +#line 2300 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2615,7 +2319,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2323: \"$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 @@ -2641,7 +2345,7 @@ fi fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2645: checking stack direction for C alloca" >&5 +echo "configure:2349: 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 @@ -2649,7 +2353,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 2653 "configure" +#line 2357 "configure" #include "confdefs.h" find_stack_direction () { @@ -2668,7 +2372,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:2672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2376: \"$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 @@ -2690,17 +2394,17 @@ EOF ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2694: checking for vfork.h" >&5 +echo "configure:2398: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2699 "configure" +#line 2403 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2408: \"$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* @@ -2725,18 +2429,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2729: checking for working vfork" >&5 +echo "configure:2433: 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:2735: checking for vfork" >&5 +echo "configure:2439: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2740 "configure" +#line 2444 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char vfork(); below. */ @@ -2759,7 +2463,7 @@ vfork(); ; return 0; } EOF -if { (eval echo configure:2763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2467: \"$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 @@ -2781,7 +2485,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext <<EOF -#line 2785 "configure" +#line 2489 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -2876,7 +2580,7 @@ main() { } } EOF -if { (eval echo configure:2880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2584: \"$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 @@ -2908,12 +2612,12 @@ fi for ac_func in _doprnt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2912: checking for $ac_func" >&5 +echo "configure:2616: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2917 "configure" +#line 2621 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2936,7 +2640,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2644: \"$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 @@ -2966,12 +2670,12 @@ done for ac_func in _doprnt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2970: checking for $ac_func" >&5 +echo "configure:2674: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2975 "configure" +#line 2679 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2994,7 +2698,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2702: \"$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 @@ -3022,19 +2726,19 @@ done for v in $vars; do echo $ac_n "checking for $v""... $ac_c" 1>&6 -echo "configure:3026: checking for $v" >&5 +echo "configure:2730: checking for $v" >&5 if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3031 "configure" +#line 2735 "configure" #include "confdefs.h" int *p; int main() { extern int $v []; p = $v; ; return 0; } EOF -if { (eval echo configure:3038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2742: \"$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 @@ -3060,12 +2764,12 @@ EOF for ac_func in $checkfuncs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3064: checking for $ac_func" >&5 +echo "configure:2768: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3069 "configure" +#line 2773 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3088,7 +2792,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2796: \"$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 @@ -3113,12 +2817,12 @@ fi done echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6 -echo "configure:3117: checking whether canonicalize_file_name must be declared" >&5 +echo "configure:2821: checking whether canonicalize_file_name must be declared" >&5 if eval "test \"`echo '$''{'libiberty_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3122 "configure" +#line 2826 "configure" #include "confdefs.h" #include "confdefs.h" @@ -3140,7 +2844,7 @@ int main() { char *(*pfn) = (char *(*)) canonicalize_file_name ; return 0; } EOF -if { (eval echo configure:3144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libiberty_cv_decl_needed_canonicalize_file_name=no else @@ -3176,17 +2880,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:3180: checking for $ac_hdr" >&5 +echo "configure:2884: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3185 "configure" +#line 2889 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2894: \"$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* @@ -3215,12 +2919,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3219: checking for $ac_func" >&5 +echo "configure:2923: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3224 "configure" +#line 2928 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3243,7 +2947,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2951: \"$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 @@ -3268,7 +2972,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3272: checking for working mmap" >&5 +echo "configure:2976: 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 @@ -3276,7 +2980,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 3280 "configure" +#line 2984 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -3416,7 +3120,7 @@ main() } EOF -if { (eval echo configure:3420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3124: \"$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 @@ -3440,7 +3144,7 @@ fi echo $ac_n "checking for working strncmp""... $ac_c" 1>&6 -echo "configure:3444: checking for working strncmp" >&5 +echo "configure:3148: 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 @@ -3448,7 +3152,7 @@ else ac_cv_func_strncmp_works=no else cat > conftest.$ac_ext <<EOF -#line 3452 "configure" +#line 3156 "configure" #include "confdefs.h" /* Test by Jim Wilson and Kaveh Ghazi. @@ -3512,7 +3216,7 @@ main () } EOF -if { (eval echo configure:3516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3220: \"$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 e142cf5..4a704e8 100644 --- a/libiberty/configure.in +++ b/libiberty/configure.in @@ -114,6 +114,7 @@ AC_SUBST(OUTPUT_OPTION) AC_ISC_POSIX AC_C_CONST AC_C_INLINE +AC_C_BIGENDIAN_CROSS dnl When we start using libtool: dnl Default to a non shared library. This may be overridden by the @@ -217,15 +218,15 @@ checkfuncs="$checkfuncs getsysinfo table sysctl" # These are neither executed nor required, but they help keep # autoheader happy without adding a bunch of text to acconfig.h. if test "x" = "y"; then - AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock) - AC_CHECK_FUNCS(getcwd getpagesize index insque mkstemps memchr memcmp memcpy) - AC_CHECK_FUNCS(memmove mempcpy memset putenv random rename rindex sigsetmask) - AC_CHECK_FUNCS(strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr) - AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf) - AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal) - AC_CHECK_FUNCS(sysconf times sbrk gettimeofday ffs snprintf vsnprintf) - AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl) - AC_CHECK_FUNCS(realpath canonicalize_file_name) + AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock \ + getcwd getpagesize index insque mkstemps memchr memcmp memcpy \ + memmove mempcpy memset putenv random rename rindex sigsetmask \ + strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr \ + strtod strtol strtoul tmpnam vasprintf vfprintf vprintf \ + vsprintf waitpid getrusage on_exit psignal strerror strsignal \ + sysconf times sbrk gettimeofday ffs snprintf vsnprintf \ + pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl \ + realpath canonicalize_file_name) AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.]) AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.]) AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.]) diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 9adf5fd..5dcce55 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -3398,7 +3398,7 @@ demangle_substitution (dm, template_p) } else { - RETURN_IF_ERROR (result_add (dm, "std::basic_istream<char, std::char_traints<char> >")); + RETURN_IF_ERROR (result_add (dm, "std::basic_istream<char, std::char_traits<char> >")); new_last_source_name = "basic_istream"; } *template_p = 0; diff --git a/libiberty/functions.texi b/libiberty/functions.texi index 4261d86..b34c204 100644 --- a/libiberty/functions.texi +++ b/libiberty/functions.texi @@ -337,13 +337,19 @@ or zero if it is not. Note that the value you pass will be cast to @end deftypefn @c hex.c:42 -@deftypefn Extension int hex_value (int @var{c}) +@deftypefn Extension unsigned int hex_value (int @var{c}) Returns the numeric equivalent of the given character when interpreted as a hexidecimal digit. The result is undefined if you pass an invalid hex digit. Note that the value you pass will be cast to @code{unsigned char} within the macro. +The @code{hex_value} macro returns @code{unsigned int}, rather than +signed @code{int}, to make it easier to use in parsing addresses from +hex dump files: a signed @code{int} would be sign-extended when +converted to a wider unsigned type --- like @code{bfd_vma}, on some +systems. + @end deftypefn @c index.c:5 diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index 32067af..3896328 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -709,3 +709,141 @@ htab_hash_string (p) return r; } + +/* DERIVED FROM: +-------------------------------------------------------------------- +lookup2.c, by Bob Jenkins, December 1996, Public Domain. +hash(), hash2(), hash3, and mix() are externally useful functions. +Routines to test the hash are included if SELF_TEST is defined. +You can use this free for any purpose. It has no warranty. +-------------------------------------------------------------------- +*/ + +/* +-------------------------------------------------------------------- +mix -- mix 3 32-bit values reversibly. +For every delta with one or two bit set, and the deltas of all three + high bits or all three low bits, whether the original value of a,b,c + is almost all zero or is uniformly distributed, +* If mix() is run forward or backward, at least 32 bits in a,b,c + have at least 1/4 probability of changing. +* If mix() is run forward, every bit of c will change between 1/3 and + 2/3 of the time. (Well, 22/100 and 78/100 for some 2-bit deltas.) +mix() was built out of 36 single-cycle latency instructions in a + structure that could supported 2x parallelism, like so: + a -= b; + a -= c; x = (c>>13); + b -= c; a ^= x; + b -= a; x = (a<<8); + c -= a; b ^= x; + c -= b; x = (b>>13); + ... + Unfortunately, superscalar Pentiums and Sparcs can't take advantage + of that parallelism. They've also turned some of those single-cycle + latency instructions into multi-cycle latency instructions. Still, + this is the fastest good hash I could find. There were about 2^^68 + to choose from. I only looked at a billion or so. +-------------------------------------------------------------------- +*/ +/* same, but slower, works on systems that might have 8 byte hashval_t's */ +#define mix(a,b,c) \ +{ \ + a -= b; a -= c; a ^= (c>>13); \ + b -= c; b -= a; b ^= (a<< 8); \ + c -= a; c -= b; c ^= ((b&0xffffffff)>>13); \ + a -= b; a -= c; a ^= ((c&0xffffffff)>>12); \ + b -= c; b -= a; b = (b ^ (a<<16)) & 0xffffffff; \ + c -= a; c -= b; c = (c ^ (b>> 5)) & 0xffffffff; \ + a -= b; a -= c; a = (a ^ (c>> 3)) & 0xffffffff; \ + b -= c; b -= a; b = (b ^ (a<<10)) & 0xffffffff; \ + c -= a; c -= b; c = (c ^ (b>>15)) & 0xffffffff; \ +} + +/* +-------------------------------------------------------------------- +hash() -- hash a variable-length key into a 32-bit value + k : the key (the unaligned variable-length array of bytes) + len : the length of the key, counting by bytes + level : can be any 4-byte value +Returns a 32-bit value. Every bit of the key affects every bit of +the return value. Every 1-bit and 2-bit delta achieves avalanche. +About 36+6len instructions. + +The best hash table sizes are powers of 2. There is no need to do +mod a prime (mod is sooo slow!). If you need less than 32 bits, +use a bitmask. For example, if you need only 10 bits, do + h = (h & hashmask(10)); +In which case, the hash table should have hashsize(10) elements. + +If you are hashing n strings (ub1 **)k, do it like this: + for (i=0, h=0; i<n; ++i) h = hash( k[i], len[i], h); + +By Bob Jenkins, 1996. bob_jenkins@burtleburtle.net. You may use this +code any way you wish, private, educational, or commercial. It's free. + +See http://burtleburtle.net/bob/hash/evahash.html +Use for hash table lookup, or anything where one collision in 2^32 is +acceptable. Do NOT use for cryptographic purposes. +-------------------------------------------------------------------- +*/ + +hashval_t iterative_hash (k_in, length, initval) + const PTR k_in; /* the key */ + register size_t length; /* the length of the key */ + register hashval_t initval; /* the previous hash, or an arbitrary value */ +{ + register const unsigned char *k = (const unsigned char *)k_in; + register hashval_t a,b,c,len; + + /* Set up the internal state */ + len = length; + a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */ + c = initval; /* the previous hash value */ + + /*---------------------------------------- handle most of the key */ +#ifndef WORDS_BIGENDIAN + /* On a little-endian machine, if the data is 4-byte aligned we can hash + by word for better speed. This gives nondeterministic results on + big-endian machines. */ + if (sizeof (hashval_t) == 4 && (((size_t)k)&3) == 0) + while (len >= 12) /* aligned */ + { + a += *(hashval_t *)(k+0); + b += *(hashval_t *)(k+4); + c += *(hashval_t *)(k+8); + mix(a,b,c); + k += 12; len -= 12; + } + else /* unaligned */ +#endif + while (len >= 12) + { + a += (k[0] +((hashval_t)k[1]<<8) +((hashval_t)k[2]<<16) +((hashval_t)k[3]<<24)); + b += (k[4] +((hashval_t)k[5]<<8) +((hashval_t)k[6]<<16) +((hashval_t)k[7]<<24)); + c += (k[8] +((hashval_t)k[9]<<8) +((hashval_t)k[10]<<16)+((hashval_t)k[11]<<24)); + mix(a,b,c); + k += 12; len -= 12; + } + + /*------------------------------------- handle the last 11 bytes */ + c += length; + switch(len) /* all the case statements fall through */ + { + case 11: c+=((hashval_t)k[10]<<24); + case 10: c+=((hashval_t)k[9]<<16); + case 9 : c+=((hashval_t)k[8]<<8); + /* the first byte of c is reserved for the length */ + case 8 : b+=((hashval_t)k[7]<<24); + case 7 : b+=((hashval_t)k[6]<<16); + case 6 : b+=((hashval_t)k[5]<<8); + case 5 : b+=k[4]; + case 4 : a+=((hashval_t)k[3]<<24); + case 3 : a+=((hashval_t)k[2]<<16); + case 2 : a+=((hashval_t)k[1]<<8); + case 1 : a+=k[0]; + /* case 0: nothing left to add */ + } + mix(a,b,c); + /*-------------------------------------------- report the result */ + return c; +} diff --git a/libiberty/hex.c b/libiberty/hex.c index 5f82292..f425509 100644 --- a/libiberty/hex.c +++ b/libiberty/hex.c @@ -39,13 +39,19 @@ or zero if it is not. Note that the value you pass will be cast to @end deftypefn -@deftypefn Extension int hex_value (int @var{c}) +@deftypefn Extension unsigned int hex_value (int @var{c}) Returns the numeric equivalent of the given character when interpreted as a hexidecimal digit. The result is undefined if you pass an invalid hex digit. Note that the value you pass will be cast to @code{unsigned char} within the macro. +The @code{hex_value} macro returns @code{unsigned int}, rather than +signed @code{int}, to make it easier to use in parsing addresses from +hex dump files: a signed @code{int} would be sign-extended when +converted to a wider unsigned type --- like @code{bfd_vma}, on some +systems. + @end deftypefn @undocumented _hex_array_size @@ -60,7 +66,7 @@ invalid hex digit. Note that the value you pass will be cast to && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21 \ && EOF == -1 -const char _hex_value[_hex_array_size] = +const unsigned char _hex_value[_hex_array_size] = { _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* NUL SOH STX ETX */ _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* EOT ENQ ACK BEL */ @@ -139,7 +145,7 @@ const char _hex_value[_hex_array_size] = #else -char _hex_value[_hex_array_size]; +unsigned char _hex_value[_hex_array_size]; #endif /* not ASCII */ diff --git a/libiberty/splay-tree.c b/libiberty/splay-tree.c index 6f90fde..fc98db1 100644 --- a/libiberty/splay-tree.c +++ b/libiberty/splay-tree.c @@ -472,7 +472,7 @@ splay_tree_predecessor (sp, key) if (comparison < 0) return sp->root; - /* Otherwise, find the leftmost element of the right subtree. */ + /* Otherwise, find the rightmost element of the left subtree. */ node = sp->root->left; if (node) while (node->right) @@ -505,7 +505,7 @@ splay_tree_successor (sp, key) if (comparison > 0) return sp->root; - /* Otherwise, find the rightmost element of the left subtree. */ + /* Otherwise, find the leftmost element of the right subtree. */ node = sp->root->right; if (node) while (node->left) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 9ff6e84..de8f363 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,37 @@ +2003-05-18 Jason Eckhardt <jle@rice.edu> + + * i860-dis.c (print_insn_i860): Instruction shrd has a dual bit, + print it. + +2003-05-17 Andreas Jaeger <aj@suse.de> + + * Makefile.am (libopcodes_la_LIBADD): Add libbfd.la. + (libopcodes_la_DEPENDENCIES): Add libbfd.la. + * Makefile.in: Regenerated. + +2003-05-16 Nick Clifton <nickc@redhat.com> + + * configure.in (ALL_LINGUAS): Add Romanian translation. + * configure: Regenerate. + * po/ro.po: New file: Romanian translation. + +2003-05-12 Dhananjay Deshpande <dhananjayd@kpitcummins.com> + + * disassemble.c (disassembler): Add support for h8300hn and h8300sn. + +2003-05-09 Alan Modra <amodra@bigpond.net.au> + + * i386-dis.c (print_insn): Test intel_syntax against (char) -1 in + case char is unsigned. + +2003-05-01 Christian Groessler <chris@groessler.org> + + * z8k-dis.c (z8k_lookup_instr): Optimize FETCH_DATA calls. + (unpack_instr): Fix representation of segmented addresses. + (intr_name): Added, contains names of the parameters to the EI/DI + instructions. + (unparse_instr): Fix display of EI/DI parameters. + 2003-04-22 Doug Evans <dje@sebabeach.org> * fr30-desc.c,fr30-desc.h,fr30-opc.c,fr30-opc.h: Regenerate. diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am index df20832..6ec05e4 100644 --- a/opcodes/Makefile.am +++ b/opcodes/Makefile.am @@ -282,8 +282,8 @@ disassemble.lo: disassemble.c $(INCDIR)/dis-asm.h $(LIBTOOL) --mode=compile $(COMPILE) -c @archdefs@ $(srcdir)/disassemble.c libopcodes_la_SOURCES = dis-buf.c disassemble.c -libopcodes_la_DEPENDENCIES = $(OFILES) -libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ +libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la +libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@ # libtool will build .libs/libopcodes.a. We create libopcodes.a in diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in index 0220191..8c03c17 100644 --- a/opcodes/Makefile.in +++ b/opcodes/Makefile.in @@ -392,8 +392,8 @@ OFILES = @BFD_MACHINES@ INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ -I$(srcdir)/../intl -I../intl libopcodes_la_SOURCES = dis-buf.c disassemble.c -libopcodes_la_DEPENDENCIES = $(OFILES) -libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ +libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la +libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@ # libtool will build .libs/libopcodes.a. We create libopcodes.a in diff --git a/opcodes/configure b/opcodes/configure index be6e1b8..bb07938 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -33,7 +33,7 @@ ac_help="$ac_help --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer" ac_help="$ac_help - --install-libbfd controls installation of libbfd and related headers" + --enable-install-libbfd controls installation of libbfd and related headers" ac_help="$ac_help --disable-nls do not use Native Language Support" ac_help="$ac_help @@ -1669,7 +1669,7 @@ irix5* | irix6*) # This must be Linux ELF. linux-gnu*) case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) + alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM @@ -2650,7 +2650,7 @@ else fi -ALL_LINGUAS="fr sv tr es da de id pt_BR" +ALL_LINGUAS="fr sv tr es da de id pt_BR ro" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:2656: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. diff --git a/opcodes/configure.in b/opcodes/configure.in index e4014f1..ea64c84 100644 --- a/opcodes/configure.in +++ b/opcodes/configure.in @@ -78,7 +78,7 @@ AC_EXEEXT AC_PROG_CC -ALL_LINGUAS="fr sv tr es da de id pt_BR" +ALL_LINGUAS="fr sv tr es da de id pt_BR ro" CY_GNU_GETTEXT . ${srcdir}/../bfd/configure.host diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c index 1408f39..2d1358e 100644 --- a/opcodes/disassemble.c +++ b/opcodes/disassemble.c @@ -141,9 +141,11 @@ disassembler (abfd) #endif #ifdef ARCH_h8300 case bfd_arch_h8300: - if (bfd_get_mach(abfd) == bfd_mach_h8300h) + if (bfd_get_mach (abfd) == bfd_mach_h8300h + || bfd_get_mach (abfd) == bfd_mach_h8300hn) disassemble = print_insn_h8300h; - else if (bfd_get_mach(abfd) == bfd_mach_h8300s) + else if (bfd_get_mach (abfd) == bfd_mach_h8300s + || bfd_get_mach (abfd) == bfd_mach_h8300sn) disassemble = print_insn_h8300s; else disassemble = print_insn_h8300; diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 79faee6..be78e83 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -1891,7 +1891,7 @@ print_insn (pc, info) mode_64bit = (info->mach == bfd_mach_x86_64_intel_syntax || info->mach == bfd_mach_x86_64); - if (intel_syntax == -1) + if (intel_syntax == (char) -1) intel_syntax = (info->mach == bfd_mach_i386_i386_intel_syntax || info->mach == bfd_mach_x86_64_intel_syntax); diff --git a/opcodes/i860-dis.c b/opcodes/i860-dis.c index ba183ab..69a106d 100644 --- a/opcodes/i860-dis.c +++ b/opcodes/i860-dis.c @@ -138,8 +138,11 @@ print_insn_i860 (memaddr, info) const char *s; int val; - /* If this a flop and its dual bit is set, prefix with 'd.'. */ - if ((insn & 0xfc000000) == 0x48000000 && (insn & 0x200)) + /* If this a flop (or a shrd) and its dual bit is set, + prefix with 'd.'. */ + if (((insn & 0xfc000000) == 0x48000000 + || (insn & 0xfc000000) == 0xb0000000) + && (insn & 0x200)) (*info->fprintf_func) (info->stream, "d.%s\t", opcode->name); else (*info->fprintf_func) (info->stream, "%s\t", opcode->name); diff --git a/opcodes/z8k-dis.c b/opcodes/z8k-dis.c index 6c19138..69d1792 100644 --- a/opcodes/z8k-dis.c +++ b/opcodes/z8k-dis.c @@ -209,11 +209,13 @@ z8k_lookup_instr (nibbles, info) int nibl_index, tabl_index; int nibl_matched; + int need_fetch = 0; unsigned short instr_nibl; unsigned short tabl_datum, datum_class, datum_value; nibl_matched = 0; tabl_index = 0; + FETCH_DATA (info, 4); while (!nibl_matched && z8k_table[tabl_index].name) { nibl_matched = 1; @@ -222,8 +224,15 @@ z8k_lookup_instr (nibbles, info) nibl_index++) { if ((nibl_index % 4) == 0) - /* Fetch one word at a time. */ - FETCH_DATA (info, nibl_index + 4); + { + /* Fetch data only if it isn't already there. */ + if (nibl_index >= 4 || (nibl_index < 4 && need_fetch)) + FETCH_DATA (info, nibl_index + 4); /* Fetch one word at a time. */ + if (nibl_index < 4) + need_fetch = 0; + else + need_fetch = 1; + } instr_nibl = nibbles[nibl_index]; tabl_datum = z8k_table[tabl_index].byte_info[nibl_index]; @@ -414,14 +423,14 @@ unpack_instr (instr_data, is_segmented, info) FETCH_DATA (info, nibl_count + 8); instr_long = (instr_data->words[nibl_count] << 16) | (instr_data->words[nibl_count + 4]); - instr_data->address = ((instr_word & 0x7f00) << 8) + instr_data->address = ((instr_word & 0x7f00) << 16) + (instr_long & 0xffff); nibl_count += 7; seg_length = 2; } else { - instr_data->address = ((instr_word & 0x7f00) << 8) + instr_data->address = ((instr_word & 0x7f00) << 16) + (instr_word & 0x00ff); nibl_count += 3; } @@ -484,6 +493,13 @@ unpack_instr (instr_data, is_segmented, info) } } +static char *intr_names[] = { + "all", /* 0 */ + "vi", /* 1 */ + "nvi", /* 2 */ + "none" /* 3 */ +}; + static void unparse_instr (instr_data, is_segmented) instr_data_s *instr_data; @@ -536,6 +552,12 @@ unparse_instr (instr_data, is_segmented) strcat (out_str, tmp_str); break; case CLASS_IMM: + if (datum_value == ARG_IMM2) /* True with EI/DI instructions only. */ + { + sprintf (tmp_str, "%s", intr_names[instr_data->interrupts]); + strcat (out_str, tmp_str); + break; + } sprintf (tmp_str, "#0x%0lx", instr_data->immediate); strcat (out_str, tmp_str); break; diff --git a/readline/ChangeLog.gdb b/readline/ChangeLog.gdb index 40eef93..28376b7 100644 --- a/readline/ChangeLog.gdb +++ b/readline/ChangeLog.gdb @@ -1,3 +1,8 @@ +2003-05-13 Andreas Jaeger <aj@suse.de> + + * support/config.guess: Update to 2003-05-09 version. + * support/config.sub: Update to 2003-05-09 version. + 2003-03-03 Joel Brobecker <brobecker@gnat.com> * aclocal.m4: Add check for mbrtowc. diff --git a/readline/support/config.guess b/readline/support/config.guess index ca12b79..6bdac8d 100755 --- a/readline/support/config.guess +++ b/readline/support/config.guess @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2003-01-03' +timestamp='2003-05-09' # 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 @@ -235,72 +235,51 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - *:MicroBSD:*:*) - echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE} - exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - eval $set_cc_for_build - cat <<EOF >$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null - if test "$?" = 0 ; then - case `$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - 2-1307) - UNAME_MACHINE="alphaev68" - ;; - 3-1307) - UNAME_MACHINE="alphaev7" - ;; - esac - fi echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) @@ -765,7 +744,7 @@ EOF *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; - *:FreeBSD:*:*) + *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -1054,7 +1033,7 @@ EOF exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0) + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -1152,7 +1131,11 @@ EOF echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` diff --git a/readline/support/config.sub b/readline/support/config.sub index 04baf3d..fe4f1ed 100755 --- a/readline/support/config.sub +++ b/readline/support/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-01-03' +timestamp='2003-05-09' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -257,7 +257,7 @@ case $basic_machine in | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ @@ -296,7 +296,7 @@ case $basic_machine in | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ @@ -329,11 +329,13 @@ case $basic_machine in | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ @@ -371,6 +373,9 @@ case $basic_machine in basic_machine=a29k-none os=-bsd ;; + amd64) + basic_machine=x86_64-pc + ;; amdahl) basic_machine=580-amdahl os=-sysv @@ -925,6 +930,14 @@ case $basic_machine in basic_machine=tic54x-unknown os=-coff ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -1027,7 +1040,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) @@ -1118,7 +1131,7 @@ case $os in | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -microbsd*) + | -powermax* | -dnix*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1227,6 +1240,12 @@ case $os in -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; -none) ;; *) diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog index 54d84e6..3256284 100644 --- a/sim/d10v/ChangeLog +++ b/sim/d10v/ChangeLog @@ -1,3 +1,15 @@ +2003-05-07 Andrew Cagney <cagney@redhat.com> + + * interp.c (sim_d10v_translate_addr): Add "regcache" parameter. + (sim_d10v_translate_imap_addr): Ditto. + (sim_d10v_translate_dmap_addr): Ditto. + (xfer_mem): Pass NULL regcache to sim_d10v_translate_addr. + (dmem_addr): Pass NULL regcache to sim_d10v_translate_dmap_addr. + (dmap_register, imap_register): Add "regcache" parameter. + (imem_addr): Pass NULL regcache to sim_d10v_translate_imap_addr. + (sim_fetch_register): Pass NULL regcache to imap_register and + dmap_register. + 2003-02-27 Andrew Cagney <cagney@redhat.com> * interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd. diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c index 718acca..30239ab 100644 --- a/sim/d10v/interp.c +++ b/sim/d10v/interp.c @@ -363,7 +363,7 @@ set_dmap_register (int reg_nr, unsigned long value) } static unsigned long -dmap_register (int reg_nr) +dmap_register (void *regcache, int reg_nr) { uint8 *raw = map_memory (SIM_D10V_MEMORY_DATA + DMAP0_OFFSET + 2 * reg_nr); @@ -386,7 +386,7 @@ set_imap_register (int reg_nr, unsigned long value) } static unsigned long -imap_register (int reg_nr) +imap_register (void *regcache, int reg_nr) { uint8 *raw = map_memory (SIM_D10V_MEMORY_DATA + IMAP0_OFFSET + 2 * reg_nr); @@ -440,7 +440,9 @@ unsigned long sim_d10v_translate_dmap_addr (unsigned long offset, int nr_bytes, unsigned long *phys, - unsigned long (*dmap_register) (int reg_nr)) + void *regcache, + unsigned long (*dmap_register) (void *regcache, + int reg_nr)) { short map; int regno; @@ -457,7 +459,7 @@ sim_d10v_translate_dmap_addr (unsigned long offset, /* Don't cross a BLOCK boundary */ nr_bytes = DMAP_BLOCK_SIZE - (offset % DMAP_BLOCK_SIZE); } - map = dmap_register (regno); + map = dmap_register (regcache, regno); if (regno == 3) { /* Always maps to data memory */ @@ -498,7 +500,9 @@ unsigned long sim_d10v_translate_imap_addr (unsigned long offset, int nr_bytes, unsigned long *phys, - unsigned long (*imap_register) (int reg_nr)) + void *regcache, + unsigned long (*imap_register) (void *regcache, + int reg_nr)) { short map; int regno; @@ -517,7 +521,7 @@ sim_d10v_translate_imap_addr (unsigned long offset, /* Don't cross a BLOCK boundary */ nr_bytes = IMAP_BLOCK_SIZE - offset; } - map = imap_register (regno); + map = imap_register (regcache, regno); sp = (map & 0x3000) >> 12; segno = (map & 0x007f); switch (sp) @@ -549,8 +553,11 @@ unsigned long sim_d10v_translate_addr (unsigned long memaddr, int nr_bytes, unsigned long *targ_addr, - unsigned long (*dmap_register) (int reg_nr), - unsigned long (*imap_register) (int reg_nr)) + void *regcache, + unsigned long (*dmap_register) (void *regcache, + int reg_nr), + unsigned long (*imap_register) (void *regcache, + int reg_nr)) { unsigned long phys; unsigned long seg; @@ -614,12 +621,12 @@ sim_d10v_translate_addr (unsigned long memaddr, break; case 0x10: /* in logical data address segment */ - nr_bytes = sim_d10v_translate_dmap_addr (off, nr_bytes, &phys, + nr_bytes = sim_d10v_translate_dmap_addr (off, nr_bytes, &phys, regcache, dmap_register); break; case 0x11: /* in logical instruction address segment */ - nr_bytes = sim_d10v_translate_imap_addr (off, nr_bytes, &phys, + nr_bytes = sim_d10v_translate_imap_addr (off, nr_bytes, &phys, regcache, imap_register); break; @@ -720,10 +727,8 @@ xfer_mem (SIM_ADDR virt, uint8 *memory; unsigned long phys; int phys_size; - phys_size = sim_d10v_translate_addr (virt, size, - &phys, - dmap_register, - imap_register); + phys_size = sim_d10v_translate_addr (virt, size, &phys, NULL, + dmap_register, imap_register); if (phys_size == 0) return xfered; @@ -892,7 +897,7 @@ dmem_addr (uint16 offset) things like ``0xfffe + 0x0e60 == 0x10e5d''. Since offset's type is uint16 this is modulo'ed onto 0x0e5d. */ - phys_size = sim_d10v_translate_dmap_addr (offset, 1, &phys, + phys_size = sim_d10v_translate_dmap_addr (offset, 1, &phys, NULL, dmap_register); if (phys_size == 0) { @@ -919,7 +924,8 @@ imem_addr (uint32 offset) { unsigned long phys; uint8 *mem; - int phys_size = sim_d10v_translate_imap_addr (offset, 1, &phys, imap_register); + int phys_size = sim_d10v_translate_imap_addr (offset, 1, &phys, NULL, + imap_register); if (phys_size == 0) { return State.mem.fault; @@ -1367,14 +1373,14 @@ sim_fetch_register (sd, rn, memory, length) break; case SIM_D10V_IMAP0_REGNUM: case SIM_D10V_IMAP1_REGNUM: - WRITE_16 (memory, imap_register (rn - SIM_D10V_IMAP0_REGNUM)); + WRITE_16 (memory, imap_register (NULL, rn - SIM_D10V_IMAP0_REGNUM)); size = 2; break; case SIM_D10V_DMAP0_REGNUM: case SIM_D10V_DMAP1_REGNUM: case SIM_D10V_DMAP2_REGNUM: case SIM_D10V_DMAP3_REGNUM: - WRITE_16 (memory, dmap_register (rn - SIM_D10V_DMAP0_REGNUM)); + WRITE_16 (memory, dmap_register (NULL, rn - SIM_D10V_DMAP0_REGNUM)); size = 2; break; case SIM_D10V_TS2_DMAP_REGNUM: diff --git a/sim/igen/ChangeLog b/sim/igen/ChangeLog index b36e4f0..db27cb8 100644 --- a/sim/igen/ChangeLog +++ b/sim/igen/ChangeLog @@ -1,3 +1,7 @@ +2003-05-03 Chris Demetriou <cgd@broadcom.com> + + * compare_igen_models: Tweak attribution slightly. + 2002-11-22 Andrew Cagney <cagney@redhat.com> * gen.c (name_cmp): Rename format_name_cmp. diff --git a/sim/igen/compare_igen_models b/sim/igen/compare_igen_models index 3c3e46a..a842be9 100755 --- a/sim/igen/compare_igen_models +++ b/sim/igen/compare_igen_models @@ -2,7 +2,7 @@ # Script to compare functions and instructions used by different igen models. # Copyright (C) 2002 Free Software Foundation, Inc. -# Contributed by Broadcom Corporation (SiByte). +# Contributed by Chris Demetriou of Broadcom Corporation (SiByte). # # This file is part of GDB, the GNU debugger. # diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog index 2d344b5..4d20a00 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,3 +1,17 @@ +2003-05-16 Ian Lance Taylor <ian@airs.com> + + * Makefile.in (SHELL): Make sure this is defined. + (various): Use $(SHELL) whenever we invoke move-if-change. + +2003-05-03 Chris Demetriou <cgd@broadcom.com> + + * cp1.c: Tweak attribution slightly. + * cp1.h: Likewise. + * mdmx.c: Likewise. + * mdmx.igen: Likewise. + * mips3d.igen: Likewise. + * sb1.igen: Likewise. + 2003-04-15 Richard Sandiford <rsandifo@redhat.com> * vr.igen (do_vr_mul_op): Zero-extend the low 32 bits of diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in index b709ce8..9d198a9 100644 --- a/sim/mips/Makefile.in +++ b/sim/mips/Makefile.in @@ -1,6 +1,8 @@ # Makefile template for Configure for the MIPS simulator. # Written by Cygnus Support. +SHELL = @SHELL@ + ## COMMON_PRE_CONFIG_FRAG srcdir=@srcdir@ @@ -155,21 +157,21 @@ tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE) -n engine.h -he tmp-engine.h \ -n engine.c -e tmp-engine.c \ -n irun.c -r tmp-irun.c - $(srcdir)/../../move-if-change tmp-icache.h icache.h - $(srcdir)/../../move-if-change tmp-icache.c icache.c - $(srcdir)/../../move-if-change tmp-idecode.h idecode.h - $(srcdir)/../../move-if-change tmp-idecode.c idecode.c - $(srcdir)/../../move-if-change tmp-semantics.h semantics.h - $(srcdir)/../../move-if-change tmp-semantics.c semantics.c - $(srcdir)/../../move-if-change tmp-model.h model.h - $(srcdir)/../../move-if-change tmp-model.c model.c - $(srcdir)/../../move-if-change tmp-support.h support.h - $(srcdir)/../../move-if-change tmp-support.c support.c - $(srcdir)/../../move-if-change tmp-itable.h itable.h - $(srcdir)/../../move-if-change tmp-itable.c itable.c - $(srcdir)/../../move-if-change tmp-engine.h engine.h - $(srcdir)/../../move-if-change tmp-engine.c engine.c - $(srcdir)/../../move-if-change tmp-irun.c irun.c + $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h icache.h + $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c icache.c + $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h idecode.h + $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c idecode.c + $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h semantics.h + $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c semantics.c + $(SHELL) $(srcdir)/../../move-if-change tmp-model.h model.h + $(SHELL) $(srcdir)/../../move-if-change tmp-model.c model.c + $(SHELL) $(srcdir)/../../move-if-change tmp-support.h support.h + $(SHELL) $(srcdir)/../../move-if-change tmp-support.c support.c + $(SHELL) $(srcdir)/../../move-if-change tmp-itable.h itable.h + $(SHELL) $(srcdir)/../../move-if-change tmp-itable.c itable.c + $(SHELL) $(srcdir)/../../move-if-change tmp-engine.h engine.h + $(SHELL) $(srcdir)/../../move-if-change tmp-engine.c engine.c + $(SHELL) $(srcdir)/../../move-if-change tmp-irun.c irun.c touch tmp-igen semantics.o: sim-main.h semantics.c $(SIM_EXTRA_DEPS) @@ -233,16 +235,16 @@ tmp-m16: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE) -n m16_support.h -hf tmp-support.h \ -n m16_support.c -f tmp-support.c \ # - $(srcdir)/../../move-if-change tmp-icache.h m16_icache.h - $(srcdir)/../../move-if-change tmp-icache.c m16_icache.c - $(srcdir)/../../move-if-change tmp-idecode.h m16_idecode.h - $(srcdir)/../../move-if-change tmp-idecode.c m16_idecode.c - $(srcdir)/../../move-if-change tmp-semantics.h m16_semantics.h - $(srcdir)/../../move-if-change tmp-semantics.c m16_semantics.c - $(srcdir)/../../move-if-change tmp-model.h m16_model.h - $(srcdir)/../../move-if-change tmp-model.c m16_model.c - $(srcdir)/../../move-if-change tmp-support.h m16_support.h - $(srcdir)/../../move-if-change tmp-support.c m16_support.c + $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h m16_icache.h + $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c m16_icache.c + $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h m16_idecode.h + $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c m16_idecode.c + $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h m16_semantics.h + $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c m16_semantics.c + $(SHELL) $(srcdir)/../../move-if-change tmp-model.h m16_model.h + $(SHELL) $(srcdir)/../../move-if-change tmp-model.c m16_model.c + $(SHELL) $(srcdir)/../../move-if-change tmp-support.h m16_support.h + $(SHELL) $(srcdir)/../../move-if-change tmp-support.c m16_support.c ../igen/igen \ $(IGEN_TRACE) \ -I $(srcdir) \ @@ -268,16 +270,16 @@ tmp-m16: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE) -n m32_support.h -hf tmp-support.h \ -n m32_support.c -f tmp-support.c \ # - $(srcdir)/../../move-if-change tmp-icache.h m32_icache.h - $(srcdir)/../../move-if-change tmp-icache.c m32_icache.c - $(srcdir)/../../move-if-change tmp-idecode.h m32_idecode.h - $(srcdir)/../../move-if-change tmp-idecode.c m32_idecode.c - $(srcdir)/../../move-if-change tmp-semantics.h m32_semantics.h - $(srcdir)/../../move-if-change tmp-semantics.c m32_semantics.c - $(srcdir)/../../move-if-change tmp-model.h m32_model.h - $(srcdir)/../../move-if-change tmp-model.c m32_model.c - $(srcdir)/../../move-if-change tmp-support.h m32_support.h - $(srcdir)/../../move-if-change tmp-support.c m32_support.c + $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h m32_icache.h + $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c m32_icache.c + $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h m32_idecode.h + $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c m32_idecode.c + $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h m32_semantics.h + $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c m32_semantics.c + $(SHELL) $(srcdir)/../../move-if-change tmp-model.h m32_model.h + $(SHELL) $(srcdir)/../../move-if-change tmp-model.c m32_model.c + $(SHELL) $(srcdir)/../../move-if-change tmp-support.h m32_support.h + $(SHELL) $(srcdir)/../../move-if-change tmp-support.c m32_support.c ../igen/igen \ $(IGEN_TRACE) \ -I $(srcdir) \ @@ -291,8 +293,8 @@ tmp-m16: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE) -n itable.h -ht tmp-itable.h \ -n itable.c -t tmp-itable.c \ # - $(srcdir)/../../move-if-change tmp-itable.h itable.h - $(srcdir)/../../move-if-change tmp-itable.c itable.c + $(SHELL) $(srcdir)/../../move-if-change tmp-itable.h itable.h + $(SHELL) $(srcdir)/../../move-if-change tmp-itable.c itable.c touch tmp-m16 @@ -336,18 +338,18 @@ tmp-mach-multi: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE) -n $${p}_engine.h -he tmp-engine.h \ -n $${p}_engine.c -e tmp-engine.c \ ; \ - $(srcdir)/../../move-if-change tmp-icache.h $${p}_icache.h ; \ - $(srcdir)/../../move-if-change tmp-icache.c $${p}_icache.c ; \ - $(srcdir)/../../move-if-change tmp-idecode.h $${p}_idecode.h ; \ - $(srcdir)/../../move-if-change tmp-idecode.c $${p}_idecode.c ; \ - $(srcdir)/../../move-if-change tmp-semantics.h $${p}_semantics.h ; \ - $(srcdir)/../../move-if-change tmp-semantics.c $${p}_semantics.c ; \ - $(srcdir)/../../move-if-change tmp-model.h $${p}_model.h ; \ - $(srcdir)/../../move-if-change tmp-model.c $${p}_model.c ; \ - $(srcdir)/../../move-if-change tmp-support.h $${p}_support.h ; \ - $(srcdir)/../../move-if-change tmp-support.c $${p}_support.c ; \ - $(srcdir)/../../move-if-change tmp-engine.h $${p}_engine.h ; \ - $(srcdir)/../../move-if-change tmp-engine.c $${p}_engine.c ; \ + $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h $${p}_icache.h ; \ + $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c $${p}_icache.c ; \ + $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h $${p}_idecode.h ; \ + $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c $${p}_idecode.c ; \ + $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h $${p}_semantics.h ; \ + $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c $${p}_semantics.c ; \ + $(SHELL) $(srcdir)/../../move-if-change tmp-model.h $${p}_model.h ; \ + $(SHELL) $(srcdir)/../../move-if-change tmp-model.c $${p}_model.c ; \ + $(SHELL) $(srcdir)/../../move-if-change tmp-support.h $${p}_support.h ; \ + $(SHELL) $(srcdir)/../../move-if-change tmp-support.c $${p}_support.c ; \ + $(SHELL) $(srcdir)/../../move-if-change tmp-engine.h $${p}_engine.h ; \ + $(SHELL) $(srcdir)/../../move-if-change tmp-engine.c $${p}_engine.c ; \ done touch tmp-mach-multi tmp-itable-multi: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE) @@ -365,8 +367,8 @@ tmp-itable-multi: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE) -n itable.h -ht tmp-itable.h \ -n itable.c -t tmp-itable.c \ # - $(srcdir)/../../move-if-change tmp-itable.h itable.h - $(srcdir)/../../move-if-change tmp-itable.c itable.c + $(SHELL) $(srcdir)/../../move-if-change tmp-itable.h itable.h + $(SHELL) $(srcdir)/../../move-if-change tmp-itable.c itable.c touch tmp-itable-multi tmp-run-multi: $(srcdir)/m16run.c for t in $(SIM_MULTI_IGEN_CONFIGS); do \ @@ -377,7 +379,7 @@ tmp-run-multi: $(srcdir)/m16run.c -e "s/^sim_/m16$${m}_/" \ -e "s/m16_/m16$${m}_/" \ -e "s/m32_/m32$${m}_/" ; \ - $(srcdir)/../../move-if-change tmp-run m16$${m}_run.c ; \ + $(SHELL) $(srcdir)/../../move-if-change tmp-run m16$${m}_run.c ; \ esac \ done touch tmp-run-multi diff --git a/sim/mips/cp1.c b/sim/mips/cp1.c index ea0f599..556af1a 100644 --- a/sim/mips/cp1.c +++ b/sim/mips/cp1.c @@ -1,9 +1,10 @@ /*> cp1.c <*/ /* MIPS Simulator FPU (CoProcessor 1) support. Copyright (C) 2002 Free Software Foundation, Inc. - Originally created by Cygnus Solutions, modified substially - by Broadcom Corporation (SiByte). Paired-single operation support - and MIPS-3D support contributed by Broadcom Corporation (SiByte). + Originally created by Cygnus Solutions. Extensive modifications, + including paired-single operation support and MIPS-3D support + contributed by Ed Satterthwaite and Chris Demetriou, of Broadcom + Corporation (SiByte). This file is part of GDB, the GNU debugger. diff --git a/sim/mips/cp1.h b/sim/mips/cp1.h index 24901d8..9a189a9 100644 --- a/sim/mips/cp1.h +++ b/sim/mips/cp1.h @@ -2,7 +2,8 @@ /* MIPS Simulator FPU (CoProcessor 1) definitions. Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc. Derived from sim-main.h contributed by Cygnus Solutions, - modified substially by Broadcom Corporation (SiByte). + modified substantially by Ed Satterthwaite of Broadcom Corporation + (SiByte). This file is part of GDB, the GNU debugger. diff --git a/sim/mips/mdmx.c b/sim/mips/mdmx.c index 4955e82..3af59b0 100644 --- a/sim/mips/mdmx.c +++ b/sim/mips/mdmx.c @@ -1,6 +1,7 @@ /* Simulation code for the MIPS MDMX ASE. Copyright (C) 2002 Free Software Foundation, Inc. - Contributed by Broadcom Corporation (SiByte). + Contributed by Ed Satterthwaite and Chris Demetriou, of Broadcom + Corporation (SiByte). This file is part of GDB, the GNU debugger. diff --git a/sim/mips/mdmx.igen b/sim/mips/mdmx.igen index f286e3b..d8edcd7 100644 --- a/sim/mips/mdmx.igen +++ b/sim/mips/mdmx.igen @@ -2,7 +2,8 @@ // Simulator definition for the MIPS MDMX ASE. // Copyright (C) 2002 Free Software Foundation, Inc. -// Contributed by Broadcom Corporation (SiByte). +// Contributed by Ed Satterthwaite and Chris Demetriou, of Broadcom +// Corporation (SiByte). // // This file is part of GDB, the GNU debugger. // diff --git a/sim/mips/mips3d.igen b/sim/mips/mips3d.igen index f7043ef..d24a06c 100644 --- a/sim/mips/mips3d.igen +++ b/sim/mips/mips3d.igen @@ -2,7 +2,8 @@ // Simulator definition for the MIPS MIPS-3D ASE. // Copyright (C) 2002 Free Software Foundation, Inc. -// Contributed by Broadcom Corporation (SiByte). +// Contributed by Ed Satterthwaite and Chris Demetriou, of Broadcom +// Corporation (SiByte). // // This file is part of GDB, the GNU debugger. // diff --git a/sim/mips/sb1.igen b/sim/mips/sb1.igen index 6453670..33c5141 100644 --- a/sim/mips/sb1.igen +++ b/sim/mips/sb1.igen @@ -2,7 +2,8 @@ // Simulator definition for the Broadcom SiByte SB-1 CPU extensions. // Copyright (C) 2002 Free Software Foundation, Inc. -// Contributed by Broadcom Corporation (SiByte). +// Contributed by Ed Satterthwaite and Chris Demetriou, of Broadcom +// Corporation (SiByte). // // This file is part of GDB, the GNU debugger. // diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index b625ac9..b7b1de5 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,8 @@ +2003-05-16 Ian Lance Taylor <ian@airs.com> + + * Makefile.in (various): Use $(SHELL) whenever we invoke + move-if-change. + 2003-02-27 Andrew Cagney <cagney@redhat.com> * sim_calls.c (sim_open, sim_create_inferior): Rename _bfd to bfd. diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in index d69b5c3..0fb8f48 100644 --- a/sim/ppc/Makefile.in +++ b/sim/ppc/Makefile.in @@ -413,17 +413,17 @@ gentmap: ../common/gentmap.c Makefile targ-vals.def targ-vals.def: $(srcdir)/../common/nltvals.def rm -f targ-vals.def tmp-def cat $(srcdir)/../common/nltvals.def > tmp-vals.def - $(srcdir)/../../move-if-change tmp-vals.def targ-vals.def + $(SHELL) $(srcdir)/../../move-if-change tmp-vals.def targ-vals.def targ-vals.h: Makefile gentmap $(srcdir)/../../move-if-change rm -f tmp-vals.h ./gentmap -h > tmp-vals.h - $(srcdir)/../../move-if-change tmp-vals.h targ-vals.h + $(SHELL) $(srcdir)/../../move-if-change tmp-vals.h targ-vals.h targ-map.c: Makefile gentmap $(srcdir)/../../move-if-change rm -f tmp-map.c ./gentmap -c > tmp-map.c - $(srcdir)/../../move-if-change tmp-map.c targ-map.c + $(SHELL) $(srcdir)/../../move-if-change tmp-map.c targ-map.c callback.o: ../common/callback.c targ-vals.h config.h $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $< @@ -443,7 +443,7 @@ options.o: options.c $(BASICS_H) $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BU tmp-defines: config.h Makefile sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > tmp-defines.h - $(srcdir)/../../move-if-change tmp-defines.h defines.h + $(SHELL) $(srcdir)/../../move-if-change tmp-defines.h defines.h touch tmp-defines # @@ -459,8 +459,8 @@ tmp-dgen: dgen ppc-spr-table $(srcdir)/../../move-if-change -r $(srcdir)/ppc-spr-table \ -n spreg.h -hp tmp-spreg.h \ -n spreg.c -p tmp-spreg.c - $(srcdir)/../../move-if-change tmp-spreg.h spreg.h - $(srcdir)/../../move-if-change tmp-spreg.c spreg.c + $(SHELL) $(srcdir)/../../move-if-change tmp-spreg.h spreg.h + $(SHELL) $(srcdir)/../../move-if-change tmp-spreg.c spreg.c touch tmp-dgen @@ -481,18 +481,18 @@ tmp-igen: igen ppc-instructions $(IGEN_OPCODE_RULES) ppc-cache-rules $(srcdir)/. -n model.c -m tmp-model.c \ -n support.h -hf tmp-support.h \ -n support.c -f tmp-support.c - $(srcdir)/../../move-if-change tmp-icache.h icache.h - $(srcdir)/../../move-if-change tmp-icache.c icache.c - $(srcdir)/../../move-if-change tmp-idecode.h idecode.h - $(srcdir)/../../move-if-change tmp-idecode.c idecode.c - $(srcdir)/../../move-if-change tmp-semantics.h semantics.h - $(srcdir)/../../move-if-change tmp-semantics.c semantics.c - $(srcdir)/../../move-if-change tmp-itable.h itable.h - $(srcdir)/../../move-if-change tmp-itable.c itable.c - $(srcdir)/../../move-if-change tmp-model.h model.h - $(srcdir)/../../move-if-change tmp-model.c model.c - $(srcdir)/../../move-if-change tmp-support.h support.h - $(srcdir)/../../move-if-change tmp-support.c support.c + $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h icache.h + $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c icache.c + $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h idecode.h + $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c idecode.c + $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h semantics.h + $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c semantics.c + $(SHELL) $(srcdir)/../../move-if-change tmp-itable.h itable.h + $(SHELL) $(srcdir)/../../move-if-change tmp-itable.c itable.c + $(SHELL) $(srcdir)/../../move-if-change tmp-model.h model.h + $(SHELL) $(srcdir)/../../move-if-change tmp-model.c model.c + $(SHELL) $(srcdir)/../../move-if-change tmp-support.h support.h + $(SHELL) $(srcdir)/../../move-if-change tmp-support.c support.c touch tmp-igen # NOTE: Some versions of make don't handle files created as side-effects @@ -596,8 +596,8 @@ tmp-hw: Makefile $(HW_SRC) $(srcdir)/../../move-if-change -e 's/^/ /' \ -e 's/$$/_device_descriptor,/' \ > tmp-hw.c - $(srcdir)/../../move-if-change tmp-hw.h hw.h - $(srcdir)/../../move-if-change tmp-hw.c hw.c + $(SHELL) $(srcdir)/../../move-if-change tmp-hw.h hw.h + $(SHELL) $(srcdir)/../../move-if-change tmp-hw.c hw.c touch tmp-hw hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H) $(CPU_H) @@ -635,7 +635,7 @@ tmp-pk: Makefile $(PACKAGE_SRC) $(srcdir)/../../move-if-change -e 's/^/extern package_create_instance_callback pk_/' \ -e 's/$$/_create_instance;/' \ > tmp-pk.h - $(srcdir)/../../move-if-change tmp-pk.h pk.h + $(SHELL) $(srcdir)/../../move-if-change tmp-pk.h pk.h touch tmp-pk pk_disklabel.o: pk.h $(DEVICE_TABLE_H) diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog index 4023d28..c88c159 100644 --- a/sim/testsuite/ChangeLog +++ b/sim/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-04-13 Michael Snyder <msnyder@redhat.com> + + * sim/h8300: New directory. Tests for Renesas h8/300 family. + 2003-04-01 Nick Clifton <nickc@redhat.com> * sim/arm: New directory: Tests for ARM simulator. diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog index 7d1075c..78fe7e2 100644 --- a/sim/v850/ChangeLog +++ b/sim/v850/ChangeLog @@ -1,3 +1,8 @@ +2003-05-16 Ian Lance Taylor <ian@airs.com> + + * Makefile.in (SHELL): Make sure this is defined. + (tmp-igen): Use $(SHELL) whenever we invoke move-if-change. + 2003-04-06 Nick Clifton <nickc@redhat.com> * simops.c (OP_40): Delete. Move code to... diff --git a/sim/v850/Makefile.in b/sim/v850/Makefile.in index 89029d6..f2ddd56 100644 --- a/sim/v850/Makefile.in +++ b/sim/v850/Makefile.in @@ -16,6 +16,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +SHELL = @SHELL@ + ## COMMON_PRE_CONFIG_FRAG SIM_OBJS = \ @@ -101,21 +103,21 @@ tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen -n engine.h -he tmp-engine.h \ -n engine.c -e tmp-engine.c \ -n irun.c -r tmp-irun.c - $(srcdir)/../../move-if-change tmp-icache.h icache.h - $(srcdir)/../../move-if-change tmp-icache.c icache.c - $(srcdir)/../../move-if-change tmp-idecode.h idecode.h - $(srcdir)/../../move-if-change tmp-idecode.c idecode.c - $(srcdir)/../../move-if-change tmp-semantics.h semantics.h - $(srcdir)/../../move-if-change tmp-semantics.c semantics.c - $(srcdir)/../../move-if-change tmp-model.h model.h - $(srcdir)/../../move-if-change tmp-model.c model.c - $(srcdir)/../../move-if-change tmp-support.h support.h - $(srcdir)/../../move-if-change tmp-support.c support.c - $(srcdir)/../../move-if-change tmp-itable.h itable.h - $(srcdir)/../../move-if-change tmp-itable.c itable.c - $(srcdir)/../../move-if-change tmp-engine.h engine.h - $(srcdir)/../../move-if-change tmp-engine.c engine.c - $(srcdir)/../../move-if-change tmp-irun.c irun.c + $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h icache.h + $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c icache.c + $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h idecode.h + $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c idecode.c + $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h semantics.h + $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c semantics.c + $(SHELL) $(srcdir)/../../move-if-change tmp-model.h model.h + $(SHELL) $(srcdir)/../../move-if-change tmp-model.c model.c + $(SHELL) $(srcdir)/../../move-if-change tmp-support.h support.h + $(SHELL) $(srcdir)/../../move-if-change tmp-support.c support.c + $(SHELL) $(srcdir)/../../move-if-change tmp-itable.h itable.h + $(SHELL) $(srcdir)/../../move-if-change tmp-itable.c itable.c + $(SHELL) $(srcdir)/../../move-if-change tmp-engine.h engine.h + $(SHELL) $(srcdir)/../../move-if-change tmp-engine.c engine.c + $(SHELL) $(srcdir)/../../move-if-change tmp-irun.c irun.c touch tmp-igen clean-extra: clean-igen |