aboutsummaryrefslogtreecommitdiff
path: root/gold/plugin.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2013-02-11 16:12:59 +0000
committerIan Lance Taylor <ian@airs.com>2013-02-11 16:12:59 +0000
commit20e2a8aa3311d7c765e3fdcaab46dc5a11d266ff (patch)
tree47a9bcec45915e80de381862173b3f76d1e11be5 /gold/plugin.cc
parent6fe6ded97b0524a0ebae0d3a1773403cb79e3540 (diff)
downloadfsf-binutils-gdb-20e2a8aa3311d7c765e3fdcaab46dc5a11d266ff.zip
fsf-binutils-gdb-20e2a8aa3311d7c765e3fdcaab46dc5a11d266ff.tar.gz
fsf-binutils-gdb-20e2a8aa3311d7c765e3fdcaab46dc5a11d266ff.tar.bz2
* descriptors.cc (Descriptors::close_all): New function.
* descriptors.h (class Descriptors): Declare close_all. (close_all_descriptors): New inline function. * plugin.cc: Include "descriptors.h". (Plugin_manager::cleanup): Call close_all_descriptors.
Diffstat (limited to 'gold/plugin.cc')
-rw-r--r--gold/plugin.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/gold/plugin.cc b/gold/plugin.cc
index 9176e06..e932c1c 100644
--- a/gold/plugin.cc
+++ b/gold/plugin.cc
@@ -71,6 +71,7 @@ dlerror(void)
#include "target.h"
#include "readsyms.h"
#include "symtab.h"
+#include "descriptors.h"
#include "elfcpp.h"
namespace gold
@@ -697,6 +698,14 @@ Plugin_manager::layout_deferred_objects()
void
Plugin_manager::cleanup()
{
+ if (this->any_added_)
+ {
+ // If any input files were added, close all the input files.
+ // This is because the plugin may want to remove them, and on
+ // Windows you are not allowed to remove an open file.
+ close_all_descriptors();
+ }
+
for (this->current_ = this->plugins_.begin();
this->current_ != this->plugins_.end();
++this->current_)