public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Gcc for powerpc configuration question
@ 2000-07-03 18:46 Peter Reilley
  2000-07-03 23:25 ` Scott Howard
  2000-07-04  4:31 ` Ola Liljedahl
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Reilley @ 2000-07-03 18:46 UTC (permalink / raw)
  To: Cross Gcc mailing list

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Gcc for powerpc configuration question
  2000-07-03 18:46 Gcc for powerpc configuration question Peter Reilley
@ 2000-07-03 23:25 ` Scott Howard
  2000-07-04  4:31 ` Ola Liljedahl
  1 sibling, 0 replies; 4+ messages in thread
From: Scott Howard @ 2000-07-03 23:25 UTC (permalink / raw)
  To: crossgcc

__eabi is in libgcc.a, so try adding libgcc.a on the linker command
line.

Scott

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Gcc for powerpc configuration question
  2000-07-03 18:46 Gcc for powerpc configuration question Peter Reilley
  2000-07-03 23:25 ` Scott Howard
@ 2000-07-04  4:31 ` Ola Liljedahl
  1 sibling, 0 replies; 4+ messages in thread
From: Ola Liljedahl @ 2000-07-04  4:31 UTC (permalink / raw)
  To: Peter Reilley; +Cc: Cross Gcc mailing list

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
begin:vcard 
n:Liljedahl;Ola
x-mozilla-html:FALSE
org:Enea OSE Systems;R & D
adr:;;;;;;
version:2.1
email;internet:olli@enea.se
title:Technical Manager
fn:Ola Liljedahl
end:vcard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Gcc for powerpc configuration question
@ 2000-07-05 17:35 Peter Reilley
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Reilley @ 2000-07-05 17:35 UTC (permalink / raw)
  To: Cross Gcc mailing list

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-07-05 17:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-03 18:46 Gcc for powerpc configuration question Peter Reilley
2000-07-03 23:25 ` Scott Howard
2000-07-04  4:31 ` Ola Liljedahl
2000-07-05 17:35 Peter Reilley

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).