From 6bf2e3a7623a1ac43ba9a26a03963519346ce1c8 Mon Sep 17 00:00:00 2001 From: Steve Chamberlain Date: Thu, 13 Aug 1992 19:16:49 +0000 Subject: * ldlex.l: now parses comment correctly, added ~ to acceptable chars in filenames * ldexp.c (exp_unop): pass down abs_output_section - now can have unary -ve constants. * ldlang.c (lang_finish): warn when an entry symbol supplied on the command line can't be found. --- ld/ChangeLog | 11 +++ ld/ldlex.l | 58 +++++++++---- ld/ldmisc.c | 269 ++++++++++++++++++++++++++++++----------------------------- 3 files changed, 189 insertions(+), 149 deletions(-) (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index e65f345..3774505 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,14 @@ +Thu Aug 13 11:49:34 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * ldlex.l: now parses comment correctly, added ~ to acceptable + chars in filenames + + * ldexp.c (exp_unop): pass down abs_output_section - now can have + unary -ve constants. + + * ldlang.c (lang_finish): warn when an entry symbol supplied on + the command line can't be found. + Fri Aug 7 12:31:10 1992 Steve Chamberlain (sac@thepub.cygnus.com) * ldlang.h: add new field "loadable" to output_section_statement. diff --git a/ld/ldlex.l b/ld/ldlex.l index 2c21a58..f98e8fd 100644 --- a/ld/ldlex.l +++ b/ld/ldlex.l @@ -43,6 +43,37 @@ char *buystring(); unsigned int lineno = 1; int old; +comment() +{ + int c; + while (1) + { + c = input(); + while (c !='*' && c != EOF) + { + if (c == '\n') lineno++; + c = input(); + } + + + if (c == '*') + { + c = input(); + while ( c == '*') + c = input(); + if ( c == '/' ) + break; /* found the end */ + } + + if ( c == EOF ) + { + einfo( "%F%P :EOF in comment"); + break; + } + } +} + + #undef YY_INPUT #define YY_INPUT(buf,result,max_size) yy_input(buf, &result, max_size) #undef YY_FATAL_ERROR @@ -66,11 +97,11 @@ unsigned int include_stack_ptr = 0; %a 4000 %o 5000 -CMDFILENAMECHAR [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\-] -CMDFILENAMECHAR1 [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>] -FILENAMECHAR1 [_a-zA-Z\/\.\\] +CMDFILENAMECHAR [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\-\~] +CMDFILENAMECHAR1 [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\~] +FILENAMECHAR1 [_a-zA-Z\/\.\\\$\_\~] SYMBOLCHARN [_a-zA-Z\/\.\\0-9] -FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\] +FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~] FILENAME {FILENAMECHAR}+ WHITE [ \t\n]+ @@ -83,6 +114,10 @@ WHITE [ \t\n]+ %s MRI %% + +"/*" { comment(); } + + "-" { RTOKEN('-');} "+" { RTOKEN('+');} {FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = buystring(yytext); return NAME; } @@ -300,7 +335,7 @@ WHITE [ \t\n]+ "FORMAT" { RTOKEN(FORMAT); } "LIST".* { RTOKEN(LIST); /* LIST and ignore to end of line */ } "SECT" { RTOKEN(SECT); } -"ABSOLUTE" { RTOKEN(ABSOLUTE); } +"ABSOLUTE" { RTOKEN(ABSOLUTE); } "end" { RTOKEN(ENDWORD); } "chip" { RTOKEN(CHIP); } "load" { RTOKEN(LOAD); } @@ -309,7 +344,7 @@ WHITE [ \t\n]+ "format" { RTOKEN(FORMAT); } "list".* { RTOKEN(LIST); /* LIST and ignore to end of line */ } "sect" { RTOKEN(SECT); } -"absolute" { RTOKEN(ABSOLUTE); } +"absolute" { RTOKEN(ABSOLUTE); } {CMDFILENAMECHAR1}{CMDFILENAMECHAR}* { yylval.name = buystring(yytext); @@ -335,16 +370,6 @@ WHITE [ \t\n]+ "\n" { lineno++;} [ \t] -"/*" { old = INITIAL; BEGIN(COMMENT); } -"/*" { old = COMMAND; BEGIN(COMMENT); } -"/*" { old =BOTH; BEGIN(COMMENT); } -