malloc problem with H8300

Mohammad Saleem mosa@enea.se
Mon Nov 12 02:24:00 GMT 2001


Hi Dennis,
Thanks for answer.

When I checked my linker file I have __end symbol but not _end.
I added that as below:
*****************
    } > mem
    .bss : {
        __bss_start = . ;
        *(.bss)
        *(COMMON)
        __end = . ;
        _end = .;
    } > mem
******************
The error disappeared but I don't know if  I did right. Is this fix 
going to affect my application?

Further during linking I get the another following error:

h8300-hitachi-hms-ld: region mem is full (test.srec section .text)
c:/dsp/lib/libc.a(dtoa.o): In function `__dtoa_r':
dtoa.c:342: undefined reference to `___cmpsi2'
dtoa.c(.text+0x606): undefined reference to `___cmpsi2'
h8300-hitachi-hms-ld: region mem is full (test.srec section .text)

Can somebody tell me what is going wrong and how I solve this problem?

thanks in advance

regards
/Mohammad

Dennis Tubbs wrote:

>Mohammad,
>As far as I know '_end' is defined in the linker command file.  It is
>defined at the very end of the code sections in the memory map.  Malloc
>allocates memory off of the heap which typically starts at the end of the
>program memory and grows toward the stack, at least for a 68k.  This way the
>heap can be defined at link time to make maximum use of the available
>memory.
>
>Hope this helps.
>
>Dennis
>
>-----Original Message-----
>From: crossgcc-owner@sources.redhat.com
>[mailto:crossgcc-owner@sources.redhat.com]On Behalf Of Mohammad Saleem
>Sent: Thursday, November 15, 2001 4:28 AM
>To: crossgcc@sources.redhat.com
>Subject: malloc problem with H8300
>
>
>Hi all,
>
>I have a question regarding malloc.
>I am using H8300 cross compiler and when I try to use malloc in one of
>my  c-files I get the following
>message:
>*******************************
>c:/dsp/lib/libc.a(sbrk.o): In function `__sbrk':
>sbrk.c:17: undefined reference to `_end'
>make: *** [test.srec] Error 1
>********************************
>When I do search for sbrk.c I get a number of such files.
>I don't in which file should I look.
>Why I get that and how I can solve this?
>Any kind of help in this regard will be appreciated.
>
>Thanks in advance
>regards
>/Mohammad
>
>
>
>
>------
>Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
>Want to unsubscribe? Send a note to
>crossgcc-unsubscribe@sourceware.cygnus.com
>
>
>------
>Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
>Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
>
>



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



More information about the crossgcc mailing list