* ldgram.y (mri_script_command): Surround processing of INCLUDE
with ldlex_script, ldlex_popstate. (ifile_p1): Likewise. * ldlex.l (EOF): Don't BEGIN(SCRIPT). Restore lineno from the correct slot. (lex_push_file): Save current lineno to lineno_stack. Set lineno to 1. Don't BEGIN(SCRIPT). (lex_redirect): Similarly. * ldmain.c (main): Set yydebug non-zero if YYDEBUG.
This commit is contained in:
parent
fd521b4750
commit
b47c420856
4 changed files with 31 additions and 9 deletions
12
ld/ChangeLog
12
ld/ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2001-10-20 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* ldgram.y (mri_script_command): Surround processing of INCLUDE
|
||||
with ldlex_script, ldlex_popstate.
|
||||
(ifile_p1): Likewise.
|
||||
* ldlex.l (EOF): Don't BEGIN(SCRIPT). Restore lineno from the
|
||||
correct slot.
|
||||
(lex_push_file): Save current lineno to lineno_stack. Set lineno
|
||||
to 1. Don't BEGIN(SCRIPT).
|
||||
(lex_redirect): Similarly.
|
||||
* ldmain.c (main): Set yydebug non-zero if YYDEBUG.
|
||||
|
||||
2001-10-20 Nick Clifton <nickc@cambridge.redhat.com>
|
||||
|
||||
* scripttempl/armcoff.sc: Define __EH_FRAME_BEGIN__ and
|
||||
|
|
|
@ -238,7 +238,9 @@ mri_script_command:
|
|||
| CASE casesymlist
|
||||
| EXTERN extern_name_list
|
||||
| INCLUDE filename
|
||||
{ ldfile_open_command_file ($2); } mri_script_lines END
|
||||
{ ldlex_script (); ldfile_open_command_file($2); }
|
||||
mri_script_lines END
|
||||
{ ldlex_popstate (); }
|
||||
| START NAME
|
||||
{ lang_add_entry ($2, false); }
|
||||
|
|
||||
|
@ -332,7 +334,9 @@ ifile_p1:
|
|||
| MAP '(' filename ')'
|
||||
{ lang_add_map($3); }
|
||||
| INCLUDE filename
|
||||
{ ldfile_open_command_file($2); } ifile_list END
|
||||
{ ldlex_script (); ldfile_open_command_file($2); }
|
||||
ifile_list END
|
||||
{ ldlex_popstate (); }
|
||||
| NOCROSSREFS '(' nocrossref_list ')'
|
||||
{
|
||||
lang_add_nocrossref ($3);
|
||||
|
|
13
ld/ldlex.l
13
ld/ldlex.l
|
@ -418,11 +418,10 @@ V_IDENTIFIER [*?.$_a-zA-Z]([*?.$_a-zA-Z0-9]|::)*
|
|||
else
|
||||
{
|
||||
yy_switch_to_buffer(include_stack[include_stack_ptr]);
|
||||
|
||||
}
|
||||
BEGIN(SCRIPT);
|
||||
|
||||
ldfile_input_filename = file_name_stack[include_stack_ptr - 1];
|
||||
lineno = lineno_stack[include_stack_ptr - 1];
|
||||
lineno = lineno_stack[include_stack_ptr];
|
||||
|
||||
return END;
|
||||
}
|
||||
|
@ -446,13 +445,13 @@ lex_push_file (file, name)
|
|||
einfo("%F:includes nested too deeply\n");
|
||||
}
|
||||
file_name_stack[include_stack_ptr] = name;
|
||||
lineno_stack[include_stack_ptr] = 1;
|
||||
lineno_stack[include_stack_ptr] = lineno;
|
||||
include_stack[include_stack_ptr] = YY_CURRENT_BUFFER;
|
||||
|
||||
include_stack_ptr++;
|
||||
lineno = 1;
|
||||
yyin = file;
|
||||
yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
|
||||
BEGIN (SCRIPT);
|
||||
}
|
||||
|
||||
/* Return a newly created flex input buffer containing STRING,
|
||||
|
@ -512,12 +511,12 @@ lex_redirect (string)
|
|||
einfo("%F: macros nested too deeply\n");
|
||||
}
|
||||
file_name_stack[include_stack_ptr] = "redirect";
|
||||
lineno_stack[include_stack_ptr] = 0;
|
||||
lineno_stack[include_stack_ptr] = lineno;
|
||||
include_stack[include_stack_ptr] = YY_CURRENT_BUFFER;
|
||||
include_stack_ptr++;
|
||||
lineno = 1;
|
||||
tmp = yy_create_string_buffer (string, strlen (string));
|
||||
yy_switch_to_buffer (tmp);
|
||||
BEGIN (SCRIPT);
|
||||
}
|
||||
|
||||
/* Functions to switch to a different flex start condition,
|
||||
|
|
|
@ -196,6 +196,13 @@ main (argc, argv)
|
|||
xexit (1);
|
||||
}
|
||||
|
||||
#if YYDEBUG
|
||||
{
|
||||
extern int yydebug;
|
||||
yydebug = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Initialize the data about options. */
|
||||
trace_files = trace_file_tries = version_printed = false;
|
||||
whole_archive = false;
|
||||
|
|
Loading…
Reference in a new issue