* fileread.cc (File_read::clear_views): Don't delete the whole
authorIan Lance Taylor <ian@airs.com>
Thu, 10 Mar 2011 01:10:19 +0000 (01:10 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 10 Mar 2011 01:10:19 +0000 (01:10 +0000)
file view.

gold/ChangeLog
gold/fileread.cc

index c02a174494ee382bb33112b8d0eb6020d323374a..bbb8185b47345f7a798dae043b371b219fcd0489 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-09  Ian Lance Taylor  <iant@google.com>
+
+       * fileread.cc (File_read::clear_views): Don't delete the whole
+       file view.
+
 2011-03-08  Ian Lance Taylor  <iant@google.com>
 
        PR gold/12525
index 654e47b42491bb8e59a653eb012838b9a41a9cd6..36485a915be9b78d56f365ce5d81fb9b7a33576f 100644 (file)
@@ -717,7 +717,9 @@ File_read::clear_views(Clear_views_mode mode)
        should_delete = false;
       else if (mode == CLEAR_VIEWS_ALL)
        should_delete = true;
-      else if (p->second->should_cache() && keep_files_mapped)
+      else if ((p->second->should_cache()
+               || p->second == this->whole_file_view_)
+              && keep_files_mapped)
        should_delete = false;
       else if (this->object_count_ > 1
               && p->second->accessed()