X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gold%2Ftarget-select.h;h=c18d84beae9c3db10767305f1f121b29ade0e68a;hb=14ea52eecb11790c7a03eda1b13568b587238b66;hp=e16afd263f5ef63a7acbc0a2183dabfab1f45ada;hpb=03ef7571fc6524b38bfbb99ffdfa72418d03d02c;p=platform%2Fupstream%2Fbinutils.git diff --git a/gold/target-select.h b/gold/target-select.h index e16afd2..c18d84b 100644 --- a/gold/target-select.h +++ b/gold/target-select.h @@ -1,6 +1,6 @@ // target-select.h -- select a target for an object file -*- C++ -*- -// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2006-2014 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -30,6 +30,7 @@ namespace gold { +class Input_file; class Target; class Target_selector; @@ -76,8 +77,9 @@ class Target_selector // If we can handle this target, return a pointer to a target // structure. The size and endianness are known. Target* - recognize(int machine, int osabi, int abiversion) - { return this->do_recognize(machine, osabi, abiversion); } + recognize(Input_file* input_file, off_t offset, + int machine, int osabi, int abiversion) + { return this->do_recognize(input_file, offset, machine, osabi, abiversion); } // If NAME matches the target, return a pointer to a target // structure. @@ -140,6 +142,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. @@ -153,7 +162,7 @@ class Target_selector // checks, or to check for multiple machine codes if the machine_ // field is EM_NONE. virtual Target* - do_recognize(int, int, int) + do_recognize(Input_file*, off_t, int, int, int) { return this->instantiate_target(); } // Recognize a target by name. When this is called we already know @@ -192,10 +201,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 @@ -225,7 +243,8 @@ class Target_selector // Select the target for an ELF file. extern Target* -select_target(int machine, int size, bool big_endian, int osabi, +select_target(Input_file*, off_t, + int machine, int size, bool big_endian, int osabi, int abiversion); // Select a target using a BFD name. @@ -249,6 +268,11 @@ supported_target_names(std::vector*); extern void supported_emulation_names(std::vector*); +// Print the output format, for the --print-output-format option. + +extern void +print_output_format(); + } // End namespace gold. #endif // !defined(GOLD_TARGET_SELECT_H)