This is the mail archive of the
mailing list for the GCC project.
RE: I really need help!
- To: "Gavin Li" <gavinux at yahoo dot com>, <gcc at gcc dot gnu dot org>
- Subject: RE: I really need help!
- From: "akbara" <syedali011 at earthlink dot net>
- Date: Wed, 17 Oct 2001 23:58:05 -0700
> -----Original Message-----
> From: firstname.lastname@example.org [mailto:email@example.com]On Behalf Of
> Gavin Li
> Sent: Wednesday, October 17, 2001 5:48 PM
> To: firstname.lastname@example.org
> Subject: I really need help!
> 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() */
> 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
> 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
> 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,
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.