This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


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

arm-elf-gcc comprehension


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.












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