Go to the documentation of this file.
17 #define EX_SOFTWARE 70
55 if(cmdline.
isset(
"native-linker"))
56 return cmdline.
get_value(
"native-linker");
61 pos == std::string::npos || base_name ==
"goto-gcc" ||
62 base_name ==
"goto-ld")
65 std::string result = base_name;
66 result.replace(
pos, 7,
"ld");
73 goto_binary_tmp_suffix(
".goto-cc-saved")
130 if(arg.is_infile_name)
153 std::vector<std::string> new_argv;
156 new_argv.push_back(a.arg);
162 for(std::size_t i = 0; i < new_argv.size(); i++)
163 debug() <<
" " << new_argv[i];
171 std::string output_file;
177 if(output_file ==
"/dev/null")
181 output_file =
"a.out";
191 result = rename(output_file.c_str(), goto_binary.c_str());
194 error() <<
"Rename failed: " << std::strerror(errno) <<
eom;
221 std::cout <<
"goto-ld understands the options of "
222 <<
"ld plus the following.\n\n";
gcc_message_handlert gcc_message_handler
#define PRECONDITION(CONDITION)
Merge linker script-defined symbols into a goto-program.
virtual bool isset(char option) const
std::list< std::string > source_files
static std::string linker_name(const cmdlinet &cmdline, const std::string &base_name)
void help_mode() final
display command line help
int add_linker_script_definitions()
Add values of linkerscript-defined symbols to the goto-binary.
bool doit()
reads and source and object files, compiles and links them into goto program objects.
int run(const std::string &what, const std::vector< std::string > &argv)
std::list< std::string > libraries
Synthesise definitions of symbols that are defined in linker scripts.
const std::string base_name
std::string native_tool_name
std::string output_file_object
ld_modet(goto_cc_cmdlinet &_cmdline, const std::string &_base_name)
std::list< std::string > object_files
mstreamt & result() const
int hybrid_binary(const std::string &compiler_or_linker, const std::string &goto_binary_file, const std::string &output_file, message_handlert &message_handler)
Merges a goto binary into an object file (e.g.
std::string output_file_executable
int ld_hybrid_binary(compilet &compiler)
std::string get_value(char option) const
std::list< std::string > library_paths
std::string object_file_extension
goto_cc_cmdlinet & cmdline
bool add_input_file(const std::string &)
puts input file names into a list and does preprocessing for libraries.
message_handlert & get_message_handler()
const std::string goto_binary_tmp_suffix
bool set(const cmdlinet &cmdline)
virtual void help()
display command line help
unsignedbv_typet size_type()
static unsigned eval_verbosity(const std::string &user_input, const message_levelt default_verbosity, message_handlert &dest)
Parse a (user-)provided string as a verbosity level and set it as the verbosity of dest.
int run_ld()
call ld with original command line
const std::list< std::string > & get_values(const std::string &option) const