summaryrefslogtreecommitdiff
path: root/gold/yyscript.y
diff options
context:
space:
mode:
Diffstat (limited to 'gold/yyscript.y')
-rw-r--r--gold/yyscript.y14
1 files changed, 12 insertions, 2 deletions
diff --git a/gold/yyscript.y b/gold/yyscript.y
index 7cfe7247e7..513241b485 100644
--- a/gold/yyscript.y
+++ b/gold/yyscript.y
@@ -168,14 +168,24 @@ file_list:
/* A command which may appear at top level of a linker script. */
file_cmd:
- OUTPUT_FORMAT '(' STRING ')'
- | GROUP
+ GROUP
{ script_start_group(closure); }
'(' input_list ')'
{ script_end_group(closure); }
| OPTION '(' STRING ')'
{ script_parse_option(closure, $3); }
| file_or_sections_cmd
+ | ignore_cmd
+ ;
+
+/* Top level commands which we ignore. The GNU linker uses these to
+ select the output format, but we don't offer a choice. Ignoring
+ these is more-or-less OK since most scripts simply explicitly
+ choose the default. */
+ignore_cmd:
+ OUTPUT_FORMAT '(' STRING ')'
+ | OUTPUT_FORMAT '(' STRING ',' STRING ',' STRING ')'
+ | OUTPUT_ARCH '(' STRING ')'
;
/* A list of input file names. */