PR ld/12549
[binutils-gdb.git] / gdb / exec.c
index 2bd31816f9a0229ec06871e326f31dc5d5af0096..221e67952d8b7c1ea9887a3aeda8bd84ec7ecde2 100644 (file)
@@ -1,6 +1,6 @@
 /* Work with executable files, for GDB. 
 
-   Copyright (C) 1988-2003, 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 1988-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -117,7 +117,6 @@ exec_close (void)
 static void
 exec_close_1 (int quitting)
 {
-  int need_symtab_cleanup = 0;
   struct vmap *vp, *nxt;
 
   using_exec_ops = 0;
@@ -128,10 +127,7 @@ exec_close_1 (int quitting)
       nxt = vp->nxt;
 
       if (vp->objfile)
-       {
-         free_objfile (vp->objfile);
-         need_symtab_cleanup = 1;
-       }
+       free_objfile (vp->objfile);
 
       gdb_bfd_unref (vp->bfd);
 
@@ -225,11 +221,11 @@ exec_file_attach (char *filename, int from_tty)
             &scratch_pathname);
        }
 #endif
+      if (scratch_chan < 0)
+       perror_with_name (filename);
 
       cleanups = make_cleanup (xfree, scratch_pathname);
 
-      if (scratch_chan < 0)
-       perror_with_name (filename);
       if (write_files)
        exec_bfd = gdb_bfd_fopen (scratch_pathname, gnutarget,
                                  FOPEN_RUB, scratch_chan);
@@ -391,11 +387,9 @@ add_to_section_table (bfd *abfd, struct bfd_section *asect,
 int
 resize_section_table (struct target_section_table *table, int num_added)
 {
-  struct target_section *old_value;
   int old_count;
   int new_count;
 
-  old_value = table->sections;
   old_count = table->sections_end - table->sections;
 
   new_count = num_added + old_count;
@@ -767,7 +761,7 @@ exec_files_info (struct target_ops *t)
 
   if (vmap)
     {
-      int addr_size = gdbarch_addr_bit (target_gdbarch) / 8;
+      int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
       struct vmap *vp;
 
       printf_unfiltered (_("\tMapping info for file `%s'.\n"), vmap->name);