* ld.h (parsing_defsym): Delete.
* ldexp.c (exp_intop, exp_bigintop, exp_relop): Set type.filename.
(fold_binary, fold_name, exp_fold_tree_1, exp_get_vma, exp_get_fill,
exp_get_abs_int): Add tree arg for %S in error messages. Don't
fudge lineno.
(exp_binop, exp_unop, exp_nameop, exp_assop, exp_assert): Copy
type.filename from sub-tree.
(exp_trinop): Likewise, and use "cond" rather than "lhs".
* ldexp.h (node_type): Add filename field to struct.
* ldfile.c (ldfile_input_filename): Delete. Remove all refs.
* ldfile.h (ldfile_input_filename): Delete.
* ldgram.y (phdr_type, phdr_qualifiers, yyerror): Add NULL arg for
%S in error messages.
* ldemul.c (syslib_default, hll_default): Likewise.
* ldlang.c (lang_memory_region_lookup, lang_memory_region_alias,
lang_get_regions, lang_new_phdr): Likewise.
(lang_size_sections_1): Pass addr_tree for %S.
* ldlex.h (lex_redirect): Update prototype.
(ldlex_filename): Declare.
* ldlex.l (<EOF>): Don't set ldfile_input_filename.
(lex_redirect): Add fake_filename and count params. Push
fake_filename to file_name_stack and init lineno from count.
(ldlex_filename): New function.
(lex_warn_invalid): Use above.
* ldmain.c (main): Update lex_redirect call.
* ldmisc.c (vfinfo <%S>): Take file name and line number from
etree_type arg, or use current if arg is NULL.
* lexsup.c (parsing_defsym): Delete.
(parse_args <OPTION_DEFSYM>): Update lex_redirect call.
+2012-02-18 Alan Modra <amodra@gmail.com>
+
+ PR ld/13343
+ * ld.h (parsing_defsym): Delete.
+ * ldexp.c (exp_intop, exp_bigintop, exp_relop): Set type.filename.
+ (fold_binary, fold_name, exp_fold_tree_1, exp_get_vma, exp_get_fill,
+ exp_get_abs_int): Add tree arg for %S in error messages. Don't
+ fudge lineno.
+ (exp_binop, exp_unop, exp_nameop, exp_assop, exp_assert): Copy
+ type.filename from sub-tree.
+ (exp_trinop): Likewise, and use "cond" rather than "lhs".
+ * ldexp.h (node_type): Add filename field to struct.
+ * ldfile.c (ldfile_input_filename): Delete. Remove all refs.
+ * ldfile.h (ldfile_input_filename): Delete.
+ * ldgram.y (phdr_type, phdr_qualifiers, yyerror): Add NULL arg for
+ %S in error messages.
+ * ldemul.c (syslib_default, hll_default): Likewise.
+ * ldlang.c (lang_memory_region_lookup, lang_memory_region_alias,
+ lang_get_regions, lang_new_phdr): Likewise.
+ (lang_size_sections_1): Pass addr_tree for %S.
+ * ldlex.h (lex_redirect): Update prototype.
+ (ldlex_filename): Declare.
+ * ldlex.l (<EOF>): Don't set ldfile_input_filename.
+ (lex_redirect): Add fake_filename and count params. Push
+ fake_filename to file_name_stack and init lineno from count.
+ (ldlex_filename): New function.
+ (lex_warn_invalid): Use above.
+ * ldmain.c (main): Update lex_redirect call.
+ * ldmisc.c (vfinfo <%S>): Take file name and line number from
+ etree_type arg, or use current if arg is NULL.
+ * lexsup.c (parsing_defsym): Delete.
+ (parse_args <OPTION_DEFSYM>): Update lex_redirect call.
+
2012-02-13 Kai Tietz <ktietz@redhat.com>
* deffilep.y (find_export_in_list): Set is_indent for
/* ld.h -- general linker header file
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of the GNU Binutils.
extern FILE * saved_script_handle;
extern bfd_boolean force_make_executable;
-/* Non-zero if we are processing a --defsym from the command line. */
-extern int parsing_defsym;
-
extern int yyparse (void);
extern void add_cref (const char *, bfd *, asection *, bfd_vma);
extern bfd_boolean handle_asneeded_cref (bfd *, enum notice_asneeded_action);
/* ldemul.c -- clearing house for ld emulation states
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2005, 2007, 2008, 2009, 2010, 2011
+ 2001, 2002, 2003, 2005, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of the GNU Binutils.
void
syslib_default (char *ignore ATTRIBUTE_UNUSED)
{
- info_msg (_("%S SYSLIB ignored\n"));
+ info_msg (_("%S SYSLIB ignored\n"), NULL);
}
void
hll_default (char *ignore ATTRIBUTE_UNUSED)
{
- info_msg (_("%S HLL ignored\n"));
+ info_msg (_("%S HLL ignored\n"), NULL);
}
ld_emulation_xfer_type *ld_emulations[] = { EMULATION_LIST };
/* This module handles expression trees.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
{
etree_type *new_e = (etree_type *) stat_alloc (sizeof (new_e->value));
new_e->type.node_code = INT;
+ new_e->type.filename = ldlex_filename ();
new_e->type.lineno = lineno;
new_e->value.value = value;
new_e->value.str = NULL;
{
etree_type *new_e = (etree_type *) stat_alloc (sizeof (new_e->value));
new_e->type.node_code = INT;
+ new_e->type.filename = ldlex_filename ();
new_e->type.lineno = lineno;
new_e->value.value = value;
new_e->value.str = str;
{
etree_type *new_e = (etree_type *) stat_alloc (sizeof (new_e->rel));
new_e->type.node_code = REL;
+ new_e->type.filename = ldlex_filename ();
new_e->type.lineno = lineno;
new_e->type.node_class = etree_rel;
new_e->rel.section = section;
expld.result.value = ((bfd_signed_vma) lhs.value
% (bfd_signed_vma) expld.result.value);
else if (expld.phase != lang_mark_phase_enum)
- einfo (_("%F%S %% by zero\n"));
+ einfo (_("%F%S %% by zero\n"), tree->binary.rhs);
if (expld.result.section == lhs.section)
expld.result.section = NULL;
break;
expld.result.value = ((bfd_signed_vma) lhs.value
/ (bfd_signed_vma) expld.result.value);
else if (expld.phase != lang_mark_phase_enum)
- einfo (_("%F%S / by zero\n"));
+ einfo (_("%F%S / by zero\n"), tree->binary.rhs);
if (expld.result.section == lhs.section)
expld.result.section = NULL;
break;
if (expld.phase != lang_mark_phase_enum)
einfo (_("%X%S: unresolvable symbol `%s'"
" referenced in expression\n"),
- tree->name.name);
+ tree, tree->name.name);
}
else if (output_section == bfd_abs_section_ptr
&& (expld.section != bfd_abs_section_ptr
}
else if (expld.phase == lang_final_phase_enum
|| expld.assigning_to_dot)
- einfo (_("%F%S: undefined symbol `%s' referenced in expression\n"),
- tree->name.name);
+ einfo (_("%F%S: undefined symbol `%s'"
+ " referenced in expression\n"),
+ tree, tree->name.name);
else if (h->type == bfd_link_hash_new)
{
h->type = bfd_link_hash_undefined;
if (os == NULL)
{
if (expld.phase == lang_final_phase_enum)
- einfo (_("%F%S: undefined section `%s' referenced in expression\n"),
- tree->name.name);
+ einfo (_("%F%S: undefined section `%s'"
+ " referenced in expression\n"),
+ tree, tree->name.name);
}
else if (os->processed_vma)
new_rel (0, os->bfd_section);
if (os == NULL)
{
if (expld.phase == lang_final_phase_enum)
- einfo (_("%F%S: undefined section `%s' referenced in expression\n"),
- tree->name.name);
+ einfo (_("%F%S: undefined section `%s'"
+ " referenced in expression\n"),
+ tree, tree->name.name);
}
else if (os->processed_lma)
{
if (os == NULL)
{
if (expld.phase == lang_final_phase_enum)
- einfo (_("%F%S: undefined section `%s' referenced in expression\n"),
- tree->name.name);
+ einfo (_("%F%S: undefined section `%s'"
+ " referenced in expression\n"),
+ tree, tree->name.name);
new_number (0);
}
else if (os->processed_vma)
new_number (mem->length);
else
einfo (_("%F%S: undefined MEMORY region `%s'"
- " referenced in expression\n"), tree->name.name);
+ " referenced in expression\n"),
+ tree, tree->name.name);
}
break;
new_rel_from_abs (mem->origin);
else
einfo (_("%F%S: undefined MEMORY region `%s'"
- " referenced in expression\n"), tree->name.name);
+ " referenced in expression\n"),
+ tree, tree->name.name);
}
break;
new_number (config.commonpagesize);
else
einfo (_("%F%S: unknown constant `%s' referenced in expression\n"),
- tree->name.name);
+ tree, tree->name.name);
break;
default:
if (tree->assign.dst[0] == '.' && tree->assign.dst[1] == 0)
{
if (tree->type.node_class != etree_assign)
- einfo (_("%F%S can not PROVIDE assignment to location counter\n"));
+ einfo (_("%F%S can not PROVIDE assignment to"
+ " location counter\n"), tree);
/* After allocation, assignment to dot should not be done inside
an output section since allocation adds a padding statement
that effectively duplicates the assignment. */
if (!expld.result.valid_p)
{
if (expld.phase != lang_mark_phase_enum)
- einfo (_("%F%S invalid assignment to location counter\n"));
+ einfo (_("%F%S invalid assignment to"
+ " location counter\n"), tree);
}
else if (expld.dotp == NULL)
einfo (_("%F%S assignment to location counter"
- " invalid outside of SECTION\n"));
+ " invalid outside of SECTION\n"), tree);
else
{
bfd_vma nextdot;
if (nextdot < expld.dot
&& expld.section != bfd_abs_section_ptr)
einfo (_("%F%S cannot move location counter backwards"
- " (from %V to %V)\n"), expld.dot, nextdot);
+ " (from %V to %V)\n"),
+ tree, expld.dot, nextdot);
else
{
expld.dot = nextdot;
etree_type value, *new_e;
value.type.node_code = code;
+ value.type.filename = lhs->type.filename;
value.type.lineno = lhs->type.lineno;
value.binary.lhs = lhs;
value.binary.rhs = rhs;
etree_type value, *new_e;
value.type.node_code = code;
- value.type.lineno = lhs->type.lineno;
+ value.type.filename = cond->type.filename;
+ value.type.lineno = cond->type.lineno;
value.trinary.lhs = lhs;
value.trinary.cond = cond;
value.trinary.rhs = rhs;
etree_type value, *new_e;
value.unary.type.node_code = code;
+ value.unary.type.filename = child->type.filename;
value.unary.type.lineno = child->type.lineno;
value.unary.child = child;
value.unary.type.node_class = etree_unary;
etree_type value, *new_e;
value.name.type.node_code = code;
+ value.name.type.filename = ldlex_filename ();
value.name.type.lineno = lineno;
value.name.name = name;
value.name.type.node_class = etree_name;
n = (etree_type *) stat_alloc (sizeof (n->assign));
n->assign.type.node_code = '=';
+ n->assign.type.filename = src->type.filename;
n->assign.type.lineno = src->type.lineno;
n->assign.type.node_class = class;
n->assign.src = src;
n = (etree_type *) stat_alloc (sizeof (n->assert_s));
n->assert_s.type.node_code = '!';
+ n->assert_s.type.filename = exp->type.filename;
n->assert_s.type.lineno = exp->type.lineno;
n->assert_s.type.node_class = etree_assert;
n->assert_s.child = exp;
if (expld.result.valid_p)
return expld.result.value;
else if (name != NULL && expld.phase != lang_mark_phase_enum)
- einfo (_("%F%S: nonconstant expression for %s\n"), name);
+ einfo (_("%F%S: nonconstant expression for %s\n"),
+ tree, name);
}
return def;
}
if (!expld.result.valid_p)
{
if (name != NULL && expld.phase != lang_mark_phase_enum)
- einfo (_("%F%S: nonconstant expression for %s\n"), name);
+ einfo (_("%F%S: nonconstant expression for %s\n"),
+ tree, name);
return def;
}
}
else if (name != NULL && expld.phase != lang_mark_phase_enum)
{
- lineno = tree->type.lineno;
- einfo (_("%F%S: nonconstant expression for %s\n"), name);
+ einfo (_("%F%S: nonconstant expression for %s\n"),
+ tree, name);
}
}
return def;
/* ldexp.h -
Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007, 2011 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2007, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU Binutils.
typedef struct {
int node_code;
unsigned int lineno;
+ const char *filename;
enum node_tree_enum node_class;
} node_type;
/* Linker file opening and searching.
Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
+ 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of the GNU Binutils.
#include "plugin.h"
#endif /* ENABLE_PLUGINS */
-const char * ldfile_input_filename;
bfd_boolean ldfile_assumed_script = FALSE;
const char * ldfile_output_machine_name = "";
unsigned long ldfile_output_machine;
lex_push_file (ldlex_input_stack, name);
- ldfile_input_filename = name;
lineno = 1;
saved_script_handle = ldlex_input_stack;
/* ldfile.h -
- Copyright 1991, 1992, 1993, 1994, 1995, 2000, 2002, 2003, 2004, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1995, 2000, 2002, 2003, 2004, 2005,
+ 2007, 2012 Free Software Foundation, Inc.
This file is part of the GNU Binutils.
#ifndef LDFILE_H
#define LDFILE_H
-extern const char *ldfile_input_filename;
extern bfd_boolean ldfile_assumed_script;
extern unsigned long ldfile_output_machine;
extern enum bfd_architecture ldfile_output_architecture;
/* A YACC grammar to parse a superset of the AT&T linker scripting language.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
{
einfo (_("\
%X%P:%S: unknown phdr type `%s' (try integer literal)\n"),
- s);
+ NULL, s);
$$ = exp_intop (0);
}
}
else if (strcmp ($1, "FLAGS") == 0 && $2 != NULL)
$$.flags = $2;
else
- einfo (_("%X%P:%S: PHDRS syntax error at `%s'\n"), $1);
+ einfo (_("%X%P:%S: PHDRS syntax error at `%s'\n"),
+ NULL, $1);
}
| AT '(' exp ')' phdr_qualifiers
{
{
if (ldfile_assumed_script)
einfo (_("%P:%s: file format not recognized; treating as linker script\n"),
- ldfile_input_filename);
+ ldlex_filename ());
if (error_index > 0 && error_index < ERROR_NAME_MAX)
- einfo ("%P%F:%S: %s in %s\n", arg, error_names[error_index-1]);
+ einfo ("%P%F:%S: %s in %s\n", NULL, arg, error_names[error_index - 1]);
else
- einfo ("%P%F:%S: %s\n", arg);
+ einfo ("%P%F:%S: %s\n", NULL, arg);
}
{
if (create)
einfo (_("%P:%S: warning: redeclaration of memory region `%s'\n"),
- name);
+ NULL, name);
return r;
}
if (!create && strcmp (name, DEFAULT_MEMORY_REGION))
- einfo (_("%P:%S: warning: memory region `%s' not declared\n"), name);
+ einfo (_("%P:%S: warning: memory region `%s' not declared\n"),
+ NULL, name);
new_region = (lang_memory_region_type *)
stat_alloc (sizeof (lang_memory_region_type));
the default memory region. */
if (strcmp (region_name, DEFAULT_MEMORY_REGION) == 0
|| strcmp (alias, DEFAULT_MEMORY_REGION) == 0)
- einfo (_("%F%P:%S: error: alias for default memory region\n"));
+ einfo (_("%F%P:%S: error: alias for default memory region\n"), NULL);
/* Look for the target region and check if the alias is not already
in use. */
if (strcmp (n->name, alias) == 0)
einfo (_("%F%P:%S: error: redefinition of memory region "
"alias `%s'\n"),
- alias);
+ NULL, alias);
}
/* Check if the target region exists. */
if (region == NULL)
einfo (_("%F%P:%S: error: memory region `%s' "
"for alias `%s' does not exist\n"),
- region_name,
- alias);
+ NULL, region_name, alias);
/* Add alias to region name list. */
n = (lang_memory_region_name *) stat_alloc (sizeof (lang_memory_region_name));
else if (expld.phase != lang_mark_phase_enum)
einfo (_("%F%S: non constant or forward reference"
" address expression for section %s\n"),
- os->name);
+ os->addr_tree, os->name);
}
if (os->bfd_section == NULL)
*region = lang_memory_region_lookup (memspec, FALSE);
if (have_lma && lma_memspec != 0)
- einfo (_("%X%P:%S: section has both a load address and a load region\n"));
+ einfo (_("%X%P:%S: section has both a load address and a load region\n"),
+ NULL);
}
void
&& (*pp)->type == 1
&& !((*pp)->filehdr || (*pp)->phdrs))
{
- einfo (_("%X%P:%S: PHDRS and FILEHDR are not supported when prior PT_LOAD headers lack them\n"));
+ einfo (_("%X%P:%S: PHDRS and FILEHDR are not supported"
+ " when prior PT_LOAD headers lack them\n"), NULL);
hdrs = FALSE;
}
/* ldlex.h -
- Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2000, 2003, 2005, 2006, 2007
- Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2000, 2003, 2005, 2006,
+ 2007, 2012 Free Software Foundation, Inc.
This file is part of the GNU Binutils.
/* In ldlex.l. */
extern int yylex (void);
extern void lex_push_file (FILE *, const char *);
-extern void lex_redirect (const char *);
+extern void lex_redirect (const char *, const char *, unsigned int);
extern void ldlex_script (void);
extern void ldlex_mri_script (void);
extern void ldlex_version_script (void);
extern void ldlex_both (void);
extern void ldlex_command (void);
extern void ldlex_popstate (void);
+extern const char* ldlex_filename (void);
/* In lexsup.c. */
extern int lex_input (void);
%{
/* Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
<<EOF>> {
include_stack_ptr--;
-
if (include_stack_ptr == 0)
- {
yyterminate ();
- }
else
- {
yy_switch_to_buffer (include_stack[include_stack_ptr]);
- }
- ldfile_input_filename = file_name_stack[include_stack_ptr - 1];
lineno = lineno_stack[include_stack_ptr];
return END;
on the include stack. */
void
-lex_redirect (const char *string)
+lex_redirect (const char *string, const char *fake_filename, unsigned int count)
{
YY_BUFFER_STATE tmp;
{
einfo("%F: macros nested too deeply\n");
}
- file_name_stack[include_stack_ptr] = "redirect";
+ file_name_stack[include_stack_ptr] = fake_filename;
lineno_stack[include_stack_ptr] = lineno;
include_stack[include_stack_ptr] = YY_CURRENT_BUFFER;
include_stack_ptr++;
- lineno = 1;
+ lineno = count;
tmp = yy_create_string_buffer (string, strlen (string));
yy_switch_to_buffer (tmp);
}
{
yy_start = *(--state_stack_p);
}
+
+/* Return the current file name, or the previous file if no file is
+ current. */
+
+const char*
+ldlex_filename (void)
+{
+ return file_name_stack[include_stack_ptr - (include_stack_ptr != 0)];
+}
\f
/* Place up to MAX_SIZE characters in BUF and return
if (ldfile_assumed_script)
{
bfd_set_error (bfd_error_file_not_recognized);
- einfo ("%F%s: file not recognized: %E\n", ldfile_input_filename);
+ einfo ("%F%s: file not recognized: %E\n", ldlex_filename ());
}
if (! ISPRINT (*what))
what = buf;
}
- einfo ("%P:%S: ignoring invalid character `%s'%s\n", what, where);
+ einfo ("%P:%S: ignoring invalid character `%s'%s\n", NULL, what, where);
}
/* Main program of GNU linker.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
else
{
lex_string = s;
- lex_redirect (s);
+ lex_redirect (s, _("built in linker script"), 1);
}
parser_input = input_script;
yyparse ();
/* ldmisc.c
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
%I filename from a lang_input_statement_type
%P print program name
%R info about a relent
- %S print script file and linenumber
+ %S print script file and linenumber from etree_type.
%T symbol name
%V hex bfd_vma
%W hex bfd_vma with 0x with no leading zeros taking up 8 spaces
case 'S':
/* Print script file and linenumber. */
- if (parsing_defsym)
- fprintf (fp, "--defsym %s", lex_string);
- else if (ldfile_input_filename != NULL)
- fprintf (fp, "%s:%u", ldfile_input_filename, lineno);
- else
- fprintf (fp, _("built in linker script:%u"), lineno);
+ {
+ node_type node;
+ etree_type *tp = va_arg (arg, etree_type *);
+
+ if (tp == NULL)
+ {
+ tp = (etree_type *) &node;
+ tp->type.filename = ldlex_filename ();
+ tp->type.lineno = lineno;
+ }
+ if (tp->type.filename != NULL)
+ fprintf (fp, "%s:%u", tp->type.filename, tp->type.lineno);
+ }
break;
case 'R':
/* 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.
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
{
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
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: