aboutsummaryrefslogtreecommitdiff
path: root/gold/yyscript.y
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-01-06 00:47:10 +0000
committerIan Lance Taylor <iant@google.com>2008-01-06 00:47:10 +0000
commitd391083d3c938e56a0d0f3e03867d91369198d35 (patch)
tree424c6ed0d5a8fa8ec5e037cee0d3a425e48b9d3b /gold/yyscript.y
parent2969336b5ef220b001aae71ced8b87c654734725 (diff)
downloadgdb-d391083d3c938e56a0d0f3e03867d91369198d35.zip
gdb-d391083d3c938e56a0d0f3e03867d91369198d35.tar.gz
gdb-d391083d3c938e56a0d0f3e03867d91369198d35.tar.bz2
Add support for -e and for ENTRY in linker scripts.
Diffstat (limited to 'gold/yyscript.y')
-rw-r--r--gold/yyscript.y13
1 files changed, 13 insertions, 0 deletions
diff --git a/gold/yyscript.y b/gold/yyscript.y
index 3250e8e..7cfe724 100644
--- a/gold/yyscript.y
+++ b/gold/yyscript.y
@@ -160,11 +160,13 @@
%%
+/* A file contains a list of commands. */
file_list:
file_list file_cmd
| /* empty */
;
+/* A command which may appear at top level of a linker script. */
file_cmd:
OUTPUT_FORMAT '(' STRING ')'
| GROUP
@@ -173,13 +175,16 @@ file_cmd:
{ script_end_group(closure); }
| OPTION '(' STRING ')'
{ script_parse_option(closure, $3); }
+ | file_or_sections_cmd
;
+/* A list of input file names. */
input_list:
input_list_element
| input_list opt_comma input_list_element
;
+/* An input file name. */
input_list_element:
STRING
{ script_add_file(closure, $1); }
@@ -189,6 +194,14 @@ input_list_element:
{ script_end_as_needed(closure); }
;
+/* A command which may appear at the top level of a linker script, or
+ within a SECTIONS block. */
+file_or_sections_cmd:
+ ENTRY '(' STRING ')'
+ { script_set_entry(closure, $3); }
+ ;
+
+/* An optional comma. */
opt_comma:
','
| /* empty */