public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] LINKING CODE to specific addresses.
@ 2001-01-23 17:10 chris.r.lipchik
  2001-01-24 10:59 ` Jonathan Larmour
  0 siblings, 1 reply; 2+ messages in thread
From: chris.r.lipchik @ 2001-01-23 17:10 UTC (permalink / raw)
  To: ecos-discuss

I'm having trouble getting started on creating 
code sections and linking code at specific addresses.

I want the code contained in a single source file (either 
C or assembly) to be located at address 0x20000.  The 
remaining code, the application S/W, needs to start 
immediately after the code in the single source file 
mentioned above.  The address of ROM in my uP is 0x00000
to 0x3FFFF.

Do I use the Configuration Tool to do this or do I need 
to manually edit a file.

Any help would be appreciated.

Thanks,


Chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] LINKING CODE to specific addresses.
  2001-01-23 17:10 [ECOS] LINKING CODE to specific addresses chris.r.lipchik
@ 2001-01-24 10:59 ` Jonathan Larmour
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Larmour @ 2001-01-24 10:59 UTC (permalink / raw)
  To: chris.r.lipchik; +Cc: ecos-discuss

chris.r.lipchik@att.net wrote:
> 
> I'm having trouble getting started on creating
> code sections and linking code at specific addresses.
> 
> I want the code contained in a single source file (either
> C or assembly) to be located at address 0x20000.  The
> remaining code, the application S/W, needs to start
> immediately after the code in the single source file
> mentioned above.  The address of ROM in my uP is 0x00000
> to 0x3FFFF.
> 
> Do I use the Configuration Tool to do this or do I need
> to manually edit a file.

For doing what you describe, you would need to edit the linker script. In
eCos, the linker script is constructed from various linker script
fragments, and information from the Memory Layout Tool. So to achieve what
you want you probably want to edit the linker script fragment for your
target, add a new "section" to contain the object code in question e.g.

#define SECTION_mysection(_region_, _vma_, _lma_) \
.mysection _vma_ : _lma_ { myspecialobject.o(.text) } > _region_

where myspecialobject.o is the object contain the special code.

Then in the MLT, give mysection the address you want (or even just hardcode
it into the .mysection description above).

You didn't give your target so I can't give more specifics than this, but
this should help you get going.

Read the GNU linker (ld) info files for more documentation on linker script
syntax.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Un cheval, pas du glue. Pas du cheval, beaucoup du glue. || Opinions==mine

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-01-24 10:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-23 17:10 [ECOS] LINKING CODE to specific addresses chris.r.lipchik
2001-01-24 10:59 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).