gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / binutils / rdcoff.c
index 249cc8596f2c6dc25fedeb81c34c83b5389cf8b2..4eb4d1579092b96a4c2721750204a8844c9e637f 100644 (file)
@@ -1,12 +1,12 @@
 /* stabs.c -- Parse COFF debugging information
 /* stabs.c -- Parse COFF debugging information
-   Copyright 1996, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1996-2020 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 "demangle.h"
+#include "bucomm.h"
 #include "debug.h"
 #include "budbg.h"
 
 #include "debug.h"
 #include "budbg.h"
 
@@ -83,35 +83,38 @@ 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 *, long);
 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 *, 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));
-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));
+  (bfd *, struct coff_symbols *, struct coff_types *,
+   union internal_auxent *, void *);
+static bfd_boolean parse_coff_symbol
+  (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, long indx)
 {
   struct coff_slots **pps;
 
   pps = &types->slots;
 
 {
   struct coff_slots **pps;
 
   pps = &types->slots;
 
+  /* PR 17512: file: 078-18333-0.001:0.1.
+     FIXME: The value of 1000 is a guess.  Maybe a better heuristic is needed.  */
+  if (indx / COFF_SLOTS > 1000)
+    fatal (_("Excessively large slot index: %lx"), indx);
+
   while (indx >= COFF_SLOTS)
     {
       if (*pps == NULL)
   while (indx >= COFF_SLOTS)
     {
       if (*pps == NULL)
@@ -135,16 +138,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;
-     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;
 
@@ -165,7 +162,7 @@ parse_coff_type (abfd, symbols, types, coff_symno, ntype, pauxent, useaux,
          type = parse_coff_type (abfd, symbols, types, coff_symno, newtype,
                                  pauxent, useaux, dhandle);
          type = debug_make_function_type (dhandle, type, (debug_type *) NULL,
          type = parse_coff_type (abfd, symbols, types, coff_symno, newtype,
                                  pauxent, useaux, dhandle);
          type = debug_make_function_type (dhandle, type, (debug_type *) NULL,
-                                          false);
+                                          FALSE);
        }
       else if (ISARY (ntype))
        {
        }
       else if (ISARY (ntype))
        {
@@ -191,14 +188,14 @@ parse_coff_type (abfd, symbols, types, coff_symno, ntype, pauxent, useaux,
            }
 
          type = parse_coff_type (abfd, symbols, types, coff_symno, newtype,
            }
 
          type = parse_coff_type (abfd, symbols, types, coff_symno, newtype,
-                                 pauxent, false, dhandle);
+                                 pauxent, FALSE, dhandle);
          type = debug_make_array_type (dhandle, type,
                                        parse_coff_base_type (abfd, symbols,
                                                              types,
                                                              coff_symno,
                                                              T_INT,
                                                              NULL, dhandle),
          type = debug_make_array_type (dhandle, type,
                                        parse_coff_base_type (abfd, symbols,
                                                              types,
                                                              coff_symno,
                                                              T_INT,
                                                              NULL, dhandle),
-                                       0, n - 1, false);
+                                       0, n - 1, FALSE);
        }
       else
        {
        }
       else
        {
@@ -238,18 +235,12 @@ 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;
 {
   debug_type ret;
-  boolean set_basic;
+  bfd_boolean set_basic;
   const char *name;
   debug_type *slot;
 
   const char *name;
   debug_type *slot;
 
@@ -258,7 +249,7 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent,
       && types->basic[ntype] != DEBUG_TYPE_NULL)
     return types->basic[ntype];
 
       && types->basic[ntype] != DEBUG_TYPE_NULL)
     return types->basic[ntype];
 
-  set_basic = true;
+  set_basic = TRUE;
   name = NULL;
 
   switch (ntype)
   name = NULL;
 
   switch (ntype)
@@ -274,23 +265,23 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent,
       break;
 
     case T_CHAR:
       break;
 
     case T_CHAR:
-      ret = debug_make_int_type (dhandle, 1, false);
+      ret = debug_make_int_type (dhandle, 1, FALSE);
       name = "char";
       break;
 
     case T_SHORT:
       name = "char";
       break;
 
     case T_SHORT:
-      ret = debug_make_int_type (dhandle, 2, false);
+      ret = debug_make_int_type (dhandle, 2, FALSE);
       name = "short";
       break;
 
     case T_INT:
       /* FIXME: Perhaps the size should depend upon the architecture.  */
       name = "short";
       break;
 
     case T_INT:
       /* FIXME: Perhaps the size should depend upon the architecture.  */
-      ret = debug_make_int_type (dhandle, 4, false);
+      ret = debug_make_int_type (dhandle, 4, FALSE);
       name = "int";
       break;
 
     case T_LONG:
       name = "int";
       break;
 
     case T_LONG:
-      ret = debug_make_int_type (dhandle, 4, false);
+      ret = debug_make_int_type (dhandle, 4, FALSE);
       name = "long";
       break;
 
       name = "long";
       break;
 
@@ -310,28 +301,28 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent,
       break;
 
     case T_UCHAR:
       break;
 
     case T_UCHAR:
-      ret = debug_make_int_type (dhandle, 1, true);
+      ret = debug_make_int_type (dhandle, 1, TRUE);
       name = "unsigned char";
       break;
 
     case T_USHORT:
       name = "unsigned char";
       break;
 
     case T_USHORT:
-      ret = debug_make_int_type (dhandle, 2, true);
+      ret = debug_make_int_type (dhandle, 2, TRUE);
       name = "unsigned short";
       break;
 
     case T_UINT:
       name = "unsigned short";
       break;
 
     case T_UINT:
-      ret = debug_make_int_type (dhandle, 4, true);
+      ret = debug_make_int_type (dhandle, 4, TRUE);
       name = "unsigned int";
       break;
 
     case T_ULONG:
       name = "unsigned int";
       break;
 
     case T_ULONG:
-      ret = debug_make_int_type (dhandle, 4, true);
+      ret = debug_make_int_type (dhandle, 4, TRUE);
       name = "unsigned long";
       break;
 
     case T_STRUCT:
       if (pauxent == NULL)
       name = "unsigned long";
       break;
 
     case T_STRUCT:
       if (pauxent == NULL)
-       ret = debug_make_struct_type (dhandle, true, 0,
+       ret = debug_make_struct_type (dhandle, TRUE, 0,
                                      (debug_field *) NULL);
       else
        ret = parse_coff_struct_type (abfd, symbols, types, ntype, pauxent,
                                      (debug_field *) NULL);
       else
        ret = parse_coff_struct_type (abfd, symbols, types, ntype, pauxent,
@@ -340,12 +331,12 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent,
       slot = coff_get_slot (types, coff_symno);
       *slot = ret;
 
       slot = coff_get_slot (types, coff_symno);
       *slot = ret;
 
-      set_basic = false;
+      set_basic = FALSE;
       break;
 
     case T_UNION:
       if (pauxent == NULL)
       break;
 
     case T_UNION:
       if (pauxent == NULL)
-       ret = debug_make_struct_type (dhandle, false, 0, (debug_field *) NULL);
+       ret = debug_make_struct_type (dhandle, FALSE, 0, (debug_field *) NULL);
       else
        ret = parse_coff_struct_type (abfd, symbols, types, ntype, pauxent,
                                      dhandle);
       else
        ret = parse_coff_struct_type (abfd, symbols, types, ntype, pauxent,
                                      dhandle);
@@ -353,7 +344,7 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent,
       slot = coff_get_slot (types, coff_symno);
       *slot = ret;
 
       slot = coff_get_slot (types, coff_symno);
       *slot = ret;
 
-      set_basic = false;
+      set_basic = FALSE;
       break;
 
     case T_ENUM:
       break;
 
     case T_ENUM:
@@ -366,7 +357,7 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent,
       slot = coff_get_slot (types, coff_symno);
       *slot = ret;
 
       slot = coff_get_slot (types, coff_symno);
       *slot = ret;
 
-      set_basic = false;
+      set_basic = FALSE;
       break;
     }
 
       break;
     }
 
@@ -384,19 +375,15 @@ 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;
   debug_field *fields;
   int count;
 {
   long symend;
   int alloc;
   debug_field *fields;
   int count;
-  boolean done;
+  bfd_boolean done;
 
   symend = pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l;
 
 
   symend = pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l;
 
@@ -404,7 +391,7 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
   fields = (debug_field *) xmalloc (alloc * sizeof *fields);
   count = 0;
 
   fields = (debug_field *) xmalloc (alloc * sizeof *fields);
   count = 0;
 
-  done = false;
+  done = FALSE;
   while (! done
         && symbols->coff_symno < symend
         && symbols->symno < symbols->symcount)
   while (! done
         && symbols->coff_symno < symend
         && symbols->symno < symbols->symcount)
@@ -422,6 +409,7 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
        {
          non_fatal (_("bfd_coff_get_syment failed: %s"),
                     bfd_errmsg (bfd_get_error ()));
        {
          non_fatal (_("bfd_coff_get_syment failed: %s"),
                     bfd_errmsg (bfd_get_error ()));
+         free (fields);
          return DEBUG_TYPE_NULL;
        }
 
          return DEBUG_TYPE_NULL;
        }
 
@@ -438,6 +426,7 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
            {
              non_fatal (_("bfd_coff_get_auxent failed: %s"),
                         bfd_errmsg (bfd_get_error ()));
            {
              non_fatal (_("bfd_coff_get_auxent failed: %s"),
                         bfd_errmsg (bfd_get_error ()));
+             free (fields);
              return DEBUG_TYPE_NULL;
            }
          psubaux = &auxent;
              return DEBUG_TYPE_NULL;
            }
          psubaux = &auxent;
@@ -457,7 +446,7 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
          break;
 
        case C_EOS:
          break;
 
        case C_EOS:
-         done = true;
+         done = TRUE;
          break;
        }
 
          break;
        }
 
