aboutsummaryrefslogtreecommitdiff
path: root/gold/gold.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2006-09-29 19:58:17 +0000
committerIan Lance Taylor <iant@google.com>2006-09-29 19:58:17 +0000
commit61ba1cf93601b0a0877a8ade94ba3c674a09f77e (patch)
treeffa744ec1dffd7f2dae13150b1dd7784728ed0a4 /gold/gold.cc
parent4dba4b2419ccdbf48fd016edb7e0e10016897827 (diff)
downloadfsf-binutils-gdb-61ba1cf93601b0a0877a8ade94ba3c674a09f77e.zip
fsf-binutils-gdb-61ba1cf93601b0a0877a8ade94ba3c674a09f77e.tar.gz
fsf-binutils-gdb-61ba1cf93601b0a0877a8ade94ba3c674a09f77e.tar.bz2
Snapshot. Now able to produce a minimal executable which actually
runs.
Diffstat (limited to 'gold/gold.cc')
-rw-r--r--gold/gold.cc46
1 files changed, 46 insertions, 0 deletions
diff --git a/gold/gold.cc b/gold/gold.cc
index 9576e4a..f403910 100644
--- a/gold/gold.cc
+++ b/gold/gold.cc
@@ -14,6 +14,7 @@
#include "symtab.h"
#include "object.h"
#include "layout.h"
+#include "reloc.h"
namespace gold
{
@@ -97,6 +98,51 @@ queue_initial_tasks(const General_options& options,
} // end anonymous namespace.
+namespace gold
+{
+
+// Queue up the final set of tasks. This is called at the end of
+// Layout_task.
+
+void
+queue_final_tasks(const General_options& options,
+ const Input_objects* input_objects,
+ const Symbol_table* symtab,
+ const Layout* layout,
+ Workqueue* workqueue,
+ Output_file* of)
+{
+ // Use a blocker to block the final cleanup task.
+ Task_token* final_blocker = new Task_token();
+
+ // Queue a task for each input object to relocate the sections and
+ // write out the local symbols.
+ for (Input_objects::Object_list::const_iterator p = input_objects->begin();
+ p != input_objects->end();
+ ++p)
+ {
+ final_blocker->add_blocker();
+ workqueue->queue(new Relocate_task(options, symtab, layout->sympool(),
+ *p, of, final_blocker));
+ }
+
+ // Queue a task to write out the symbol table.
+ final_blocker->add_blocker();
+ workqueue->queue(new Write_symbols_task(symtab, input_objects->target(),
+ layout->sympool(), of,
+ final_blocker));
+
+ // Queue a task to write out everything else.
+ final_blocker->add_blocker();
+ workqueue->queue(new Write_data_task(layout, of, final_blocker));
+
+ // Queue a task to close the output file. This will be blocked by
+ // FINAL_BLOCKER.
+ workqueue->queue(new Close_task(of, final_blocker));
+}
+
+} // End namespace gold.
+
int
main(int argc, char** argv)
{