Fix an illegal memory access triggered when trying to examine an input file containin...
[deliverable/binutils-gdb.git] / gdb / solib.c
index 548367060a8a3f049adf836c3f59947a1ae06376..962ce32dcf0396c94d3b898851dbde3ba4ffe37d 100644 (file)
@@ -1,6 +1,6 @@
 /* Handle shared libraries for GDB, the GNU Debugger.
 
-   Copyright (C) 1990-2019 Free Software Foundation, Inc.
+   Copyright (C) 1990-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -835,7 +835,7 @@ update_solib_list (int from_tty)
          /* Unless the user loaded it explicitly, free SO's objfile.  */
          if (gdb->objfile && ! (gdb->objfile->flags & OBJF_USERLOADED)
              && !solib_used (gdb))
-           delete gdb->objfile;
+           gdb->objfile->unlink ();
 
          /* Some targets' section tables might be referring to
             sections from so->abfd; remove them.  */
@@ -1312,7 +1312,7 @@ reload_shared_libraries_1 (int from_tty)
        {
          if (so->objfile && ! (so->objfile->flags & OBJF_USERLOADED)
              && !solib_used (so))
-           delete so->objfile;
+           so->objfile->unlink ();
          remove_target_sections (so);
          clear_so (so);
        }
This page took 0.024886 seconds and 4 git commands to generate.