Link error for arm-elf under Cygwin

Grant Edwards
Fri Nov 9 02:53:00 GMT 2001

On Tue, Dec 18, 2001 at 07:14:00PM +0200, Amit wrote:

> I failed to mention that I am using newlib.
> The previous link used libc.a at: D:\cygwin\home\amit\arm-elf\arm-elf\lib\
> I found libgcc at: D:\cygwin\home\amit\arm-elf\lib\gcc-lib\arm-elf\2.95.3\
> Now linking with:
> $ arm-elf-ld -e0x8000 -o test test.o -lc -lgcc
> I tried debugging with Insight 5.1 and received the following error on the
> malloc() line:
>  str=(char *)malloc(80)
> (gdb) r
> Starting program: /home/amit/mallocTest/test
> _sbrk: Heap and stack collision

It appears that your start-up code (the code, probably in
assembly, that runs first and then calls main()) isn't setting
up the stack and heap spaces properly.  I don't know what
newlib expects in regards to heap/stack...

Grant Edwards

Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list