aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdb_bfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdb_bfd.c')
-rw-r--r--gdb/gdb_bfd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
index 160e9e6..8f40d74 100644
--- a/gdb/gdb_bfd.c
+++ b/gdb/gdb_bfd.c
@@ -21,6 +21,22 @@
#include "defs.h"
#include "gdb_bfd.h"
#include "gdb_assert.h"
+#include "gdb_string.h"
+
+/* See gdb_bfd.h. */
+
+void
+gdb_bfd_stash_filename (struct bfd *abfd)
+{
+ char *name = bfd_get_filename (abfd);
+ char *data;
+
+ data = bfd_alloc (abfd, strlen (name) + 1);
+ strcpy (data, name);
+
+ /* Unwarranted chumminess with BFD. */
+ abfd->filename = data;
+}
/* Close ABFD, and warn if that fails. */