musl/crt/crt1.c
Sam Clegg 3b871f91e2 Fix signatures of __libc_start_main/_init/_fini
We should probably upstream these.  The __libc_start_main
is pretty clearly wrong in the current upstream.
2018-06-22 08:07:42 -07:00

19 lines
394 B
C

#include <features.h>
#define START "_start"
#include "crt_arch.h"
int main(int argc, char *argv[]);
void _init(void) __attribute__((weak));
void _fini(void) __attribute__((weak));
_Noreturn int __libc_start_main(int (*)(), int, char **,
void (*)(), void(*)());
void _start_c(long *p)
{
int argc = p[0];
char **argv = (void *)(p+1);
__libc_start_main(main, argc, argv, _init, _fini);
}