[ECOS] malloc not allocing

David N. Welton davidw@dedasys.com
Tue Jan 14 21:29:00 GMT 2003


Jonathan Larmour <jifl@eCosCentric.com> writes:

> 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

Frustratingly, even after changing it, a make clean and make, I still
have:

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

Which is odd, because the previous setup worked, once upon a time.

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

I tried a variety of locations... 0x108000, 0x100000, 0x10ffef and
sizes, and it seems to always get the same results.  This is just a
regular old PC with lots of memory, so I just want to use a big space.

Thankyou very much for your help, it's greatly appreciated.

Tools are the following:

davidw@arqua:~$ ld --version
GNU ld version 2.13.90.0.10 20021010 Debian GNU/Linux
davidw@arqua:~$ gcc --version
2.95.4
davidw@arqua:~$ objcopy --version
GNU objcopy 2.13.90.0.10 20021010 Debian GNU/Linux

My ecos version is the one in Debian's 'testing' as well, which
appears to be from last July.  Would that cause any of these problems?

I have this feeling that I'm doing something stupid...

Thanks again,
-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

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