-y support
* ld.texinfo: new doc. * ldgram.y, ldlex.l: understand -y<symbol> * ldmain.c (Q_enter_file_symbols): if had -y, lookup symbol and print info. (add_ysym): new function. * ldsym.h: (ldsym_type): new define SYM_Y.
This commit is contained in:
parent
dde624eff9
commit
85e38cfa01
3 changed files with 64 additions and 32 deletions
|
@ -1,3 +1,11 @@
|
|||
Mon Dec 7 08:43:41 1992 Steve Chamberlain (sac@thepub.cygnus.com)
|
||||
-y support
|
||||
* ld.texinfo: new doc.
|
||||
* ldgram.y, ldlex.l: understand -y<symbol>
|
||||
* ldmain.c (Q_enter_file_symbols): if had -y, lookup symbol and
|
||||
print info. (add_ysym): new function.
|
||||
* ldsym.h: (ldsym_type): new define SYM_Y.
|
||||
|
||||
Sat Nov 21 03:15:27 1992 John Gilmore (gnu@cygnus.com)
|
||||
|
||||
* ldctor.h, lderror.h, ldexp.h, ldfile.h, ldindr.h, ldlang.c,
|
||||
|
|
86
ld/ldlex.l
86
ld/ldlex.l
|
@ -43,36 +43,7 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static comment();
|
||||
|
||||
#undef YY_INPUT
|
||||
#define YY_INPUT(buf,result,max_size) yy_input(buf, &result, max_size)
|
||||
|
@ -105,6 +76,9 @@ FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~]
|
|||
FILENAME {FILENAMECHAR}+
|
||||
WHITE [ \t\n]+
|
||||
|
||||
NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
|
||||
|
||||
|
||||
%s COMMAND
|
||||
%s SCRIPT
|
||||
%s EXPRESSION
|
||||
|
@ -197,13 +171,20 @@ WHITE [ \t\n]+
|
|||
return OPTION_F;
|
||||
}
|
||||
|
||||
<COMMAND>"-y"{FILENAME} {
|
||||
yylval.name = buystring(yytext+2);
|
||||
return OPTION_y;
|
||||
}
|
||||
|
||||
<COMMAND>"-A"{FILENAME} {
|
||||
yylval.name = buystring(yytext+2);
|
||||
return OPTION_Aarch;
|
||||
}
|
||||
|
||||
<COMMAND>"-retain-symbols-file" { return OPTION_RETAIN_SYMBOLS_FILE; }
|
||||
|
||||
<MRI,EXPRESSION>"$"([0-9A-Fa-f])+ {
|
||||
yylval.integer = strtoul(yytext+1, 0,16);
|
||||
yylval.integer = strtoul(yytext+1, 0,16);
|
||||
return INT;
|
||||
}
|
||||
|
||||
|
@ -325,9 +306,13 @@ WHITE [ \t\n]+
|
|||
<MRI>"\n" { ++ lineno; RTOKEN(NEWLINE); }
|
||||
<MRI>"*".* { /* Mri comment line */ }
|
||||
<MRI>"END" { RTOKEN(ENDWORD); }
|
||||
<MRI>"ALIGNMOD" { RTOKEN(ALIGNMOD);}
|
||||
<MRI>"ALIGN" { RTOKEN(ALIGN_K);}
|
||||
|
||||
<MRI>"CHIP" { RTOKEN(CHIP); }
|
||||
<MRI>"BASE" { RTOKEN(BASE); }
|
||||
<MRI>"ALIAS" { RTOKEN(ALIAS); }
|
||||
<MRI>"TRUNCATE" { RTOKEN(TRUNCATE); }
|
||||
<MRI>"LOAD" { RTOKEN(LOAD); }
|
||||
<MRI>"PUBLIC" { RTOKEN(PUBLIC); }
|
||||
<MRI>"ORDER" { RTOKEN(ORDER); }
|
||||
|
@ -352,7 +337,14 @@ WHITE [ \t\n]+
|
|||
}
|
||||
|
||||
|
||||
<MRI,BOTH,EXPRESSION>{FILENAMECHAR1}{FILENAMECHAR}* {
|
||||
<MRI>{FILENAMECHAR1}{NOCFILENAMECHAR}* {
|
||||
/* Filename without commas, needed to parse mri stuff */
|
||||
yylval.name = buystring(yytext);
|
||||
return NAME;
|
||||
}
|
||||
|
||||
|
||||
<BOTH,EXPRESSION>{FILENAMECHAR1}{FILENAMECHAR}* {
|
||||
yylval.name = buystring(yytext);
|
||||
return NAME;
|
||||
}
|
||||
|
@ -527,3 +519,33 @@ int max_size;
|
|||
}
|
||||
}
|
||||
|
||||
static
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,6 +56,8 @@ typedef struct user_symbol_struct
|
|||
/* If this symbol explicitly should be kept, despite discarding
|
||||
most others. */
|
||||
#define SYM_KEEP 8
|
||||
/* If its got -y set */
|
||||
#define SYM_Y 16
|
||||
int flags;
|
||||
} ldsym_type;
|
||||
|
||||
|
|
Loading…
Reference in a new issue