Define SKIP_ZEROES as 32 for tic4x target in order to ensure proper
[deliverable/binutils-gdb.git] / binutils / rdcoff.c
index d1ee6e620f5f82eef5460c48d0ebc35b8ce7960a..2091964e89b4cded8bf3eae37729389f2f2c0701 100644 (file)
@@ -1,5 +1,5 @@
 /* stabs.c -- Parse COFF debugging information
-   Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
+   Copyright 1996, 2000 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -25,7 +25,6 @@
 #include "coff/internal.h"
 #include "bucomm.h"
 #include "libiberty.h"
-#include "demangle.h"
 #include "debug.h"
 #include "budbg.h"
 
@@ -99,6 +98,7 @@ static debug_type parse_coff_enum_type
 static boolean parse_coff_symbol
   PARAMS ((bfd *, struct coff_types *, asymbol *, long,
           struct internal_syment *, PTR, debug_type, boolean));
+static boolean external_coff_symbol_p PARAMS ((int sym_class));
 \f
 /* Return the slot for a type.  */
 
@@ -201,8 +201,7 @@ parse_coff_type (abfd, symbols, types, coff_symno, ntype, pauxent, useaux,
        }
       else
        {
-         fprintf (stderr, _("%s: parse_coff_type: Bad type code 0x%x\n"),
-                  program_name, ntype);
+         non_fatal (_("parse_coff_type: Bad type code 0x%x"), ntype);
          return DEBUG_TYPE_NULL;
        }
 
@@ -420,8 +419,8 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
 
       if (! bfd_coff_get_syment (abfd, sym, &syment))
        {
-         fprintf (stderr, _("%s: bfd_coff_get_syment failed: %s\n"),
-                  program_name, bfd_errmsg (bfd_get_error ()));
+         non_fatal (_("bfd_coff_get_syment failed: %s"),
+                    bfd_errmsg (bfd_get_error ()));
          return DEBUG_TYPE_NULL;
        }
 
@@ -436,8 +435,8 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
        {
          if (! bfd_coff_get_auxent (abfd, sym, 0, &auxent))
            {
-             fprintf (stderr, _("%s: bfd_coff_get_auxent failed: %s\n"),
-                      program_name, bfd_errmsg (bfd_get_error ()));
+             non_fatal (_("bfd_coff_get_auxent failed: %s"),
+                        bfd_errmsg (bfd_get_error ()));
              return DEBUG_TYPE_NULL;
            }
          psubaux = &auxent;
@@ -528,8 +527,8 @@ parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
 
       if (! bfd_coff_get_syment (abfd, sym, &syment))
        {
-         fprintf (stderr, _("%s: bfd_coff_get_syment failed: %s\n"),
-                  program_name, bfd_errmsg (bfd_get_error ()));
+         non_fatal (_("bfd_coff_get_syment failed: %s"),
+                    bfd_errmsg (bfd_get_error ()));
          return DEBUG_TYPE_NULL;
        }
 
@@ -589,6 +588,7 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
        return false;
       break;
 
+    case C_WEAKEXT:
     case C_EXT:
       if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
                                   DEBUG_GLOBAL, bfd_asymbol_value (sym)))
@@ -654,7 +654,24 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
       break;
     }
 
-  return true;                            
+  return true;
+}
+
+/* Determine if a symbol has external visibility.  */
+
+static boolean
+external_coff_symbol_p (sym_class)
+     int sym_class;
+{
+  switch (sym_class)
+    {
+    case C_EXT:
+    case C_WEAKEXT:
+      return true;
+    default:
+      break;
+    }
+  return false;
 }
 
 /* This is the main routine.  It looks through all the symbols and
@@ -709,8 +726,8 @@ parse_coff (abfd, syms, symcount, dhandle)
 
       if (! bfd_coff_get_syment (abfd, sym, &syment))
        {
-         fprintf (stderr, _("%s: bfd_coff_get_syment failed: %s\n"),
-                  program_name, bfd_errmsg (bfd_get_error ()));
+         non_fatal (_("bfd_coff_get_syment failed: %s"),
+                    bfd_errmsg (bfd_get_error ()));
          return false;
        }
 
@@ -729,8 +746,8 @@ parse_coff (abfd, syms, symcount, dhandle)
        {
          if (! bfd_coff_get_auxent (abfd, sym, 0, &auxent))
            {
-             fprintf (stderr, _("%s: bfd_coff_get_auxent failed: %s\n"),
-                      program_name, bfd_errmsg (bfd_get_error ()));
+             non_fatal (_("bfd_coff_get_auxent failed: %s"),
+                        bfd_errmsg (bfd_get_error ()));
              return false;
            }
          paux = &auxent;
@@ -768,6 +785,7 @@ parse_coff (abfd, syms, symcount, dhandle)
          if (syment.n_type == T_NULL)
            break;
          /* Fall through.  */
+       case C_WEAKEXT:
        case C_EXT:
          if (ISFCN (syment.n_type))
            {
@@ -795,8 +813,8 @@ parse_coff (abfd, syms, symcount, dhandle)
            {
              if (fnname == NULL)
                {
-                 fprintf (stderr, _("%s: %ld: .bf without preceding function\n"),
-                          program_name, this_coff_symno);
+                 non_fatal (_("%ld: .bf without preceding function"),
+                            this_coff_symno);
                  return false;
                }
 
@@ -806,7 +824,7 @@ parse_coff (abfd, syms, symcount, dhandle)
                return false;
 
              if (! debug_record_function (dhandle, fnname, type,
-                                          fnclass == C_EXT,
+                                          external_coff_symbol_p (fnclass),
                                           bfd_asymbol_value (sym)))
                return false;
 
@@ -845,8 +863,7 @@ parse_coff (abfd, syms, symcount, dhandle)
            {
              if (! within_function)
                {
-                 fprintf (stderr, _("%s: %ld: unexpected .ef\n"),
-                          program_name, this_coff_symno);
+                 non_fatal (_("%ld: unexpected .ef\n"), this_coff_symno);
                  return false;
                }
 
This page took 0.0253 seconds and 4 git commands to generate.