@zigc/lib 0.15.2-test.1 → 0.15.2-test.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +1 -5
  3. package/libc/freebsd/lib/csu/aarch64/crt.h +1 -0
  4. package/libc/freebsd/lib/csu/aarch64/crt1_c.c +33 -0
  5. package/libc/freebsd/lib/csu/aarch64/crt1_s.S +68 -0
  6. package/libc/freebsd/lib/csu/amd64/crt.h +30 -0
  7. package/libc/freebsd/lib/csu/amd64/crt1_c.c +30 -0
  8. package/libc/freebsd/lib/csu/amd64/crt1_s.S +89 -0
  9. package/libc/freebsd/lib/csu/arm/crt.h +1 -0
  10. package/libc/freebsd/lib/csu/arm/crt1_c.c +80 -0
  11. package/libc/freebsd/lib/csu/arm/crt1_s.S +77 -0
  12. package/libc/freebsd/lib/csu/common/crtbegin.c +95 -0
  13. package/libc/freebsd/lib/csu/common/crtbrand.S +55 -0
  14. package/libc/freebsd/lib/csu/common/crtend.c +65 -0
  15. package/libc/freebsd/lib/csu/common/csu_common.h +50 -0
  16. package/libc/freebsd/lib/csu/common/feature_note.S +47 -0
  17. package/libc/freebsd/lib/csu/common/ignore_init_note.S +48 -0
  18. package/libc/freebsd/lib/csu/common/notes.h +32 -0
  19. package/libc/freebsd/lib/csu/i386/crt.h +30 -0
  20. package/libc/freebsd/lib/csu/i386/crt1_c.c +30 -0
  21. package/libc/freebsd/lib/csu/i386/crt1_s.S +91 -0
  22. package/libc/freebsd/lib/csu/powerpc/crt.h +31 -0
  23. package/libc/freebsd/lib/csu/powerpc/crt1_c.c +89 -0
  24. package/libc/freebsd/lib/csu/powerpc/crtsavres.S +189 -0
  25. package/libc/freebsd/lib/csu/powerpc64/crt.h +31 -0
  26. package/libc/freebsd/lib/csu/powerpc64/crt1_c.c +83 -0
  27. package/libc/freebsd/lib/csu/riscv/crt.h +8 -0
  28. package/libc/freebsd/lib/csu/riscv/crt1_c.c +51 -0
  29. package/libc/freebsd/lib/csu/riscv/crt1_s.S +51 -0
  30. package/libc/freebsd/lib/libc/include/libc_private.h +450 -0
  31. package/libc/netbsd/lib/csu/arch/aarch64/crt0.S +45 -0
  32. package/libc/netbsd/lib/csu/arch/earm/crt0.S +61 -0
  33. package/libc/netbsd/lib/csu/arch/i386/crt0.S +48 -0
  34. package/libc/netbsd/lib/csu/arch/m68k/crt0.S +47 -0
  35. package/libc/netbsd/lib/csu/arch/mips/crt0.S +59 -0
  36. package/libc/netbsd/lib/csu/arch/powerpc/crt0.S +56 -0
  37. package/libc/netbsd/lib/csu/arch/sparc/crt0.S +55 -0
  38. package/libc/netbsd/lib/csu/arch/sparc64/crt0.S +59 -0
  39. package/libc/netbsd/lib/csu/arch/x86_64/crt0.S +48 -0
  40. package/libc/netbsd/lib/csu/common/crt0-common.c +351 -0
  41. package/libc/netbsd/lib/csu/common/crtbegin.c +135 -0
  42. package/libc/netbsd/lib/csu/common/csu-common.h +38 -0
  43. package/libc/netbsd/lib/csu/common/sysident.S +89 -0
  44. package/libc/netbsd/lib/csu/common/sysident_assym.h +17 -0
  45. package/package.json +2 -2