@@ -467,7 +456,7 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
          debug_field f;
 
          ftype = parse_coff_type (abfd, symbols, types, this_coff_symno,
          debug_field f;
 
          ftype = parse_coff_type (abfd, symbols, types, this_coff_symno,
-                                  syment.n_type, psubaux, true, dhandle);
+                                  syment.n_type, psubaux, TRUE, dhandle);
          f = debug_make_field (dhandle, bfd_asymbol_name (sym), ftype,
                                bitpos, bitsize, DEBUG_VISIBILITY_PUBLIC);
          if (f == DEBUG_FIELD_NULL)
          f = debug_make_field (dhandle, bfd_asymbol_name (sym), ftype,
                                bitpos, bitsize, DEBUG_VISIBILITY_PUBLIC);
          if (f == DEBUG_FIELD_NULL)
@@ -495,19 +484,16 @@ 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;
   const char **names;
   bfd_signed_vma *vals;
   int count;
 {
   long symend;
   int alloc;
   const char **names;
   bfd_signed_vma *vals;
   int count;
-  boolean done;
+  bfd_boolean done;
 
   symend = pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l;
 
 
   symend = pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l;
 
@@ -516,7 +502,7 @@ parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
   vals = (bfd_signed_vma *) xmalloc (alloc * sizeof *vals);
   count = 0;
 
   vals = (bfd_signed_vma *) xmalloc (alloc * sizeof *vals);
   count = 0;
 
-  done = false;
+  done = FALSE;
   while (! done
         && symbols->coff_symno < symend
         && symbols->symno < symbols->symcount)
   while (! done
         && symbols->coff_symno < symend
         && symbols->symno < symbols->symcount)
@@ -530,6 +516,8 @@ parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
        {
          non_fatal (_("bfd_coff_get_syment failed: %s"),
                     bfd_errmsg (bfd_get_error ()));
        {
          non_fatal (_("bfd_coff_get_syment failed: %s"),
                     bfd_errmsg (bfd_get_error ()));
+         free (names);
+         free (vals);
          return DEBUG_TYPE_NULL;
        }
 
          return DEBUG_TYPE_NULL;
        }
 
@@ -554,7 +542,7 @@ parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
          break;
 
        case C_EOS:
          break;
 
        case C_EOS:
-         done = true;
+         done = TRUE;
          break;
        }
     }
          break;
        }
     }
