public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Carlo Wood <carlo@alinoe.com>
To: Gavin Li <gavinux@yahoo.com>
Cc: gcc@gcc.gnu.org
Subject: Re: I really need help!
Date: Wed, 17 Oct 2001 18:15:00 -0000	[thread overview]
Message-ID: <20011018031531.A11436@alinoe.com> (raw)
In-Reply-To: <20011018004749.76726.qmail@web14509.mail.yahoo.com>

Did you try -fomit-frame-pointer ?

On Wed, Oct 17, 2001 at 05:47:49PM -0700, Gavin Li wrote:
> I am not sure if I should send this mail to here.
> 
> I use gcc (2.95.3) compile a file which include a
> function start(), 
> the C file is:
> /* Hardware boot loader */
> void start(void)
> {
> 	asm ("movl %esp, 0x5000");
> 	for (;;)
> 	{
>         	/* do whatever I want, such as call foo() */
> 		foo();
> 	}
> }
> foo()
> {
>    ...
> }
> 
> the command line used to compile :
> gcc -O3 -nostdlib -e start -o bootldr.out bootldr.c
> objdump -d bootldr.out > bootldr.asm
> 
> the ASM output is:
> 	push %ebp
> 	mov  %esp, %ebp
> 	mpv  %esp, 0x5000
> 	...
> 
> 
> My question is how can I get ride of the first two ASM
> instructions? I want the compiler to compile my
> inlined ASM instruction as the first instruction in
> the start() function, and the other function just as
> general output.
>  
> My reason that I want to get ride of those instruction
> si:
>    I provided -e start to tell compiler that program
> should start run from start(). There is no other
> function will call this start(), It is the first
> function which was run after power on. The first two
> ASM instructions are useless. Seriosly, they are
> harmful!!!
> Because when an embedded system power on, it runs from
> start(), the stack pointer is undefined at this time,
> it may points to some place where do NOT have memory
> at all! so the push instruction will generate
> exception! So, I need the compiler to generate start()
> which the first instruction is my inline assembler!
>     I checked the GCC online manual, but I can't find
> how to make gcc works as what I want.
>     Anyone who can tell me how to do that?
> 
> Thanks a lot,
> 
> Gavin
> 
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com

-- 
Carlo Wood <carlo@alinoe.com>

  reply	other threads:[~2001-10-17 18:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-17 17:47 Gavin Li
2001-10-17 18:15 ` Carlo Wood [this message]
2001-10-22  6:46   ` Joern Rennecke
2001-10-17 22:04 ` akbara
2001-10-17 19:37 mike stump
2001-10-18  9:26 ` Davide Libenzi
2001-10-22  6:46 ` Joern Rennecke

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=20011018031531.A11436@alinoe.com \
    --to=carlo@alinoe.com \
    --cc=gavinux@yahoo.com \
    --cc=gcc@gcc.gnu.org \
    /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).