* linker.c (_bfd_generic_link_add_archive_symbols): Replace alloca()
authorThiemo Seufer <ths@networkno.de>
Fri, 24 Aug 2001 03:56:28 +0000 (03:56 +0000)
committerThiemo Seufer <ths@networkno.de>
Fri, 24 Aug 2001 03:56:28 +0000 (03:56 +0000)
by bfd_malloc().

bfd/ChangeLog
bfd/linker.c

index 8895828347165344817bcd92ff24a973ba9c91a5..166ca49a374bec8d32ad7a61b2c621ebd68af02a 100644 (file)
@@ -1,3 +1,8 @@
+2001-08-24  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+       * linker.c (_bfd_generic_link_add_archive_symbols): Replace alloca()
+       by bfd_malloc().
+
 2001-08-23  Andreas Jaeger  <aj@suse.de>
 
        * elf64-x86-64.c (elf64_x86_64_check_relocs): Set DF_TEXTREL if
index 00389aca6c2d1bf7988a876a94b7c6d5bb5e125e..89b952691547db715144c74813a0a93adb52e318 100644 (file)
@@ -1007,9 +1007,13 @@ _bfd_generic_link_add_archive_symbols (abfd, info, checkfn)
             let's look for its import thunk */
          if (info->pei386_auto_import)
            {
-             char *buf = alloca (strlen (h->root.string) + 10);
+             char *buf = (char *) bfd_malloc (strlen (h->root.string) + 10);
+             if (buf == NULL)
+               return false;
+
              sprintf (buf, "__imp_%s", h->root.string);
              arh = archive_hash_lookup (&arsym_hash, buf, false, false);
+             free(buf);
            }
          if (arh == (struct archive_hash_entry *) NULL)
            {