*** empty log message ***
[binutils-gdb.git] / binutils / rddbg.c
index 9428c37ad5ce713bf1c644e1cf317d6721892fc0..e6ace7755775054c9ea1f2e4916afbfc4e1a9bed 100644 (file)
@@ -1,5 +1,5 @@
 /* rddbg.c -- Read debugging information into a generic form.
-   Copyright (C) 1995, 96, 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -84,8 +84,8 @@ read_debugging_info (abfd, syms, symcount)
 
   if (! found)
     {
-      fprintf (stderr, _("%s: no recognized debugging information\n"),
-              bfd_get_filename (abfd));
+      non_fatal (_("%s: no recognized debugging information"),
+                bfd_get_filename (abfd));
       return NULL;
     }
 
@@ -159,7 +159,7 @@ read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound)
          next_stroff = 0;
          for (stab = stabs; stab < stabs + stabsize; stab += 12)
            {
-             bfd_size_type strx;
+             unsigned int strx;
              int type;
              int other;
              int desc;
@@ -185,7 +185,17 @@ read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound)
                  char *f, *s;
 
                  f = NULL;
+                 
+                 if (stroff + strx > strsize)
+                   {
+                     fprintf (stderr, "%s: %s: stab entry %d is corrupt, strx = 0x%x, type = %d\n",
+                              bfd_get_filename (abfd), names[i].secname,
+                              (stab - stabs) / 12, strx, type);
+                     continue;
+                   }
+                 
                  s = (char *) strings + stroff + strx;
+                 
                  while (s[strlen (s) - 1] == '\\'
                         && stab + 12 < stabs + stabsize)
                    {