aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlex.l
diff options
context:
space:
mode:
authorSteve Chamberlain <steve@cygnus>1991-04-23 15:59:24 +0000
committerSteve Chamberlain <steve@cygnus>1991-04-23 15:59:24 +0000
commita37cc0c05c5ee0e72a14a09c547555621371ef1d (patch)
tree2df4ce4a562ee651f2f17351d0a0402c75152583 /ld/ldlex.l
parent1327fb29568debb17b167a405a548f641bcfda69 (diff)
downloadgdb-a37cc0c05c5ee0e72a14a09c547555621371ef1d.zip
gdb-a37cc0c05c5ee0e72a14a09c547555621371ef1d.tar.gz
gdb-a37cc0c05c5ee0e72a14a09c547555621371ef1d.tar.bz2
*** empty log message ***
Diffstat (limited to 'ld/ldlex.l')
-rw-r--r--ld/ldlex.l31
1 files changed, 25 insertions, 6 deletions
diff --git a/ld/ldlex.l b/ld/ldlex.l
index 9d74ea1..d1f448f 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -47,7 +47,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
int debug;
-extern boolean ldgram_in_defsym;
+static boolean ldgram_in_defsym;
static boolean ldgram_had_equals;
extern boolean ldgram_in_script;
static char *command_line;
@@ -87,6 +87,7 @@ keyword_type keywords[] =
"FILL",FILL,
"STARTUP",STARTUP,
"OUTPUT_FORMAT",OUTPUT_FORMAT,
+"OUTPUT_ARCH", OUTPUT_ARCH,
"HLL",HLL,
"SYSLIB",SYSLIB,
"FLOAT",FLOAT,
@@ -125,7 +126,7 @@ lex_input()
ldlex_input_stack = (FILE *)NULL;
ldfile_input_filename = (char *)NULL;
/* First char after script eof is a @ so that we can tell the grammer
- that we've eft */
+ that we've left */
thischar = '@';
}
@@ -269,12 +270,13 @@ WHITE [ \t]+
%%
-"@" { return ENDSCRIPT; }
-"\ -defsym\ " { return OPTION_defsym; }
+"@" { return '}'; }
+"\ -defsym\ " { ldgram_in_defsym = true; return OPTION_defsym; }
"\ -noinhibit_exec\ " { return OPTION_noinhibit_exec; }
"\ -format\ " { return OPTION_format; }
"\ -n\ " { return OPTION_n; }
"\ -r\ " { return OPTION_r; }
+"\ -i\ " { return OPTION_r; }
"\ -Ur\ " { return OPTION_Ur; }
"\ -o\ " { return OPTION_o; }
"\ -g\ " { return OPTION_g; }
@@ -293,6 +295,7 @@ WHITE [ \t]+
"\ -u\ " { return OPTION_u; }
"\ -s\ " { return OPTION_s; }
"\ -S\ " { return OPTION_S; }
+"\ -B{FILENAME}\ " { /* Ignored */ }
"\ -l"{FILENAME} {
yylval.name = buystring(yytext+3);
return OPTION_l;
@@ -335,7 +338,12 @@ WHITE [ \t]+
return OPTION_Aarch;
}
-" " { if (ldgram_had_equals == true) ldgram_in_defsym = false; }
+" " {
+ if (ldgram_had_equals == true) {
+ ldgram_in_defsym = false;
+ ldgram_had_equals = false;
+ }
+ }
"<<=" { RTOKEN(LSHIFTEQ);}
">>=" { RTOKEN(RSHIFTEQ);}
"||" { RTOKEN(OROR);}
@@ -471,7 +479,18 @@ WHITE [ \t]+
}
}
-
+ if(ldgram_in_script == true) {
+ switch (ch) {
+ case '*':
+ case '=':
+ case '+':
+ case '-':
+ case '!':
+ case '~':
+ goto quit;
+ }
+ }
+
if (isalpha(ch) || isdigit(ch) || ch == '.' || ch == '_' ||
ch == '/' || ch == '.' || ch == '+' || ch == '-' || ch =='=') {
yytext[yyleng++] = ch;