public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Jonathan Larmour <jlarmour@redhat.com>
To: chris.r.lipchik@att.net
Cc: ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] LINKING CODE to specific addresses.
Date: Wed, 24 Jan 2001 10:59:00 -0000	[thread overview]
Message-ID: <3A6F262B.7D0C8E69@redhat.com> (raw)
In-Reply-To: <20010124011049.NZJL1480.mtiwmhc24.worldnet.att.net@webmail.worldnet.att.net>

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

      reply	other threads:[~2001-01-24 10:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-23 17:10 chris.r.lipchik
2001-01-24 10:59 ` Jonathan Larmour [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A6F262B.7D0C8E69@redhat.com \
    --to=jlarmour@redhat.com \
    --cc=chris.r.lipchik@att.net \
    --cc=ecos-discuss@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).