From e2eb3fb11c16b2a57f2cf97a74f796d2dceca1d2 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 5 Mar 2013 10:00:40 +0800 Subject: [PATCH] Usermode/crt0 - Patching to support cross-compiler --- Usermode/Libraries/crt0.o_src/crt0.c | 6 +++++- Usermode/Libraries/crt0.o_src/crtbegin.c | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Usermode/Libraries/crt0.o_src/crt0.c b/Usermode/Libraries/crt0.o_src/crt0.c index f506d72b..8363aea9 100644 --- a/Usermode/Libraries/crt0.o_src/crt0.c +++ b/Usermode/Libraries/crt0.o_src/crt0.c @@ -6,11 +6,15 @@ typedef void (*exithandler_t)(void); typedef void (*constructor_t)(void); +constructor_t _crtbegin_ctors[0] __attribute__((section(".ctors"))); + exithandler_t _crt0_exit_handler; -extern constructor_t _crtbegin_ctors[]; +//extern constructor_t _crtbegin_ctors[]; extern void _exit(int status) __attribute__((noreturn)); extern int main(int argc, char *argv[], char **envp); +void _start(int argc, char *argv[], char **envp) __attribute__ ((alias("start"))); + void start(int argc, char *argv[], char **envp) { int i; diff --git a/Usermode/Libraries/crt0.o_src/crtbegin.c b/Usermode/Libraries/crt0.o_src/crtbegin.c index 8e18f89b..e69de29b 100644 --- a/Usermode/Libraries/crt0.o_src/crtbegin.c +++ b/Usermode/Libraries/crt0.o_src/crtbegin.c @@ -1,2 +0,0 @@ - -void *_crtbegin_ctors[0] __attribute__((section(".ctors"))); -- 2.20.1