@@ -566,17 +554,11 @@ parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
 
 /* Handle a single COFF symbol.  */
 
 
 /* Handle a single COFF symbol.  */
 
-static 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;
-     boolean within_function;
+static bfd_boolean
+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)
     {
@@ -586,14 +568,14 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
     case C_AUTO:
       if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
                                   DEBUG_LOCAL, bfd_asymbol_value (sym)))
     case C_AUTO:
       if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
                                   DEBUG_LOCAL, bfd_asymbol_value (sym)))
-       return false;
+       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)))
       break;
 
     case C_WEAKEXT:
     case C_EXT:
       if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
                                   DEBUG_GLOBAL, bfd_asymbol_value (sym)))
-       return false;
+       return FALSE;
       break;
 
     case C_STAT:
       break;
 
     case C_STAT:
@@ -602,14 +584,14 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
                                    ? DEBUG_LOCAL_STATIC
                                    : DEBUG_STATIC),
                                   bfd_asymbol_value (sym)))
                                    ? DEBUG_LOCAL_STATIC
                                    : DEBUG_STATIC),
                                   bfd_asymbol_value (sym)))
-       return false;
+       return FALSE;
       break;
 
     case C_REG:
       /* FIXME: We may need to convert the register number.  */
       if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
                                   DEBUG_REGISTER, bfd_asymbol_value (sym)))
       break;
 
     case C_REG:
       /* FIXME: We may need to convert the register number.  */
       if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
                                   DEBUG_REGISTER, bfd_asymbol_value (sym)))
