Re: ELF Sections in GCC

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

 



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"



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux