From e6a307bae3aac48d98d01f51308e238aeabbdfd4 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 23 Jun 2009 06:39:47 +0000 Subject: PR 10030 * yyscript.y: Parse TARGET. * script.cc (script_set_target): New function. * script-c.h (script_set_target): Declare. * options.cc (General_options::string_to_object_format): Rename from string_to_object_format in anonymous namespace. Change callers. * options.h (class General_options): Declare string_to_object_format. --- gold/script.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'gold/script.cc') diff --git a/gold/script.cc b/gold/script.cc index 86ce13b..70ffeb5 100644 --- a/gold/script.cc +++ b/gold/script.cc @@ -1207,7 +1207,7 @@ class Parser_closure skip_on_incompatible_target() const { return this->skip_on_incompatible_target_; } - // Stop skipping to the next flie on an incompatible target. This + // Stop skipping to the next file on an incompatible target. This // is called when we make some unrevocable change to the data // structures. void @@ -2331,6 +2331,18 @@ script_check_output_format(void* closurev, return 1; } +// Called by the bison parser to handle TARGET. + +extern "C" void +script_set_target(void* closurev, const char* target, size_t len) +{ + Parser_closure* closure = static_cast(closurev); + std::string s(target, len); + General_options::Object_format format_enum; + format_enum = General_options::string_to_object_format(s.c_str()); + closure->position_dependent_options().set_format_enum(format_enum); +} + // Called by the bison parser to handle SEARCH_DIR. This is handled // exactly like a -L option. -- cgit v1.1