]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2009-10-08 Paul Pluzhnikov <ppluzhnikov@google.com>
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Thu, 8 Oct 2009 17:42:10 +0000 (17:42 +0000)
committerPaul Pluzhnikov <ppluzhnikov@google.com>
Thu, 8 Oct 2009 17:42:10 +0000 (17:42 +0000)
PR gdb/10457
* elfread.c (elf_symtab_read): Don't use alloca in a loop.

gdb/ChangeLog
gdb/elfread.c

index f9962ca9e3589c6472dcc3ba3f8b719eddaed925..2e2a107e1aae7d1711d9c41bb018593dd7f8eb5e 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+       PR gdb/10457
+       * elfread.c (elf_symtab_read): Don't use alloca in a loop.
+       
 2009-10-06  Joel Brobecker  <brobecker@adacore.com>
 
        * version.in: Set version to 7.0.0.20091006-cvs.
index 6e79d4abbd0c92abd16317f1cb43c0d6f0c08357..767dfe6b214657a54bf7331b9cd71b3c22d44978 100644 (file)
@@ -535,7 +535,7 @@ elf_symtab_read (struct objfile *objfile, int type,
 
              if (len > 4 && strcmp (sym->name + len - 4, "@plt") == 0)
                {
-                 char *base_name = alloca (len - 4 + 1);
+                 char *base_name = xmalloc (len - 4 + 1);
                  struct minimal_symbol *mtramp;
 
                  memcpy (base_name, sym->name, len - 4);
@@ -543,6 +543,7 @@ elf_symtab_read (struct objfile *objfile, int type,
                  mtramp = record_minimal_symbol (base_name, symaddr,
                                                  mst_solib_trampoline,
                                                  sym->section, objfile);
+                 xfree (base_name);
                  if (mtramp)
                    {
                      MSYMBOL_SIZE (mtramp) = MSYMBOL_SIZE (msym);