aboutsummaryrefslogtreecommitdiff
path: root/ld/ldgram.y
diff options
context:
space:
mode:
authorDavid MacKenzie <djm@cygnus>1993-06-17 20:55:43 +0000
committerDavid MacKenzie <djm@cygnus>1993-06-17 20:55:43 +0000
commit8ddef5528d34f05ff9a492e23b15ef5c6c8eb5fb (patch)
treef921e9cedac5cd479f9954d6b30598061db2e93d /ld/ldgram.y
parent21cc14d8505ad50143ea248c0de12bfa9eecf1e7 (diff)
downloadbinutils-8ddef5528d34f05ff9a492e23b15ef5c6c8eb5fb.zip
binutils-8ddef5528d34f05ff9a492e23b15ef5c6c8eb5fb.tar.gz
binutils-8ddef5528d34f05ff9a492e23b15ef5c6c8eb5fb.tar.bz2
* ldfile.c (ldfile_open_command): Don't try .ld extension.
It wasn't documented (or likely used) and wastes time. (try_open): If EXTEN is empty, don't try it. * ldctor.c, lderror.c, ldexp.c, ldfile.c, ldindr.c, ldlang.c, ldlex.l, ldmain.c, ldmisc.c, ldsym.c, ldver.c, ldwarn.c, ldwrite.c, lexsup.c, mri.c, relax.c: Replace DEFUN macro calls with normal function declarations. * Move *.em to emultempl/*.em. Move *.sh to emulparams/*.sh. Move *.sc-sh to scripttempl/*.sc. * {emultempl,emulparams,scripttempl}/README: New files. * sh.em, st2000.em, z8ksim.em, h8300hms.em, h8500hms.em: Files removed, replaced with generic.em. * h8300.sh, h8500.sh, h8300.sc, h8500.sc: Renamed from h8[35]00hms.s[ch]. Change their contents to omit the "hms". * *.em (*_get_script): Return script name instead of script contents. * ldlang.c (lang_process): Change caller. * ldlex.l, ldgram.y: Recognize -m option. Check for input files after *all* options in grammar. * ldmain.c (main): Check for -m options. Add default directory for -m. * mkscript.c: File removed. * genscripts.sh: Take two more parameters, tooldirlib and libdir, to add to the default LIB_PATH. Look for input files in the new subdirectories. Create the scripts in emulations subdirectory and don't filter them through mkscript. * configure.in: Make the emulations subdirectory. * Makefile.in: Account for all of the above changes. Remove unused .SUFFIXES. Get libgcc.a path with gcc -print-libgcc-file-name instead of $(libdir)/libgcc.a. Put CFLAGS last in the compilation rules. Add -I../bfd to INCLUDES so sysdep.h is found. * ldfile.c (try_open): If opening without the extension fails, try with the extension even if -v or -V was given. had_script is imported (from ldgram.y), not exported.
Diffstat (limited to 'ld/ldgram.y')
-rw-r--r--ld/ldgram.y39
1 files changed, 30 insertions, 9 deletions
diff --git a/ld/ldgram.y b/ld/ldgram.y
index e106b5f..5921c47 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -43,6 +43,7 @@ extern unsigned int lineno;
extern boolean trace_files;
extern boolean write_map;
extern boolean option_longmap;
+extern int g_switch_value;
boolean hex_mode;
static int typebits;
strip_symbols_type strip_symbols=STRIP_NONE;
@@ -90,7 +91,7 @@ static int error_index;
char *name;
int token;
union etree_union *etree;
-struct sec *section;
+ struct sec *section;
struct lang_output_section_statement_struct *output_section_statement;
union lang_statement_union **statement_ptr;
int lineno;
@@ -138,11 +139,11 @@ struct sec *section;
%token NOLOAD DSECT COPY INFO OVERLAY
%token NAME DEFINED TARGET_K SEARCH_DIR MAP ENTRY
%token OPTION_e OPTION_c OPTION_noinhibit_exec OPTION_s OPTION_S OPTION_sort_common
-%token OPTION_EB OPTION_EL
+%token OPTION_EB OPTION_EL OPTION_G OPTION_Gval
%token OPTION_format OPTION_F OPTION_u OPTION_Bstatic OPTION_N
%token <integer> SIZEOF NEXT ADDR
%token OPTION_d OPTION_dc OPTION_dp OPTION_x OPTION_X OPTION_defsym
-%token OPTION_v OPTION_V OPTION_M OPTION_t STARTUP HLL SYSLIB FLOAT NOFLOAT
+%token OPTION_v OPTION_V OPTION_m OPTION_memul OPTION_M OPTION_t STARTUP HLL SYSLIB FLOAT NOFLOAT
%token OPTION_Map
%token OPTION_n OPTION_r OPTION_o OPTION_b OPTION_R OPTION_relax
%token <name> OPTION_l OPTION_L OPTION_T OPTION_Aarch OPTION_Tfile OPTION_Texp
@@ -197,6 +198,14 @@ command_line_option:
write_map = true;
config.map_filename = $2;
}
+ | OPTION_m NAME
+ {
+ /* Ignore. */
+ }
+ | OPTION_memul
+ {
+ /* Ignore. */
+ }
| OPTION_M
{
config.map_filename = "-";
@@ -303,9 +312,6 @@ command_line_option:
{
/* Ignore */
}
- | NAME
- { lang_add_input_file($1,lang_input_file_is_file_enum,
- (char *)NULL); }
| OPTION_c filename
{ ldfile_open_command_file($2); } mri_script_file END { ldlex_command();}
@@ -348,9 +354,19 @@ command_line_option:
``produce a little-endian object file''. It could
be used to select an output format. */
}
+ | OPTION_G NAME
+ {
+ g_switch_value = atoi ($2);
+ }
+ | OPTION_Gval
+ {
+ g_switch_value = yylval.integer;
+ }
| '-' NAME
- { info("%P%F Unrecognized option -%s\n", $2); }
-
+ { einfo("%P%F illegal option -- %s\n", $2); }
+ | NAME
+ { lang_add_input_file($1,lang_input_file_is_file_enum,
+ (char *)NULL); }
| '{' script_file '}'
;
@@ -573,6 +589,11 @@ statement_list:
| statement
;
+statement_list_opt:
+ /* empty */
+ | statement_list
+ ;
+
length:
LONG
{ $$ = $1; }
@@ -801,7 +822,7 @@ section: NAME { ldlex_expression(); }
{
lang_enter_output_section_statement($1,$3,typebits,0,0,0,$4);
}
- statement_list
+ statement_list_opt
'}' {ldlex_expression();} fill_opt memspec_opt
{
ldlex_popstate();