-       return false;
+       return FALSE;
       break;
 
     case C_LABEL:
       break;
 
     case C_LABEL:
@@ -618,20 +600,20 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
     case C_ARG:
       if (! debug_record_parameter (dhandle, bfd_asymbol_name (sym), type,
                                    DEBUG_PARM_STACK, bfd_asymbol_value (sym)))
     case C_ARG:
       if (! debug_record_parameter (dhandle, bfd_asymbol_name (sym), type,
                                    DEBUG_PARM_STACK, bfd_asymbol_value (sym)))
-       return false;
+       return FALSE;
       break;
 
     case C_REGPARM:
       /* FIXME: We may need to convert the register number.  */
       if (! debug_record_parameter (dhandle, bfd_asymbol_name (sym), type,
                                    DEBUG_PARM_REG, bfd_asymbol_value (sym)))
       break;
 
     case C_REGPARM:
       /* FIXME: We may need to convert the register number.  */
       if (! debug_record_parameter (dhandle, bfd_asymbol_name (sym), type,
                                    DEBUG_PARM_REG, bfd_asymbol_value (sym)))
-       return false;
+       return FALSE;
       break;
 
     case C_TPDEF:
       type = debug_name_type (dhandle, bfd_asymbol_name (sym), type);
       if (type == DEBUG_TYPE_NULL)
       break;
 
     case C_TPDEF:
       type = debug_name_type (dhandle, bfd_asymbol_name (sym), type);
       if (type == DEBUG_TYPE_NULL)
-       return false;
+       return FALSE;
       break;
 
     case C_STRTAG:
       break;
 
     case C_STRTAG:
@@ -642,7 +624,7 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
 
        type = debug_tag_type (dhandle, bfd_asymbol_name (sym), type);
        if (type == DEBUG_TYPE_NULL)
 
        type = debug_tag_type (dhandle, bfd_asymbol_name (sym), type);
        if (type == DEBUG_TYPE_NULL)
-         return false;
+         return FALSE;
 
        /* Store the named type into the slot, so that references get
            the name.  */
 
        /* Store the named type into the slot, so that references get
            the name.  */
@@ -655,35 +637,30 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
       break;
     }
 
       break;
     }
 
-  return true;
+  return TRUE;
 }
 
 /* Determine if a symbol has external visibility.  */
 
 }
 
 /* Determine if a symbol has external visibility.  */
 
-static boolean
-external_coff_symbol_p (sym_class)
-     int sym_class;
+static bfd_boolean
+external_coff_symbol_p (int sym_class)
 {
   switch (sym_class)
     {
     case C_EXT:
     case C_WEAKEXT:
 {
   switch (sym_class)
     {
     case C_EXT:
     case C_WEAKEXT:
-      return true;
+      return TRUE;
     default:
       break;
     }
     default:
       break;
     }
-  return false;
+  return FALSE;
 }
 
 /* This is the main routine.  It looks through all the symbols and
    handles them.  */
 
 }
 
 /* This is the main routine.  It looks through all the symbols and
    handles them.  */
 
-boolean
-parse_coff (abfd, syms, symcount, dhandle)
-     bfd *abfd;
-     asymbol **syms;
-     long symcount;
-     PTR dhandle;
+bfd_boolean
+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;
@@ -694,7 +671,7 @@ parse_coff (abfd, syms, symcount, dhandle)
   int fntype;
   bfd_vma fnend;
   alent *linenos;
   int fntype;
   bfd_vma fnend;
   alent *linenos;
