PR gold/12934

* target-select.cc (Target_selector::Target_selector): Add
	emulation parameter.  Change all callers.
	(select_target_by_bfd_name): Rename from select_target_by_name.
	Change all callers.
	(select_target_by_emulation): New function.
	(supported_emulation_names): New function.
	* target-select.h (class Target_selector): Add emulation_ field.
	Update declarations.
	(Target_selector::recognize_by_bfd_name): Rename from
	recognize_by_name.  Change all callers.
	(Target_selector::supported_bfd_names): Rename from
	supported_names.  Change all callers.
	(Target_selector::recognize_by_emulation): New function.
	(Target_selector::supported_emulations): New function.
	(Target_selector::emulation): New function.
	(Target_selector::do_recognize_by_bfd_name): Rename from
	do_recognize_by_name.  Change all callers.
	(Target_selector::do_supported_bfd_names): Rename from
	do_supported_names.  Change all callers.
	(Target_selector::do_recognize_by_emulation): New function.
	(Target_selector::do_supported_emulations): New function.
	(select_target_by_bfd_name): Change name in declaration.
	(select_target_by_emulation): Declare.
	(supported_emulation_names): Declare.
	* parameters.cc (parameters_force_valid_target): Try to find
	target based on emulation from -m option.
	* options.h (class General_options): Change doc string for -m.
	* options.cc (help): Print emulations.
	(General_options::parse_V): Likewise.
	* freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
	Add emulation parameter.  Change all callers.
This commit is contained in:
Ian Lance Taylor
2011-06-28 23:12:31 +00:00
parent 200b2bb9e8
commit 03ef7571fc
14 changed files with 192 additions and 40 deletions

View File

@ -1,6 +1,6 @@
// options.c -- handle command line options 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.
@ -170,6 +170,15 @@ help()
printf(" %s", *p);
printf("\n");
printf(_("%s: supported emulations:"), gold::program_name);
supported_names.clear();
gold::supported_emulation_names(&supported_names);
for (std::vector<const char*>::const_iterator p = supported_names.begin();
p != supported_names.end();
++p)
printf(" %s", *p);
printf("\n");
// REPORT_BUGS_TO is defined in bfd/bfdver.h.
const char* report = REPORT_BUGS_TO;
if (*report != '\0')
@ -300,6 +309,7 @@ General_options::parse_V(const char*, const char*, Command_line*)
{
gold::print_version(true);
this->printed_version_ = true;
printf(_(" Supported targets:\n"));
std::vector<const char*> supported_names;
gold::supported_target_names(&supported_names);
@ -307,6 +317,14 @@ General_options::parse_V(const char*, const char*, Command_line*)
p != supported_names.end();
++p)
printf(" %s\n", *p);
printf(_(" Supported emulations:\n"));
supported_names.clear();
gold::supported_emulation_names(&supported_names);
for (std::vector<const char*>::const_iterator p = supported_names.begin();
p != supported_names.end();
++p)
printf(" %s\n", *p);
}
void