public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Matt Sartori <msartori@hanoverdisplays.com>
Cc: eCos Discussion <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] Simple Redboot Q's
Date: Tue, 26 Jul 2005 17:21:00 -0000	[thread overview]
Message-ID: <20050726172136.GB10656@lunn.ch> (raw)
In-Reply-To: <F9885E669725F248A1F6DB9109FDD679357122@Molly.hanover.local>

On Tue, Jul 26, 2005 at 06:03:51PM +0100, Matt Sartori wrote:
> Yes, that all the jumps and references within the code are relative, not
> absolute.

Nope. eCos is position dependant. ie you have to load it where it
expects to be loaded. Otherwise it crashes and burns.

> I think what I'm not quite understanding is what the load does. 
> I would expect the loading of an elf to involve the interpretation of
> the file as to where to put it (and probably other stuff), however
> loading an elf explicitly to a location (with -b) doesn't make logical
> sense to me since the elf already knows where it wants to go. 

Correct. You should not tell the loader where to put the image. You
only need this for raw binaries. That format does not contain the
position information so you have to tell it.

> Equally baffling to me is when I load a .bin to an explicit location
> then I can't just run it from that location.
>
> Only when I load the .bin into the same memory location as what I've put
> in the binary's linker script does it work

Thats the position independant stuff again... You code appears not to
be position independant. It contains absolute addresses, not relative
addresses. Hence when its in the wrong place it crashes an burns.

If you want to be able to load your application to any random address
you need to make your application position independant. This can be
quite difficult, so most applications don't do it.

        Andrew

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

  reply	other threads:[~2005-07-26 17:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-26 17:03 Matt Sartori
2005-07-26 17:21 ` Andrew Lunn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-07-27 11:17 Matt Sartori
2005-07-26 15:55 Matt Sartori
2005-07-26 16:30 ` Andrew Lunn
2005-07-26 14:52 Matt Sartori
2005-07-26 14:59 ` Gary Thomas
2005-07-26 13:20 Matt Sartori
2005-07-26 13:28 ` Gary Thomas
2005-07-26 13:28 ` Andrew Lunn
2005-07-26 10:16 Matt Sartori
2005-07-26 11:05 ` Andrew Lunn
2005-07-26 13:08   ` Gary Thomas

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=20050726172136.GB10656@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=msartori@hanoverdisplays.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).