summaryrefslogtreecommitdiffhomepage
path: root/crt/nt32/crt1.c
blob: d08eea84afadcdaabf345c9e06a4370083e651a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**************************************************************************/
/*  mmglue: midipix architecture- and target-specific bits for musl libc  */
/*  Copyright (C) 2013--2023  SysDeer Technologies, LLC                   */
/*  Released under the Standard MIT License; see COPYING.MMGLUE.          */
/**************************************************************************/

#include "crtinit.h"

static const int __disabled = 0;
extern const int __hidden __crtopt_posix  __attribute((weak,alias("__disabled")));
extern const int __hidden __crtopt_dinga  __attribute((weak,alias("__disabled")));
extern const int __hidden __crtopt_ldso   __attribute((weak,alias("__disabled")));
extern const int __hidden __crtopt_vrfs   __attribute((weak,alias("__disabled")));

int  __hidden main();
void __hidden __libc_loader_init(void * __main, int flags);

void __hidden _start(void)
{
	const unsigned short fmode = 0x37f;

	__asm__ __volatile__ (
		"fldcw %0"
		: : "m" (*&fmode));

	__libc_loader_init(
		main,
		__crtopt_posix
			| __crtopt_dinga
			| __crtopt_ldso
			| __crtopt_vrfs);
}