aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-08-22 16:44:45 +0000
committerTom Tromey <tromey@redhat.com>2012-08-22 16:44:45 +0000
commite1507e953ec06f50f83f0bbc2b50a7f3b11f4022 (patch)
tree3d41d055dcf029eefad47eb986ad8559430e1740 /gdb/objfiles.c
parent1c00ec6b06aa852351b7eebd64b4f1604766e818 (diff)
downloadgdb-e1507e953ec06f50f83f0bbc2b50a7f3b11f4022.zip
gdb-e1507e953ec06f50f83f0bbc2b50a7f3b11f4022.tar.gz
gdb-e1507e953ec06f50f83f0bbc2b50a7f3b11f4022.tar.bz2
* jit.c (jit_object_close_impl): Don't malloc the objfile
name. * objfiles.c (allocate_objfile): Don't malloc the objfile name. (free_objfile): Don't free the objfile name. * objfiles.h (struct objfile) <name>: Update comment. * symfile.c (reread_symbols): Fix reference counting. Don't malloc objfile name.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index d5317a8..a1db8c6 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -271,7 +271,7 @@ allocate_objfile (bfd *abfd, int flags)
/* Look up the gdbarch associated with the BFD. */
objfile->gdbarch = gdbarch_from_bfd (abfd);
- objfile->name = xstrdup (bfd_get_filename (abfd));
+ objfile->name = bfd_get_filename (abfd);
objfile->mtime = bfd_get_mtime (abfd);
/* Build section table. */
@@ -279,7 +279,7 @@ allocate_objfile (bfd *abfd, int flags)
}
else
{
- objfile->name = xstrdup ("<<anonymous objfile>>");
+ objfile->name = "<<anonymous objfile>>";
}
objfile->per_bfd = get_objfile_bfd_data (objfile, abfd);
@@ -670,7 +670,6 @@ free_objfile (struct objfile *objfile)
/* The last thing we do is free the objfile struct itself. */
- xfree (objfile->name);
if (objfile->global_psymbols.list)
xfree (objfile->global_psymbols.list);
if (objfile->static_psymbols.list)