powerpc-rtems-gcc question (fwd)
joel at oarcorp.com
joel at oarcorp.com
Fri Oct 30 15:02:49 UTC 1998
---------- Forwarded message ----------
Date: Thu, 29 Oct 1998 19:44:23 -0600 (CST)
From: joel at OARcorp.com
To: Brendan Simon <brendan at dgs.monash.edu.au>
Cc: rtems-list <rtems-list at oarcorp.com>
Subject: Re: powerpc-rtems-gcc question
On Sat, 31 Oct 1998, Brendan Simon wrote:
> I have successfully compiled the gcc suite following the rtems-4.0.0
> documentation. Before I try to use RTEMS I thought I would try a little
> test that flashes a led on the ADS board. It is about 20 lines of code
> but the executalbe seems quite large. I used objcopy to generate an
> s-record and it is nearly 4kb. I am not using any libc functions (that
> I know of anyway). Is the compliler linking in all of libc or parts of
> RTEMS by default ???
If it is only 4K, then it is unlikely you are getting much of anything
other than crt0 and a C routine. Use powerpc-rtems-nm to see the symbols
in it. Srecords also use 2 ascii bytes to represent 1 byte in the real
image plus per record overhead. So your real image size is under 2K.
> Can I use this as a pure powerpc compiler without an implicit linking.
> It also complains about _start not being defined. I assume crt0.o is
> being linked in but I'm not quite sure which one and where the source is
> that generated the crt0.o
The answer is yes. Look at the gcc options like -nostdlib and
-nostdinclude or something like that.
> The command is
> powerpc-rtems-gcc -Wall -O2 -Wl,-Ttext=0x1000000,-Tdata=0x20000000 -o
> leds.elf leds.c
>
> The only library that I assume is being linked in implicitly is libc.a.
> Is this true ?
Probably. Adding a -v will check that out by printing the ld command.
> Are there any linker scripts involved. Can I define my own if need be
> and where should I put it.
See the ld line with the -v option to check it out for sure.
--joel
Joel Sherrill Director of Research & Development
joel at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the users
mailing list