From 6f88f0312286a7356b43ff479642a4894ea07890 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 16 Jun 1994 21:59:41 +0000 Subject: [PATCH] * configure.in: Set UNDERSCORE in Makefile based on result of invoking config.bfd with a second argument of ``_''. * Makefile.in (underscore.c): Depend upon Makefile. Don't try to run $(CC) and $(NM), just use $(UNDERSCORE). Create via temporary file. (demangle.o): Remove target. ($(NM_PROG)): Don't depend upon demangle.o, and don't link against demangle.o. It's in libiberty anyhow. (cplus-dem.o): Don't depend upon demangle.o. * binutils.texi: Mention -n and --no-strip-underscores arguments to c++filt. --- binutils/ChangeLog | 17 +++++++++++++++++ binutils/Makefile.in | 25 +++++++------------------ binutils/binutils.texi | 8 +++++++- binutils/configure.in | 7 +++++++ 4 files changed, 38 insertions(+), 19 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 7c02004..a61c689 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,17 @@ +Thu Jun 16 17:25:20 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in: Set UNDERSCORE in Makefile based on result of + invoking config.bfd with a second argument of ``_''. + * Makefile.in (underscore.c): Depend upon Makefile. Don't try to + run $(CC) and $(NM), just use $(UNDERSCORE). Create via temporary + file. + (demangle.o): Remove target. + ($(NM_PROG)): Don't depend upon demangle.o, and don't link against + demangle.o. It's in libiberty anyhow. + (cplus-dem.o): Don't depend upon demangle.o. + * binutils.texi: Mention -n and --no-strip-underscores arguments + to c++filt. + Wed Jun 15 12:10:31 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * nm.c (long_options): Add --no-demangle to turn off --demangle, @@ -1964,5 +1978,8 @@ Fri May 3 22:21:44 1991 John Gilmore (gnu at cygint.cygnus.com) Local Variables: +mode: indented-text +left-margin: 8 +fill-column: 74 version-control: never End: diff --git a/binutils/Makefile.in b/binutils/Makefile.in index e7fdee3..6373595 100644 --- a/binutils/Makefile.in +++ b/binutils/Makefile.in @@ -198,33 +198,22 @@ $(STRINGS_PROG): $(ADDL_LIBS) strings.o $(BFD) $(STRIP_PROG): $(ADDL_LIBS) objcopy.o is-strip.o $(BFD) $(CC) $(CFLAGS) $(LDFLAGS) -o $(STRIP_PROG) objcopy.o is-strip.o $(ADDL_LIBS) $(EXTRALIBS) -$(NM_PROG): $(ADDL_LIBS) nm.o demangle.o $(BFD) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(NM_PROG) nm.o demangle.o $(ADDL_LIBS) $(EXTRALIBS) +$(NM_PROG): $(ADDL_LIBS) nm.o $(BFD) + $(CC) $(CFLAGS) $(LDFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(EXTRALIBS) $(OBJDUMP_PROG): $(ADDL_LIBS) objdump.o $(BFD) $(OPCODES) $(CC) $(CFLAGS) $(LDFLAGS) -o $(OBJDUMP_PROG) objdump.o $(OPCODES) $(ADDL_LIBS) $(EXTRALIBS) -underscore.c: - echo "int xxy_us_dummy;" >dummy.c - $(CC) -c dummy.c +underscore.c: Makefile rm -f underscore.c - echo '/*WARNING: This file is automatically generated!*/' >underscore.c - if [ "`$(NM) dummy.o | grep _xxy_us_dummy ; true`" != "" ]; then \ - echo "int prepends_underscore = 1;" >>underscore.c; \ - else \ - echo "int prepends_underscore = 0;" >>underscore.c; \ - fi - -rm -f dummy.c dummy.o + echo '/*WARNING: This file is automatically generated!*/' >underscore.t + echo "int prepends_underscore = $(UNDERSCORE);" >>underscore.t + mv -f underscore.t underscore.c version.o: version.c $(CC) $(INCLUDES) $(HDEFINES) $(TDEFINES) -DVERSION='"$(VERSION)"' $(CFLAGS) -c $(srcdir)/version.c -demangle.o: $(BASEDIR)/libiberty/cplus-dem.c - $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS) $(BASEDIR)/libiberty/cplus-dem.c - mv cplus-dem.o demangle.o - -# For parallel compiling, depend on demangle.o so that one gets done first. -cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h demangle.o +cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h $(CC) -c -DMAIN $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS) $(BASEDIR)/libiberty/cplus-dem.c $(DEMANGLER_PROG): cplus-dem.o $(LIBIBERTY) underscore.o version.o diff --git a/binutils/binutils.texi b/binutils/binutils.texi index 10f4665..77f2e2f 100644 --- a/binutils/binutils.texi +++ b/binutils/binutils.texi @@ -1276,6 +1276,7 @@ archives, @samp{strip -v} lists all members of the archive. @smallexample c++filt [ -_ | --strip-underscores ] + [ -n | --no-strip-underscores ] [ -s @var{format} | --format=@var{format} ] [ --help ] [ --version ] [ @var{symbol}@dots{} ] @end smallexample @@ -1308,7 +1309,12 @@ standard output. All results are printed on the standard output. @itemx --strip-underscores On some systems, both the C and C++ compilers put an underscore in front of every name. For example, the C name @code{foo} gets the low-level -name @code{_foo}. This option removes the initial underscore. +name @code{_foo}. This option removes the initial underscore. Whether +@code{c++filt} removes the underscore by default is target dependent. + +@item -n +@itemx --no-strip-underscores +Do not remove the initial underscore. @item -s @var{format} @itemx --format=@var{format} diff --git a/binutils/configure.in b/binutils/configure.in index 649e5d5..300d941 100644 --- a/binutils/configure.in +++ b/binutils/configure.in @@ -76,6 +76,13 @@ if [ "x${build_srconv}" = "xtrue" ]; then echo 'BUILD_SRCONV = $(SRCONV_PROG)' >> Makefile.2 fi +if [ "x`$srcdir/../bfd/config.bfd $target _`" = "xyes" ]; then + underscore=1 +else + underscore=0 +fi +echo "UNDERSCORE = ${underscore}" >> Makefile.2 + cat Makefile.tmp >> Makefile.2 rm -f Makefile.tmp mv Makefile.2 Makefile -- 2.7.4