* sh-tdep.c (sh_is_renesas_calling_convention): Fix handling of
[deliverable/binutils-gdb.git] / bfd / elf-strtab.c
index f5d6db1c10c0ed8ce72cba5e6b1ec5be8b25e49b..7d2fad4e51762ecd052a3300db5ffd5e5656c112 100644 (file)
@@ -1,5 +1,5 @@
 /* ELF strtab with GC and suffix merging support.
-   Copyright 2001, 2002, 2003, 2005, 2006, 2007
+   Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
    Written by Jakub Jelinek <jakub@redhat.com>.
 
@@ -7,7 +7,7 @@
 
    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,
@@ -17,7 +17,8 @@
 
    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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
 
 #include "sysdep.h"
 #include "bfd.h"
@@ -67,7 +68,8 @@ elf_strtab_hash_newfunc (struct bfd_hash_entry *entry,
   /* Allocate the structure if it has not already been allocated by a
      subclass.  */
   if (entry == NULL)
-    entry = bfd_hash_allocate (table, sizeof (struct elf_strtab_hash_entry));
+    entry = (struct bfd_hash_entry *)
+        bfd_hash_allocate (table, sizeof (struct elf_strtab_hash_entry));
   if (entry == NULL)
     return NULL;
 
@@ -96,7 +98,7 @@ _bfd_elf_strtab_init (void)
   struct elf_strtab_hash *table;
   bfd_size_type amt = sizeof (struct elf_strtab_hash);
 
-  table = bfd_malloc (amt);
+  table = (struct elf_strtab_hash *) bfd_malloc (amt);
   if (table == NULL)
     return NULL;
 
@@ -111,7 +113,8 @@ _bfd_elf_strtab_init (void)
   table->size = 1;
   table->alloced = 64;
   amt = sizeof (struct elf_strtab_hasn_entry *);
-  table->array = bfd_malloc (table->alloced * amt);
+  table->array = (struct elf_strtab_hash_entry **)
+      bfd_malloc (table->alloced * amt);
   if (table->array == NULL)
     {
       free (table);
@@ -165,7 +168,8 @@ _bfd_elf_strtab_add (struct elf_strtab_hash *tab,
        {
          bfd_size_type amt = sizeof (struct elf_strtab_hash_entry *);
          tab->alloced *= 2;
-         tab->array = bfd_realloc (tab->array, tab->alloced * amt);
+         tab->array = (struct elf_strtab_hash_entry **)
+              bfd_realloc_or_free (tab->array, tab->alloced * amt);
          if (tab->array == NULL)
            return (bfd_size_type) -1;
        }
@@ -310,7 +314,7 @@ _bfd_elf_strtab_finalize (struct elf_strtab_hash *tab)
 
   /* Sort the strings by suffix and length.  */
   amt = tab->size * sizeof (struct elf_strtab_hash_entry *);
-  array = bfd_malloc (amt);
+  array = (struct elf_strtab_hash_entry **) bfd_malloc (amt);
   if (array == NULL)
     goto alloc_failure;
 
This page took 0.024707 seconds and 4 git commands to generate.