Update the address and phone number of the FSF organization in the GPL notices
[deliverable/binutils-gdb.git] / bfd / syms.c
index 62acf12f686c979648707fe3e4750907bcd65733..0ff94164ed5e28dfb78a7049980d30e9c55ca096 100644 (file)
@@ -1,6 +1,6 @@
 /* Generic symbol-table support for the BFD library.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -18,7 +18,7 @@
 
    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.  */
 
 /*
 SECTION
@@ -133,9 +133,9 @@ SUBSECTION
 |      nm foo
 |      00012345 A dummy_symbol
 
-       Many formats cannot represent arbitary symbol information; for
+       Many formats cannot represent arbitrary symbol information; for
        instance, the <<a.out>> object format does not allow an
-       arbitary number of sections. A symbol pointing to a section
+       arbitrary number of sections. A symbol pointing to a section
        which is not one  of <<.text>>, <<.data>> or <<.bss>> cannot
        be described.
 
@@ -222,7 +222,7 @@ CODE_FRAGMENT
 .     <<BSF_LOCAL>>, <<BSF_FORT_COMM>>,  <<BSF_UNDEFINED>> or
 .     <<BSF_GLOBAL>>.  *}
 .
-.  {* The symbol is a debugging record. The value has an arbitary
+.  {* The symbol is a debugging record. The value has an arbitrary
 .     meaning, unless BSF_DEBUGGING_RELOC is also set.  *}
 .#define BSF_DEBUGGING 0x08
 .
@@ -355,7 +355,7 @@ 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_SECTION_SYM)) != 0)
+  if ((sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_FILE | BSF_SECTION_SYM)) != 0)
     return FALSE;
   if (sym->name == NULL)
     return FALSE;
@@ -380,6 +380,23 @@ DESCRIPTION
 .
 */
 
+/*
+FUNCTION
+       bfd_is_target_special_symbol
+
+SYNOPSIS
+        bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
+
+DESCRIPTION
+       Return TRUE iff a symbol @var{sym} in the BFD @var{abfd} is something
+       special to the particular target represented by the BFD.  Such symbols
+       should normally not be mentioned to the user.
+
+.#define bfd_is_target_special_symbol(abfd, sym) \
+.  BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
+.
+*/
+
 /*
 FUNCTION
        bfd_canonicalize_symtab
@@ -934,8 +951,12 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
          return TRUE;
        }
 
-      stabsize = info->stabsec->_raw_size;
-      strsize = info->strsec->_raw_size;
+      stabsize = (info->stabsec->rawsize
+                 ? info->stabsec->rawsize
+                 : info->stabsec->size);
+      strsize = (info->strsec->rawsize
+                ? info->strsec->rawsize
+                : info->strsec->size);
     }
   else
     {
@@ -965,8 +986,12 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
          return TRUE;
        }
 
-      stabsize = info->stabsec->_raw_size;
-      strsize = info->strsec->_raw_size;
+      stabsize = (info->stabsec->rawsize
+                 ? info->stabsec->rawsize
+                 : info->stabsec->size);
+      strsize = (info->strsec->rawsize
+                ? info->strsec->rawsize
+                : info->strsec->size);
 
       info->stabs = bfd_alloc (abfd, stabsize);
       info->strs = bfd_alloc (abfd, strsize);
@@ -974,9 +999,9 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
        return FALSE;
 
       if (! bfd_get_section_contents (abfd, info->stabsec, info->stabs,
-                                     (bfd_vma) 0, stabsize)
+                                     0, stabsize)
          || ! bfd_get_section_contents (abfd, info->strsec, info->strs,
-                                        (bfd_vma) 0, strsize))
+                                        0, strsize))
        return FALSE;
 
       /* If this is a relocatable object file, we have to relocate
@@ -1008,6 +1033,10 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
              asymbol *sym;
 
              r = *pr;
+             /* Ignore R_*_NONE relocs.  */
+             if (r->howto->dst_mask == 0)
+               continue;
+
              if (r->howto->rightshift != 0
                  || r->howto->size != 2
                  || r->howto->bitsize != 32
@@ -1222,7 +1251,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
       long low, high;
       long mid = -1;
 
-      /* Cache non-existant or invalid.  Do binary search on
+      /* Cache non-existent or invalid.  Do binary search on
          indextable.  */
       indexentry = NULL;
 
This page took 0.025909 seconds and 4 git commands to generate.