From: madzero on
hi,
I'v a process is dynamically linked, and some shared libraries are
set to the fixed address, like "/lib/ld-linux.so.2" is set at
0x00812000, while I'd like to put it in another address, as I wish I
could map the whole lowest 1G memory for other usage. So how can I set
to address for these shared libraries?
Thanks a lot!
From: David Schwartz on
On Dec 23, 6:34 pm, madzero <zerocool...(a)gmail.com> wrote:
> hi,
>    I'v a process is dynamically linked, and some shared libraries are
> set to the fixed address, like "/lib/ld-linux.so.2" is set at
> 0x00812000, while I'd like to put it in another address, as I wish I
> could map the whole lowest 1G memory for other usage. So how can I set
> to address for these shared libraries?
>    Thanks a lot!

You'll need to use your own copy of the shared library. You can
relocate it with the 'prelink' command, specifying the '-r' parameter.
You should, however, just consider moving to modern hardware and
software instead.

DS
From: madzero on
On Dec 24, 12:16 pm, David Schwartz <dav...(a)webmaster.com> wrote:
> On Dec 23, 6:34 pm, madzero <zerocool...(a)gmail.com> wrote:
>
> > hi,
> >    I'v a process is dynamically linked, and some shared libraries are
> > set to the fixed address, like "/lib/ld-linux.so.2" is set at
> > 0x00812000, while I'd like to put it in another address, as I wish I
> > could map the whole lowest 1G memory for other usage. So how can I set
> > to address for these shared libraries?
> >    Thanks a lot!
>
> You'll need to use your own copy of the shared library. You can
> relocate it with the 'prelink' command, specifying the '-r' parameter.
> You should, however, just consider moving to modern hardware and
> software instead.
>
> DS

I copy the file "/lib/ld-linux.so.2" to a new file, and use prelink
set a new entry (here I set it to 0x41000000) for it, and I update the
gcc-specs to let it use the new loader file, then compiled it, and it
works, but when I run my process, segmentation fault occurs, it crash
at 0x4100cf14 in dl_bebug_initialize() from the new loader file. So
what's reason?

thanks a lot!