@@ -0,0 +1,83 @@
1
+ /* LINTLIBRARY */
2
+ /*-
3
+ * SPDX-License-Identifier: BSD-4-Clause
4
+ *
5
+ * Copyright 2001 David E. O'Brien.
6
+ * All rights reserved.
7
+ * Copyright 1996-1998 John D. Polstra.
8
+ * All rights reserved.
9
+ * Copyright (c) 1997 Jason R. Thorpe.
10
+ * Copyright (c) 1995 Christopher G. Demetriou
11
+ * All rights reserved.
12
+ *
13
+ * Redistribution and use in source and binary forms, with or without
14
+ * modification, are permitted provided that the following conditions
15
+ * are met:
16
+ * 1. Redistributions of source code must retain the above copyright
17
+ * notice, this list of conditions and the following disclaimer.
18
+ * 2. Redistributions in binary form must reproduce the above copyright
19
+ * notice, this list of conditions and the following disclaimer in the
20
+ * documentation and/or other materials provided with the distribution.
21
+ * 3. All advertising materials mentioning features or use of this software
22
+ * must display the following acknowledgement:
23
+ * This product includes software developed for the
24
+ * FreeBSD Project. See https://www.freebsd.org/ for
25
+ * information about FreeBSD.
26
+ * This product includes software developed for the
27
+ * NetBSD Project. See http://www.netbsd.org/ for
28
+ * information about NetBSD.
29
+ * 4. The name of the author may not be used to endorse or promote products
30
+ * derived from this software without specific prior written permission
31
+ *
32
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
33
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
34
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
35
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
36
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
37
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
38
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
39
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
41
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42
+ */
43
+
44
+ #include <sys/cdefs.h>
45
+ #include <stdint.h>
46
+ #include <sys/elf.h>
47
+
48
+ #include "libc_private.h"
49
+ #include "csu_common.h"
50
+
51
+ struct Struct_Obj_Entry;
52
+ struct ps_strings;
53
+
54
+ void _start(int, char **, char **, const struct Struct_Obj_Entry *,
55
+ void (*)(void), struct ps_strings *) __dead2;
56
+
57
+ struct ps_strings *__ps_strings;
58
+
59
+ /* The entry function. */
60
+ /*
61
+ * First 5 arguments are specified by the PowerPC SVR4 ABI.
62
+ * The last argument, ps_strings, is a BSD extension.
63
+ */
64
+ void
65
+ _start(int argc, char **argv, char **env,
66
+ const struct Struct_Obj_Entry *obj __unused, void (*cleanup)(void),
67
+ struct ps_strings *ps_strings)
68
+ {
69
+ if (ps_strings != (struct ps_strings *)0)
70
+ __ps_strings = ps_strings;
71
+
72
+ #ifdef GCRT
73
+ __libc_start1_gcrt(argc, argv, env, cleanup, main, &eprol, &etext);
74
+ #else
75
+ __libc_start1(argc, argv, env, cleanup, main);
76
+ #endif
77
+ }
78
+
79
+ #ifdef GCRT
80
+ __asm__(".text");
81
+ __asm__("eprol:");
82
+ __asm__(".previous");
83
+ #endif
@@ -0,0 +1,8 @@
1
+
2
+ #ifndef _CRT_H_
3
+ #define _CRT_H_
4
+
5
+ /* zig patch: no HAVE_CTORS */
6
+ #define INIT_CALL_SEQ(func) "call " __STRING(func)
7
+
8
+ #endif
@@ -0,0 +1,51 @@
1
+ /* LINTLIBRARY */
2
+ /*-
3
+ * Copyright 1996-1998 John D. Polstra.
4
+ * Copyright (c) 2015-2017 Ruslan Bukin <br@bsdpad.com>
5
+ * All rights reserved.
6
+ *
7
+ * Portions of this software were developed by SRI International and the
8
+ * University of Cambridge Computer Laboratory under DARPA/AFRL contract
9
+ * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme.
10
+ *
11
+ * Portions of this software were developed by the University of Cambridge
12
+ * Computer Laboratory as part of the CTSRD Project, with support from the
13
+ * UK Higher Education Innovation Fund (HEIF).
14
+ *
15
+ * Redistribution and use in source and binary forms, with or without
16
+ * modification, are permitted provided that the following conditions
17
+ * are met:
18
+ * 1. Redistributions of source code must retain the above copyright
19
+ * notice, this list of conditions and the following disclaimer.
20
+ * 2. Redistributions in binary form must reproduce the above copyright
21
+ * notice, this list of conditions and the following disclaimer in the
22
+ * documentation and/or other materials provided with the distribution.
23
+ *
24
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
28
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ */
35
+
36
+ #include <sys/cdefs.h>
37
+ #include "libc_private.h"
38
+ #include "csu_common.h"
39
+
40
+ void __start(int argc, char **argv, char **env, void (*cleanup)(void)) __dead2;
41
+
42
+ void
43
+ __start(int argc, char **argv, char **env, void (*cleanup)(void))
44
+ {
45
+ #ifdef GCRT
46
+ __libc_start1_gcrt(argc, argv, env, cleanup, main, &eprol, &etext);
47
+ __asm__("eprol:");
48
+ #else
49
+ __libc_start1(argc, argv, env, cleanup, main);
50
+ #endif
51
+ }
@@ -0,0 +1,51 @@
1
+ /* LINTLIBRARY */
2
+ /*-
3
+ * Copyright 1996-1998 John D. Polstra.
4
+ * Copyright (c) 2015-2017 Ruslan Bukin <br@bsdpad.com>
5
+ * All rights reserved.
6
+ *
7
+ * Portions of this software were developed by SRI International and the
8
+ * University of Cambridge Computer Laboratory under DARPA/AFRL contract
9
+ * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme.
10
+ *
11
+ * Portions of this software were developed by the University of Cambridge
12
+ * Computer Laboratory as part of the CTSRD Project, with support from the
13
+ * UK Higher Education Innovation Fund (HEIF).
14
+ *
15
+ * Redistribution and use in source and binary forms, with or without
16
+ * modification, are permitted provided that the following conditions
17
+ * are met:
18
+ * 1. Redistributions of source code must retain the above copyright
19
+ * notice, this list of conditions and the following disclaimer.
20
+ * 2. Redistributions in binary form must reproduce the above copyright
21
+ * notice, this list of conditions and the following disclaimer in the
22
+ * documentation and/or other materials provided with the distribution.
23
+ *
24
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
28
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ */
35
+
36
+ #include <machine/asm.h>
37
+ ENTRY(_start)
38
+ mv a3, a2 # cleanup
39
+ addi a1, a0, 8 # get argv
40
+ ld a0, 0(a0) # load argc
41
+ slli t0, a0, 3 # mult by arg size
42
+ add a2, a1, t0 # env is after argv
43
+ addi a2, a2, 8 # argv is null terminated
44
+ .option push
45
+ .option norelax
46
+ lla gp, __global_pointer$
47
+ .option pop
48
+ call __start
49
+ END(_start)
50
+
51
+ .section .note.GNU-stack,"",%progbits
@@ -0,0 +1,450 @@
1
+ /*-
2
+ * SPDX-License-Identifier: BSD-3-Clause
3
+ *
4
+ * Copyright (c) 1998 John Birrell <jb@cimlogic.com.au>.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions
9
+ * are met:
10
+ * 1. Redistributions of source code must retain the above copyright
11
+ * notice, this list of conditions and the following disclaimer.
12
+ * 2. Redistributions in binary form must reproduce the above copyright
13
+ * notice, this list of conditions and the following disclaimer in the
14
+ * documentation and/or other materials provided with the distribution.
15
+ * 3. Neither the name of the author nor the names of any co-contributors
16
+ * may be used to endorse or promote products derived from this software
17
+ * without specific prior written permission.
18
+ *
19
+ * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
20
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29
+ * SUCH DAMAGE.
30
+ *
31
+ * Private definitions for libc, libc_r and libpthread.
32
+ *
33
+ */
34
+
35
+ #ifndef _LIBC_PRIVATE_H_
36
+ #define _LIBC_PRIVATE_H_
37
+ #include <sys/_types.h>
38
+ #include <sys/_pthreadtypes.h>
39
+
40
+ extern char **environ;
41
+
42
+ /*
43
+ * The kernel doesn't expose PID_MAX to the user space. Save it here
44
+ * to allow to run a newer world on a pre-1400079 kernel.
45
+ */
46
+ #define _PID_MAX 99999
47
+
48
+ /*
49
+ * This global flag is non-zero when a process has created one
50
+ * or more threads. It is used to avoid calling locking functions
51
+ * when they are not required.
52
+ */
53
+ #ifndef __LIBC_ISTHREADED_DECLARED
54
+ #define __LIBC_ISTHREADED_DECLARED
55
+ extern int __isthreaded;
56
+ #endif
57
+
58
+ /*
59
+ * Elf_Auxinfo *__elf_aux_vector, the pointer to the ELF aux vector
60
+ * provided by kernel. Either set for us by rtld, or found at runtime
61
+ * on stack for static binaries.
62
+ *
63
+ * Type is void to avoid polluting whole libc with ELF types.
64
+ */
65
+ extern void *__elf_aux_vector;
66
+
67
+ /*
68
+ * libc should use libc_dlopen internally, which respects a global
69
+ * flag where loading of new shared objects can be restricted.
70
+ */
71
+ void *libc_dlopen(const char *, int);
72
+
73
+ /*
74
+ * For dynamic linker.
75
+ */
76
+ void _rtld_error(const char *fmt, ...);
77
+
78
+ /*
79
+ * File lock contention is difficult to diagnose without knowing
80
+ * where locks were set. Allow a debug library to be built which
81
+ * records the source file and line number of each lock call.
82
+ */
83
+ #ifdef _FLOCK_DEBUG
84
+ #define _FLOCKFILE(x) _flockfile_debug(x, __FILE__, __LINE__)
85
+ #else
86
+ #define _FLOCKFILE(x) _flockfile(x)
87
+ #endif
88
+
89
+ /*
90
+ * Macros for locking and unlocking FILEs. These test if the
91
+ * process is threaded to avoid locking when not required.
92
+ */
93
+ #define FLOCKFILE(fp) if (__isthreaded) _FLOCKFILE(fp)
94
+ #define FUNLOCKFILE(fp) if (__isthreaded) _funlockfile(fp)
95
+
96
+ struct _spinlock;
97
+ extern struct _spinlock __stdio_thread_lock __hidden;
98
+ #define STDIO_THREAD_LOCK() \
99
+ do { \
100
+ if (__isthreaded) \
101
+ _SPINLOCK(&__stdio_thread_lock); \
102
+ } while (0)
103
+ #define STDIO_THREAD_UNLOCK() \
104
+ do { \
105
+ if (__isthreaded) \
106
+ _SPINUNLOCK(&__stdio_thread_lock); \
107
+ } while (0)
108
+
109
+ void __libc_spinlock_stub(struct _spinlock *);
110
+ void __libc_spinunlock_stub(struct _spinlock *);
111
+
112
+ /*
113
+ * Indexes into the pthread jump table.
114
+ *
115
+ * Warning! If you change this type, you must also change the threads
116
+ * libraries that reference it (libc_r, libpthread).
117
+ */
118
+ typedef enum {
119
+ PJT_ATFORK,
120
+ PJT_ATTR_DESTROY,
121
+ PJT_ATTR_GETDETACHSTATE,
122
+ PJT_ATTR_GETGUARDSIZE,
123
+ PJT_ATTR_GETINHERITSCHED,
124
+ PJT_ATTR_GETSCHEDPARAM,
125
+ PJT_ATTR_GETSCHEDPOLICY,
126
+ PJT_ATTR_GETSCOPE,
127
+ PJT_ATTR_GETSTACKADDR,
128
+ PJT_ATTR_GETSTACKSIZE,
129
+ PJT_ATTR_INIT,
130
+ PJT_ATTR_SETDETACHSTATE,
131
+ PJT_ATTR_SETGUARDSIZE,
132
+ PJT_ATTR_SETINHERITSCHED,
133
+ PJT_ATTR_SETSCHEDPARAM,
134
+ PJT_ATTR_SETSCHEDPOLICY,
135
+ PJT_ATTR_SETSCOPE,
136
+ PJT_ATTR_SETSTACKADDR,
137
+ PJT_ATTR_SETSTACKSIZE,
138
+ PJT_CANCEL,
139
+ PJT_CLEANUP_POP,
140
+ PJT_CLEANUP_PUSH,
141
+ PJT_COND_BROADCAST,
142
+ PJT_COND_DESTROY,
143
+ PJT_COND_INIT,
144
+ PJT_COND_SIGNAL,
145
+ PJT_COND_TIMEDWAIT,
146
+ PJT_COND_WAIT,
147
+ PJT_DETACH,
148
+ PJT_EQUAL,
149
+ PJT_EXIT,
150
+ PJT_GETSPECIFIC,
151
+ PJT_JOIN,
152
+ PJT_KEY_CREATE,
153
+ PJT_KEY_DELETE,
154
+ PJT_KILL,
155
+ PJT_MAIN_NP,
156
+ PJT_MUTEXATTR_DESTROY,
157
+ PJT_MUTEXATTR_INIT,
158
+ PJT_MUTEXATTR_SETTYPE,
159
+ PJT_MUTEX_DESTROY,
160
+ PJT_MUTEX_INIT,
161
+ PJT_MUTEX_LOCK,
162
+ PJT_MUTEX_TRYLOCK,
163
+ PJT_MUTEX_UNLOCK,
164
+ PJT_ONCE,
165
+ PJT_RWLOCK_DESTROY,
166
+ PJT_RWLOCK_INIT,
167
+ PJT_RWLOCK_RDLOCK,
168
+ PJT_RWLOCK_TRYRDLOCK,
169
+ PJT_RWLOCK_TRYWRLOCK,
170
+ PJT_RWLOCK_UNLOCK,
171
+ PJT_RWLOCK_WRLOCK,
172
+ PJT_SELF,
173
+ PJT_SETCANCELSTATE,
174
+ PJT_SETCANCELTYPE,
175
+ PJT_SETSPECIFIC,
176
+ PJT_SIGMASK,
177
+ PJT_TESTCANCEL,
178
+ PJT_CLEANUP_POP_IMP,
179
+ PJT_CLEANUP_PUSH_IMP,
180
+ PJT_CANCEL_ENTER,
181
+ PJT_CANCEL_LEAVE,
182
+ PJT_MUTEX_CONSISTENT,
183
+ PJT_MUTEXATTR_GETROBUST,
184
+ PJT_MUTEXATTR_SETROBUST,
185
+ PJT_GETTHREADID_NP,
186
+ PJT_ATTR_GET_NP,
187
+ PJT_GETNAME_NP,
188
+ PJT_MAX
189
+ } pjt_index_t;
190
+
191
+ typedef int (*pthread_func_t)(void);
192
+ typedef pthread_func_t pthread_func_entry_t[2];
193
+
194
+ extern pthread_func_entry_t __thr_jtable[];
195
+
196
+ void __set_error_selector(int *(*arg)(void));
197
+ int _pthread_mutex_init_calloc_cb_stub(pthread_mutex_t *mutex,
198
+ void *(calloc_cb)(__size_t, __size_t));
199
+
200
+ typedef int (*interpos_func_t)(void);
201
+ interpos_func_t *__libc_interposing_slot(int interposno);
202
+ extern interpos_func_t __libc_interposing[] __hidden;
203
+
204
+ enum {
205
+ INTERPOS_accept,
206
+ INTERPOS_accept4,
207
+ INTERPOS_aio_suspend,
208
+ INTERPOS_close,
209
+ INTERPOS_connect,
210
+ INTERPOS_fcntl,
211
+ INTERPOS_fsync,
212
+ INTERPOS_fork,
213
+ INTERPOS_msync,
214
+ INTERPOS_nanosleep,
215
+ INTERPOS_openat,
216
+ INTERPOS_poll,
217
+ INTERPOS_pselect,
218
+ INTERPOS_recvfrom,
219
+ INTERPOS_recvmsg,
220
+ INTERPOS_select,
221
+ INTERPOS_sendmsg,
222
+ INTERPOS_sendto,
223
+ INTERPOS_setcontext,
224
+ INTERPOS_sigaction,
225
+ INTERPOS_sigprocmask,
226
+ INTERPOS_sigsuspend,
227
+ INTERPOS_sigwait,
228
+ INTERPOS_sigtimedwait,
229
+ INTERPOS_sigwaitinfo,
230
+ INTERPOS_swapcontext,
231
+ INTERPOS_system,
232
+ INTERPOS_tcdrain,
233
+ INTERPOS_read,
234
+ INTERPOS_readv,
235
+ INTERPOS_wait4,
236
+ INTERPOS_write,
237
+ INTERPOS_writev,
238
+ INTERPOS__pthread_mutex_init_calloc_cb,
239
+ INTERPOS_spinlock,
240
+ INTERPOS_spinunlock,
241
+ INTERPOS_kevent,
242
+ INTERPOS_wait6,
243
+ INTERPOS_ppoll,
244
+ INTERPOS_map_stacks_exec,
245
+ INTERPOS_fdatasync,
246
+ INTERPOS_clock_nanosleep,
247
+ INTERPOS_distribute_static_tls,
248
+ INTERPOS_pdfork,
249
+ INTERPOS_MAX
250
+ };
251
+
252
+ /*
253
+ * yplib internal interfaces
254
+ */
255
+ #ifdef YP
256
+ int _yp_check(char **);
257
+ #endif
258
+
259
+ void __libc_start1(int, char *[], char *[],
260
+ void (*)(void), int (*)(int, char *[], char *[])) __dead2;
261
+ void __libc_start1_gcrt(int, char *[], char *[],
262
+ void (*)(void), int (*)(int, char *[], char *[]),
263
+ int *, int *) __dead2;
264
+
265
+ /*
266
+ * Initialise TLS for static programs
267
+ */
268
+ void _init_tls(void);
269
+
270
+ /*
271
+ * Provides pthread_once()-like functionality for both single-threaded
272
+ * and multi-threaded applications.
273
+ */
274
+ int _once(pthread_once_t *, void (*)(void));
275
+
276
+ /*
277
+ * This is a pointer in the C run-time startup code. It is used
278
+ * by getprogname() and setprogname().
279
+ */
280
+ extern const char *__progname;
281
+
282
+ /*
283
+ * This function is used by the threading libraries to notify malloc that a
284
+ * thread is exiting.
285
+ */
286
+ void _malloc_thread_cleanup(void);
287
+
288
+ /*
289
+ * This function is used by the threading libraries to notify libc that a
290
+ * thread is exiting, so its thread-local dtors should be called.
291
+ */
292
+ void __cxa_thread_call_dtors(void);
293
+ int __cxa_thread_atexit_hidden(void (*dtor_func)(void *), void *obj,
294
+ void *dso_symbol) __hidden;
295
+
296
+ /*
297
+ * These functions are used by the threading libraries in order to protect
298
+ * malloc across fork().
299
+ */
300
+ void _malloc_prefork(void);
301
+ void _malloc_postfork(void);
302
+
303
+ void _malloc_first_thread(void);
304
+
305
+ /*
306
+ * Function to clean up streams, called from abort() and exit().
307
+ */
308
+ extern void (*__cleanup)(void) __hidden;
309
+
310
+ /*
311
+ * Get kern.osreldate to detect ABI revisions. Explicitly
312
+ * ignores value of $OSVERSION and caches result.
313
+ */
314
+ int __getosreldate(void);
315
+ #include <sys/_types.h>
316
+ #include <sys/_sigset.h>
317
+
318
+ struct aiocb;
319
+ struct fd_set;
320
+ struct iovec;
321
+ struct kevent;
322
+ struct msghdr;
323
+ struct pollfd;
324
+ struct rusage;
325
+ struct sigaction;
326
+ struct sockaddr;
327
+ struct stat;
328
+ struct statfs;
329
+ struct timespec;
330
+ struct timeval;
331
+ struct timezone;
332
+ struct __siginfo;
333
+ struct __ucontext;
334
+ struct __wrusage;
335
+ enum idtype;
336
+ int __sys_aio_suspend(const struct aiocb * const[], int,
337
+ const struct timespec *);
338
+ int __sys_accept(int, struct sockaddr *, __socklen_t *);
339
+ int __sys_accept4(int, struct sockaddr *, __socklen_t *, int);
340
+ int __sys_clock_gettime(__clockid_t, struct timespec *ts);
341
+ int __sys_clock_nanosleep(__clockid_t, int,
342
+ const struct timespec *, struct timespec *);
343
+ int __sys_close(int);
344
+ int __sys_close_range(unsigned, unsigned, int);
345
+ int __sys_connect(int, const struct sockaddr *, __socklen_t);
346
+ int __sys_fcntl(int, int, ...);
347
+ int __sys_fdatasync(int);
348
+ int __sys_fstat(int fd, struct stat *);
349
+ int __sys_fstatfs(int fd, struct statfs *);
350
+ int __sys_fstatat(int, const char *, struct stat *, int);
351
+ int __sys_fsync(int);
352
+ __pid_t __sys_fork(void);
353
+ int __sys_ftruncate(int, __off_t);
354
+ __ssize_t __sys_getdirentries(int, char *, __size_t, __off_t *);
355
+ int __sys_getfsstat(struct statfs *, long, int);
356
+ int __sys_gettimeofday(struct timeval *, struct timezone *);
357
+ int __sys_kevent(int, const struct kevent *, int, struct kevent *,
358
+ int, const struct timespec *);
359
+ __off_t __sys_lseek(int, __off_t, int);
360
+ void *__sys_mmap(void *, __size_t, int, int, int, __off_t);
361
+ int __sys_msync(void *, __size_t, int);
362
+ int __sys_nanosleep(const struct timespec *, struct timespec *);
363
+ int __sys_open(const char *, int, ...);
364
+ int __sys_openat(int, const char *, int, ...);
365
+ int __sys_pdfork(int *, int);
366
+ int __sys_pselect(int, struct fd_set *, struct fd_set *,
367
+ struct fd_set *, const struct timespec *,
368
+ const __sigset_t *);
369
+ int __sys_ptrace(int, __pid_t, char *, int);
370
+ int __sys_poll(struct pollfd *, unsigned, int);
371
+ int __sys_ppoll(struct pollfd *, unsigned, const struct timespec *,
372
+ const __sigset_t *);
373
+ __ssize_t __sys_pread(int, void *, __size_t, __off_t);
374
+ __ssize_t __sys_pwrite(int, const void *, __size_t, __off_t);
375
+ __ssize_t __sys_read(int, void *, __size_t);
376
+ __ssize_t __sys_readv(int, const struct iovec *, int);
377
+ __ssize_t __sys_recv(int, void *, __size_t, int);
378
+ __ssize_t __sys_recvfrom(int, void *, __size_t, int, struct sockaddr *,
379
+ __socklen_t *);
380
+ __ssize_t __sys_recvmsg(int, struct msghdr *, int);
381
+ int __sys_sched_getcpu(void);
382
+ int __sys_select(int, struct fd_set *, struct fd_set *,
383
+ struct fd_set *, struct timeval *);
384
+ __ssize_t __sys_sendmsg(int, const struct msghdr *, int);
385
+ __ssize_t __sys_sendto(int, const void *, __size_t, int,
386
+ const struct sockaddr *, __socklen_t);
387
+ int __sys_setcontext(const struct __ucontext *);
388
+ int __sys_sigaction(int, const struct sigaction *,
389
+ struct sigaction *);
390
+ int __sys_sigprocmask(int, const __sigset_t *, __sigset_t *);
391
+ int __sys_sigsuspend(const __sigset_t *);
392
+ int __sys_sigtimedwait(const __sigset_t *, struct __siginfo *,
393
+ const struct timespec *);
394
+ int __sys_sigwait(const __sigset_t *, int *);
395
+ int __sys_sigwaitinfo(const __sigset_t *, struct __siginfo *);
396
+ int __sys___specialfd(int, const void *, __size_t);
397
+ int __sys_statfs(const char *, struct statfs *);
398
+ int __sys_swapcontext(struct __ucontext *,
399
+ const struct __ucontext *);
400
+ int __sys_thr_kill(long, int);
401
+ int __sys_thr_self(long *);
402
+ int __sys_truncate(const char *, __off_t);
403
+ __pid_t __sys_wait4(__pid_t, int *, int, struct rusage *);
404
+ __pid_t __sys_wait6(enum idtype, __id_t, int *, int,
405
+ struct __wrusage *, struct __siginfo *);
406
+ __ssize_t __sys_write(int, const void *, __size_t);
407
+ __ssize_t __sys_writev(int, const struct iovec *, int);
408
+ int __sys_shm_open2(const char *, int, __mode_t, int, const char *);
409
+
410
+ int __libc_sigaction(int, const struct sigaction *,
411
+ struct sigaction *) __hidden;
412
+ int __libc_sigprocmask(int, const __sigset_t *, __sigset_t *)
413
+ __hidden;
414
+ int __libc_sigsuspend(const __sigset_t *) __hidden;
415
+ int __libc_sigwait(const __sigset_t * __restrict,
416
+ int * restrict sig);
417
+ int __libc_system(const char *);
418
+ int __libc_tcdrain(int);
419
+ int __fcntl_compat(int fd, int cmd, ...);
420
+
421
+ int __sys_futimens(int fd, const struct timespec *times) __hidden;
422
+ int __sys_utimensat(int fd, const char *path,
423
+ const struct timespec *times, int flag) __hidden;
424
+
425
+ int _elf_aux_info(int aux, void *buf, int buflen);
426
+ struct dl_phdr_info;
427
+ int __elf_phdr_match_addr(struct dl_phdr_info *, void *);
428
+ void __init_elf_aux_vector(void);
429
+ void __libc_map_stacks_exec(void);
430
+ void __libc_distribute_static_tls(__size_t, void *, __size_t, __size_t);
431
+ __uintptr_t __libc_static_tls_base(__size_t);
432
+
433
+ void _pthread_cancel_enter(int);
434
+ void _pthread_cancel_leave(int);
435
+
436
+ struct _pthread_cleanup_info;
437
+ void ___pthread_cleanup_push_imp(void (*)(void *), void *,
438
+ struct _pthread_cleanup_info *);
439
+ void ___pthread_cleanup_pop_imp(int);
440
+
441
+ void __throw_constraint_handler_s(const char * restrict msg, int error);
442
+
443
+ struct __nl_cat_d;
444
+ struct _xlocale;
445
+ struct __nl_cat_d *__catopen_l(const char *name, int type,
446
+ struct _xlocale *locale);
447
+ int __strerror_rl(int errnum, char *strerrbuf, __size_t buflen,
448
+ struct _xlocale *locale);
449
+
450
+ #endif /* _LIBC_PRIVATE_H_ */
@@ -0,0 +1,45 @@
1
+ /* $NetBSD: crt0.S,v 1.2 2018/11/26 17:37:44 joerg Exp $ */
2
+
3
+ /*-
4
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
5
+ * All rights reserved.
6
+ *
7
+ * This code is derived from software contributed to The NetBSD Foundation
8
+ * by Matt Thomas of 3am Software Foundry.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions
12
+ * are met:
13
+ * 1. Redistributions of source code must retain the above copyright
14
+ * notice, this list of conditions and the following disclaimer.
15
+ * 2. Redistributions in binary form must reproduce the above copyright
16
+ * notice, this list of conditions and the following disclaimer in the
17
+ * documentation and/or other materials provided with the distribution.
18
+ *
19
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
+ * POSSIBILITY OF SUCH DAMAGE.
30
+ */
31
+
32
+ #include <aarch64/asm.h>
33
+
34
+ RCSID("$NetBSD: crt0.S,v 1.2 2018/11/26 17:37:44 joerg Exp $")
35
+
36
+ STRONG_ALIAS(_start,__start)
37
+
38
+ _ENTRY(__start)
39
+ /*
40
+ * void ___start(void (*cleanup)(void),
41
+ * struct ps_strings *ps_strings);
42
+ */
43
+ mov x1, x2
44
+ b ___start
45
+ END(__start)