Automatic date update in version.in
[deliverable/binutils-gdb.git] / bfd / libbfd.c
index 608d80cd40c766b9451d305f6c4b66793175d643..3579ddb855a643da28c0edf59b43399da324f894 100644 (file)
@@ -1,5 +1,5 @@
 /* Assorted BFD support routines, only used internally.
 /* Assorted BFD support routines, only used internally.
-   Copyright (C) 1990-2019 Free Software Foundation, Inc.
+   Copyright (C) 1990-2020 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -245,7 +245,7 @@ _bfd_nocore_core_file_pid (bfd *ignore_abfd ATTRIBUTE_UNUSED)
   return 0;
 }
 
   return 0;
 }
 
-const bfd_target *
+bfd_cleanup
 _bfd_dummy_target (bfd *ignore_abfd ATTRIBUTE_UNUSED)
 {
   bfd_set_error (bfd_error_wrong_format);
 _bfd_dummy_target (bfd *ignore_abfd ATTRIBUTE_UNUSED)
 {
   bfd_set_error (bfd_error_wrong_format);
@@ -279,24 +279,6 @@ bfd_malloc (bfd_size_type size)
   return ptr;
 }
 
   return ptr;
 }
 
-/* Allocate memory using malloc, nmemb * size with overflow checking.  */
-
-void *
-bfd_malloc2 (bfd_size_type nmemb, bfd_size_type size)
-{
-  if ((nmemb | size) >= HALF_BFD_SIZE_TYPE
-      && size != 0
-      && nmemb > ~(bfd_size_type) 0 / size)
-    {
-      bfd_set_error (bfd_error_no_memory);
-      return NULL;
-    }
-
-  return bfd_malloc (size * nmemb);
-}
-
-/* Reallocate memory using realloc.  */
-
 void *
 bfd_realloc (void *ptr, bfd_size_type size)
 {
 void *
 bfd_realloc (void *ptr, bfd_size_type size)
 {
@@ -322,22 +304,6 @@ bfd_realloc (void *ptr, bfd_size_type size)
   return ret;
 }
 
   return ret;
 }
 
-/* Reallocate memory using realloc, nmemb * size with overflow checking.  */
-
-void *
-bfd_realloc2 (void *ptr, bfd_size_type nmemb, bfd_size_type size)
-{
-  if ((nmemb | size) >= HALF_BFD_SIZE_TYPE
-      && size != 0
-      && nmemb > ~(bfd_size_type) 0 / size)
-    {
-      bfd_set_error (bfd_error_no_memory);
-      return NULL;
-    }
-
-  return bfd_realloc (ptr, size * nmemb);
-}
-
 /* Reallocate memory using realloc.
    If this fails the pointer is freed before returning.  */
 
 /* Reallocate memory using realloc.
    If this fails the pointer is freed before returning.  */
 
@@ -365,25 +331,6 @@ bfd_zmalloc (bfd_size_type size)
   return ptr;
 }
 
   return ptr;
 }
 
-/* Allocate memory using malloc (nmemb * size) with overflow checking
-   and clear it.  */
-
-void *
-bfd_zmalloc2 (bfd_size_type nmemb, bfd_size_type size)
-{
-  void *ptr = bfd_malloc2 (nmemb, size);
-
-  if (ptr != NULL)
-    {
-      size_t sz = nmemb * size;
-
-      if (sz > 0)
-       memset (ptr, 0, sz);
-    }
-
-  return ptr;
-}
-
 /*
 INTERNAL_FUNCTION
        bfd_write_bigendian_4byte_int
 /*
 INTERNAL_FUNCTION
        bfd_write_bigendian_4byte_int
This page took 0.02467 seconds and 4 git commands to generate.