summaryrefslogtreecommitdiff
path: root/gold/script.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-06-23 06:39:47 +0000
committerIan Lance Taylor <ian@airs.com>2009-06-23 06:39:47 +0000
commite6a307bae3aac48d98d01f51308e238aeabbdfd4 (patch)
tree757dcf3896fda91c7ffc280de3add37f3ca7eb41 /gold/script.cc
parent3ee173de46efe0473d4aa2f63b16fe5943599e2b (diff)
downloadbinutils-gdb-e6a307bae3aac48d98d01f51308e238aeabbdfd4.tar.gz
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.
Diffstat (limited to 'gold/script.cc')
-rw-r--r--gold/script.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/gold/script.cc b/gold/script.cc
index 86ce13bf7fe..70ffeb509f3 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<Parser_closure*>(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.