This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Changed shared library loading strategy on PPC, why?
On Mon, Jun 18, 2001 at 03:49:58PM -0700, Ulrich Drepper wrote:
> Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
>
> > Yes, I rechecked with old glibc rpms I have lying around and that was
> > introduced somewhere between May 18 and Jun 6. I'm suspecting this patch:
> >
> > 2001-05-21 Jakub Jelinek <jakub@redhat.com>
>
> All this patch does is finding objects for given addresses. glibc
> nowhere forces a load address.
>
> Run your new glibc with strace (start ld.so directly) and look at all
> the mmap calls. The first mmap call for every DSO must use NULL as
> the preferred address. The following calls (one on x86, I think two
> on PPC) use fixed addresses.
For what it's worth, this is not currently the case on PowerPC (post-2.2.3
CVS):
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\2\245"..., 1024) = 1024
fstat64(0x3, 0x7ffff008) = 0
mmap(0x6feac000, 1326520, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x6feac000
mprotect(0x6ffbc000, 212408, PROT_NONE) = 0
mmap(0x6ffbc000, 192512, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x100000) = 0x6ffbc000
mmap(0x6ffeb000, 19896, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x6ffeb000
close(3) = 0
Nor did it used to be. However, the address has changed (2.1.3):
mmap(0xfeea000, 1072764, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xfeea000
mprotect(0xffcb000, 151164, PROT_NONE) = 0
mmap(0xffda000, 69632, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0xe0000) = 0xffda000
mmap(0xffeb000, 20092, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffeb000
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer