This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

AIX 4.1.5.0's gas chokes on g++ 2.95.2's non-positive .lines


On Dec  3, 1999, Alexandre Oliva <oliva@lsd.ic.unicamp.br> wrote:

> /tmp/ccJPpGNZ.s: Assembler messages:
> /tmp/ccJPpGNZ.s:1971: Error: Line numbers must be positive integers

> /tmp/ccJPpGNZ.s:1983: Error: Line numbers must be positive integers

> It's most definitely a bug in gcc, since the code in
> gas/config/obj-coff.c says line 0 is used as an end marker.  The
> following patch causes gas to accept `.line 0', as does the native
> assembler:

It turned out that g++ would also generate *negative* line numbers,
for example, when generating libstdc++/cstrmain.o.  Since the native
assembler also silently accepts such negative line numbers, here's a
revised patch that supersedes the previous one:

Index: gas/ChangeLog
from  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
	
	* config/obj-coff.c (add_lineno): Accept non-positive lineno with
	warning, and bump it to 1.
	
Index: gas/config/obj-coff.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/obj-coff.c,v
retrieving revision 1.19
diff -u -r1.19 obj-coff.c
--- gas/config/obj-coff.c	1999/09/12 03:44:41	1.19
+++ gas/config/obj-coff.c	1999/12/03 19:16:50
@@ -441,8 +441,8 @@
   if (num <= 0) 
     {
       /* Zero is used as an end marker in the file.  */
-      as_bad (_("Line numbers must be positive integers\n"));
-      return;
+      as_warn (_("Line numbers must be positive integers\n"));
+      num = 1;
     }
   new_line->next = line_nos;
   new_line->frag = frag;

-- 
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]