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]
Other format: [Raw text]

Link error for arm-elf under Cygwin


Hi all,
I successfully compiled the following test program for arm-elf under Cygwin
cross-GCC:
-----------------------------------------
#include <stdlib.h>
#include <stdio.h>

int main()
{
   char *str ;
   str=(char *)malloc(80) ;
   strcpy( str, "hello world" ) ;
   free( str ) ;
}

__gccmain(void)
{;}
-----------------------------------------
$ arm-elf-gcc -g test.c

This produced a working executable, which I could debug under GDB/Insight.

However, when I tried to use arm-elf-ld, I received the following error:

amit@AMIT ~/mallocTest
$ arm-elf-gcc -g -c test.c

amit@AMIT ~/mallocTest
$ arm-elf-ld  -e0x8000 -o test test.o -lc
/home/amit/arm-elf/arm-elf/lib/libc.a(freer.o): In function
`_malloc_trim_r':
/home/amit/GNU_SRC/build-newlib/arm-elf/newlib/libc/stdlib/../../../../../ne
wlib
-1.9.0/newlib/libc/stdlib/mallocr.c:3270: undefined reference to `__udivsi3'

It seems to me like I'm missing something in the link command line.
Any help will be greatly appreciated.

P.S.
I'm using:
$ arm-elf-gcc -v
Reading specs from /home/amit/arm-elf/lib/gcc-lib/arm-elf/2.95.3/specs
gcc version 2.95.3 20010315 (release
$ arm-elf-ld -v
GNU ld version 2.11.2 (with BFD 2.11.2)
===================
-------------------
Amit Resh
VP R&D
Connect One Ltd.
2 Ha'Nagar Street
New Industrial zone,   44425
Kfar Saba,      Israel

Tel:  +972-9-766-0456
Fax: +972-9-766-0461
E-Mail: amit@connectone.com
http://www.connectone.com

CONNECT ONE: CONNECTING YOUR DEVICE TO THE INTERNET


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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