aboutsummaryrefslogtreecommitdiff
path: root/gas/as.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-01-30 14:44:36 +0000
committerNick Clifton <nickc@redhat.com>2007-01-30 14:44:36 +0000
commitbf083c64df944d5de2c01b0bb0ab821801b7b3f9 (patch)
treeb708c773e7bc06bf7b473d762956ba86ae7a4d20 /gas/as.c
parentef7723ebe72dd86e57d4c54d5eadc12d0f13e5b2 (diff)
downloadfsf-binutils-gdb-bf083c64df944d5de2c01b0bb0ab821801b7b3f9.zip
fsf-binutils-gdb-bf083c64df944d5de2c01b0bb0ab821801b7b3f9.tar.gz
fsf-binutils-gdb-bf083c64df944d5de2c01b0bb0ab821801b7b3f9.tar.bz2
* as.c (main): Mark symbols created via the --defsym command line
option as volatile so that they can be overridden later on by a .set directive. This maintains compatibility with the behaviour of earlier versions of the assembler. * doc/as.texinfo (--defsym): Document that the defined symbol's value can be overridden via a .set directive.
Diffstat (limited to 'gas/as.c')
-rw-r--r--gas/as.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gas/as.c b/gas/as.c
index e1bfb86..39d7c22 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -1,6 +1,6 @@
/* as.c - GAS main program.
Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -1122,6 +1122,11 @@ main (int argc, char ** argv)
sym = symbol_new (defsyms->name, absolute_section, defsyms->value,
&zero_address_frag);
+ /* Make symbols defined on the command line volatile, so that they
+ can be redefined inside a source file. This makes this assembler's
+ behaviour compatible with earlier versions, but it may not be
+ completely intuitive. */
+ S_SET_VOLATILE (sym);
symbol_table_insert (sym);
next = defsyms->next;
free (defsyms);