Update my email address in MAINTAINERS
[deliverable/binutils-gdb.git] / bfd / syms.c
index 9559ab4580513ce64f4d791d23f695d201242b6d..7daf741b7b61e27db12e04226599979226cc1f21 100644 (file)
@@ -307,6 +307,9 @@ CODE_FRAGMENT
 .     with this name and type in use.  BSF_OBJECT must also be set.  *}
 .#define BSF_GNU_UNIQUE          (1 << 23)
 .
+.  {* This section symbol should be included in the symbol table.  *}
+.#define BSF_SECTION_SYM_USED    (1 << 24)
+.
 .  flagword flags;
 .
 .  {* A pointer to the section to which this symbol is
@@ -361,23 +364,23 @@ FUNCTION
        bfd_is_local_label
 
 SYNOPSIS
-       bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
+       bool bfd_is_local_label (bfd *abfd, asymbol *sym);
 
 DESCRIPTION
        Return TRUE if the given symbol @var{sym} in the BFD @var{abfd} is
        a compiler generated local label, else return FALSE.
 */
 
-bfd_boolean
+bool
 bfd_is_local_label (bfd *abfd, asymbol *sym)
 {
   /* The BSF_SECTION_SYM check is needed for IA-64, where every label that
      starts with '.' is local.  This would accidentally catch section names
      if we didn't reject them here.  */
   if ((sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_FILE | BSF_SECTION_SYM)) != 0)
-    return FALSE;
+    return false;
   if (sym->name == NULL)
-    return FALSE;
+    return false;
   return bfd_is_local_label_name (abfd, sym->name);
 }
 
@@ -386,7 +389,7 @@ FUNCTION
        bfd_is_local_label_name
 
 SYNOPSIS
-       bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
+       bool bfd_is_local_label_name (bfd *abfd, const char *name);
 
 DESCRIPTION
        Return TRUE if a symbol with the name @var{name} in the BFD
@@ -404,7 +407,7 @@ FUNCTION
        bfd_is_target_special_symbol
 
 SYNOPSIS
-       bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
+       bool bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
 
 DESCRIPTION
        Return TRUE iff a symbol @var{sym} in the BFD @var{abfd} is something
@@ -437,7 +440,7 @@ FUNCTION
        bfd_set_symtab
 
 SYNOPSIS
-       bfd_boolean bfd_set_symtab
+       bool bfd_set_symtab
          (bfd *abfd, asymbol **location, unsigned int count);
 
 DESCRIPTION
@@ -446,18 +449,18 @@ DESCRIPTION
        will be written.
 */
 
-bfd_boolean
+bool
 bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int symcount)
 {
   if (abfd->format != bfd_object || bfd_read_p (abfd))
     {
       bfd_set_error (bfd_error_invalid_operation);
-      return FALSE;
+      return false;
     }
 
   abfd->outsymbols = location;
   abfd->symcount = symcount;
-  return TRUE;
+  return true;
 }
 
 /*
@@ -651,6 +654,10 @@ bfd_decode_symclass (asymbol *symbol)
 {
   char c;
 
+  /* Paranoia...  */
+  if (symbol == NULL || symbol->section == NULL)
+    return '?';
+
   if (symbol->section && bfd_is_com_section (symbol->section))
     {
       if (symbol->section->flags & SEC_SMALL_DATA)
@@ -724,10 +731,10 @@ DESCRIPTION
        Returns zero otherwise.
 
 SYNOPSIS
-       bfd_boolean bfd_is_undefined_symclass (int symclass);
+       bool bfd_is_undefined_symclass (int symclass);
 */
 
-bfd_boolean
+bool
 bfd_is_undefined_symclass (int symclass)
 {
   return symclass == 'U' || symclass == 'w' || symclass == 'v';
@@ -764,7 +771,7 @@ FUNCTION
        bfd_copy_private_symbol_data
 
 SYNOPSIS
-       bfd_boolean bfd_copy_private_symbol_data
+       bool bfd_copy_private_symbol_data
          (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
 
 DESCRIPTION
@@ -788,7 +795,7 @@ DESCRIPTION
 
 long
 _bfd_generic_read_minisymbols (bfd *abfd,
-                              bfd_boolean dynamic,
+                              bool dynamic,
                               void **minisymsp,
                               unsigned int *sizep)
 {
@@ -840,7 +847,7 @@ _bfd_generic_read_minisymbols (bfd *abfd,
 
 asymbol *
 _bfd_generic_minisymbol_to_symbol (bfd *abfd ATTRIBUTE_UNUSED,
-                                  bfd_boolean dynamic ATTRIBUTE_UNUSED,
+                                  bool dynamic ATTRIBUTE_UNUSED,
                                   const void *minisym,
                                   asymbol *sym ATTRIBUTE_UNUSED)
 {
@@ -920,12 +927,12 @@ struct stab_find_info
   char *filename;
 };
 
-bfd_boolean
+bool
 _bfd_stab_section_find_nearest_line (bfd *abfd,
                                     asymbol **symbols,
                                     asection *section,
                                     bfd_vma offset,
-                                    bfd_boolean *pfound,
+                                    bool *pfound,
                                     const char **pfilename,
                                     const char **pfnname,
                                     unsigned int *pline,
@@ -939,9 +946,9 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
   struct indexentry *indexentry;
   char *file_name;
   char *directory_name;
-  bfd_boolean saw_line, saw_func;
+  bool saw_line, saw_func;
 
-  *pfound = FALSE;
+  *pfound = false;
   *pfilename = bfd_get_filename (abfd);
   *pfnname = NULL;
   *pline = 0;
@@ -972,7 +979,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
       if (info->stabsec == NULL || info->strsec == NULL)
        {
          /* No stabs debugging information.  */
-         return TRUE;
+         return true;
        }
 
       stabsize = (info->stabsec->rawsize
@@ -992,7 +999,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
 
       info = (struct stab_find_info *) bfd_zalloc (abfd, amt);
       if (info == NULL)
-       return FALSE;
+       return false;
 
       /* FIXME: When using the linker --split-by-file or
         --split-by-reloc options, it is possible for the .stab and
@@ -1012,7 +1019,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
              /* No stabs debugging information.  Set *pinfo so that we
                 can return quickly in the info != NULL case above.  */
              *pinfo = info;
-             return TRUE;
+             return true;
            }
        }
 
@@ -1027,13 +1034,13 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
       info->stabs = (bfd_byte *) bfd_alloc (abfd, stabsize);
       info->strs = (bfd_byte *) bfd_alloc (abfd, strsize);
       if (info->stabs == NULL || info->strs == NULL)
-       return FALSE;
+       return false;
 
       if (! bfd_get_section_contents (abfd, info->stabsec, info->stabs,
                                      0, stabsize)
          || ! bfd_get_section_contents (abfd, info->strsec, info->strs,
                                         0, strsize))
-       return FALSE;
+       return false;
 
       /* Stab strings ought to be nul terminated.  Ensure the last one
         is, to prevent running off the end of the buffer.  */
@@ -1045,16 +1052,16 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
         this should be no big deal.  */
       reloc_size = bfd_get_reloc_upper_bound (abfd, info->stabsec);
       if (reloc_size < 0)
-       return FALSE;
+       return false;
       reloc_vector = (arelent **) bfd_malloc (reloc_size);
       if (reloc_vector == NULL && reloc_size != 0)
-       return FALSE;
+       return false;
       reloc_count = bfd_canonicalize_reloc (abfd, info->stabsec, reloc_vector,
                                            symbols);
       if (reloc_count < 0)
        {
          free (reloc_vector);
-         return FALSE;
+         return false;
        }
       if (reloc_count > 0)
        {
@@ -1085,7 +1092,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
                    (_("unsupported .stab relocation"));
                  bfd_set_error (bfd_error_invalid_operation);
                  free (reloc_vector);
-                 return FALSE;
+                 return false;
                }
 
              val = bfd_get_32 (abfd, info->stabs + octets);
@@ -1139,14 +1146,14 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
        ++info->indextablesize;
 
       if (info->indextablesize == 0)
-       return TRUE;
+       return true;
       ++info->indextablesize;
 
       amt = info->indextablesize;
       amt *= sizeof (struct indexentry);
       info->indextable = (struct indexentry *) bfd_alloc (abfd, amt);
       if (info->indextable == NULL)
-       return FALSE;
+       return false;
 
       file_name = NULL;
       directory_name = NULL;
@@ -1319,7 +1326,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
        }
 
       if (indexentry == NULL)
-       return TRUE;
+       return true;
 
       stab = indexentry->stab + STABSIZE;
       file_name = indexentry->file_name;
@@ -1328,14 +1335,14 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
   directory_name = indexentry->directory_name;
   str = indexentry->str;
 
-  saw_line = FALSE;
-  saw_func = FALSE;
+  saw_line = false;
+  saw_func = false;
   for (; stab < (indexentry+1)->stab; stab += STABSIZE)
     {
-      bfd_boolean done;
+      bool done;
       bfd_vma val;
 
-      done = FALSE;
+      done = false;
 
       switch (stab[TYPEOFF])
        {
@@ -1376,15 +1383,15 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
 #endif
            }
          if (val > offset)
-           done = TRUE;
-         saw_line = TRUE;
+           done = true;
+         saw_line = true;
          break;
 
        case N_FUN:
        case N_SO:
          if (saw_func || saw_line)
-           done = TRUE;
-         saw_func = TRUE;
+           done = true;
+         saw_func = true;
          break;
        }
 
@@ -1392,7 +1399,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
        break;
     }
 
-  *pfound = TRUE;
+  *pfound = true;
 
   if (file_name == NULL || IS_ABSOLUTE_PATH (file_name)
       || directory_name == NULL)
@@ -1414,7 +1421,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
          len = strlen (file_name) + 1;
          info->filename = (char *) bfd_alloc (abfd, dirlen + len);
          if (info->filename == NULL)
-           return FALSE;
+           return false;
          memcpy (info->filename, directory_name, dirlen);
          memcpy (info->filename + dirlen, file_name, len);
        }
@@ -1436,7 +1443,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
       *pfnname = indexentry->function_name;
     }
 
-  return TRUE;
+  return true;
 }
 
 long
@@ -1464,17 +1471,17 @@ _bfd_nosymbols_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED,
 const char *
 _bfd_nosymbols_get_symbol_version_string (bfd *abfd,
                                          asymbol *symbol ATTRIBUTE_UNUSED,
-                                         bfd_boolean base_p ATTRIBUTE_UNUSED,
-                                         bfd_boolean *hidden ATTRIBUTE_UNUSED)
+                                         bool base_p ATTRIBUTE_UNUSED,
+                                         bool *hidden ATTRIBUTE_UNUSED)
 {
   return (const char *) _bfd_ptr_bfd_null_error (abfd);
 }
 
-bfd_boolean
+bool
 _bfd_nosymbols_bfd_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED,
                                        const char *name ATTRIBUTE_UNUSED)
 {
-  return FALSE;
+  return false;
 }
 
 alent *
@@ -1483,7 +1490,7 @@ _bfd_nosymbols_get_lineno (bfd *abfd, asymbol *sym ATTRIBUTE_UNUSED)
   return (alent *) _bfd_ptr_bfd_null_error (abfd);
 }
 
-bfd_boolean
+bool
 _bfd_nosymbols_find_nearest_line
     (bfd *abfd,
      asymbol **symbols ATTRIBUTE_UNUSED,
@@ -1497,7 +1504,7 @@ _bfd_nosymbols_find_nearest_line
   return _bfd_bool_bfd_false_error (abfd);
 }
 
-bfd_boolean
+bool
 _bfd_nosymbols_find_line (bfd *abfd,
                          asymbol **symbols ATTRIBUTE_UNUSED,
                          asymbol *symbol ATTRIBUTE_UNUSED,
@@ -1507,7 +1514,7 @@ _bfd_nosymbols_find_line (bfd *abfd,
   return _bfd_bool_bfd_false_error (abfd);
 }
 
-bfd_boolean
+bool
 _bfd_nosymbols_find_inliner_info
     (bfd *abfd,
      const char **filename_ptr ATTRIBUTE_UNUSED,
@@ -1527,7 +1534,7 @@ _bfd_nosymbols_bfd_make_debug_symbol (bfd *abfd,
 
 long
 _bfd_nosymbols_read_minisymbols (bfd *abfd,
-                                bfd_boolean dynamic ATTRIBUTE_UNUSED,
+                                bool dynamic ATTRIBUTE_UNUSED,
                                 void **minisymsp ATTRIBUTE_UNUSED,
                                 unsigned int *sizep ATTRIBUTE_UNUSED)
 {
@@ -1536,7 +1543,7 @@ _bfd_nosymbols_read_minisymbols (bfd *abfd,
 
 asymbol *
 _bfd_nosymbols_minisymbol_to_symbol (bfd *abfd,
-                                    bfd_boolean dynamic ATTRIBUTE_UNUSED,
+                                    bool dynamic ATTRIBUTE_UNUSED,
                                     const void *minisym ATTRIBUTE_UNUSED,
                                     asymbol *sym ATTRIBUTE_UNUSED)
 {
This page took 0.028645 seconds and 4 git commands to generate.