* symfile.c (symbol_file_add): Don't open BFD twice.
authorTom Tromey <tromey@redhat.com>
Tue, 24 Jul 2012 20:15:56 +0000 (20:15 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 24 Jul 2012 20:15:56 +0000 (20:15 +0000)
gdb/ChangeLog
gdb/symfile.c

index 07bb7bf47eecfce75b49976b1f5b3f789035e8d8..a14a25fa0734352c8222678ccd8afeb4d51f6f8d 100644 (file)
@@ -1,3 +1,7 @@
+2012-07-24  Tom Tromey  <tromey@redhat.com>
+
+       * symfile.c (symbol_file_add): Don't open BFD twice.
+
 2012-07-24  Marc Khouzam  <marc.khouzam@ericsson.com>
 
        * breakpoint.c (create_breakpoint): Store condition for pending
index 7a913e97a91bd933ac879bcd9a8f0a8faa322fbc..95ed480ff640838e24e78e25a674c87feca1bd87 100644 (file)
@@ -1208,8 +1208,7 @@ symbol_file_add (char *name, int add_flags, struct section_addr_info *addrs,
   struct cleanup *cleanup = make_cleanup_bfd_unref (bfd);
   struct objfile *objf;
 
-  objf = symbol_file_add_from_bfd (symfile_bfd_open (name), add_flags, addrs,
-                                   flags, NULL);
+  objf = symbol_file_add_from_bfd (bfd, add_flags, addrs, flags, NULL);
   do_cleanups (cleanup);
   return objf;
 }