aboutsummaryrefslogtreecommitdiff
path: root/ld/lexsup.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-09-28 19:18:07 +0000
committerIan Lance Taylor <ian@airs.com>1995-09-28 19:18:07 +0000
commit630f4ac9c6e6a705230173f9cc5f675b36696660 (patch)
tree3e7d242383f5c1cba3e0770e60ff178e07400f28 /ld/lexsup.c
parenta69bb1fa31d713afeee88b12f6e816ea761308d7 (diff)
downloadgdb-630f4ac9c6e6a705230173f9cc5f675b36696660.zip
gdb-630f4ac9c6e6a705230173f9cc5f675b36696660.tar.gz
gdb-630f4ac9c6e6a705230173f9cc5f675b36696660.tar.bz2
* ld.h (parsing_defsym): Declare.
* ldlex.h (lex_string): Declare. * ldlex.l (lex_string): Define. * lexsup.c (parsing_defsym): Define. (parse_args): In OPTION_DEFSYM case, set lex_string before calling lex_redirect, and clear it after calling yyparse. Set parsing_defsym around call to yyparse. * ldmain.c (main): Set lex_string before calling lex_redirect, and clear it after calling yyparse. * ldmisc.c (vfinfo): For %S, handle --defsym arguments and built in linker scripts correctly. PR 8092.
Diffstat (limited to 'ld/lexsup.c')
-rw-r--r--ld/lexsup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c
index a0a5ad0..96babdd 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -47,6 +47,8 @@ unsigned long strtoul ();
static void set_default_dirlist PARAMS ((char *dirlist_ptr));
static void set_section_start PARAMS ((char *sect, char *valstr));
+/* Non-zero if we are processing a --defsym from the command line. */
+int parsing_defsym = 0;
void
parse_args (argc, argv)
@@ -260,9 +262,13 @@ parse_args (argc, argv)
command_line.force_common_definition = true;
break;
case OPTION_DEFSYM:
+ lex_string = optarg;
lex_redirect (optarg);
parser_input = input_defsym;
+ parsing_defsym = 1;
yyparse ();
+ parsing_defsym = 0;
+ lex_string = NULL;
break;
case OPTION_DYNAMIC_LINKER:
command_line.interpreter = optarg;