summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-01-08 11:51:43 +0000
committerMike Frysinger <vapier@gentoo.org>2006-01-08 11:51:43 +0000
commit4cb63ab6d1034aa3449154396fcdf35fce1200f6 (patch)
tree7624db813131fa72478a734bf0e8f99dd6513572
parent9eb7e16e2557ada5e81814492eedac426711760f (diff)
create a hidden internal pagesize symbol for libc usage
-rw-r--r--libc/misc/internals/__uClibc_main.c6
-rw-r--r--libc/sysdeps/linux/common/getpagesize.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 3876c7606..924175d97 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -82,7 +82,9 @@ strong_alias (__progname_full, program_invocation_name)
char **__environ = 0;
weak_alias(__environ, environ)
+/* TODO: don't export __pagesize; we cant now because libpthread uses it */
size_t __pagesize = 0;
+hidden_strong_alias(__pagesize,__pagesize_internal)
#ifndef O_NOFOLLOW
# define O_NOFOLLOW 0
@@ -150,7 +152,7 @@ void __uClibc_init(void)
/* Setup an initial value. This may not be perfect, but is
* better than malloc using __pagesize=0 for atexit, ctors, etc. */
- __pagesize = PAGE_SIZE;
+ __pagesize_internal = PAGE_SIZE;
#ifdef __UCLIBC_HAS_THREADS__
/* Before we start initializing uClibc we have to call
@@ -247,7 +249,7 @@ __uClibc_main(int (*main)(int, char **, char **), int argc,
#ifdef __ARCH_HAS_MMU__
/* Make certain getpagesize() gives the correct answer */
- __pagesize = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE;
+ __pagesize_internal = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE;
/* Prevent starting SUID binaries where the stdin. stdout, and
* stderr file descriptors are not already opened. */
diff --git a/libc/sysdeps/linux/common/getpagesize.c b/libc/sysdeps/linux/common/getpagesize.c
index 669cdb075..517040d46 100644
--- a/libc/sysdeps/linux/common/getpagesize.c
+++ b/libc/sysdeps/linux/common/getpagesize.c
@@ -19,14 +19,14 @@
#include <unistd.h>
#include <features.h>
#include <sys/param.h>
-extern size_t __pagesize;
+extern size_t __pagesize_internal attribute_hidden;
/* Return the system page size. */
/* couldn't make __getpagesize hidden, because shm.h uses it in a macro */
int attribute_hidden __getpagesize_internal(void)
{
- if (__pagesize != 0)
- return __pagesize;
+ if (__pagesize_internal != 0)
+ return __pagesize_internal;
#ifdef EXEC_PAGESIZE
return EXEC_PAGESIZE;