]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elfread.c (elf_symtab_read): Put the filename in the filename
authorTom Tromey <tromey@redhat.com>
Wed, 21 Dec 2011 21:30:31 +0000 (21:30 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 21 Dec 2011 21:30:31 +0000 (21:30 +0000)
bcache.

gdb/ChangeLog
gdb/elfread.c

index d4d980f1e5078cd23196d8eb4331fb183c23cb9e..57f3aa02efe6cc3aec5d25a06d6e09966cafbb6b 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-21  Tom Tromey  <tromey@redhat.com>
+
+       * elfread.c (elf_symtab_read): Put the filename in the filename
+       bcache.
+
 2011-12-21  Tom Tromey  <tromey@redhat.com>
 
        * symtab.h (struct minimal_symbol) <filename>: Now const.
index fd65ecf91597b4598660ecdfc43468b3704f917e..4ceb31bd5642aea09024a82e14cb4b8b2dd08d1d 100644 (file)
@@ -43,6 +43,7 @@
 #include "infcall.h"
 #include "gdbthread.h"
 #include "regcache.h"
+#include "bcache.h"
 
 extern void _initialize_elfread (void);
 
@@ -240,8 +241,8 @@ elf_symtab_read (struct objfile *objfile, int type,
      seen any section info for it yet.  */
   asymbol *filesym = 0;
   /* Name of filesym.  This is either a constant string or is saved on
-     the objfile's obstack.  */
-  char *filesymname = "";
+     the objfile's filename cache.  */
+  const char *filesymname = "";
   struct dbx_symfile_info *dbx = objfile->deprecated_sym_stab_info;
   int stripped = (bfd_get_symcount (objfile->obfd) == 0);
 
@@ -346,9 +347,8 @@ elf_symtab_read (struct objfile *objfile, int type,
              sectinfo = NULL;
            }
          filesym = sym;
-         filesymname =
-           obsavestring ((char *) filesym->name, strlen (filesym->name),
-                         &objfile->objfile_obstack);
+         filesymname = bcache (filesym->name, strlen (filesym->name) + 1,
+                               objfile->filename_cache);
        }
       else if (sym->flags & BSF_SECTION_SYM)
        continue;