This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
arm-elf-gcc comprehension
- Subject: [ECOS] arm-elf-gcc comprehension
- From: ANDRE Sébastien <sebastien dot andre at sxb dot bsf dot alcatel dot fr>
- Date: Fri, 29 Jun 2001 10:12:07 +0200
- CC: ecos-discuss at sources dot redhat dot com
- Organization: ALCATEL
- References: <DJLAJKFEHELLAAAA@shared1-mail.whowhere.com>
Hi all,
So i try a test with "arm-elf-gdb" and "arm-elf-gcc" !!
Typically i write a basycally C program like it
int main()
{ int a;
while (a < 5000)
{ a++ ; }
return a;
}
==> a program without stdlib, stdio, etc ..... :-)
So i want to compile and build it for arm processor but NOT for eCos Kernel !!
I want only arm executable file (it possible normally ?)
and after my idea is to try to simulate it on gdb (normally it's possible now because no really hardware
dependant exept arm core ! ?)
If i'm wrong somewhere again !! say me it !
So i build around like it :
arm-elf-gcc -c test.c -o test.o -ggdb -Wall
arm-elf-gcc -Wl,--gc-sections -o test test.o -nostdlib
PS: i try without "-Wl,--gcc-sections" but if i suppress it i have an error build process like it :
test.o: In function `main':
/root/test/test.c:4: undefined reference to `__gccmain'
collect2: ld returned 1 exit status
An executalble file is generate ..... but i have two mistake (in reallity only one i think)
If i try to simulate it (debug) on gdb with this procedure
arm-elf-gdb test
> target sim
> load
i have this error :
gdbsim: no loadable sections "/root/test/test"
unable to load program
So now for see if i have some sections i launch this command :
arm-elf-size test
and say it :
text data bss dec hex filename
0 0 0 0 0 test
So what i miss for build correctly my elf executable files ?
So i know that isn't really an eCos problem but i thanks you if somebody can help me..
bestregards,
Sébastien.