Makefile.in (DISTSTUFF): Don't build binutils.mm.
authorKen Raeburn <raeburn@cygnus>
Tue, 25 May 1993 04:28:56 +0000 (04:28 +0000)
committerKen Raeburn <raeburn@cygnus>
Tue, 25 May 1993 04:28:56 +0000 (04:28 +0000)
objdump.c (slurp_symtab): Print warning for bad symbol table.

binutils/ChangeLog
binutils/Makefile.in
binutils/objdump.c

index 8cb045d..0c78ef8 100644 (file)
@@ -1,5 +1,19 @@
+Tue May 25 00:26:47 1993  Ken Raeburn  (raeburn@cygnus.com)
+
+       * objdump.c (slurp_symtab): Print warning for bad symbol table.
+
+       * Makefile.in (DISTSTUFF): Don't build binutils.mm.
+
 Fri May 21 10:51:19 1993  David J. Mackenzie  (djm@rtl.cygnus.com)
 
+       * nm.c: Add -f/--format, -P/--portability, -t/--radix options.
+       Make global variables static.
+       (main): Make -v like -n, not -V, and make -A like -o, for POSIX.2.
+       (set_print_radix, set_output_format,
+       print_{object_filename,archive_filename,archive_member,symbol_info}
+       {bsd,sysv,posix}): New functions.
+       (display_file, print_symbols): Call them.
+
        * ar.c: Improve error messages.
 
        * nm.c (main): Handle long options that just set a flag.
index 865d90f..7e6edd1 100644 (file)
@@ -57,6 +57,8 @@ RANLIB = ranlib
 BISONFLAGS = -d
 TEXI2ROFF=texi2roff
 
+NM_FOR_TARGET = nm
+NM = $(NM_FOR_TARGET)
 SYMLINK = ln -s
 
 BISON = `if [ -f ../byacc/byacc ] ; then echo ../byacc/byacc ; else echo byacc ; fi`
@@ -65,7 +67,7 @@ LEX_OPTIONS = -I -Cem
 LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
 
 # Distribution version
-VERSION=2.1
+VERSION=2.2
 # Distribution name
 DIST_NAME=binutils-${VERSION}
 
@@ -96,7 +98,7 @@ DEMANGLER_PROG=c++filt
 PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG)
 STAGESTUFF = $(PROGS) *.o
 # Files that can be generated, but should be in the distribution.
-DISTSTUFF=arparse.c arlex.c binutils.mm
+DISTSTUFF=arparse.c arlex.c
 
 BASEDIR = $(srcdir)/..
 LIBDIR  = ./../bfd
@@ -194,8 +196,22 @@ $(NM_PROG): $(ADDL_LIBS) nm.o $(BFD)
 $(OBJDUMP_PROG): $(ADDL_LIBS) size.o objdump.o $(BFD) $(OPCODES)
        $(CC) $(LDFLAGS) $(CFLAGS) -o $(OBJDUMP_PROG) objdump.o $(OPCODES) $(ADDL_LIBS) $(LOADLIBES)
 
-$(DEMANGLER_PROG): $(LIBIBERTY_SRC_DIR)/cplus-dem.c
-       $(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) -DMAIN -o $(DEMANGLER_PROG) $(LIBIBERTY_SRC_DIR)/cplus-dem.c $(LIBIBERTY) $(LOADLIBES)
+underscore.c:
+       echo "int xxy_us_dummy;" >dummy.c
+       $(CC) -c dummy.c
+       echo '/*WARNING: This file is automatically generated!*/' >underscore.c
+       if [ "`$(NM) dummy.o | grep _xxy_us_dummy`" != "" ]; then \
+         echo "int prepends_underscore = 1;" >>underscore.c; \
+       else \
+         echo "int prepends_underscore = 0;" >>underscore.c; \
+       fi
+       -rm -f dummy.c dummy.o
+
+cplus-dem.o: $(LIBIBERTY_SRC_DIR)/cplus-dem.c
+       $(CC) -c -DMAIN $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(LIBIBERTY_SRC_DIR)/cplus-dem.c
+
+$(DEMANGLER_PROG): cplus-dem.o $(LIBIBERTY) underscore.o
+       $(CC) $(LDFLAGS) $(CFLAGS) -o $(DEMANGLER_PROG) cplus-dem.o $(LIBIBERTY) $(LOADLIBES) underscore.o
 
 arparse.c:arparse.y
        $(BISON) $(BISONFLAGS)  $(srcdir)/arparse.y
@@ -336,7 +352,7 @@ binutils.me: $(srcdir)/binutils.texi
 mostlyclean:
        -rm -f *.o *~ \#* core binutils.?? binutils.???
 clean: mostlyclean
-       -rm -f $(PROGS)
+       -rm -f $(PROGS) underscore.c
 distclean: clean
        -rm -f Makefile config.status sysdep.h
 realclean: distclean
@@ -386,11 +402,11 @@ clean-info:
 # Sanitize
 # cd {HERE}; make dist [-f Makefile.in]
 
-dist: $(DIST_NAME).tar.Z
+dist: $(DIST_NAME).tar.z
 
 diststuff: $(DISTSTUFF)
 
-$(DIST_NAME).tar.Z:
+$(DIST_NAME).tar.z:
        cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME)
        make diststuff -f Makefile.in
        cd ../ld; make diststuff -f Makefile.in
@@ -400,7 +416,7 @@ $(DIST_NAME).tar.Z:
        mv ../configure.in tmp; \
          sed -e '/^host_tools=/s/texinfo //' <tmp >../configure.in; rm tmp
        cd ..; chmod og=u `find . -print`
-       cd ../..; tar chf - $(DIST_NAME) | compress >$(DIST_NAME).tar.Z
+       cd ../..; tar chf - $(DIST_NAME) | gzip >$(DIST_NAME).tar.z
        rm -rf ../../$(DIST_NAME)
 
 # These get around a bug in Sun Make in SunOS 4.1.1
index 545293b..fb63668 100644 (file)
@@ -88,10 +88,9 @@ dump_symbols PARAMS ((bfd *abfd));
 void
 usage ()
 {
-  fprintf (stderr, "objdump %s\n\
+  fprintf (stderr, "\
 Usage: %s [-ahifdrtxsl] [-m machine] [-j section_name] [-b bfdname]\n\
-       [--syms] [--reloc] [--header] [--version] objfile...\n",
-          program_version, program_name);
+       [--syms] [--reloc] [--header] [--version] objfile...\n", program_name);
   exit (1);
 }
 
@@ -172,6 +171,12 @@ DEFUN (slurp_symtab, (abfd),
        }
     }
   symcount = bfd_canonicalize_symtab (abfd, sy);
+  if (symcount <= 0)
+    {
+      fprintf (stderr, "%s: Bad symbol table in \"%s\".\n",
+              program_name, bfd_get_filename (abfd));
+      exit (1);
+    }
   return sy;
 }