summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-07-28 14:52:51 +0000
committerEric Andersen <andersen@codepoet.org>2004-07-28 14:52:51 +0000
commit2b553bc16f1adf6c7302a87dee5b29ceaf47aba5 (patch)
tree7c3dfbbbee3cca06373b33c1629e67a0009fa60a
parent6a108999f81ae9baf8b39b8acc47b7b4c6c048a0 (diff)
Do not grovel about in the ELF header for the page size when
running on uClinux, which at runtime uses the FLAT file format.
-rw-r--r--libc/misc/internals/__uClibc_main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index b404b0ebc..f74e35625 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -123,10 +123,10 @@ void __attribute__ ((__noreturn__))
__uClibc_start_main(int argc, char **argv, char **envp,
void (*app_init)(void), void (*app_fini)(void))
{
+ /* Pull stuff from the ELF header when possible */
+#ifdef __ARCH_HAS_MMU__
unsigned long *aux_dat;
Elf32_auxv_t auxvt[AT_EGID + 1];
-
- /* Pull stuff from the ELF header when possible */
aux_dat = (unsigned long*)envp;
while (*aux_dat) {
aux_dat++;
@@ -140,6 +140,9 @@ __uClibc_start_main(int argc, char **argv, char **envp,
aux_dat += 2;
}
_dl_pagesize = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : 4096;
+#else
+ _dl_pagesize = 4096;
+#endif
/* If we are dynamically linked the shared lib loader already
* did this for us. But if we are statically linked, we need