aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gold/ChangeLog6
-rw-r--r--gold/archive.cc14
2 files changed, 14 insertions, 6 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 14c5386..d62547e 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-13 Ian Lance Taylor <iant@google.com>
+
+ * archive.cc (Archive::include_member): Unlock an external member
+ of a thin archive. Don't bother to delete an object we know is
+ NULL.
+
2010-07-12 Cary Coutant <ccoutant@google.com>
* compressed_output.cc (zlib_decompress): New function.
diff --git a/gold/archive.cc b/gold/archive.cc
index 36e4862..202fc2c8e 100644
--- a/gold/archive.cc
+++ b/gold/archive.cc
@@ -853,11 +853,7 @@ Archive::include_member(Symbol_table* symtab, Layout* layout,
&& this->searched_for()
&& obj == NULL
&& unconfigured)
- {
- if (obj != NULL)
- delete obj;
- return false;
- }
+ return false;
if (obj == NULL)
return true;
@@ -874,7 +870,13 @@ Archive::include_member(Symbol_table* symtab, Layout* layout,
}
if (!input_objects->add_object(obj))
- delete obj;
+ {
+ // If this is an external member of a thin archive, unlock the
+ // file.
+ if (obj->offset() == 0)
+ obj->unlock(this->task_);
+ delete obj;
+ }
else
{
{