* elf32-m68k.c (elf_m68k_copy_indirect_symbol): Propagate non_got_ref
[deliverable/binutils-gdb.git] / bfd / syms.c
index 9b4c6524497b1bf7bd5c75cfcc2f625dcc1a91fb..e4258b556a49696a15396fb10d46d562fc800d61 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, 2004, 2007, 2008
+   2000, 2001, 2002, 2003, 2004, 2007, 2008, 2009
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -231,13 +231,6 @@ CODE_FRAGMENT
 .     perhaps others someday.  *}
 .#define BSF_FUNCTION          (1 << 3)
 .
-.  {* The symbol is an indirect code object.  Unrelated to BSF_INDIRECT.
-.     Relocations against a symbol with this flag have to evaluated at
-.     run-time, where the function pointed to by this symbol is invoked
-.     in order to determine the value to be used in the relocation.
-.     BSF_FUNCTION must also be set for symbols with this flag.  *}
-.#define BSF_INDIRECT_FUNCTION (1 << 4)
-. 
 .  {* Used by the linker.  *}
 .#define BSF_KEEP              (1 << 5)
 .#define BSF_KEEP_G            (1 << 6)
@@ -304,6 +297,16 @@ CODE_FRAGMENT
 .  {* This symbol was created by bfd_get_synthetic_symtab.  *}
 .#define BSF_SYNTHETIC         (1 << 21)
 .
+.  {* This symbol is an indirect code object.  Unrelated to BSF_INDIRECT.
+.     The dynamic linker will compute the value of this symbol by
+.     calling the function that it points to.  BSF_FUNCTION must
+.     also be also set.  *}
+.#define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
+.  {* This symbol is a globally unique data object.  The dynamic linker
+.     will make sure that in the entire process there is just one symbol
+.     with this name and type in use.  BSF_OBJECT must also be set.  *}
+.#define BSF_GNU_UNIQUE                (1 << 23)
+.
 .  flagword flags;
 .
 .  {* A pointer to the section to which this symbol is
@@ -486,11 +489,12 @@ bfd_print_symbol_vandf (bfd *abfd, void *arg, asymbol *symbol)
   fprintf (file, " %c%c%c%c%c%c%c",
           ((type & BSF_LOCAL)
            ? (type & BSF_GLOBAL) ? '!' : 'l'
-           : (type & BSF_GLOBAL) ? 'g' : ' '),
+           : (type & BSF_GLOBAL) ? 'g'
+           : (type & BSF_GNU_UNIQUE) ? 'u' : ' '),
           (type & BSF_WEAK) ? 'w' : ' ',
           (type & BSF_CONSTRUCTOR) ? 'C' : ' ',
           (type & BSF_WARNING) ? 'W' : ' ',
-          (type & BSF_INDIRECT) ? 'I' : (type & BSF_INDIRECT_FUNCTION) ? 'i' : ' ',
+          (type & BSF_INDIRECT) ? 'I' : (type & BSF_GNU_INDIRECT_FUNCTION) ? 'i' : ' ',
           (type & BSF_DEBUGGING) ? 'd' : (type & BSF_DYNAMIC) ? 'D' : ' ',
           ((type & BSF_FUNCTION)
            ? 'F'
@@ -676,7 +680,7 @@ bfd_decode_symclass (asymbol *symbol)
     }
   if (bfd_is_ind_section (symbol->section))
     return 'I';
-  if (symbol->flags & BSF_INDIRECT_FUNCTION)
+  if (symbol->flags & BSF_GNU_INDIRECT_FUNCTION)
     return 'i';
   if (symbol->flags & BSF_WEAK)
     {
@@ -687,6 +691,8 @@ bfd_decode_symclass (asymbol *symbol)
       else
        return 'W';
     }
+  if (symbol->flags & BSF_GNU_UNIQUE)
+    return 'u';
   if (!(symbol->flags & (BSF_GLOBAL | BSF_LOCAL)))
     return '?';
 
@@ -1385,10 +1391,11 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
        {
          size_t len;
 
-         if (info->filename != NULL)
-           free (info->filename);
+         /* Don't free info->filename here.  objdump and other
+            apps keep a copy of a previously returned file name
+            pointer.  */
          len = strlen (file_name) + 1;
-         info->filename = bfd_malloc (dirlen + len);
+         info->filename = bfd_alloc (abfd, dirlen + len);
          if (info->filename == NULL)
            return FALSE;
          memcpy (info->filename, directory_name, dirlen);
This page took 0.025214 seconds and 4 git commands to generate.