Clean up _dl_pagesize initialization.
authorRoland McGrath <roland@hack.frob.com>
Fri, 15 Mar 2013 21:35:17 +0000 (14:35 -0700)
committerRoland McGrath <roland@hack.frob.com>
Fri, 15 Mar 2013 21:35:17 +0000 (14:35 -0700)
ChangeLog
elf/dl-support.c

index f3eea738576c499831d6662eb39a1852e908926a..4afd5f2022f0b766bd34552d033972fb724ada12 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2013-03-15  Roland McGrath  <roland@hack.frob.com>
 
+       * elf/dl-support.c (_dl_aux_init): Ignore zero value for AT_PAGESZ.
+       (_dl_non_dynamic_init): Don't set _dl_pagesize; it will never be
+       zero since it's initialized to EXEC_PAGESIZE.
+
        * sysdeps/unix/sysv/linux/ldsodefs.h
        (_dl_non_dynamic_init, _dl_aux_init): Move declarations to ...
        * sysdeps/generic/ldsodefs.h: ... here.
index b2bf31264e484110a5ac371d6e70911d7276939c..ad9b4c40b072518e89a1e91403ffef99d7d8a5ff 100644 (file)
@@ -198,7 +198,8 @@ _dl_aux_init (ElfW(auxv_t) *av)
     switch (av->a_type)
       {
       case AT_PAGESZ:
-       GLRO(dl_pagesize) = av->a_un.a_val;
+       if (av->a_un.a_val != 0)
+         GLRO(dl_pagesize) = av->a_un.a_val;
        break;
       case AT_CLKTCK:
        GLRO(dl_clktck) = av->a_un.a_val;
@@ -266,9 +267,6 @@ _dl_non_dynamic_init (void)
   if (HP_TIMING_AVAIL)
     HP_TIMING_NOW (_dl_cpuclock_offset);
 
-  if (!_dl_pagesize)
-    _dl_pagesize = __getpagesize ();
-
   _dl_verbose = *(getenv ("LD_WARN") ?: "") == '\0' ? 0 : 1;
 
   /* Set up the data structures for the system-supplied DSO early,