aboutsummaryrefslogtreecommitdiff
path: root/ld/lexsup.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/lexsup.c')
-rw-r--r--ld/lexsup.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c
index 20e0271..7c1bc46 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -1,6 +1,6 @@
/* Parse options for the GNU linker.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
Free Software Foundation, Inc.
This file is part of the GNU Binutils.
@@ -62,9 +62,6 @@ static void set_section_start (char *, char *);
static void set_segment_start (const char *, char *);
static void help (void);
-/* Non-zero if we are processing a --defsym from the command line. */
-int parsing_defsym = 0;
-
/* Codes used for the long options with no short synonyms. 150 isn't
special; it's just an arbitrary non-ASCII char value. */
enum option_values
@@ -729,6 +726,7 @@ parse_args (unsigned argc, char **argv)
{
int longind;
int optc;
+ static unsigned int defsym_count;
/* Using last_optind lets us avoid calling ldemul_parse_args
multiple times on a single option, which would lead to
@@ -823,11 +821,9 @@ parse_args (unsigned argc, char **argv)
break;
case OPTION_DEFSYM:
lex_string = optarg;
- lex_redirect (optarg);
+ lex_redirect (optarg, "--defsym", ++defsym_count);
parser_input = input_defsym;
- parsing_defsym = 1;
yyparse ();
- parsing_defsym = 0;
lex_string = NULL;
break;
case OPTION_DEMANGLE: