From fbd8a2572efc74ed0951e6b33b151bc13015e772 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Mon, 29 Sep 2008 21:23:02 +0000 Subject: * archive.cc (Archive::get_file_and_offset): Use filename instead of name to get library path. (Archive::include_member): Unlock external member of a thin archive. * testsuite/Makefile.am (TEST_AR): New variable. (thin_archive_test_1): New test. (thin_archive_test_2): New test. --- gold/archive.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gold/archive.cc') diff --git a/gold/archive.cc b/gold/archive.cc index 7fd1a17..7e2d143 100644 --- a/gold/archive.cc +++ b/gold/archive.cc @@ -459,11 +459,11 @@ Archive::get_file_and_offset(off_t off, Input_objects* input_objects, // to the directory containing the archive. if (!IS_ABSOLUTE_PATH(member_name->c_str())) { - const char* arch_path = this->name().c_str(); + const char* arch_path = this->filename().c_str(); const char* basename = lbasename(arch_path); if (basename > arch_path) member_name->replace(0, 0, - this->name().substr(0, basename - arch_path)); + this->filename().substr(0, basename - arch_path)); } if (nested_off > 0) @@ -786,6 +786,11 @@ Archive::include_member(Symbol_table* symtab, Layout* layout, obj->read_symbols(&sd); obj->layout(symtab, layout, &sd); obj->add_symbols(symtab, &sd); + + // If this is an external member of a thin archive, unlock the file + // for the next task. + if (obj->offset() == 0) + obj->unlock(this->task_); } else { -- cgit v1.1