This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Link start address
- From: "Ramana Radhakrishnan" <ramana dot r at gmail dot com>
- To: "Jonathan S. Shapiro" <shap at eros-os dot com>
- Cc: binutils <binutils at sources dot redhat dot com>
- Date: Fri, 3 Aug 2007 23:00:02 +0530
- Subject: Re: Link start address
- References: <1186161144.23564.126.camel@shap.om-md.eros-os.com>
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.
If you were however writing your own standalone linker script you'd do a
. = <startaddress> in your linker script.
>
> 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
cheers
Ramana
>
> This is an ELF target. If we simply issue a --section-start for
> the .init section from GCC, will the other sections get adjusted
> accordingly under the generic linker script, or do we need to do
> something more involved?
>
> If it's more involved, where to look?
>
> Bother. I used to know how to do this. :-)
>
>
> shap
>
>
--
Ramana Radhakrishnan