summaryrefslogtreecommitdiff
path: root/gold/plugin.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2008-12-24 06:17:18 +0000
committerCary Coutant <ccoutant@google.com>2008-12-24 06:17:18 +0000
commitb3142064e6a18f5946c2117184328195a0bd6704 (patch)
tree56386f13f338b5d3adf9227067552d2cd8895574 /gold/plugin.h
parent83cad425bfe73057b8c6451816db0578ea1c3f00 (diff)
downloadbinutils-redhat-b3142064e6a18f5946c2117184328195a0bd6704.tar.gz
* gold.cc (gold_exit): Call plugin cleanup handlers on exit.
* plugin.cc (Plugin_manager::finish): Rename as layout_deferred_objects. Move cleanup to separate function. (Plugin_manager::cleanup): New function. (Plugin_finish::run): Call layout_deferred_objects and cleanup separately. * plugin.h (Plugin_manager::finish): Rename as layout_deferred_objects. (Plugin_manager::cleanup): New function. (Plugin_manager::cleanup_done): New field.
Diffstat (limited to 'gold/plugin.h')
-rw-r--r--gold/plugin.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/gold/plugin.h b/gold/plugin.h
index 20d416aac7..2ea0370878 100644
--- a/gold/plugin.h
+++ b/gold/plugin.h
@@ -121,9 +121,9 @@ class Plugin_manager
public:
Plugin_manager(const General_options& options)
: plugins_(), objects_(), deferred_layout_objects_(), input_file_(NULL),
- plugin_input_file_(), in_replacement_phase_(false), options_(options),
- workqueue_(NULL), input_objects_(NULL), symtab_(NULL), layout_(NULL),
- dirpath_(NULL), mapfile_(NULL), this_blocker_(NULL)
+ plugin_input_file_(), in_replacement_phase_(false), cleanup_done_(false),
+ options_(options), workqueue_(NULL), input_objects_(NULL), symtab_(NULL),
+ layout_(NULL), dirpath_(NULL), mapfile_(NULL), this_blocker_(NULL)
{ this->current_ = plugins_.end(); }
~Plugin_manager();
@@ -155,9 +155,13 @@ class Plugin_manager
Symbol_table* symtab, Layout* layout, Dirsearch* dirpath,
Mapfile* mapfile, Task_token** last_blocker);
- // Run deferred layout and call the cleanup handlers.
+ // Run deferred layout.
void
- finish();
+ layout_deferred_objects();
+
+ // Call the cleanup handlers.
+ void
+ cleanup();
// Register a claim-file handler.
void
@@ -248,6 +252,9 @@ class Plugin_manager
// placeholder symbols from the Pluginobj objects.
bool in_replacement_phase_;
+ // TRUE if the cleanup handlers have been called.
+ bool cleanup_done_;
+
const General_options& options_;
Workqueue* workqueue_;
Input_objects* input_objects_;