-  boolean within_function;
+  bfd_boolean within_function;
   long this_coff_symno;
 
   symbols.syms = syms;
   long this_coff_symno;
 
   symbols.syms = syms;
@@ -712,7 +689,7 @@ parse_coff (abfd, syms, symcount, dhandle)
   fntype = 0;
   fnend = 0;
   linenos = NULL;
   fntype = 0;
   fnend = 0;
   linenos = NULL;
-  within_function = false;
+  within_function = FALSE;
 
   while (symbols.symno < symcount)
     {
 
   while (symbols.symno < symcount)
     {
@@ -729,7 +706,7 @@ parse_coff (abfd, syms, symcount, dhandle)
        {
          non_fatal (_("bfd_coff_get_syment failed: %s"),
                     bfd_errmsg (bfd_get_error ()));
        {
          non_fatal (_("bfd_coff_get_syment failed: %s"),
                     bfd_errmsg (bfd_get_error ()));
-         return false;
+         return FALSE;
        }
 
       name = bfd_asymbol_name (sym);
        }
 
       name = bfd_asymbol_name (sym);
@@ -749,7 +726,7 @@ parse_coff (abfd, syms, symcount, dhandle)
            {
              non_fatal (_("bfd_coff_get_auxent failed: %s"),
                         bfd_errmsg (bfd_get_error ()));
            {
              non_fatal (_("bfd_coff_get_auxent failed: %s"),
                         bfd_errmsg (bfd_get_error ()));
-             return false;
+             return FALSE;
            }
          paux = &auxent;
        }
            }
          paux = &auxent;
        }
@@ -759,7 +736,7 @@ parse_coff (abfd, syms, symcount, dhandle)
          /* The last C_FILE symbol points to the first external
              symbol.  */
          if (! debug_set_filename (dhandle, "*globals*"))
          /* The last C_FILE symbol points to the first external
              symbol.  */
          if (! debug_set_filename (dhandle, "*globals*"))
-           return false;
+           return FALSE;
        }
 
       switch (syment.n_sclass)
        }
 
       switch (syment.n_sclass)
@@ -777,7 +754,7 @@ parse_coff (abfd, syms, symcount, dhandle)
        case C_FILE:
          next_c_file = syment.n_value;
          if (! debug_set_filename (dhandle, name))
        case C_FILE:
          next_c_file = syment.n_value;
          if (! debug_set_filename (dhandle, name))
-           return false;
+           return FALSE;
          break;
 
        case C_STAT:
          break;
 
        case C_STAT:
@@ -801,12 +778,12 @@ parse_coff (abfd, syms, symcount, dhandle)
              break;
            }
          type = parse_coff_type (abfd, &symbols, &types, this_coff_symno,
              break;
            }
          type = parse_coff_type (abfd, &symbols, &types, this_coff_symno,
-                                 syment.n_type, paux, true, dhandle);
+                                 syment.n_type, paux, TRUE, dhandle);
          if (type == DEBUG_TYPE_NULL)
          if (type == DEBUG_TYPE_NULL)
-           return false;
+           return FALSE;
          if (! parse_coff_symbol (abfd, &types, sym, this_coff_symno, &syment,
                                   dhandle, type, within_function))
          if (! parse_coff_symbol (abfd, &types, sym, this_coff_symno, &syment,
                                   dhandle, type, within_function))
-           return false;
+           return FALSE;
          break;
 
        case C_FCN:
          break;
 
        case C_FCN:
@@ -816,18 +793,18 @@ parse_coff (abfd, syms, symcount, dhandle)
                {
                  non_fatal (_("%ld: .bf without preceding function"),
                             this_coff_symno);
                {
                  non_fatal (_("%ld: .bf without preceding function"),
                             this_coff_symno);
-                 return false;
+                 return FALSE;
                }
 
              type = parse_coff_type (abfd, &symbols, &types, this_coff_symno,
                }
 
              type = parse_coff_type (abfd, &symbols, &types, this_coff_symno,
-                                     DECREF (fntype), paux, false, dhandle);
+                                     DECREF (fntype), paux, FALSE, dhandle);
              if (type == DEBUG_TYPE_NULL)
              if (type == DEBUG_TYPE_NULL)
