PR 9766
[deliverable/binutils-gdb.git] / gold / archive.cc
index 7fd1a1785f4651a21e57e4584a7e7d71eebbe419..b1ba6d91ad1bf0fd30d6be255a16a1ece1a48d5f 100644 (file)
@@ -1,6 +1,6 @@
 // archive.cc -- archive support for gold
 
-// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -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)
@@ -535,7 +535,6 @@ Archive::get_elf_object_for_member(off_t off, Input_objects* input_objects)
         {
           // The input file was claimed by a plugin, and its symbols
           // have been provided by the plugin.
-         input_file->file().claim_for_plugin();
           return obj;
         }
     }
@@ -786,6 +785,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
     {
This page took 0.023481 seconds and 4 git commands to generate.