delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/01/15/13:22:58

From: Andrew Crabtree <andrewc AT typhoon DOT rose DOT hp DOT com>
Message-Id: <199801151816.AA247868176@typhoon.rose.hp.com>
Subject: Re: -g problem
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Thu, 15 Jan 1998 10:16:15 PST
Cc: andrewc AT rosemail DOT rose DOT hp DOT com, djgpp-workers AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.980115130601.12130I-100000@is>; from "Eli Zaretskii" at Jan 15, 98 1:06 pm
Reply-To: andrewc AT rosemail DOT rose DOT hp DOT com

 
> What exactly do you mean by ``bombs''?  I think the error message
> about duplicate symbols with -g is because you define functions, not
> variables.
Gas doesn't keep track of functions or variables differently though, 
does it?  The error occurs from the assembler (this is what I meant by
bombs, it just quits with an error).  It also doesn't appear
to be multiply defined, except for references in the debug data.

But why does it occur ONLY if -g is specified?  -gstabs does not exhibit
this behaviour, nor does compiling without any -g or -gstabs.  

I realize I probably didn't send in the assembly code.  Here's the output
with -g

/usr/tmp/cca24774.s: Assembler messages:
/usr/tmp/cca24774.s:39: Fatal error: Symbol __start already defined.

gcc2_compiled.:
___gnu_compiled_c:
.text
	.def	_start;	.val	start;	.scl	2;	.type	041;	.endef
.globl start
start:
	.def	.bf;	.val	.;	.scl	101;	.line	9;	.endef
	pushl %ebp
	movl %esp,%ebp
L1:
	movl %ebp,%esp
	popl %ebp
	ret
	.def	.ef;	.val	.;	.scl	101;	.line	1;	.endef
	.def	_start;	.val	.;	.scl	-1;	.endef
	.def	__start;	.val	_start;	.scl	2;	.type	041;	.endef
.globl _start
_start:
	.def	.bf;	.val	.;	.scl	101;	.line	10;	.endef
	pushl %ebp
	movl %esp,%ebp
L2:
	movl %ebp,%esp
	popl %ebp
	ret
	.def	.ef;	.val	.;	.scl	101;	.line	1;	.endef
	.def	__start;	.val	.;	.scl	-1;	.endef
	.def	___start;	.val	__start;	.scl	2;	.type	041;	.endef
.globl __start
__start:            <<<<<<<<<<<<<<<<<<<<<<<This line has the error
	.def	.bf;	.val	.;	.scl	101;	.line	11;	.endef
	pushl %ebp
	movl %esp,%ebp
L3:
	movl %ebp,%esp
	popl %ebp
	ret
	.def	.ef;	.val	.;	.scl	101;	.line	1;	.endef
	.def	___start;	.val	.;	.scl	-1;	.endef
	.def	_mainCRTStartup;	.val	_mainCRTStartup;	.scl	2;	.type	041;	.endef

Now again but without the -g (this assembles fine)

gcc2_compiled.:
___gnu_compiled_c:
.text
.globl start
start:
	pushl %ebp
	movl %esp,%ebp
L1:
	movl %ebp,%esp
	popl %ebp
	ret
.globl _start
_start:
	pushl %ebp
	movl %esp,%ebp
L2:
	movl %ebp,%esp
	popl %ebp
	ret
.globl __start
__start:
	pushl %ebp
	movl %esp,%ebp
L3:
	movl %ebp,%esp
	popl %ebp
	ret

The same globals and labels are defined it looks like.


>  I don't quite understand why did you write e.g. 
> `extern void start() __asm__("start");' and what do you want this to
> produce, but isn't this what you want:
> 
> 	extern unsigned start __asm__("start");
Please .... You think I would write that.  Its from the gcc sources :)
Its also in the sources for all targets, and since the default 
CFLAGS are "-O2 -g" I assume other targets don't have this problem.
 
> > BTW - Kenner released 2.8.0 for those who have been waiting...
> Yep, I saw the announcement.  The question is: who's gonna work on
> porting it (and libstdc++ 2.8.0) to DJGPP?
Uh - see above ;)  Actually, gcc itself should be in pretty good shape.
All my patches from the last year have been applied.
After you work through some quirks in the make process everything
should work ok, except for gcov, which I have never been able 
to get working.  Haven't tried in almost 6 months now, but I don't
think its changed much.  There is still the fixincludes, and gcc uses 
header file problems, and also the target name scheme must be changed
to match binutils.  I also finally got the c++ libs to build
so those should go OK too.  The only thing I don't know about is 
how it will build under bash and a djgpp environment.  I always
bootstrap from unix.  Given that 2.8.1 will probably be out within 2
weeks might as well wait though.

Andy


--
_______       ___________________________________________________________
           /                       	                  Andrew Crabtree 
          /                          	      Workgroup Networks Division 
         ____       ___  /                                Hewlett-Packard 
        /     /    /    /   		                    Roseville, CA 
     __/   __/    _____/                                     916/785-1675
                 /                           andrewc AT rosemail DOT rose DOT hp DOT com
___________   __/   _____________________________________________________

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019