This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Gcc for powerpc configuration question


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.

But;

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?

Thanks,
Pete.


-----Original Message-----
From: Ola Liljedahl <olli@enea.se>
To: Peter Reilley <micrio@mv.com>
Cc: Cross Gcc mailing list <crossgcc@sourceware.cygnus.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,
>> Pete.
>>
>> ------
>> Want more information?  See the CrossGCC FAQ,
http://www.objsw.com/CrossGCC/
>> Want to unsubscribe? Send a note to
crossgcc-unsubscribe@sourceware.cygnus.com


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]