diff options
author | Ian Lance Taylor <ian@airs.com> | 2010-07-13 07:56:08 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2010-07-13 07:56:08 +0000 |
commit | f2d707b5bbca6893f38094b9be1e6346118a6d0e (patch) | |
tree | 52444aede92c82a0cc8f71a160bda27725d15353 /gold/archive.cc | |
parent | 2ef36331d2904194948f22ec75f99281240acad7 (diff) | |
download | gdb-f2d707b5bbca6893f38094b9be1e6346118a6d0e.zip gdb-f2d707b5bbca6893f38094b9be1e6346118a6d0e.tar.gz gdb-f2d707b5bbca6893f38094b9be1e6346118a6d0e.tar.bz2 |
* archive.cc (Archive::include_member): Unlock an external member
of a thin archive. Don't bother to delete an object we know is
NULL.
Diffstat (limited to 'gold/archive.cc')
-rw-r--r-- | gold/archive.cc | 14 |
1 files changed, 8 insertions, 6 deletions
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 { { |