ELF Sections in GCC
John Love-Jensen
eljay@adobe.com
Mon Sep 15 18:45:00 GMT 2003
Hi Rudy,
I'm not seeing a intra-routine padding problem, using GCC 3.2.
I'm only seeing inter-routine padding, for alignment.
Could you send a short example that illustrates the problem?
Worse come to worse, you could change the ".p2align 4,,15" to ".p2align
4,144,15" (144 == 0x90) through some post-processing sed or perl magic
before the assembler gets a crack at it.
--Eljay
>gcc -O3 -save-temps -c doo.cpp
- - - - doo.cpp - - - -
extern int foo (char a, char b) __attribute__ ((section ("bar")));
extern int bar (int a, int b) __attribute__ ((section ("bar")));
int foo (char a, char b)// __attribute__ ((section ("bar")))
{
return a + b;
}
int bar (int a, int b)// __attribute__ ((section ("bar")))
{
return a + b;
}
- - - - doo.s - - - -
.file "doo.cpp"
.section bar,"ax",@progbits
.align 2
.p2align 4,,15
.globl _Z3foocc
.type _Z3foocc,@function
_Z3foocc:
.LFB1:
pushl %ebp
.LCFI0:
movl %esp, %ebp
.LCFI1:
movsbl 8(%ebp),%eax
movsbl 12(%ebp),%ecx
popl %ebp
addl %ecx, %eax
ret
.LFE1:
.Lfe1:
.size _Z3foocc,.Lfe1-_Z3foocc
.align 2
.p2align 4,,15
.globl _Z3barii
.type _Z3barii,@function
_Z3barii:
.LFB2:
pushl %ebp
.LCFI2:
movl %esp, %ebp
.LCFI3:
movl 12(%ebp), %eax
movl 8(%ebp), %ecx
popl %ebp
addl %ecx, %eax
ret
.LFE2:
.Lfe2:
.size _Z3barii,.Lfe2-_Z3barii
.ident "GCC: (GNU) 3.2"
More information about the Gcc-help
mailing list