This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
3.2 ia64: conflict with asms and -g
- From: "Wichmann, Mats D" <mats dot d dot wichmann at intel dot com>
- To: <gcc-bugs at gcc dot gnu dot org>
- Date: Sat, 3 May 2003 10:49:42 -0700
- Subject: 3.2 ia64: conflict with asms and -g
Not sure if this is bug or usage problem - so I'm
looking for advice from someone who knows, particularly,
the ia64 port since it seems to be unique to that one.
A project I'm on has a set of stub libraries generated
from a database which are used at link time to control
symbol inclusion; normal libraries are used at runtime.
The stubs are normally built with "-g". When building
with gcc 3.2, a few of these fail this way, but build
if "-g" is omitted. 2.9x gcc does not seem to have
this issue, nor does 3.x on ia32 or ppc.
This fragment reproduces the problem for me:
void acos(void) {} ;
__asm__(".globl signgam; .data; .type signgam,@object; .size signgam, 4;
signgam: .long 0");
When this is built to assembler with a 2.96 compiler,
we see something like this:
<snip>
#APP
.globl signgam; .data; .type signgam,@object; .size signgam, 4;
signgam: .long 0
.section .text
.Letext0:
.section .debug_abbrev, "", "progbits"
</snip>
<snip>
data8.ua .Letext0-.Ltext0
</snip>
The same bit with a 3.2 compiler looks like this:
<snip>
#APP
.globl signgam; .data; .type signgam,@object; .size signgam, 4;
signgam: .long 0
.Letext0:
.section .debug_info
data4.ua 0x45
data2.ua 0x2
data4.ua @secrel(.Ldebug_abbrev0)
</snip>
<snip>
data8.ua .Letext0-.Ltext0
</snip>
The .section .text statement is missing from the latter.
In other words, .Letext0 looks like it's now in
data, rather than text, and the assembler gags on
the calculation ".Lextext0-.Ltext0". This isn't
terribly hard to work around; the script that generates
the stub can add a ".text" at the end of each asm line
that has a ".data".
What I'd like to find out is if this is a bug in
gcc, or if it's not considered kosher to use
section declaration in asm statements, or what
the story is.
Thanks much.
-- mats wichmann