This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: mapping shared libraries at fixed address...
- From: Alexandre Julliard <julliard at winehq dot org>
- To: Faré <fahree at gmail dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 18 Jan 2006 10:19:04 +0100
- Subject: Re: mapping shared libraries at fixed address...
- References: <653bea160601172121k791c4a9dx@mail.gmail.com>
Faré <fahree@gmail.com> writes:
> So as to be able to mmap BIG data files on i386, I would like to get
> the shared libraries out of the way. With no userspace specification,
> ld.so and libc.so are mmap()ed by the kernel at one third of the
> address space (starting at 0x55555000), which means that I can't mmap
> contiguously a file larger than 1.6GB approximately (less than I
> need), at opposed to a maximum of 2.9GB or so if I could get the
> libraries loaded near the bottom of the memory.
We had a similar problem in Wine, since we need to load Windows
binaries at fixed addresses. What we ended up doing is a preloader
that allows you to reserve a range of addresses before ld.so and libc
are mapped. You can find the code here:
http://source.winehq.org/git/?p=wine.git;a=blob;hb=HEAD;f=loader/preloader.c
--
Alexandre Julliard
julliard@winehq.org