* fileread.cc (Input_file::open): Remove options parameter.

Change all callers.
	(Input_file::open_binary): Likewise.
	* script.cc (read_input_script): Likewise.
	* readsyms.h (class Read_symbols): Remove options_ field.  Remove
	options parameter from constructor.  Change all callers.
	(class Read_script): Likewise.
	* fileread.h (class Input_file): Update declarations.
	* script.h (read_input_script): Update declaration.
This commit is contained in:
Ian Lance Taylor 2009-03-13 21:30:06 +00:00
parent 9ee6bb930d
commit f1ed28fb81
10 changed files with 43 additions and 43 deletions

View File

@ -1,3 +1,15 @@
2009-03-13 Ian Lance Taylor <iant@google.com>
* fileread.cc (Input_file::open): Remove options parameter.
Change all callers.
(Input_file::open_binary): Likewise.
* script.cc (read_input_script): Likewise.
* readsyms.h (class Read_symbols): Remove options_ field. Remove
options parameter from constructor. Change all callers.
(class Read_script): Likewise.
* fileread.h (class Input_file): Update declarations.
* script.h (read_input_script): Update declaration.
2009-03-10 Nick Clifton <nickc@redhat.com>
* po/es.po: New Spanish translation.

View File

@ -482,8 +482,7 @@ Archive::get_file_and_offset(off_t off, Input_objects* input_objects,
new Input_file_argument(member_name->c_str(), false, "", false,
parameters->options());
*input_file = new Input_file(input_file_arg);
if (!(*input_file)->open(parameters->options(), *this->dirpath_,
this->task_))
if (!(*input_file)->open(*this->dirpath_, this->task_))
return false;
arch = new Archive(*member_name, *input_file, false, this->dirpath_,
this->task_);
@ -502,8 +501,7 @@ Archive::get_file_and_offset(off_t off, Input_objects* input_objects,
new Input_file_argument(member_name->c_str(), false, "", false,
this->input_file_->options());
*input_file = new Input_file(input_file_arg);
if (!(*input_file)->open(parameters->options(), *this->dirpath_,
this->task_))
if (!(*input_file)->open(*this->dirpath_, this->task_))
return false;
*memoff = 0;

View File

@ -766,8 +766,7 @@ Input_file::just_symbols() const
// the file location, rather than the current directory.
bool
Input_file::open(const General_options& options, const Dirsearch& dirpath,
const Task* task)
Input_file::open(const Dirsearch& dirpath, const Task* task)
{
std::string name;
@ -789,7 +788,7 @@ Input_file::open(const General_options& options, const Dirsearch& dirpath,
std::string n1("lib");
n1 += this->input_argument_->name();
std::string n2;
if (options.is_static()
if (parameters->options().is_static()
|| !this->input_argument_->options().Bdynamic())
n1 += ".a";
else
@ -845,7 +844,7 @@ Input_file::open(const General_options& options, const Dirsearch& dirpath,
else
{
gold_assert(format == General_options::OBJECT_FORMAT_BINARY);
ok = this->open_binary(options, task, name);
ok = this->open_binary(task, name);
}
if (!ok)
@ -861,8 +860,7 @@ Input_file::open(const General_options& options, const Dirsearch& dirpath,
// Open a file for --format binary.
bool
Input_file::open_binary(const General_options&,
const Task* task, const std::string& name)
Input_file::open_binary(const Task* task, const std::string& name)
{
// In order to open a binary file, we need machine code, size, and
// endianness. We may not have a valid target at this point, in

View File

@ -434,7 +434,7 @@ class Input_file
// Open the file. If the open fails, this will report an error and
// return false.
bool
open(const General_options&, const Dirsearch&, const Task*);
open(const Dirsearch&, const Task*);
// Return the name given by the user. For -lc this will return "c".
const char*
@ -485,8 +485,7 @@ class Input_file
// Open a binary file.
bool
open_binary(const General_options&, const Task* task,
const std::string& name);
open_binary(const Task* task, const std::string& name);
// The argument from the command line.
const Input_file_argument* input_argument_;

View File

@ -182,7 +182,7 @@ queue_initial_tasks(const General_options& options,
{
Task_token* next_blocker = new Task_token(true);
next_blocker->add_blocker();
workqueue->queue(new Read_symbols(options, input_objects, symtab, layout,
workqueue->queue(new Read_symbols(input_objects, symtab, layout,
&search_path, mapfile, &*p, NULL,
this_blocker, next_blocker));
this_blocker = next_blocker;

View File

@ -407,8 +407,7 @@ Plugin_manager::add_input_file(char *pathname)
Input_argument* input_argument = new Input_argument(file);
Task_token* next_blocker = new Task_token(true);
next_blocker->add_blocker();
this->workqueue_->queue_soon(new Read_symbols(this->options_,
this->input_objects_,
this->workqueue_->queue_soon(new Read_symbols(this->input_objects_,
this->symtab_,
this->layout_,
this->dirpath_,

View File

@ -139,7 +139,7 @@ Read_symbols::do_read_symbols(Workqueue* workqueue)
}
Input_file* input_file = new Input_file(&this->input_argument_->file());
if (!input_file->open(this->options_, *this->dirpath_, this))
if (!input_file->open(*this->dirpath_, this))
return false;
// Read enough of the file to pick up the entire ELF header.
@ -258,8 +258,7 @@ Read_symbols::do_read_symbols(Workqueue* workqueue)
// read multiple scripts simultaneously, which could lead to
// unpredictable changes to the General_options structure.
workqueue->queue_soon(new Read_script(this->options_,
this->symtab_,
workqueue->queue_soon(new Read_script(this->symtab_,
this->layout_,
this->dirpath_,
this->input_objects_,
@ -296,8 +295,7 @@ Read_symbols::do_group(Workqueue* workqueue)
Task_token* next_blocker = new Task_token(true);
next_blocker->add_blocker();
workqueue->queue_soon(new Read_symbols(this->options_,
this->input_objects_,
workqueue->queue_soon(new Read_symbols(this->input_objects_,
this->symtab_, this->layout_,
this->dirpath_, this->mapfile_,
arg, input_group,
@ -491,8 +489,8 @@ void
Read_script::run(Workqueue* workqueue)
{
bool used_next_blocker;
if (!read_input_script(workqueue, this->options_, this->symtab_,
this->layout_, this->dirpath_, this->input_objects_,
if (!read_input_script(workqueue, this->symtab_, this->layout_,
this->dirpath_, this->input_objects_,
this->mapfile_, this->input_group_,
this->input_argument_, this->input_file_,
this->next_blocker_, &used_next_blocker))

View File

@ -54,15 +54,15 @@ class Read_symbols : public Task
// one has completed; it will be NULL for the first task.
// NEXT_BLOCKER is used to block the next input file from adding
// symbols.
Read_symbols(const General_options& options, Input_objects* input_objects,
Symbol_table* symtab, Layout* layout, Dirsearch* dirpath,
Mapfile* mapfile, const Input_argument* input_argument,
Read_symbols(Input_objects* input_objects, Symbol_table* symtab,
Layout* layout, Dirsearch* dirpath, Mapfile* mapfile,
const Input_argument* input_argument,
Input_group* input_group, Task_token* this_blocker,
Task_token* next_blocker)
: options_(options), input_objects_(input_objects), symtab_(symtab),
layout_(layout), dirpath_(dirpath), mapfile_(mapfile),
input_argument_(input_argument), input_group_(input_group),
this_blocker_(this_blocker), next_blocker_(next_blocker)
: input_objects_(input_objects), symtab_(symtab), layout_(layout),
dirpath_(dirpath), mapfile_(mapfile), input_argument_(input_argument),
input_group_(input_group), this_blocker_(this_blocker),
next_blocker_(next_blocker)
{ }
~Read_symbols();
@ -90,7 +90,6 @@ class Read_symbols : public Task
bool
do_read_symbols(Workqueue*);
const General_options& options_;
Input_objects* input_objects_;
Symbol_table* symtab_;
Layout* layout_;
@ -230,13 +229,12 @@ class Finish_group : public Task
class Read_script : public Task
{
public:
Read_script(const General_options& options, Symbol_table* symtab,
Layout* layout, Dirsearch* dirpath, Input_objects* input_objects,
Mapfile* mapfile, Input_group* input_group,
const Input_argument* input_argument,
Read_script(Symbol_table* symtab, Layout* layout, Dirsearch* dirpath,
Input_objects* input_objects, Mapfile* mapfile,
Input_group* input_group, const Input_argument* input_argument,
Input_file* input_file, Task_token* this_blocker,
Task_token* next_blocker)
: options_(options), symtab_(symtab), layout_(layout), dirpath_(dirpath),
: symtab_(symtab), layout_(layout), dirpath_(dirpath),
input_objects_(input_objects), mapfile_(mapfile),
input_group_(input_group), input_argument_(input_argument),
input_file_(input_file), this_blocker_(this_blocker),
@ -260,7 +258,6 @@ class Read_script : public Task
get_name() const;
private:
const General_options& options_;
Symbol_table* symtab_;
Layout* layout_;
Dirsearch* dirpath_;

View File

@ -1321,8 +1321,7 @@ class Parser_closure
// as a script. Return true if the file was handled.
bool
read_input_script(Workqueue* workqueue, const General_options& options,
Symbol_table* symtab, Layout* layout,
read_input_script(Workqueue* workqueue, Symbol_table* symtab, Layout* layout,
Dirsearch* dirsearch, Input_objects* input_objects,
Mapfile* mapfile, Input_group* input_group,
const Input_argument* input_argument,
@ -1363,7 +1362,7 @@ read_input_script(Workqueue* workqueue, const General_options& options,
nb = new Task_token(true);
nb->add_blocker();
}
workqueue->queue_soon(new Read_symbols(options, input_objects, symtab,
workqueue->queue_soon(new Read_symbols(input_objects, symtab,
layout, dirsearch, mapfile, &*p,
input_group, this_blocker, nb));
this_blocker = nb;
@ -1398,7 +1397,7 @@ read_script_file(const char* filename, Command_line* cmdline,
posdep.set_format_enum(General_options::OBJECT_FORMAT_ELF);
Input_file_argument input_argument(filename, false, "", false, posdep);
Input_file input_file(&input_argument);
if (!input_file.open(cmdline->options(), dirsearch, task))
if (!input_file.open(dirsearch, task))
return false;
std::string input_string;

View File

@ -389,8 +389,8 @@ class Script_options
// whether the function took over NEXT_BLOCKER.
bool
read_input_script(Workqueue*, const General_options&, Symbol_table*, Layout*,
Dirsearch*, Input_objects*, Mapfile*, Input_group*,
read_input_script(Workqueue*, Symbol_table*, Layout*, Dirsearch*,
Input_objects*, Mapfile*, Input_group*,
const Input_argument*, Input_file*,
Task_token* next_blocker, bool* used_next_blocker);