public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Jonathan S. Shapiro" <shap@eros-os.com>
To: Ramana Radhakrishnan <ramana.r@gmail.com>
Cc: binutils <binutils@sources.redhat.com>
Subject: Re: Link start address
Date: Fri, 03 Aug 2007 17:44:00 -0000	[thread overview]
Message-ID: <1186163057.23564.130.camel@shap.om-md.eros-os.com> (raw)
In-Reply-To: <67ea2eb0708031030v4e016671gf976815459a55cbc@mail.gmail.com>

On Fri, 2007-08-03 at 23:00 +0530, Ramana Radhakrishnan wrote:
> Redirecting it there ...
> 
> On 8/3/07, Jonathan S. Shapiro <shap@eros-os.com> wrote:
> > This is probably a question that should be directed to the binutils
> > list.
> >
> > We need to set the default link start address used by ld. Unfortunately
> > ld doesn't have a nice porting guide like GCC does. :-)
> 
> Look at emulparams/*.sh and scriptempl/*.sc  in the ld directory in
> binutils sources. You would need to set up TEXT_START_ADDRESS
> depending on your target to the correct address. Its a bunch of shell
> scripts that run to generate the default linker script and the
> corresponding start addresses.

Isn't TEXT_START_ADDRESS the same as the address specified by the -Ttext
option? If so, this is not sufficient. It causes the text section to
move, but it does not cause the following sections (data, bss) to be
adjusted. What I am looking for is a simple way to lower all of them.

I will look at the places you mention.

> 
> If you were however writing your own standalone linker script you'd do a
> . = <startaddress> in your linker script.

Yes. That I knew about.

> > Actually, we need to choose one of two possible start addresses based on
> > command line options to GCC, and I am wondering if this may make things
> > more complicated.
> 
> You might want to have different linker options chosen - you could
> have different emul targets depending on the command line option you
> choose. You can control this using LINK_SPEC in the gcc driver .
> 
> hope this helps

I was really hoping to avoid multiple emul targets, but I suppose that I
should look at that. :-(

Thanks again.


shap

  reply	other threads:[~2007-08-03 17:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1186161144.23564.126.camel@shap.om-md.eros-os.com>
2007-08-03 17:30 ` Ramana Radhakrishnan
2007-08-03 17:44   ` Jonathan S. Shapiro [this message]
2007-08-03 23:12     ` Ian Lance Taylor

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=1186163057.23564.130.camel@shap.om-md.eros-os.com \
    --to=shap@eros-os.com \
    --cc=binutils@sources.redhat.com \
    --cc=ramana.r@gmail.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).