This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

Problems with arm-elf-ld


Hi!

	I am tring to build an executable for an arm target using
gcc and related tools "as" and "ld".
If I just use the command line:

arm-elf-gcc simplefile.c

everything goes right and I obtain an a.out file.
But what I'm actually trying to do is to obtain the same result
using in different steps gcc with the -S option, then as and finally ld.

Here is what I am using...

   $CC -mthumb-interwork -save-temps -g -S -mcpu=arm7tdmi     
prova1.c	

    $AS -mthumb-interwork -adslh -EL -D -o prova1.o prova1.s &> 
prova1.l
    $AS -mthumb-interwork -adslh -EL -D -o crt0.o crt0.s &> crt0.l

    $LL  --script armelf.x  -Map exe.map -o exe.elf *.o


In the following lines you can see the code of the test program
I wrote and the error msg I obtain from the linker.

/***********************************************************************/
#include "stdio.h"

extern int main(void);

int main()
{
 int a,b,c;
 
 a=3;
 b=10;
 printf("1) a=%d, b=%d/n",a,b);
 c=a;
 a=b;
 b=a;
 printf("2) a=%d, b=%d/n",a,b);
 return(a);
}
/**********************************************************************/

 > /Tools/Xgcc-arm/xgcc/bin/arm-elf-ld: warning: cannot find entry    
    symbol start; defaulting to 02000000
 > prova1.o: In function `main':
 > /home/mp3/prova1.c:6: undefined reference to `__gccmain'
 > /home/mp3/prova1.c:11: undefined reference to `printf'
 > /home/mp3/prova1.c:15: undefined reference to `printf'

Is there anybody out there that can suggest me something to go
on? Thanks a lot in advance,

	Igor.
----------------------------------------------
Virgilio Mail - Il tuo indirizzo E-mail gratis
http://mail.virgilio.it



------
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]