[okl4-developer] linking boot image
Tomas Hruby
thruby at cs.otago.ac.nz
Tue Aug 19 09:57:23 EST 2008
Hi,
I only wanted to have the userspace code linked to a different virtual
address. Setting _LINKADDRESS does exactly what I want. The ELF image
is still laid out by the build system in "physical" memory, however
the virtual load address is mine :) The Openboot loads the image with
virtual addressing ON, so I need to patch the physical addresses in
the rootserver info by adding an offset. But that's OK.
Cheers, T.
On Mon, Aug 18, 2008 at 09:04:37PM +1000, Geoffrey Lee wrote:
> On Mon, Aug 18, 2008 at 02:47:40PM +1000, Tomas Hruby wrote:
> > Hi,
> >
> > > If you look closely, the elfadorn command actually contains a call to
> > > the linker (ld). The -Ttext option is actually passed to the linker,
> > > not elfadorn. If you take a look at the linker man page, you'll find
> > > that -Ttext determines the absolute address that the .text section will
> > > be linked to. This is important because the bootloader should start
> > > execution from this very address after bootstrap.
> >
> > Yes, that is clear. It was probably a wrong question. I mean, where
> > does this specific value comes from when linking the root server. I am
> > not specifying it anywhere. I fured out that I can change it by
> > setting _LINKADDRESS in machine if I want to link usercode to a
> > different address.
>
> Hi Tomas
>
> The programs are laid out in memory by the build system. Hence
> this address is picked by the build system. However, I don't
> think this answers what are you are really after. Do you have
> a specific problem that you are trying to solve?
>
>
> >
> > T.
> >
>
> -gl
>
> > > Of course, depending on your setup, it is possible to change this
> > > address and still have a working system (for example, simply telling the
> > > bootloader to start at a different address).
> > >
> > > Which platform are you working on, and what linker is being used?
> > >
> > > Nelson.
> > >
> > > On 18/08/2008, at 11:30 AM, Tomas Hruby wrote:
> > >
> > >> when linking, elfadorn gets called with -Ttext=100000 option. Where
> > >> does it come from? How can I change it (or not to use it)?
> > >
> > > --
> > > (nt)
> > >
> > > Nelson Tam
> > >
> > >
> >
> > _______________________________________________
> > Developer mailing list
> > Developer at okl4.org
> > https://lists.okl4.org/mailman/listinfo/developer
> >
>
> --
>
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
>
More information about the Developer
mailing list