Line 1... |
Line 1... |
// main.cc -- gold main function.
|
// main.cc -- gold main function.
|
|
|
// 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>.
|
// Written by Ian Lance Taylor <iant@google.com>.
|
|
|
// This file is part of gold.
|
// This file is part of gold.
|
|
|
// This program is free software; you can redistribute it and/or modify
|
// This program is free software; you can redistribute it and/or modify
|
Line 31... |
Line 31... |
|
|
#include "libiberty.h"
|
#include "libiberty.h"
|
|
|
#include "script.h"
|
#include "script.h"
|
#include "options.h"
|
#include "options.h"
|
|
#include "target-select.h"
|
#include "parameters.h"
|
#include "parameters.h"
|
#include "errors.h"
|
#include "errors.h"
|
#include "mapfile.h"
|
#include "mapfile.h"
|
#include "dirsearch.h"
|
#include "dirsearch.h"
|
#include "workqueue.h"
|
#include "workqueue.h"
|
Line 193... |
Line 194... |
// permit some linker optimizations. Perhaps we need yet another
|
// permit some linker optimizations. Perhaps we need yet another
|
// option to control this. FIXME.
|
// option to control this. FIXME.
|
if (parameters->options().relocatable())
|
if (parameters->options().relocatable())
|
command_line.script_options().version_script_info()->clear();
|
command_line.script_options().version_script_info()->clear();
|
|
|
// Load plugin libraries.
|
|
if (command_line.options().has_plugins())
|
|
command_line.options().plugins()->load_plugins();
|
|
|
|
// The work queue.
|
// The work queue.
|
Workqueue workqueue(command_line.options());
|
Workqueue workqueue(command_line.options());
|
|
|
// The list of input objects.
|
// The list of input objects.
|
Input_objects input_objects;
|
Input_objects input_objects;
|
Line 232... |
Line 229... |
layout.incremental_inputs()->report_command_line(argc, argv);
|
layout.incremental_inputs()->report_command_line(argc, argv);
|
|
|
if (parameters->options().section_ordering_file())
|
if (parameters->options().section_ordering_file())
|
layout.read_layout_from_file();
|
layout.read_layout_from_file();
|
|
|
|
// Load plugin libraries.
|
|
if (command_line.options().has_plugins())
|
|
command_line.options().plugins()->load_plugins(&layout);
|
|
|
// Get the search path from the -L options.
|
// Get the search path from the -L options.
|
Dirsearch search_path;
|
Dirsearch search_path;
|
search_path.initialize(&workqueue, &command_line.options().library_path());
|
search_path.initialize(&workqueue, &command_line.options().library_path());
|
|
|
// Queue up the first set of tasks.
|
// Queue up the first set of tasks.
|
Line 244... |
Line 245... |
&symtab, &layout, mapfile);
|
&symtab, &layout, mapfile);
|
|
|
// Run the main task processing loop.
|
// Run the main task processing loop.
|
workqueue.process(0);
|
workqueue.process(0);
|
|
|
|
if (command_line.options().print_output_format())
|
|
print_output_format();
|
|
|
if (command_line.options().stats())
|
if (command_line.options().stats())
|
{
|
{
|
Timer::TimeStats elapsed = timer.get_elapsed_time();
|
Timer::TimeStats elapsed = timer.get_elapsed_time();
|
fprintf(stderr,
|
fprintf(stderr,
|
_("%s: total run time: " \
|
_("%s: total run time: " \
|