aboutsummaryrefslogtreecommitdiff
path: root/gold/archive.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2008-09-29 21:23:02 +0000
committerCary Coutant <ccoutant@google.com>2008-09-29 21:23:02 +0000
commitfbd8a2572efc74ed0951e6b33b151bc13015e772 (patch)
tree6d2d573d901db9e7c01a7c102e691c04a4c0f414 /gold/archive.cc
parenteff458138e2978ee9a3aef4ebee40d53da11e764 (diff)
downloadgdb-fbd8a2572efc74ed0951e6b33b151bc13015e772.zip
gdb-fbd8a2572efc74ed0951e6b33b151bc13015e772.tar.gz
gdb-fbd8a2572efc74ed0951e6b33b151bc13015e772.tar.bz2
* 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.
Diffstat (limited to 'gold/archive.cc')
-rw-r--r--gold/archive.cc9
1 files changed, 7 insertions, 2 deletions
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
{