symfile, vdso: remove target sections
[binutils-gdb.git] / gdb / symfile.c
index 64a83c684a01b2d13261c83cef12b2a79bb5a773..7ad4a44fa63b5b29ab975279ea822dcd88b41125 100644 (file)
@@ -3892,8 +3892,8 @@ symfile_find_segment_sections (struct objfile *objfile)
 static void
 symfile_free_objfile (struct objfile *objfile)
 {
-  /* Remove the target sections of user-added objfiles.  */
-  if (objfile != 0 && objfile->flags & OBJF_USERLOADED)
+  /* Remove the target sections owned by this objfile.  */
+  if (objfile != NULL)
     remove_target_sections ((void *) objfile);
 }