This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] [gold] Unlock external members of thin archives.


gold/
	* archive.cc (Archive::get_elf_object_for_member): Unlock external
	members of thin archives so that they may be used by plugins.
---
 gold/ChangeLog  | 5 +++++
 gold/archive.cc | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/gold/ChangeLog b/gold/ChangeLog
index 946504a..c3ea98d 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-27  Peter Collingbourne  <pcc@google.com>
+
+	* archive.cc (Archive::get_elf_object_for_member): Unlock external
+	members of thin archives so that they may be used by plugins.
+
 2015-01-25  Cary Coutant  <ccoutant@google.com>
 
 	* output.cc (Output_segment::set_section_addresses): Fix calculation
diff --git a/gold/archive.cc b/gold/archive.cc
index 69107f5..949514a 100644
--- a/gold/archive.cc
+++ b/gold/archive.cc
@@ -692,6 +692,12 @@ Archive::get_elf_object_for_member(off_t off, bool* punconfigured)
 	  // Delete its elf object.
 	  if (obj != NULL)
 	    delete obj;
+
+	  // If this is an external member of a thin archive, unlock the
+	  // file.
+	  if (this->is_thin_archive_)
+	    input_file->file().unlock(this->task_);
+
           return plugin_obj;
         }
     }
-- 
2.2.0.rc0.207.ga3a616c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]