This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

[PATCH] Re: Changed shared library loading strategy on PPC, why?


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


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