Changeset View
Changeset View
Standalone View
Standalone View
lib/csu/aarch64/crt1_c.c
- This file was moved from lib/csu/aarch64/crt1.c.
Show All 29 Lines | |||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include "libc_private.h" | #include "libc_private.h" | ||||
#include "crtbrand.c" | |||||
#include "ignore_init.c" | #include "ignore_init.c" | ||||
#ifdef GCRT | #ifdef GCRT | ||||
extern void _mcleanup(void); | extern void _mcleanup(void); | ||||
extern void monstartup(void *, void *); | extern void monstartup(void *, void *); | ||||
extern int eprol; | extern int eprol; | ||||
extern int etext; | extern int etext; | ||||
#endif | #endif | ||||
extern long * _end; | extern long * _end; | ||||
void __start(int, char **, char **, void (*)(void)); | void __start(int, char **, char **, void (*)(void)); | ||||
/* The entry function. */ | |||||
__asm(" .text \n" | |||||
" .align 0 \n" | |||||
" .globl _start \n" | |||||
" _start: \n" | |||||
" mov x3, x2 \n" /* cleanup */ | |||||
" add x1, x0, #8 \n" /* load argv */ | |||||
" ldr x0, [x0] \n" /* load argc */ | |||||
" add x2, x1, x0, lsl #3 \n" /* env is after argv */ | |||||
" add x2, x2, #8 \n" /* argv is null terminated */ | |||||
" b __start "); | |||||
/* The entry function. */ | /* The entry function. */ | ||||
void | void | ||||
__start(int argc, char *argv[], char *env[], void (*cleanup)(void)) | __start(int argc, char *argv[], char *env[], void (*cleanup)(void)) | ||||
{ | { | ||||
handle_argv(argc, argv, env); | handle_argv(argc, argv, env); | ||||
Show All 14 Lines |