bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: as: multiple definitions is now error


From: Nick Clifton
Subject: Re: as: multiple definitions is now error
Date: Tue, 30 Jan 2007 14:45:13 +0000
User-agent: Thunderbird 1.5.0.9 (X11/20061215)

Hi Fabi,

So know is that a bug?
Not a bug as such, more of a mis-feature.  Please could you try out the 
attached patch which I think will resolve the problem for you.

Yes, it works with the patch, thanks a lot.

Good - I have checked in a extended version of the patch which adds a comment explaining why --defsym variables are now marked as being volatile as well as an update to the documentation mentioning that values created via --defsym can be overridden via .set directives.

Cheers
  Nick

gas/ChangeLog
2007-01-30  Nick Clifton  <address@hidden>

        * 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.
Index: gas/as.c
===================================================================
RCS file: /cvs/src/src/gas/as.c,v
retrieving revision 1.69
diff -c -3 -p -r1.69 as.c
*** gas/as.c    7 Jun 2006 11:27:57 -0000       1.69
--- gas/as.c    30 Jan 2007 14:41:58 -0000
***************
*** 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
     Free Software Foundation, Inc.
  
     This file is part of GAS, the GNU Assembler.
--- 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, 2007
     Free Software Foundation, Inc.
  
     This file is part of GAS, the GNU Assembler.
*************** main (int argc, char ** argv)
*** 1122,1127 ****
--- 1122,1132 ----
  
        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);
Index: gas/doc/as.texinfo
===================================================================
RCS file: /cvs/src/src/gas/doc/as.texinfo,v
retrieving revision 1.155
diff -c -3 -p -r1.155 as.texinfo
*** gas/doc/as.texinfo  3 Nov 2006 07:29:37 -0000       1.155
--- gas/doc/as.texinfo  30 Jan 2007 14:42:00 -0000
*************** other assemblers.
*** 501,507 ****
  @item --defsym @address@hidden
  Define the symbol @var{sym} to be @var{value} before assembling the input 
file.
  @var{value} must be an integer constant.  As in C, a leading @samp{0x}
! indicates a hexadecimal value, and a leading @samp{0} indicates an octal 
value.
  
  @item -f
  ``fast''---skip whitespace and comment preprocessing (assume source is
--- 501,509 ----
  @item --defsym @address@hidden
  Define the symbol @var{sym} to be @var{value} before assembling the input 
file.
  @var{value} must be an integer constant.  As in C, a leading @samp{0x}
! indicates a hexadecimal value, and a leading @samp{0} indicates an octal
! value.  The value of the symbol can be overridden inside a source file via the
! use of a @code{.set} pseudo-op.
  
  @item -f
  ``fast''---skip whitespace and comment preprocessing (assume source is

reply via email to

[Prev in Thread] Current Thread [Next in Thread]