gdb/
[binutils-gdb.git] / binutils / rdcoff.c
index cca9b0e64be07a79aba35a771faa8f3461a7544c..473305e231333cbe6dfe0d942958bac4d7995b16 100644 (file)
@@ -1,12 +1,13 @@
 /* stabs.c -- Parse COFF debugging information
 /* stabs.c -- Parse COFF debugging information
-   Copyright 1996, 2000, 2002 Free Software Foundation, Inc.
+   Copyright 1996, 1999, 2000, 2002, 2003, 2005, 2007
+   Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
 
    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
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
 
    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
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    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.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
 
 /* This file contains code which parses COFF debugging information.  */
 
 
 /* This file contains code which parses COFF debugging information.  */
 
+#include "sysdep.h"
 #include "bfd.h"
 #include "coff/internal.h"
 #include "bfd.h"
 #include "coff/internal.h"
-#include "bucomm.h"
 #include "libiberty.h"
 #include "libiberty.h"
+#include "bucomm.h"
 #include "debug.h"
 #include "budbg.h"
 
 #include "debug.h"
 #include "budbg.h"
 
@@ -82,32 +84,28 @@ struct coff_types
   debug_type basic[T_MAX + 1];
 };
 
   debug_type basic[T_MAX + 1];
 };
 
-static debug_type *coff_get_slot
-  PARAMS ((struct coff_types *, int));
+static debug_type *coff_get_slot (struct coff_types *, int);
 static debug_type parse_coff_type
 static debug_type parse_coff_type
-  PARAMS ((bfd *, struct coff_symbols *, struct coff_types *, long, int,
-          union internal_auxent *, bfd_boolean, PTR));
+  (bfd *, struct coff_symbols *, struct coff_types *, long, int,
+   union internal_auxent *, bfd_boolean, void *);
 static debug_type parse_coff_base_type
 static debug_type parse_coff_base_type
-  PARAMS ((bfd *, struct coff_symbols *, struct coff_types *, long, int,
-          union internal_auxent *, PTR));
+  (bfd *, struct coff_symbols *, struct coff_types *, long, int,
+   union internal_auxent *, void *);
 static debug_type parse_coff_struct_type
 static debug_type parse_coff_struct_type
-  PARAMS ((bfd *, struct coff_symbols *, struct coff_types *, int,
-          union internal_auxent *, PTR));
+  (bfd *, struct coff_symbols *, struct coff_types *, int,
+   union internal_auxent *, void *);
 static debug_type parse_coff_enum_type
 static debug_type parse_coff_enum_type
-  PARAMS ((bfd *, struct coff_symbols *, struct coff_types *,
-          union internal_auxent *, PTR));
+  (bfd *, struct coff_symbols *, struct coff_types *,
+   union internal_auxent *, void *);
 static bfd_boolean parse_coff_symbol
 static bfd_boolean parse_coff_symbol
-  PARAMS ((bfd *, struct coff_types *, asymbol *, long,
-          struct internal_syment *, PTR, debug_type, bfd_boolean));
-static bfd_boolean external_coff_symbol_p
-  PARAMS ((int sym_class));
+  (bfd *, struct coff_types *, asymbol *, long, struct internal_syment *,
+   void *, debug_type, bfd_boolean);
+static bfd_boolean external_coff_symbol_p (int sym_class);
 \f
 /* Return the slot for a type.  */
 
 static debug_type *
 \f
 /* Return the slot for a type.  */
 
 static debug_type *
-coff_get_slot (types, indx)
-     struct coff_types *types;
-     int indx;
+coff_get_slot (struct coff_types *types, int indx)
 {
   struct coff_slots **pps;
 
 {
   struct coff_slots **pps;
 
@@ -136,16 +134,10 @@ coff_get_slot (types, indx)
 /* Parse a COFF type code in NTYPE.  */
 
 static debug_type
 /* Parse a COFF type code in NTYPE.  */
 
 static debug_type
-parse_coff_type (abfd, symbols, types, coff_symno, ntype, pauxent, useaux,
-                dhandle)
-     bfd *abfd;
-     struct coff_symbols *symbols;
-     struct coff_types *types;
-     long coff_symno;
-     int ntype;
-     union internal_auxent *pauxent;
-     bfd_boolean useaux;
-     PTR dhandle;
+parse_coff_type (bfd *abfd, struct coff_symbols *symbols,
+                struct coff_types *types, long coff_symno, int ntype,
+                union internal_auxent *pauxent, bfd_boolean useaux,
+                void *dhandle)
 {
   debug_type type;
 
 {
   debug_type type;
 
@@ -239,15 +231,9 @@ parse_coff_type (abfd, symbols, types, coff_symno, ntype, pauxent, useaux,
 /* Parse a basic COFF type in NTYPE.  */
 
 static debug_type
 /* Parse a basic COFF type in NTYPE.  */
 
 static debug_type
-parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent,
-                     dhandle)
-     bfd *abfd;
-     struct coff_symbols *symbols;
-     struct coff_types *types;
-     long coff_symno;
-     int ntype;
-     union internal_auxent *pauxent;
-     PTR dhandle;
+parse_coff_base_type (bfd *abfd, struct coff_symbols *symbols,
+                     struct coff_types *types, long coff_symno, int ntype,
+                     union internal_auxent *pauxent, void *dhandle)
 {
   debug_type ret;
   bfd_boolean set_basic;
 {
   debug_type ret;
   bfd_boolean set_basic;
@@ -385,13 +371,9 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent,
 /* Parse a struct type.  */
 
 static debug_type
 /* Parse a struct type.  */
 
 static debug_type
-parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
-     bfd *abfd;
-     struct coff_symbols *symbols;
-     struct coff_types *types;
-     int ntype;
-     union internal_auxent *pauxent;
-     PTR dhandle;
+parse_coff_struct_type (bfd *abfd, struct coff_symbols *symbols,
+                       struct coff_types *types, int ntype,
+                       union internal_auxent *pauxent, void *dhandle)
 {
   long symend;
   int alloc;
 {
   long symend;
   int alloc;
@@ -496,12 +478,9 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
 /* Parse an enum type.  */
 
 static debug_type
 /* Parse an enum type.  */
 
 static debug_type
-parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
-     bfd *abfd;
-     struct coff_symbols *symbols;
-     struct coff_types *types ATTRIBUTE_UNUSED;
-     union internal_auxent *pauxent;
-     PTR dhandle;
+parse_coff_enum_type (bfd *abfd, struct coff_symbols *symbols,
+                     struct coff_types *types ATTRIBUTE_UNUSED,
+                     union internal_auxent *pauxent, void *dhandle)
 {
   long symend;
   int alloc;
 {
   long symend;
   int alloc;
@@ -568,16 +547,10 @@ parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
 /* Handle a single COFF symbol.  */
 
 static bfd_boolean
 /* Handle a single COFF symbol.  */
 
 static bfd_boolean
-parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
-                  within_function)
-     bfd *abfd ATTRIBUTE_UNUSED;
-     struct coff_types *types;
-     asymbol *sym;
-     long coff_symno;
-     struct internal_syment *psyment;
-     PTR dhandle;
-     debug_type type;
-     bfd_boolean within_function;
+parse_coff_symbol (bfd *abfd ATTRIBUTE_UNUSED, struct coff_types *types,
+                  asymbol *sym, long coff_symno,
+                  struct internal_syment *psyment, void *dhandle,
+                  debug_type type, bfd_boolean within_function)
 {
   switch (psyment->n_sclass)
     {
 {
   switch (psyment->n_sclass)
     {
@@ -662,8 +635,7 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
 /* Determine if a symbol has external visibility.  */
 
 static bfd_boolean
 /* Determine if a symbol has external visibility.  */
 
 static bfd_boolean
-external_coff_symbol_p (sym_class)
-     int sym_class;
+external_coff_symbol_p (int sym_class)
 {
   switch (sym_class)
     {
 {
   switch (sym_class)
     {
@@ -680,11 +652,7 @@ external_coff_symbol_p (sym_class)
    handles them.  */
 
 bfd_boolean
    handles them.  */
 
 bfd_boolean
-parse_coff (abfd, syms, symcount, dhandle)
-     bfd *abfd;
-     asymbol **syms;
-     long symcount;
-     PTR dhandle;
+parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle)
 {
   struct coff_symbols symbols;
   struct coff_types types;
 {
   struct coff_symbols symbols;
   struct coff_types types;