]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
solib-darwin: Overwrite filename of unpeeled fat-binary bfd.
authorJoel Brobecker <brobecker@gnat.com>
Thu, 11 Apr 2013 01:24:09 +0000 (01:24 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Thu, 11 Apr 2013 01:24:09 +0000 (01:24 +0000)
gdb/ChangeLog:

        * solib-darwin.c (darwin_bfd_open): Set the filename of the
        returned bfd to a copy of PATHNAME.

gdb/ChangeLog
gdb/solib-darwin.c

index 8b57165d3df308ba5cf187a1a39a558962b3d2bf..20a2072b0f48bc7d87042f0d1adbafd62b190541 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-10  Joel Brobecker  <brobecker@adacore.com>
+
+       * solib-darwin.c (darwin_bfd_open): Set the filename of the
+       returned bfd to a copy of PATHNAME.
+
 2013-04-09  Markus Metzger  <markus.t.metzger@intel.com>
 
        * NEWS: Mention new btrace RSP packets.
index b9a4be1c600ebd19552cd130f90bab420b4943a3..9b61de588050579f26e9e366543853d58eeaedfc 100644 (file)
@@ -621,6 +621,16 @@ darwin_bfd_open (char *pathname)
             bfd_get_filename (abfd), bfd_errmsg (bfd_get_error ()));
     }
 
+  /* The current filename for fat-binary BFDs is a name generated
+     by BFD, usually a string containing the name of the architecture.
+     Reset its value to the actual filename.  */
+    {
+      char *data = bfd_alloc (res, strlen (pathname) + 1);
+
+      strcpy (data, pathname);
+      res->filename = data;
+    }
+
   gdb_bfd_unref (abfd);
   return res;
 }