// parameters.cc -- general parameters for a link using 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.
return this->incremental_mode_ != General_options::INCREMENTAL_OFF;
}
+// Return true if we are doing a full incremental link.
+
+bool
+Parameters::incremental_full() const
+{
+ return this->incremental_mode_ == General_options::INCREMENTAL_FULL;
+}
+
// Return true if we are doing an incremental update.
bool
gold_assert(parameters->options_valid());
if (parameters->options().user_set_oformat())
{
- Target* target = select_target_by_name(parameters->options().oformat());
+ const char* bfd_name = parameters->options().oformat();
+ Target* target = select_target_by_bfd_name(bfd_name);
+ if (target != NULL)
+ {
+ set_parameters_target(target);
+ return;
+ }
+
+ gold_error(_("unrecognized output format %s"), bfd_name);
+ }
+
+ if (parameters->options().user_set_m())
+ {
+ const char* emulation = parameters->options().m();
+ Target* target = select_target_by_emulation(emulation);
if (target != NULL)
{
set_parameters_target(target);
return;
}
- gold_error(_("unrecognized output format %s"),
- parameters->options().oformat());
+ gold_error(_("unrecognized emulation %s"), emulation);
}
// The GOLD_DEFAULT_xx macros are defined by the configure script.
is_big_endian,
elfcpp::GOLD_DEFAULT_OSABI,
0);
- gold_assert(target != NULL);
+
+ if (target == NULL)
+ {
+ gold_assert(is_big_endian != GOLD_DEFAULT_BIG_ENDIAN);
+ gold_fatal(_("no supported target for -EB/-EL option"));
+ }
+
set_parameters_target(target);
}