From adcf2eed05bb041ba579d74102c18ea1e97b29d6 Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Tue, 7 Jan 2014 00:24:41 +0800 Subject: Remove gdb_bfd_stash_filename to fix crash with fix of binutils/11983 https://sourceware.org/ml/gdb-patches/2014-01/msg00029.html https://sourceware.org/ml/gdb-patches/2014-01/msg00053.html 2014-01-07 Hui Zhu * gdb_bfd.c (gdb_bfd_stash_filename): Removed. (gdb_bfd_open): Removed gdb_bfd_stash_filename. (gdb_bfd_fopen): Ditto. (gdb_bfd_openr): Ditto. (gdb_bfd_openw): Ditto. (gdb_bfd_openr_iovec): Ditto. (gdb_bfd_fdopenr): Ditto. * gdb_bfd.h (gdb_bfd_stash_filename): Removed. * solib-aix.c (solib_aix_bfd_open): Alloc object_bfd->filename with xstrdup. * solib-darwin.c (darwin_bfd_open): Alloc res->filename with xstrdup. * symfile-mem.c (symbol_file_add_from_memory): Removed gdb_bfd_stash_filename. --- gdb/solib-aix.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'gdb/solib-aix.c') diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c index 080a17b..fefa51f 100644 --- a/gdb/solib-aix.c +++ b/gdb/solib-aix.c @@ -728,12 +728,8 @@ solib_aix_bfd_open (char *pathname) to allow commands listing all shared libraries to display that synthetic name. Otherwise, we would only be displaying the name of the archive member object. */ - { - char *data = bfd_alloc (object_bfd, path_len + 1); - - strcpy (data, pathname); - object_bfd->filename = data; - } + xfree (bfd_get_filename (object_bfd)); + object_bfd->filename = xstrdup (pathname); gdb_bfd_unref (archive_bfd); do_cleanups (cleanup); -- cgit v1.1