aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2003-01-07 05:38:41 +0000
committerH. Peter Anvin <hpa@zytor.com>2003-01-07 05:38:41 +0000
commit5fc07e76452fcdd18c8b3bc9eb52dc9cd9e092a7 (patch)
treea427b75d6bbf2c13c602499a2fd3a3e952a1f975
parentc463163248d42b6142538416007905c71e28356d (diff)
downloadklibc-5fc07e76452fcdd18c8b3bc9eb52dc9cd9e092a7.tar.gz
Correct old bogosityklibc-0.73
-rw-r--r--klibc/arch/README28
1 files changed, 8 insertions, 20 deletions
diff --git a/klibc/arch/README b/klibc/arch/README
index 9a76577b57c0d..b97aaca96063c 100644
--- a/klibc/arch/README
+++ b/klibc/arch/README
@@ -8,29 +8,17 @@ The "getenvtest" test program is a very good test for proper crt0.S
functionality.
-extern char **environ;
-extern int main(int, char **, char **);
-extern __noreturn exit(int);
+extern __noreturn __libc_init(void *, void *);
__noreturn _start(void)
{
- intptr_t *argptr = __stack_pointer(); /* Usually -- e.g. SPARC is special */
- int argc;
- char **argv, **envp;
-
-#if STACK_GROWS_UP
- argc = (int)*argptr--;
- argv = (char **)argptr;
- envp = argv-(argc+1);
-#else
- argc = (int)*argptr++;
- argv = (char **)argptr;
- envp = argv+(argc+1);
-#endif
-
- environ = envp;
-
- exit(main(argc, argv, envp));
+ void *elf_data = get_elf_data_address(); /* Usually the stack address */
+ void *atexit_ptr = get_atexit_ptr(); /* Usually in a register */
+
+ /* Some architectures need this for debugging to work */
+ setup_null_stack_frame_if_necessary();
+
+ __libc_init(elf_data, atexit_ptr);
}