This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Re: Mapping specific code to specific regions in memory
- To: Amlan Chakraborty <amlan dot cha at wipro dot com>
- Subject: Re: [ECOS] Mapping specific code to specific regions in memory
- From: Jonathan Larmour <jlarmour at redhat dot co dot uk>
- Date: Thu, 22 Jun 2000 17:51:13 +0100
- CC: "ecos-discuss at sourceware dot cygnus dot com" <ecos-discuss at sourceware dot cygnus dot com>
- Organization: Red Hat UK Ltd.
- References: <3951C9CE.6F46570D@wipro.com>
Amlan Chakraborty wrote:
>
> I am using ECOS with ARM PID7t as the target.
>
> Can anyone tell me how do I place some object files
> into some particular region of the memory?
You need to change your linker script. Have a look at the linker
documentation at
http://www.gnu.org/manual/ld-2.9.1/html_chapter/ld_toc.html
and in particular "Memory Layout" and "Specifying Output Sections". Some of
this is best done in the eCos memory layout tool built into the
Configuration Tool (which is Windows-only at present), but some
hand-tweaking will be required to specify the object files.
> Also how
> do I configure the heap to be in some particular
> region of the memory?
This is being worked on in a generic way right now. But for now, what you
can probably do is create a linker output section (e.g. ".heap" )in the
desired location in memory, and edit the linker script to place the input
section .heap into the output section .heap, e.g.
.heap { *(.heap) }
Finally go to language/c/libc/VERSION/src/stdlib/malloc.cxx and add the
line "" to the pool definition there, i.e.
cyg_uint8 cyg_libc_malloc_memorypool[ CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE ]
__attribute__((section(".heap")))
CYGBLD_ATTRIB_WEAK;
This should force this array to be placed in the section ".heap".
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault