summaryrefslogtreecommitdiff
path: root/gold/readsyms.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2011-01-24 21:48:40 +0000
committerIan Lance Taylor <ian@airs.com>2011-01-24 21:48:40 +0000
commit0f3b89d87a62ea42186fb5ba525dadde36182a97 (patch)
treea1ba50cb45c68cfeaf4d02005a29a693f3d9a687 /gold/readsyms.cc
parent314d366acd62a3de1ff8fff788d5b369c2f2d36c (diff)
downloadbinutils-gdb-0f3b89d87a62ea42186fb5ba525dadde36182a97.tar.gz
* plugin.cc (class Plugin_rescan): Define new class.
(Plugin_manager::claim_file): Set any_claimed_. (Plugin_manager::save_archive): New function. (Plugin_manager::save_input_group): New function. (Plugin_manager::all_symbols_read): Create Plugin_rescan task if necessary. (Plugin_manager::new_undefined_symbol): New function. (Plugin_manager::rescan): New function. (Plugin_manager::rescannable_defines): New function. (Plugin_manager::add_input_file): Set any_added_. * plugin.h (class Plugin_manager): define new fields rescannable_, undefined_symbols_, any_claimed_, and any_added_. Declare Plugin_rescan as friend. Declare new functions. (Plugin_manager::Rescannable): Define type. (Plugin_manager::Rescannable_list): Define type. (Plugin_manager::Undefined_symbol_list): Define type. (Plugin_manager::Plugin_manager): Initialize new fields. * archive.cc (Archive::defines_symbol): New function. (Add_archive_symbols::run): Pass archive to plugins if any. * archive.h (class Archive): Declare defines_symbol. * readsyms.cc (Input_group::~Input_group): New function. (Finish_group::run): Pass input_group to plugins if any. * readsyms.h (class Input_group): Declare destructor. * symtab.cc (add_from_object): Pass undefined symbol to plugins if any.
Diffstat (limited to 'gold/readsyms.cc')
-rw-r--r--gold/readsyms.cc27
1 files changed, 21 insertions, 6 deletions
diff --git a/gold/readsyms.cc b/gold/readsyms.cc
index 5c00026a16f..9f88b01d8b9 100644
--- a/gold/readsyms.cc
+++ b/gold/readsyms.cc
@@ -1,6 +1,6 @@
// readsyms.cc -- read input file symbols for gold
-// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
@@ -599,6 +599,19 @@ Add_symbols::run(Workqueue*)
}
}
+// Class Input_group.
+
+// When we delete an Input_group we can delete the archive
+// information.
+
+Input_group::~Input_group()
+{
+ for (Input_group::const_iterator p = this->begin();
+ p != this->end();
+ ++p)
+ delete *p;
+}
+
// Class Start_group.
Start_group::~Start_group()
@@ -680,8 +693,8 @@ Finish_group::run(Workqueue*)
}
}
- // Now that we're done with the archives, record the incremental layout
- // information, then delete them.
+ // Now that we're done with the archives, record the incremental
+ // layout information.
for (Input_group::const_iterator p = this->input_group_->begin();
p != this->input_group_->end();
++p)
@@ -691,10 +704,12 @@ Finish_group::run(Workqueue*)
this->layout_->incremental_inputs();
if (incremental_inputs != NULL)
incremental_inputs->report_archive_end(*p);
-
- delete *p;
}
- delete this->input_group_;
+
+ if (parameters->options().has_plugins())
+ parameters->options().plugins()->save_input_group(this->input_group_);
+ else
+ delete this->input_group_;
}
// Class Read_script