[ECOS] malloc not allocing

Jonathan Larmour jifl@eCosCentric.com
Tue Jan 14 15:48:00 GMT 2003


David N. Welton wrote:
> Jonathan Larmour <jifl@eCosCentric.com> writes:
> 
>>You could see what address the linker put __heap2 at by searching
>>for it in the output of i386-elf-nm on your ELF image (not the
>>.bin).
> 
> 
> This doesn't look quite right?
> 
> davidw@arqua:~/workshop/ecos2-ficl/ficl$ nm embficl | grep heap
> 00015c84 t _GLOBAL_.D.47000.cygmem_memalloc_heaps
> 00015c6c t _GLOBAL_.I.47000.cygmem_memalloc_heaps
> 0008e5b0 A __heap1
> 0008e5b0 A __heap2
> 00024674 D cygmem_memalloc_heaps
> 00026960 B cygmem_pool_heap1
> 00026d80 B cygmem_pool_heap2

Oh doh! I should have noticed that before. The syntax in the .ldi file 
should be something more like:

     CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
     CYG_LABEL_DEFN(__heap2) = 0x108000; . = CYG_LABEL_DEFN(__heap2) + 
0x100000;
     SECTIONS_END
}

Where 0x108000 would be the address you would want the heap at (substitute 
in the value the heap memory you want to use is actually at) and 0x100000 
is the size, which should match the definition in the .h file.

Jifl
-- 
eCosCentric       http://www.eCosCentric.com/       <info@eCosCentric.com>
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list