-               return false;
+               return FALSE;
 
              if (! debug_record_function (dhandle, fnname, type,
                                           external_coff_symbol_p (fnclass),
                                           bfd_asymbol_value (sym)))
 
              if (! debug_record_function (dhandle, fnname, type,
                                           external_coff_symbol_p (fnclass),
                                           bfd_asymbol_value (sym)))
-               return false;
+               return FALSE;
 
              if (linenos != NULL)
                {
 
              if (linenos != NULL)
                {
@@ -839,7 +816,7 @@ parse_coff (abfd, syms, symcount, dhandle)
                  else
                    base = auxent.x_sym.x_misc.x_lnsz.x_lnno - 1;
 
                  else
                    base = auxent.x_sym.x_misc.x_lnsz.x_lnno - 1;
 
-                 addr = bfd_get_section_vma (abfd, bfd_get_section (sym));
+                 addr = bfd_section_vma (bfd_asymbol_section (sym));
 
                  ++linenos;
 
 
                  ++linenos;
 
@@ -848,7 +825,7 @@ parse_coff (abfd, syms, symcount, dhandle)
                      if (! debug_record_line (dhandle,
                                               linenos->line_number + base,
                                               linenos->u.offset + addr))
                      if (! debug_record_line (dhandle,
                                               linenos->line_number + base,
                                               linenos->u.offset + addr))
-                       return false;
+                       return FALSE;
                      ++linenos;
                    }
                }
                      ++linenos;
                    }
                }
@@ -858,23 +835,23 @@ parse_coff (abfd, syms, symcount, dhandle)
              fnclass = 0;
              fntype = 0;
 
              fnclass = 0;
              fntype = 0;
 
-             within_function = true;
+             within_function = TRUE;
            }
          else if (strcmp (name, ".ef") == 0)
            {
              if (! within_function)
                {
                  non_fatal (_("%ld: unexpected .ef\n"), this_coff_symno);
            }
          else if (strcmp (name, ".ef") == 0)
            {
              if (! within_function)
                {
                  non_fatal (_("%ld: unexpected .ef\n"), this_coff_symno);
-                 return false;
+                 return FALSE;
                }
 
              if (bfd_asymbol_value (sym) > fnend)
                fnend = bfd_asymbol_value (sym);
              if (! debug_end_function (dhandle, fnend))
                }
 
              if (bfd_asymbol_value (sym) > fnend)
                fnend = bfd_asymbol_value (sym);
              if (! debug_end_function (dhandle, fnend))
-               return false;
+               return FALSE;
 
              fnend = 0;
 
              fnend = 0;
-             within_function = false;
+             within_function = FALSE;
            }
          break;
 
            }
          break;
 
@@ -882,26 +859,26 @@ parse_coff (abfd, syms, symcount, dhandle)
          if (strcmp (name, ".bb") == 0)
            {
              if (! debug_start_block (dhandle, bfd_asymbol_value (sym)))
          if (strcmp (name, ".bb") == 0)
            {
              if (! debug_start_block (dhandle, bfd_asymbol_value (sym)))
-               return false;
+               return FALSE;
            }
          else if (strcmp (name, ".eb") == 0)
            {
              if (! debug_end_block (dhandle, bfd_asymbol_value (sym)))
            }
          else if (strcmp (name, ".eb") == 0)
            {
              if (! debug_end_block (dhandle, bfd_asymbol_value (sym)))
-               return false;
+               return FALSE;
            }
          break;
 
        default:
          type = parse_coff_type (abfd, &symbols, &types, this_coff_symno,
            }
          break;
 
        default:
          type = parse_coff_type (abfd, &symbols, &types, this_coff_symno,
-                                 syment.n_type, paux, true, dhandle);
+                                 syment.n_type, paux, TRUE, dhandle);
          if (type == DEBUG_TYPE_NULL)
          if (type == DEBUG_TYPE_NULL)
-           return false;
+           return FALSE;
          if (! parse_coff_symbol (abfd, &types, sym, this_coff_symno, &syment,
                                   dhandle, type, within_function))
          if (! parse_coff_symbol (abfd, &types, sym, this_coff_symno, &syment,
                                   dhandle, type, within_function))
-           return false;
+           return FALSE;
          break;
        }
     }
 
          break;
        }
     }
 
-  return true;
+  return TRUE;
 }
 }
This page took 0.036134 seconds and 4 git commands to generate.