[Top] [All Lists]

Re: [patch] 2.4, head: PAGE_SHIFT changes break glibc

To: Ralf Baechle <>
Subject: Re: [patch] 2.4, head: PAGE_SHIFT changes break glibc
From: "Maciej W. Rozycki" <>
Date: Tue, 25 Nov 2003 16:27:49 +0100 (CET)
In-reply-to: <>
Organization: Technical University of Gdansk
Original-recipient: rfc822;
References: <> <> <>
On Fri, 21 Nov 2003, Maciej W. Rozycki wrote:

> > The kernel is already passing AT_PAGESZ to ELF binaries.  Wouldn't that
> > be sufficient?  Currently it's passing the largest supported page size,
>  Well, AFAICS in glibc it's that is responsible for interpreting the
> auxiliary vector -- see _dl_aux_init() in elf/dl-support.c.  If the
> dynamic linker isn't run (which is the usual case for static binaries,
> although calling dlopen() from them might complicate things), the
> dl_pagesize variable remains set to zero.  Please prove me wrong if I am
> missing anything.
> > that is 64k.  However this constant is always passed even when a smaller
> > page size is configured.
>  Are you sure?  I can see create_elf_tables() in fs/binfmt_elf.c sets 
> AT_PAGESZ to ELF_EXEC_PAGESIZE, which, in turn, is set in 
> include/asm-mips/elf.h to PAGE_SIZE.  Which is the currently used page 
> size and probably the optimal solution.

 After rebuilding glibc (2.2.5) with the patch applied, the following

#include <stdio.h>
#include <unistd.h>

int main(void)
        printf("%u\n", getpagesize());
        return 0;

prints "4096" if dynamically linked and "65536" if statically linked on my
system, as expected.

+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+        e-mail:, PGP key available        +

<Prev in Thread] Current Thread [Next in Thread>