Subject: Re: NetBSD ld.elf_so vs FreeBSD ld-elf.so vs Linux ld-linux.so
To: None <tech-perform@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-perform
Date: 09/26/2002 17:13:17
In article <20020926150819.94598A@proven.weird.com>,
Greg A. Woods <tech-userlevel@netbsd.org, tech-perform@netbsd.org> wrote:
>
>I can't find anything related to pre-binding, pre-linking, or caching,
>here yet:
>
>	http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/binutils/
>
>but it seems support for it will eventually be contributed back to GNU
>Binutils so perhaps we'll get it yet! ;-)

On RH-7.3 seems /lib/i686/libc.so gets loaded at:

    /lib/i686/libc.so.6:     file format elf32-i386
    /lib/i686/libc.so.6
    architecture: i386, flags 0x00000150:
    HAS_SYMS, DYNAMIC, D_PAGED
    start address 0x42017560

    Program Header:
	PHDR off    0x00000034 vaddr 0x42000034 paddr 0x42000034 align 2**2
	     filesz 0x000000c0 memsz 0x000000c0 flags r-x
      INTERP off    0x0012b950 vaddr 0x4212b950 paddr 0x4212b950 align 2**0
	     filesz 0x00000013 memsz 0x00000013 flags r--
	LOAD off    0x00000000 vaddr 0x42000000 paddr 0x42000000 align 2**12
	     filesz 0x0012b963 memsz 0x0012b963 flags r-x
	LOAD off    0x0012c000 vaddr 0x4212c000 paddr 0x4212c000 align 2**12
	     filesz 0x00004b60 memsz 0x00008d20 flags rw-
     DYNAMIC off    0x00130220 vaddr 0x42130220 paddr 0x42130220 align 2**2
	     filesz 0x000000d8 memsz 0x000000d8 flags rw-
	NOTE off    0x000000f4 vaddr 0x420000f4 paddr 0x420000f4 align 2**2
	     filesz 0x00000020 memsz 0x00000020 flags r--

Which is a PITA, because if you change:

include/asm-i386/processor.h
+#if 0
#define TASK_UNMAPPED_BASE      (TASK_SIZE / 3)
+#endif 
+#define TASK_UNMAPPED_BASE      0x10000000

In order to be able to start a 2.7G java process instead of a 1.7G one,
you cannot use /lib/i686 because it still loads at 0x40000000, instead
of 0x10000000 where it could.

The joys of pre-loading. If anyone knows how to make it load at 0x10000000
or has a different shared library linked for there, let me know.

The solution in my case was mv /lib/i686{,.old}...

christos