* elf32-bfin.c (bfd_const_reloc, bfd_oper_reloc, bfin_push_reloc,
[deliverable/binutils-gdb.git] / bfd / hash.c
index 21c6293e141b8f60a37d5fa6e1623bd75224f6ea..ce9ba5c6297fb436274b828939bde37f27dbc7c2 100644 (file)
@@ -1,6 +1,6 @@
 /* hash.c -- hash table routines for BFD
-   Copyright 1993, 1994, 1995, 1997, 1999, 2001, 2002, 2003, 2004, 2005
-   Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1995, 1997, 1999, 2001, 2002, 2003, 2004, 2005,
+   2006 Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -17,7 +17,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.  */
 
 #include "bfd.h"
 #include "sysdep.h"
@@ -308,6 +308,7 @@ bfd_hash_table_init_n (struct bfd_hash_table *table,
                       struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *,
                                                          struct bfd_hash_table *,
                                                          const char *),
+                      unsigned int entsize,
                       unsigned int size)
 {
   unsigned int alloc;
@@ -328,6 +329,7 @@ bfd_hash_table_init_n (struct bfd_hash_table *table,
     }
   memset ((void *) table->table, 0, alloc);
   table->size = size;
+  table->entsize = entsize;
   table->newfunc = newfunc;
   return TRUE;
 }
@@ -338,9 +340,11 @@ bfd_boolean
 bfd_hash_table_init (struct bfd_hash_table *table,
                     struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *,
                                                        struct bfd_hash_table *,
-                                                       const char *))
+                                                       const char *),
+                    unsigned int entsize)
 {
-  return bfd_hash_table_init_n (table, newfunc, bfd_default_hash_table_size);
+  return bfd_hash_table_init_n (table, newfunc, entsize,
+                               bfd_default_hash_table_size);
 }
 
 /* Free a hash table.  */
@@ -492,7 +496,7 @@ bfd_hash_set_default_size (bfd_size_type hash_size)
   /* Extend this prime list if you want more granularity of hash table size.  */
   static const bfd_size_type hash_size_primes[] =
     {
-      1021, 4051, 8599, 16699
+      251, 509, 1021, 2039, 4051, 8599, 16699, 32749
     };
   size_t index;
 
@@ -591,7 +595,8 @@ _bfd_stringtab_init (void)
   if (table == NULL)
     return NULL;
 
-  if (! bfd_hash_table_init (& table->table, strtab_hash_newfunc))
+  if (!bfd_hash_table_init (&table->table, strtab_hash_newfunc,
+                           sizeof (struct strtab_hash_entry)))
     {
       free (table);
       return NULL;
This page took 0.024749 seconds and 4 git commands to generate.