This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] Re: Changed shared library loading strategy on PPC, why?
- To: Ulrich Drepper <drepper at redhat dot com>, Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Subject: [PATCH] Re: Changed shared library loading strategy on PPC, why?
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 22 Jun 2001 13:15:02 +0200
- Cc: libc-alpha at sources dot redhat dot com
- References: <5.1.0.14.2.20010618101149.0368aec8@mail.lauterbach.com>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jun 18, 2001 at 10:24:54AM +0200, Franz Sirl wrote:
> Hi,
>
> it seems someone changed the library loading strategy on PPC, which
> certainly has a performance impact. So I would like to know why this had
> been done and if it was done on purpose at all.
>
> On PPC before the change the address scheme was like that:
>
> executable at 0x10000000
> shared lib first load below that, and if that space runs out, loading
> continues below 0x70000000.
>
> Now, it seems that loading starts immediately below 0x70000000, leaving the
> space with optimal relocations below 0x10000000 unused.
Apparently powerpc's ELF_PREFERRED_ADDRESS relies on executable's l_map_end
== ~0UL.
Does following patch help?
Perhaps the test could be l == _dl_loaded instead of
l->l_type == lt_executable...
2001-06-22 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/dl-machine.c (__elf_preferred_address): Prefer
gaps below main executable.
--- libc/sysdeps/powerpc/dl-machine.c.jj Fri Mar 2 13:44:57 2001
+++ libc/sysdeps/powerpc/dl-machine.c Fri Jun 22 13:14:35 2001
@@ -119,7 +119,8 @@ __elf_preferred_address(struct link_map
mapend = l->l_map_end | (_dl_pagesize - 1);
assert (mapend > mapstart);
- if (mapend >= high && high >= mapstart)
+ if ((mapend >= high || l->l_type == lt_executable)
+ && high >= mapstart)
high = mapstart;
else if (mapend >= low && low >= mapstart)
low = mapend;
Jakub