This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Link start address


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]