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/gdb_bfd.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'gdb/gdb_bfd.h') diff --git a/gdb/gdb_bfd.h b/gdb/gdb_bfd.h index 35c5bda..d415005 100644 --- a/gdb/gdb_bfd.h +++ b/gdb/gdb_bfd.h @@ -24,12 +24,6 @@ DECLARE_REGISTRY (bfd); -/* Make a copy ABFD's filename using bfd_alloc, and reassign it to the - BFD. This ensures that the BFD's filename has the same lifetime as - the BFD itself. */ - -void gdb_bfd_stash_filename (struct bfd *abfd); - /* Open a read-only (FOPEN_RB) BFD given arguments like bfd_fopen. Returns NULL on error. On success, returns a new reference to the BFD, which must be freed with gdb_bfd_unref. BFDs returned by this @@ -79,22 +73,22 @@ int gdb_bfd_crc (struct bfd *abfd, unsigned long *crc_out); /* A wrapper for bfd_fopen that initializes the gdb-specific reference - count and calls gdb_bfd_stash_filename. */ + count. */ bfd *gdb_bfd_fopen (const char *, const char *, const char *, int); /* A wrapper for bfd_openr that initializes the gdb-specific reference - count and calls gdb_bfd_stash_filename. */ + count. */ bfd *gdb_bfd_openr (const char *, const char *); /* A wrapper for bfd_openw that initializes the gdb-specific reference - count and calls gdb_bfd_stash_filename. */ + count. */ bfd *gdb_bfd_openw (const char *, const char *); /* A wrapper for bfd_openr_iovec that initializes the gdb-specific - reference count and calls gdb_bfd_stash_filename. */ + reference count. */ bfd *gdb_bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -112,12 +106,12 @@ bfd *gdb_bfd_openr_iovec (const char *filename, const char *target, struct stat *sb)); /* A wrapper for bfd_openr_next_archived_file that initializes the - gdb-specific reference count and calls gdb_bfd_stash_filename. */ + gdb-specific reference count. */ bfd *gdb_bfd_openr_next_archived_file (bfd *archive, bfd *previous); /* A wrapper for bfd_fdopenr that initializes the gdb-specific - reference count and calls gdb_bfd_stash_filename. */ + reference count. */ bfd *gdb_bfd_fdopenr (const char *filename, const char *target, int fd); -- cgit v1.1