diff options
author | Ian Lance Taylor <ian@airs.com> | 2011-07-15 21:43:08 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2011-07-15 21:43:08 +0000 |
commit | f1ddb6008e405707f7025369cfd7ec0ba442d128 (patch) | |
tree | 8cadf0eb5b35ef18245571f71b17ceb68418b9ea /gold/gold.cc | |
parent | 9e8b7a03dd9c4754ff3f18ca13a1dad851f4ec58 (diff) | |
download | gdb-f1ddb6008e405707f7025369cfd7ec0ba442d128.zip gdb-f1ddb6008e405707f7025369cfd7ec0ba442d128.tar.gz gdb-f1ddb6008e405707f7025369cfd7ec0ba442d128.tar.bz2 |
* options.h (class General_options): Add --print-output-format.
Move -EL next to -EB, for better --help output.
* target-select.cc: Include <cstdio>, "options.h", and
"parameters.h".
(Target_selector::do_target_bfd_name): New function.
(print_output_format): New function.
* target-select.h (class Target_selector): Update declarations.
(Target_selector::target_bfd_name): New function.
(print_output_format): Declare.
* main.cc: Include "target-select.h".
(main): Handle --print-output-format.
* gold.cc: Include "target-select.h".
(queue_initial_tasks): Handle --print-output-format when there are
no input files.
* parameters.cc (parameters_force_valid_target): Give a better
error message if -EB/-EL does not match target.
* freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
function.
Diffstat (limited to 'gold/gold.cc')
-rw-r--r-- | gold/gold.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gold/gold.cc b/gold/gold.cc index f68ba3e..12f25b7 100644 --- a/gold/gold.cc +++ b/gold/gold.cc @@ -1,6 +1,6 @@ // gold.cc -- main linker functions -// 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. @@ -30,6 +30,7 @@ #include "libiberty.h" #include "options.h" +#include "target-select.h" #include "debug.h" #include "workqueue.h" #include "dirsearch.h" @@ -175,7 +176,15 @@ queue_initial_tasks(const General_options& options, { if (cmdline.begin() == cmdline.end()) { + bool is_ok = false; if (options.printed_version()) + is_ok = true; + if (options.print_output_format()) + { + print_output_format(); + is_ok = true; + } + if (is_ok) gold_exit(GOLD_OK); gold_fatal(_("no input files")); } |