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/target-select.h | |
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/target-select.h')
-rw-r--r-- | gold/target-select.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gold/target-select.h b/gold/target-select.h index e16afd2..310c0b9 100644 --- a/gold/target-select.h +++ b/gold/target-select.h @@ -140,6 +140,13 @@ class Target_selector emulation() const { return this->emulation_; } + // The reverse mapping, for --print-output-format: if we + // instantiated TARGET, return our BFD_NAME. If we did not + // instantiate it, return NULL. + const char* + target_bfd_name(const Target* target) + { return this->do_target_bfd_name(target); } + protected: // Return an instance of the real target. This must be implemented // by the child class. @@ -192,10 +199,19 @@ class Target_selector emulations->push_back(this->emulation_); } + // Map from target to BFD name. + virtual const char* + do_target_bfd_name(const Target*); + // Instantiate the target and return it. Target* instantiate_target(); + // Return whether TARGET is the target we instantiated. + bool + is_our_target(const Target* target) + { return target == this->instantiated_target_; } + private: // Set the target. void @@ -249,6 +265,11 @@ supported_target_names(std::vector<const char*>*); extern void supported_emulation_names(std::vector<const char*>*); +// Print the output format, for the --print-output-format option. + +extern void +print_output_format(); + } // End namespace gold. #endif // !defined(GOLD_TARGET_SELECT_H) |