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]

Re: malloc problem with H8300



Hi again,

Now I have solved the full memory problem but I still get the following 
error:

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: warning: cannot find entry symbol __start; 
defaulting to 0
0008000
dtoa.c(.text+0x606): undefined reference to `___cmpsi2'
make: *** [test.srec] Error 1


I tried to find on the crossgcc mail archive and at other place but 
didn't find any answer to that.

Can someone help me to solve this problem?

regards
/Mohammad


Mohammad Saleem wrote:

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



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