[uClibc-cvs] CVS update of uClibc (libc/misc/internals/__uClibc_main.c libc/stdlib/malloc/malloc.h libc/sysdeps/linux/common/getpagesize.c libpthread/linuxthreads/internals.h)

Erik Andersen andersen at codepoet.org
Mon Aug 16 19:21:47 UTC 2004


    Date: Monday, August 16, 2004 @ 13:21:47
  Author: andersen
    Path: /var/cvs/uClibc

Modified: libc/misc/internals/__uClibc_main.c (1.38 -> 1.39)
          libc/stdlib/malloc/malloc.h (1.20 -> 1.21)
          libc/sysdeps/linux/common/getpagesize.c (1.4 -> 1.5)
          libpthread/linuxthreads/internals.h (1.9 -> 1.10)

The variable used to store pagesize is not the same as the
_dl_pagesize variable in ldso, so avoid aliasing.
 -Erik


Index: uClibc/libc/misc/internals/__uClibc_main.c
diff -u uClibc/libc/misc/internals/__uClibc_main.c:1.38 uClibc/libc/misc/internals/__uClibc_main.c:1.39
--- uClibc/libc/misc/internals/__uClibc_main.c:1.38	Fri Aug 13 17:39:42 2004
+++ uClibc/libc/misc/internals/__uClibc_main.c	Mon Aug 16 13:21:42 2004
@@ -48,9 +48,7 @@
  */
 
 extern int _dl_secure;
-extern size_t _dl_pagesize;
-size_t __dl_pagesize = 0;
-weak_alias(__dl_pagesize, _dl_pagesize);
+size_t __pagesize = 0;
 
 char **__environ = 0;
 const char *__progname = 0;
@@ -140,9 +138,9 @@
 	}
 	aux_dat += 2;
     }
-    _dl_pagesize = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE;
+    __pagesize = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE;
 #else
-    _dl_pagesize = PAGE_SIZE;
+    __pagesize = PAGE_SIZE;
 #endif
 
     /* If we are dynamically linked the shared lib loader already
Index: uClibc/libc/stdlib/malloc/malloc.h
diff -u uClibc/libc/stdlib/malloc/malloc.h:1.20 uClibc/libc/stdlib/malloc/malloc.h:1.21
--- uClibc/libc/stdlib/malloc/malloc.h:1.20	Fri Aug 13 17:39:42 2004
+++ uClibc/libc/stdlib/malloc/malloc.h	Mon Aug 16 13:21:43 2004
@@ -15,7 +15,8 @@
 #define MALLOC_ALIGNMENT	(sizeof (double))
 
 /* The system pagesize... */
-#define MALLOC_PAGE_SIZE	_dl_pagesize
+extern size_t __pagesize;
+#define MALLOC_PAGE_SIZE	__pagesize
 
 /* The minimum size of block we request from the the system to extend the
    heap for small allocations (we may request a bigger block if necessary to
Index: uClibc/libc/sysdeps/linux/common/getpagesize.c
diff -u uClibc/libc/sysdeps/linux/common/getpagesize.c:1.4 uClibc/libc/sysdeps/linux/common/getpagesize.c:1.5
--- uClibc/libc/sysdeps/linux/common/getpagesize.c:1.4	Tue May 11 05:14:57 2004
+++ uClibc/libc/sysdeps/linux/common/getpagesize.c	Mon Aug 16 13:21:44 2004
@@ -19,13 +19,13 @@
 #include <unistd.h>
 #include <features.h>
 #include <sys/param.h>
-extern size_t _dl_pagesize;
+extern size_t __pagesize;
 
 /* Return the system page size.  */
 int __getpagesize(void)
 {
-  if (_dl_pagesize != 0)
-    return _dl_pagesize;
+  if (__pagesize != 0)
+    return __pagesize;
 
 #ifdef	EXEC_PAGESIZE
   return EXEC_PAGESIZE;
Index: uClibc/libpthread/linuxthreads/internals.h
diff -u uClibc/libpthread/linuxthreads/internals.h:1.9 uClibc/libpthread/linuxthreads/internals.h:1.10
--- uClibc/libpthread/linuxthreads/internals.h:1.9	Fri Aug 13 17:39:45 2004
+++ uClibc/libpthread/linuxthreads/internals.h	Mon Aug 16 13:21:45 2004
@@ -316,7 +316,7 @@
 
 /* The page size we can get from the system.  This should likely not be
    changed by the machine file but, you never know.  */
-extern size_t _dl_pagesize;
+extern size_t __pagesize;
 #include <bits/uClibc_page.h>
 #ifndef PAGE_SIZE
 #define PAGE_SIZE  (sysconf (_SC_PAGESIZE))
@@ -329,19 +329,19 @@
 #ifdef __ARCH_HAS_MMU__
 #define STACK_SIZE  (2 * 1024 * 1024)
 #else
-#define STACK_SIZE  (4 * _dl_pagesize)
+#define STACK_SIZE  (4 * __pagesize)
 #endif
 #endif
 
 /* The initial size of the thread stack.  Must be a multiple of PAGE_SIZE.  */
 #ifndef INITIAL_STACK_SIZE
-#define INITIAL_STACK_SIZE  (4 * _dl_pagesize)
+#define INITIAL_STACK_SIZE  (4 * __pagesize)
 #endif
 
 /* Size of the thread manager stack. The "- 32" avoids wasting space
    with some malloc() implementations. */
 #ifndef THREAD_MANAGER_STACK_SIZE
-#define THREAD_MANAGER_STACK_SIZE  (2 * _dl_pagesize - 32)
+#define THREAD_MANAGER_STACK_SIZE  (2 * __pagesize - 32)
 #endif
 
 /* The base of the "array" of thread stacks.  The array will grow down from



More information about the uClibc-cvs mailing list