public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: John Love-Jensen <eljay@adobe.com>
To: Rudy Koot <rudykoot@hotmail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: ELF Sections in GCC
Date: Mon, 15 Sep 2003 18:45:00 -0000	[thread overview]
Message-ID: <BB8B7215.A754%eljay@adobe.com> (raw)
In-Reply-To: <BAY7-F1008S0g9S83w40000c987@hotmail.com>

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"


       reply	other threads:[~2003-09-15 18:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BAY7-F1008S0g9S83w40000c987@hotmail.com>
2003-09-15 18:45 ` John Love-Jensen [this message]
     [not found] <BAY7-F58QtofuWvPwcu000241d6@hotmail.com>
2003-09-15 21:02 ` Eljay Love-Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BB8B7215.A754%eljay@adobe.com \
    --to=eljay@adobe.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=rudykoot@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).