From Craig Silverstein: preliminary support for OPTION in linker script.
authorIan Lance Taylor <iant@google.com>
Fri, 26 Oct 2007 22:16:06 +0000 (22:16 +0000)
committerIan Lance Taylor <iant@google.com>
Fri, 26 Oct 2007 22:16:06 +0000 (22:16 +0000)
gold/script-c.h
gold/script.cc
gold/yyscript.y

index cb0ef8ec69dcdbf684b9b47d4ea3573e5e30cebc..1214800dd0ad26d6e4b4782e8dafb27ff57c720a 100644 (file)
@@ -66,6 +66,10 @@ script_start_as_needed(void* closure);
 extern void
 script_end_as_needed(void* closure);
 
+/* Called by the bison parser to parse an OPTION.  */
+extern void
+script_parse_option(void* closure, const char*);
+
 #ifdef __cplusplus
 }
 #endif
index 2cea0c8878767f9305e8105e98887714227a0fac..08be65f0b98d3e0909b031d66e4756f160fa6549 100644 (file)
@@ -1045,6 +1045,7 @@ Keyword_to_parsecode::keyword_parsecodes_[] =
   { "NOLOAD", NOLOAD },
   { "ONLY_IF_RO", ONLY_IF_RO },
   { "ONLY_IF_RW", ONLY_IF_RW },
+  { "OPTION", OPTION },
   { "ORIGIN", ORIGIN },
   { "OUTPUT", OUTPUT },
   { "OUTPUT_ARCH", OUTPUT_ARCH },
@@ -1257,3 +1258,12 @@ script_end_as_needed(void* closurev)
   Parser_closure* closure = static_cast<Parser_closure*>(closurev);
   closure->position_dependent_options().clear_as_needed();
 }
+
+// Called by the bison parser to parse an OPTION.
+
+extern "C" void
+script_parse_option(void* closurev, const char* option)
+{
+  Parser_closure* closure = static_cast<Parser_closure*>(closurev);
+  printf("%s: Saw option %s\n", closure->filename(), option);  //!!
+}
index b78c09b5662f512a95281f95c5d01909217f1b0c..3250e8ed2d715bb6fe430be60e9471ca58a4d6e1 100644 (file)
 %token TRUNCATE
 %token VERSIONK                /* VERSION */
 
+/* Keywords, part 2.  These are keywords that are unique to gold,
+   and not present in the old GNU linker.  As before, unless the
+   comments say otherwise, the keyword is recognized as the token
+   name in upper case. */
+
+%token OPTION
+
 %%
 
 file_list:
@@ -164,6 +171,8 @@ file_cmd:
            { script_start_group(closure); }
          '(' input_list ')'
            { script_end_group(closure); }
+        | OPTION '(' STRING ')'
+            { script_parse_option(closure, $3); }
        ;
 
 input_list:
This page took 0.028031 seconds and 4 git commands to generate.