Gcc for powerpc configuration question
Wed Jul 5 17:35:00 GMT 2000
I have solved the problem with the help of the people here, thanks.
This is what I have found out. I needed to use ppc-elf and
not ppc-eabi. I could have stubbed out the call to __eabi
but I did not like that solution. Including libgcc caused more
calls to be unresolved.
Using elf solved the problem. The test program compiled
OK but crashed when run. The stack was not being set.
I solved this in my linker script and everything is OK.
A new problem came up. The program has the normal
entry point at _start in the crt0 module. I specify the base
address for the .text section as 0x8000. The _start label
is at 0x8004. There is a pointer to my .fixup section at
location 0x8000? Don't know why that is there.
Anyway, when gdb loads the code it uses bfd_get_start_address
to get the initial execution point and sets the processors' $pc
with this value. The problem is that it is getting the base
address of 0x8000 and not the _start location of 0x8004. If I set
the $pc by hand then everything is OK.
Could some shed some light on this problem?
From: Ola Liljedahl <email@example.com>
To: Peter Reilley <firstname.lastname@example.org>
Cc: Cross Gcc mailing list <email@example.com>
Date: Tuesday, July 04, 2000 7:31 AM
Subject: Re: Gcc for powerpc configuration question
>I think __eabi() is for calling constructors of static objects.
>It is called from main().
>You probably don't need that so just implement a dummy __eabi().
>But it should not be wrong to include libgcc.a on the linker
>command line since gcc might have generated some other calls to
>be resolved by this library. libgcc.a is a companion to the
>compiler, it does not contain any public library functions.
> Ola Liljedahl
>Peter Reilley wrote:
>> I am trying to build a test program that will be downloaded
>> into a powerpc evaluation board. The program will run bare,
>> there is no monitor in the board. I am using gcc to compile
>> the test program written in C. I configured the tools with
>> "ppc-eabi". The link fails with a call to __eabi. The test program
>> does no I/O and so needs no libraries.
>> I have successfully written an assembly program that runs in the
>> board so I know that I can assemble and download OK. I am
>> using gdb to download the test program.
>> I am new at writing embedded code and am wondering if the
>> "ppc-eabi" configuration is correct.
>> Any help greatly appreciated,
>> Want more information? See the CrossGCC FAQ,
>> Want to unsubscribe? Send a note to
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to firstname.lastname@example.org
More information about the crossgcc