authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-04-11 08:42:53+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-04-11 08:42:53+02:00
log8f03217f3edbd98cf0c3209c154cdd21ff0665c6
tree63ec48a9601e56d50037413e692097b20dcd9c4b
parent4b63f94b4ecf282c259c24a09d6c4ab7490b6cab
parentd01f2aa6e768c8389b622898ffd845c9b7138084
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #23497 from alexrp/hexagon

Some `hexagon-linux` porting work

66 files changed, 7459 insertions(+), 62 deletions(-)

lib/libc/include/hexagon-linux-musl/bits/alltypes.h created+409
......@@ -0,0 +1,409 @@
1#define _Addr int
2#define _Int64 long long
3#define _Reg int
4
5#define __BYTE_ORDER 1234
6#define __LONG_MAX 0x7fffffffL
7
8#ifndef __cplusplus
9#ifdef __WCHAR_TYPE__
10#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
11typedef __WCHAR_TYPE__ wchar_t;
12#define __DEFINED_wchar_t
13#endif
14
15#else
16#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
17typedef long wchar_t;
18#define __DEFINED_wchar_t
19#endif
20
21#endif
22#endif
23
24#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
25typedef float float_t;
26#define __DEFINED_float_t
27#endif
28
29#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
30typedef double double_t;
31#define __DEFINED_double_t
32#endif
33
34#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
35typedef struct { long long __ll; long double __ld; } max_align_t;
36#define __DEFINED_max_align_t
37#endif
38
39#define __LITTLE_ENDIAN 1234
40#define __BIG_ENDIAN 4321
41#define __USE_TIME_BITS64 1
42
43#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
44typedef unsigned _Addr size_t;
45#define __DEFINED_size_t
46#endif
47
48#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
49typedef unsigned _Addr uintptr_t;
50#define __DEFINED_uintptr_t
51#endif
52
53#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
54typedef _Addr ptrdiff_t;
55#define __DEFINED_ptrdiff_t
56#endif
57
58#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
59typedef _Addr ssize_t;
60#define __DEFINED_ssize_t
61#endif
62
63#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
64typedef _Addr intptr_t;
65#define __DEFINED_intptr_t
66#endif
67
68#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
69typedef _Addr regoff_t;
70#define __DEFINED_regoff_t
71#endif
72
73#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
74typedef _Reg register_t;
75#define __DEFINED_register_t
76#endif
77
78#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
79typedef _Int64 time_t;
80#define __DEFINED_time_t
81#endif
82
83#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
84typedef _Int64 suseconds_t;
85#define __DEFINED_suseconds_t
86#endif
87
88
89#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
90typedef signed char int8_t;
91#define __DEFINED_int8_t
92#endif
93
94#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
95typedef signed short int16_t;
96#define __DEFINED_int16_t
97#endif
98
99#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
100typedef signed int int32_t;
101#define __DEFINED_int32_t
102#endif
103
104#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
105typedef signed _Int64 int64_t;
106#define __DEFINED_int64_t
107#endif
108
109#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
110typedef signed _Int64 intmax_t;
111#define __DEFINED_intmax_t
112#endif
113
114#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
115typedef unsigned char uint8_t;
116#define __DEFINED_uint8_t
117#endif
118
119#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
120typedef unsigned short uint16_t;
121#define __DEFINED_uint16_t
122#endif
123
124#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
125typedef unsigned int uint32_t;
126#define __DEFINED_uint32_t
127#endif
128
129#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
130typedef unsigned _Int64 uint64_t;
131#define __DEFINED_uint64_t
132#endif
133
134#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
135typedef unsigned _Int64 u_int64_t;
136#define __DEFINED_u_int64_t
137#endif
138
139#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
140typedef unsigned _Int64 uintmax_t;
141#define __DEFINED_uintmax_t
142#endif
143
144
145#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
146typedef unsigned mode_t;
147#define __DEFINED_mode_t
148#endif
149
150#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
151typedef unsigned _Reg nlink_t;
152#define __DEFINED_nlink_t
153#endif
154
155#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
156typedef _Int64 off_t;
157#define __DEFINED_off_t
158#endif
159
160#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
161typedef unsigned _Int64 ino_t;
162#define __DEFINED_ino_t
163#endif
164
165#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
166typedef unsigned _Int64 dev_t;
167#define __DEFINED_dev_t
168#endif
169
170#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
171typedef long blksize_t;
172#define __DEFINED_blksize_t
173#endif
174
175#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
176typedef _Int64 blkcnt_t;
177#define __DEFINED_blkcnt_t
178#endif
179
180#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
181typedef unsigned _Int64 fsblkcnt_t;
182#define __DEFINED_fsblkcnt_t
183#endif
184
185#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
186typedef unsigned _Int64 fsfilcnt_t;
187#define __DEFINED_fsfilcnt_t
188#endif
189
190
191#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
192typedef unsigned wint_t;
193#define __DEFINED_wint_t
194#endif
195
196#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
197typedef unsigned long wctype_t;
198#define __DEFINED_wctype_t
199#endif
200
201
202#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
203typedef void * timer_t;
204#define __DEFINED_timer_t
205#endif
206
207#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
208typedef int clockid_t;
209#define __DEFINED_clockid_t
210#endif
211
212#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
213typedef long clock_t;
214#define __DEFINED_clock_t
215#endif
216
217#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
218struct timeval { time_t tv_sec; suseconds_t tv_usec; };
219#define __DEFINED_struct_timeval
220#endif
221
222#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
223struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
224#define __DEFINED_struct_timespec
225#endif
226
227
228#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
229typedef int pid_t;
230#define __DEFINED_pid_t
231#endif
232
233#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
234typedef unsigned id_t;
235#define __DEFINED_id_t
236#endif
237
238#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
239typedef unsigned uid_t;
240#define __DEFINED_uid_t
241#endif
242
243#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
244typedef unsigned gid_t;
245#define __DEFINED_gid_t
246#endif
247
248#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
249typedef int key_t;
250#define __DEFINED_key_t
251#endif
252
253#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
254typedef unsigned useconds_t;
255#define __DEFINED_useconds_t
256#endif
257
258
259#ifdef __cplusplus
260#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
261typedef unsigned long pthread_t;
262#define __DEFINED_pthread_t
263#endif
264
265#else
266#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
267typedef struct __pthread * pthread_t;
268#define __DEFINED_pthread_t
269#endif
270
271#endif
272#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
273typedef int pthread_once_t;
274#define __DEFINED_pthread_once_t
275#endif
276
277#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
278typedef unsigned pthread_key_t;
279#define __DEFINED_pthread_key_t
280#endif
281
282#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
283typedef int pthread_spinlock_t;
284#define __DEFINED_pthread_spinlock_t
285#endif
286
287#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
288typedef struct { unsigned __attr; } pthread_mutexattr_t;
289#define __DEFINED_pthread_mutexattr_t
290#endif
291
292#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
293typedef struct { unsigned __attr; } pthread_condattr_t;
294#define __DEFINED_pthread_condattr_t
295#endif
296
297#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
298typedef struct { unsigned __attr; } pthread_barrierattr_t;
299#define __DEFINED_pthread_barrierattr_t
300#endif
301
302#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
303typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
304#define __DEFINED_pthread_rwlockattr_t
305#endif
306
307
308#if defined(__NEED_struct__IO_FILE) && !defined(__DEFINED_struct__IO_FILE)
309struct _IO_FILE { char __x; };
310#define __DEFINED_struct__IO_FILE
311#endif
312
313#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
314typedef struct _IO_FILE FILE;
315#define __DEFINED_FILE
316#endif
317
318
319#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
320typedef __builtin_va_list va_list;
321#define __DEFINED_va_list
322#endif
323
324#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
325typedef __builtin_va_list __isoc_va_list;
326#define __DEFINED___isoc_va_list
327#endif
328
329
330#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
331typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
332#define __DEFINED_mbstate_t
333#endif
334
335
336#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
337typedef struct __locale_struct * locale_t;
338#define __DEFINED_locale_t
339#endif
340
341
342#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
343typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
344#define __DEFINED_sigset_t
345#endif
346
347
348#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
349struct iovec { void *iov_base; size_t iov_len; };
350#define __DEFINED_struct_iovec
351#endif
352
353
354#if defined(__NEED_struct_winsize) && !defined(__DEFINED_struct_winsize)
355struct winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
356#define __DEFINED_struct_winsize
357#endif
358
359
360#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
361typedef unsigned socklen_t;
362#define __DEFINED_socklen_t
363#endif
364
365#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
366typedef unsigned short sa_family_t;
367#define __DEFINED_sa_family_t
368#endif
369
370
371#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
372typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
373#define __DEFINED_pthread_attr_t
374#endif
375
376#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
377typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
378#define __DEFINED_pthread_mutex_t
379#endif
380
381#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
382typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
383#define __DEFINED_mtx_t
384#endif
385
386#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
387typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
388#define __DEFINED_pthread_cond_t
389#endif
390
391#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
392typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
393#define __DEFINED_cnd_t
394#endif
395
396#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
397typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
398#define __DEFINED_pthread_rwlock_t
399#endif
400
401#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
402typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
403#define __DEFINED_pthread_barrier_t
404#endif
405
406
407#undef _Addr
408#undef _Int64
409#undef _Reg
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/bits/fenv.h created+20
......@@ -0,0 +1,20 @@
1#define FE_INVALID (1 << 1)
2#define FE_DIVBYZERO (1 << 2)
3#define FE_OVERFLOW (1 << 3)
4#define FE_UNDERFLOW (1 << 4)
5#define FE_INEXACT (1 << 5)
6#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \
7 FE_OVERFLOW | FE_UNDERFLOW)
8
9#define FE_TONEAREST 0x00
10#define FE_TOWARDZERO 0x01
11#define FE_DOWNWARD 0x02
12#define FE_UPWARD 0x03
13
14typedef unsigned long fexcept_t;
15
16typedef struct {
17 unsigned long __cw;
18} fenv_t;
19
20#define FE_DFL_ENV ((const fenv_t *) -1)
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/bits/float.h created+16
......@@ -0,0 +1,16 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
4#define LDBL_MIN 2.22507385850720138309e-308L
5#define LDBL_MAX 1.79769313486231570815e+308L
6#define LDBL_EPSILON 2.22044604925031308085e-16L
7
8#define LDBL_MANT_DIG 53
9#define LDBL_MIN_EXP (-1021)
10#define LDBL_MAX_EXP 1024
11
12#define LDBL_DIG 15
13#define LDBL_MIN_10_EXP (-307)
14#define LDBL_MAX_10_EXP 308
15
16#define DECIMAL_DIG 17
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/bits/ipcstat.h created+1
......@@ -0,0 +1 @@
1#define IPC_STAT 0x102
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/bits/msg.h created+18
......@@ -0,0 +1,18 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 unsigned long __msg_stime_lo;
4 unsigned long __msg_stime_hi;
5 unsigned long __msg_rtime_lo;
6 unsigned long __msg_rtime_hi;
7 unsigned long __msg_ctime_lo;
8 unsigned long __msg_ctime_hi;
9 unsigned long msg_cbytes;
10 msgqnum_t msg_qnum;
11 msglen_t msg_qbytes;
12 pid_t msg_lspid;
13 pid_t msg_lrpid;
14 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
18};
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/bits/reg.h created
lib/libc/include/hexagon-linux-musl/bits/sem.h created+13
......@@ -0,0 +1,13 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_otime_hi;
5 unsigned long __sem_ctime_lo;
6 unsigned long __sem_ctime_hi;
7 unsigned short sem_nsems;
8 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
9 long __unused3;
10 long __unused4;
11 time_t sem_otime;
12 time_t sem_ctime;
13};
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/bits/setjmp.h created+1
......@@ -0,0 +1 @@
1typedef long long __jmp_buf[8];
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/bits/shm.h created+31
......@@ -0,0 +1,31 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_atime_hi;
8 unsigned long __shm_dtime_lo;
9 unsigned long __shm_dtime_hi;
10 unsigned long __shm_ctime_lo;
11 unsigned long __shm_ctime_hi;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17 unsigned long __pad3;
18 time_t shm_atime;
19 time_t shm_dtime;
20 time_t shm_ctime;
21};
22
23struct shminfo {
24 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
25};
26
27struct shm_info {
28 int __used_ids;
29 unsigned long shm_tot, shm_rss, shm_swp;
30 unsigned long __swap_attempts, __swap_successes;
31};
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/bits/signal.h created+103
......@@ -0,0 +1,103 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10typedef int greg_t, gregset_t[18];
11typedef struct sigcontext
12{
13 unsigned long r0, r1, r2, r3;
14 unsigned long r4, r5, r6, r7;
15 unsigned long r8, r9, r10, r11;
16 unsigned long r12, r13, r14, r15;
17 unsigned long r16, r17, r18, r19;
18 unsigned long r20, r21, r22, r23;
19 unsigned long r24, r25, r26, r27;
20 unsigned long r28, r29, r30, r31;
21 unsigned long sa0;
22 unsigned long lc0;
23 unsigned long sa1;
24 unsigned long lc1;
25 unsigned long m0;
26 unsigned long m1;
27 unsigned long usr;
28 unsigned long p3_0;
29 unsigned long gp;
30 unsigned long ugp;
31 unsigned long pc;
32 unsigned long cause;
33 unsigned long badva;
34 unsigned long pad1;
35 unsigned long long pad2;
36} mcontext_t;
37#else
38typedef struct {
39 unsigned long __regs[48];
40} __attribute__((__aligned__(8))) mcontext_t;
41#endif
42
43struct sigaltstack {
44 void *ss_sp;
45 int ss_flags;
46 size_t ss_size;
47};
48
49typedef struct __ucontext {
50 unsigned long uc_flags;
51 struct __ucontext *uc_link;
52 stack_t uc_stack;
53 mcontext_t uc_mcontext;
54 sigset_t uc_sigmask;
55} ucontext_t;
56
57#define SA_NOCLDSTOP 1
58#define SA_NOCLDWAIT 2
59#define SA_SIGINFO 4
60#define SA_ONSTACK 0x08000000
61#define SA_RESTART 0x10000000
62#define SA_NODEFER 0x40000000
63#define SA_RESETHAND 0x80000000
64#define SA_RESTORER 0x04000000
65
66#endif
67
68#define SIGHUP 1
69#define SIGINT 2
70#define SIGQUIT 3
71#define SIGILL 4
72#define SIGTRAP 5
73#define SIGABRT 6
74#define SIGIOT SIGABRT
75#define SIGBUS 7
76#define SIGFPE 8
77#define SIGKILL 9
78#define SIGUSR1 10
79#define SIGSEGV 11
80#define SIGUSR2 12
81#define SIGPIPE 13
82#define SIGALRM 14
83#define SIGTERM 15
84#define SIGSTKFLT 16
85#define SIGCHLD 17
86#define SIGCONT 18
87#define SIGSTOP 19
88#define SIGTSTP 20
89#define SIGTTIN 21
90#define SIGTTOU 22
91#define SIGURG 23
92#define SIGXCPU 24
93#define SIGXFSZ 25
94#define SIGVTALRM 26
95#define SIGPROF 27
96#define SIGWINCH 28
97#define SIGIO 29
98#define SIGPOLL 29
99#define SIGPWR 30
100#define SIGSYS 31
101#define SIGUNUSED SIGSYS
102
103#define _NSIG 65
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/bits/stat.h created+20
......@@ -0,0 +1,20 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3struct stat {
4 dev_t st_dev;
5 ino_t st_ino;
6 mode_t st_mode;
7 nlink_t st_nlink;
8 uid_t st_uid;
9 gid_t st_gid;
10 dev_t st_rdev;
11 unsigned long __pad;
12 off_t st_size;
13 blksize_t st_blksize;
14 int __pad2;
15 blkcnt_t st_blocks;
16 struct timespec st_atim;
17 struct timespec st_mtim;
18 struct timespec st_ctim;
19 unsigned __unused[2];
20};
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/bits/syscall.h created+695
......@@ -0,0 +1,695 @@
1#define __NR_io_setup 0
2#define __NR_io_destroy 1
3#define __NR_io_submit 2
4#define __NR_io_cancel 3
5#define __NR_io_getevents 4
6#define __NR_setxattr 5
7#define __NR_lsetxattr 6
8#define __NR_fsetxattr 7
9#define __NR_getxattr 8
10#define __NR_lgetxattr 9
11#define __NR_fgetxattr 10
12#define __NR_listxattr 11
13#define __NR_llistxattr 12
14#define __NR_flistxattr 13
15#define __NR_removexattr 14
16#define __NR_lremovexattr 15
17#define __NR_fremovexattr 16
18#define __NR_getcwd 17
19#define __NR_lookup_dcookie 18
20#define __NR_eventfd2 19
21#define __NR_epoll_create1 20
22#define __NR_epoll_ctl 21
23#define __NR_epoll_pwait 22
24#define __NR_dup 23
25#define __NR_dup3 24
26#define __NR_fcntl 25
27#define __NR_inotify_init1 26
28#define __NR_inotify_add_watch 27
29#define __NR_inotify_rm_watch 28
30#define __NR_ioctl 29
31#define __NR_ioprio_set 30
32#define __NR_ioprio_get 31
33#define __NR_flock 32
34#define __NR_mknodat 33
35#define __NR_mkdirat 34
36#define __NR_unlinkat 35
37#define __NR_symlinkat 36
38#define __NR_linkat 37
39#define __NR_renameat 38
40#define __NR_umount2 39
41#define __NR_mount 40
42#define __NR_pivot_root 41
43#define __NR_nfsservctl 42
44#define __NR_statfs 43
45#define __NR_fstatfs 44
46#define __NR_truncate 45
47#define __NR_ftruncate 46
48#define __NR_fallocate 47
49#define __NR_faccessat 48
50#define __NR_chdir 49
51#define __NR_fchdir 50
52#define __NR_chroot 51
53#define __NR_fchmod 52
54#define __NR_fchmodat 53
55#define __NR_fchownat 54
56#define __NR_fchown 55
57#define __NR_openat 56
58#define __NR_close 57
59#define __NR_vhangup 58
60#define __NR_pipe2 59
61#define __NR_quotactl 60
62#define __NR_getdents64 61
63#define __NR_lseek 62
64#define __NR_read 63
65#define __NR_write 64
66#define __NR_readv 65
67#define __NR_writev 66
68#define __NR_pread64 67
69#define __NR_pwrite64 68
70#define __NR_preadv 69
71#define __NR_pwritev 70
72#define __NR_sendfile 71
73#define __NR_pselect6 72
74#define __NR_ppoll 73
75#define __NR_signalfd4 74
76#define __NR_vmsplice 75
77#define __NR_splice 76
78#define __NR_tee 77
79#define __NR_readlinkat 78
80#define __NR_fstatat 79
81#define __NR_fstat 80
82#define __NR_sync 81
83#define __NR_fsync 82
84#define __NR_fdatasync 83
85#define __NR_sync_file_range2 84
86#define __NR_sync_file_range 84
87#define __NR_timerfd_create 85
88#define __NR_timerfd_settime 86
89#define __NR_timerfd_gettime 87
90#define __NR_utimensat 88
91#define __NR_acct 89
92#define __NR_capget 90
93#define __NR_capset 91
94#define __NR_personality 92
95#define __NR_exit 93
96#define __NR_exit_group 94
97#define __NR_waitid 95
98#define __NR_set_tid_address 96
99#define __NR_unshare 97
100#define __NR_futex 98
101#define __NR_set_robust_list 99
102#define __NR_get_robust_list 100
103#define __NR_nanosleep 101
104#define __NR_getitimer 102
105#define __NR_setitimer 103
106#define __NR_kexec_load 104
107#define __NR_init_module 105
108#define __NR_delete_module 106
109#define __NR_timer_create 107
110#define __NR_timer_gettime 108
111#define __NR_timer_getoverrun 109
112#define __NR_timer_settime 110
113#define __NR_timer_delete 111
114#define __NR_clock_settime 112
115#define __NR_clock_gettime32 113
116#define __NR_clock_getres 114
117#define __NR_clock_nanosleep 115
118#define __NR_syslog 116
119#define __NR_ptrace 117
120#define __NR_sched_setparam 118
121#define __NR_sched_setscheduler 119
122#define __NR_sched_getscheduler 120
123#define __NR_sched_getparam 121
124#define __NR_sched_setaffinity 122
125#define __NR_sched_getaffinity 123
126#define __NR_sched_yield 124
127#define __NR_sched_get_priority_max 125
128#define __NR_sched_get_priority_min 126
129#define __NR_sched_rr_get_interval 127
130#define __NR_restart_syscall 128
131#define __NR_kill 129
132#define __NR_tkill 130
133#define __NR_tgkill 131
134#define __NR_sigaltstack 132
135#define __NR_rt_sigsuspend 133
136#define __NR_rt_sigaction 134
137#define __NR_rt_sigprocmask 135
138#define __NR_rt_sigpending 136
139#define __NR_rt_sigtimedwait 137
140#define __NR_rt_sigqueueinfo 138
141#define __NR_rt_sigreturn 139
142#define __NR_setpriority 140
143#define __NR_getpriority 141
144#define __NR_reboot 142
145#define __NR_setregid 143
146#define __NR_setgid 144
147#define __NR_setreuid 145
148#define __NR_setuid 146
149#define __NR_setresuid 147
150#define __NR_getresuid 148
151#define __NR_setresgid 149
152#define __NR_getresgid 150
153#define __NR_setfsuid 151
154#define __NR_setfsgid 152
155#define __NR_times 153
156#define __NR_setpgid 154
157#define __NR_getpgid 155
158#define __NR_getsid 156
159#define __NR_setsid 157
160#define __NR_getgroups 158
161#define __NR_setgroups 159
162#define __NR_uname 160
163#define __NR_sethostname 161
164#define __NR_setdomainname 162
165#define __NR_getrlimit 163
166#define __NR_setrlimit 164
167#define __NR_getrusage 165
168#define __NR_umask 166
169#define __NR_prctl 167
170#define __NR_getcpu 168
171#define __NR_gettimeofday_time32 169
172#define __NR_settimeofday 170
173#define __NR_adjtimex 171
174#define __NR_getpid 172
175#define __NR_getppid 173
176#define __NR_getuid 174
177#define __NR_geteuid 175
178#define __NR_getgid 176
179#define __NR_getegid 177
180#define __NR_gettid 178
181#define __NR_sysinfo 179
182#define __NR_mq_open 180
183#define __NR_mq_unlink 181
184#define __NR_mq_timedsend 182
185#define __NR_mq_timedreceive 183
186#define __NR_mq_notify 184
187#define __NR_mq_getsetattr 185
188#define __NR_msgget 186
189#define __NR_msgctl 187
190#define __NR_msgrcv 188
191#define __NR_msgsnd 189
192#define __NR_semget 190
193#define __NR_semctl 191
194#define __NR_semtimedop 192
195#define __NR_semop 193
196#define __NR_shmget 194
197#define __NR_shmctl 195
198#define __NR_shmat 196
199#define __NR_shmdt 197
200#define __NR_socket 198
201#define __NR_socketpair 199
202#define __NR_bind 200
203#define __NR_listen 201
204#define __NR_accept 202
205#define __NR_connect 203
206#define __NR_getsockname 204
207#define __NR_getpeername 205
208#define __NR_sendto 206
209#define __NR_recvfrom 207
210#define __NR_setsockopt 208
211#define __NR_getsockopt 209
212#define __NR_shutdown 210
213#define __NR_sendmsg 211
214#define __NR_recvmsg 212
215#define __NR_readahead 213
216#define __NR_brk 214
217#define __NR_munmap 215
218#define __NR_mremap 216
219#define __NR_add_key 217
220#define __NR_request_key 218
221#define __NR_keyctl 219
222#define __NR_clone 220
223#define __NR_execve 221
224#define __NR_mmap 222
225#define __NR_fadvise64 223
226#define __NR_swapon 224
227#define __NR_swapoff 225
228#define __NR_mprotect 226
229#define __NR_msync 227
230#define __NR_mlock 228
231#define __NR_munlock 229
232#define __NR_mlockall 230
233#define __NR_munlockall 231
234#define __NR_mincore 232
235#define __NR_madvise 233
236#define __NR_remap_file_pages 234
237#define __NR_mbind 235
238#define __NR_get_mempolicy 236
239#define __NR_set_mempolicy 237
240#define __NR_migrate_pages 238
241#define __NR_move_pages 239
242#define __NR_rt_tgsigqueueinfo 240
243#define __NR_perf_event_open 241
244#define __NR_accept4 242
245#define __NR_recvmmsg 243
246#define __NR_arch_specific_syscall 244
247#define __NR_wait4 260
248#define __NR_prlimit64 261
249#define __NR_fanotify_init 262
250#define __NR_fanotify_mark 263
251#define __NR_name_to_handle_at 264
252#define __NR_open_by_handle_at 265
253#define __NR_clock_adjtime 266
254#define __NR_syncfs 267
255#define __NR_setns 268
256#define __NR_sendmmsg 269
257#define __NR_process_vm_readv 270
258#define __NR_process_vm_writev 271
259#define __NR_kcmp 272
260#define __NR_finit_module 273
261#define __NR_sched_setattr 274
262#define __NR_sched_getattr 275
263#define __NR_renameat2 276
264#define __NR_seccomp 277
265#define __NR_getrandom 278
266#define __NR_memfd_create 279
267#define __NR_bpf 280
268#define __NR_execveat 281
269#define __NR_userfaultfd 282
270#define __NR_membarrier 283
271#define __NR_mlock2 284
272#define __NR_copy_file_range 285
273#define __NR_preadv2 286
274#define __NR_pwritev2 287
275#define __NR_pkey_mprotect 288
276#define __NR_pkey_alloc 289
277#define __NR_pkey_free 290
278#define __NR_statx 291
279#define __NR_clock_gettime64 403
280#define __NR_clock_settime64 404
281#define __NR_clock_adjtime64 405
282#define __NR_clock_getres_time64 406
283#define __NR_clock_nanosleep_time64 407
284#define __NR_timer_gettime64 408
285#define __NR_timer_settime64 409
286#define __NR_timerfd_gettime64 410
287#define __NR_timerfd_settime64 411
288#define __NR_utimensat_time64 412
289#define __NR_pselect6_time64 413
290#define __NR_ppoll_time64 414
291#define __NR_io_pgetevents_time64 416
292#define __NR_recvmmsg_time64 417
293#define __NR_mq_timedsend_time64 418
294#define __NR_mq_timedreceive_time64 419
295#define __NR_semtimedop_time64 420
296#define __NR_rt_sigtimedwait_time64 421
297#define __NR_futex_time64 422
298#define __NR_sched_rr_get_interval_time64 423
299#define __NR_pidfd_send_signal 424
300#define __NR_io_uring_setup 425
301#define __NR_io_uring_enter 426
302#define __NR_io_uring_register 427
303#define __NR_open_tree 428
304#define __NR_move_mount 429
305#define __NR_fsopen 430
306#define __NR_fsconfig 431
307#define __NR_fsmount 432
308#define __NR_fspick 433
309#define __NR_pidfd_open 434
310#define __NR_close_range 436
311#define __NR_openat2 437
312#define __NR_pidfd_getfd 438
313#define __NR_faccessat2 439
314#define __NR_process_madvise 440
315#define __NR_epoll_pwait2 441
316#define __NR_mount_setattr 442
317#define __NR_quotactl_fd 443
318#define __NR_landlock_create_ruleset 444
319#define __NR_landlock_add_rule 445
320#define __NR_landlock_restrict_self 446
321#define __NR_process_mrelease 448
322#define __NR_futex_waitv 449
323#define __NR_set_mempolicy_home_node 450
324#define __NR_cachestat 451
325#define __NR_fchmodat2 452
326#define __NR_map_shadow_stack 453
327#define __NR_futex_wake 454
328#define __NR_futex_wait 455
329#define __NR_futex_requeue 456
330#define __NR_statmount 457
331#define __NR_listmount 458
332#define __NR_lsm_get_self_attr 459
333#define __NR_lsm_set_self_attr 460
334#define __NR_lsm_list_modules 461
335
336#define __NR_syscalls (__NR_lsm_list_modules+1)
337#define __NR_newfstatat __NR_fstatat
338#define __NR_fcntl64 __NR_fcntl
339#define __NR_statfs64 __NR_statfs
340#define __NR_fstatfs64 __NR_fstatfs
341#define __NR_truncate64 __NR_truncate
342#define __NR_ftruncate64 __NR_ftruncate
343#define __NR__llseek __NR_lseek
344#define __NR_sendfile64 __NR_sendfile
345#define __NR_fstatat64 __NR_fstatat
346#define __NR_fstat64 __NR_fstat
347#define __NR_mmap2 __NR_mmap
348#define __NR_fadvise64_64 __NR_fadvise64
349#define SYS_io_setup 0
350#define SYS_io_destroy 1
351#define SYS_io_submit 2
352#define SYS_io_cancel 3
353#define SYS_io_getevents 4
354#define SYS_setxattr 5
355#define SYS_lsetxattr 6
356#define SYS_fsetxattr 7
357#define SYS_getxattr 8
358#define SYS_lgetxattr 9
359#define SYS_fgetxattr 10
360#define SYS_listxattr 11
361#define SYS_llistxattr 12
362#define SYS_flistxattr 13
363#define SYS_removexattr 14
364#define SYS_lremovexattr 15
365#define SYS_fremovexattr 16
366#define SYS_getcwd 17
367#define SYS_lookup_dcookie 18
368#define SYS_eventfd2 19
369#define SYS_epoll_create1 20
370#define SYS_epoll_ctl 21
371#define SYS_epoll_pwait 22
372#define SYS_dup 23
373#define SYS_dup3 24
374#define SYS_fcntl 25
375#define SYS_inotify_init1 26
376#define SYS_inotify_add_watch 27
377#define SYS_inotify_rm_watch 28
378#define SYS_ioctl 29
379#define SYS_ioprio_set 30
380#define SYS_ioprio_get 31
381#define SYS_flock 32
382#define SYS_mknodat 33
383#define SYS_mkdirat 34
384#define SYS_unlinkat 35
385#define SYS_symlinkat 36
386#define SYS_linkat 37
387#define SYS_renameat 38
388#define SYS_umount2 39
389#define SYS_mount 40
390#define SYS_pivot_root 41
391#define SYS_nfsservctl 42
392#define SYS_statfs 43
393#define SYS_fstatfs 44
394#define SYS_truncate 45
395#define SYS_ftruncate 46
396#define SYS_fallocate 47
397#define SYS_faccessat 48
398#define SYS_chdir 49
399#define SYS_fchdir 50
400#define SYS_chroot 51
401#define SYS_fchmod 52
402#define SYS_fchmodat 53
403#define SYS_fchownat 54
404#define SYS_fchown 55
405#define SYS_openat 56
406#define SYS_close 57
407#define SYS_vhangup 58
408#define SYS_pipe2 59
409#define SYS_quotactl 60
410#define SYS_getdents64 61
411#define SYS_lseek 62
412#define SYS_read 63
413#define SYS_write 64
414#define SYS_readv 65
415#define SYS_writev 66
416#define SYS_pread64 67
417#define SYS_pwrite64 68
418#define SYS_preadv 69
419#define SYS_pwritev 70
420#define SYS_sendfile 71
421#define SYS_pselect6 72
422#define SYS_ppoll 73
423#define SYS_signalfd4 74
424#define SYS_vmsplice 75
425#define SYS_splice 76
426#define SYS_tee 77
427#define SYS_readlinkat 78
428#define SYS_fstatat 79
429#define SYS_fstat 80
430#define SYS_sync 81
431#define SYS_fsync 82
432#define SYS_fdatasync 83
433#define SYS_sync_file_range2 84
434#define SYS_sync_file_range 84
435#define SYS_timerfd_create 85
436#define SYS_timerfd_settime 86
437#define SYS_timerfd_gettime 87
438#define SYS_utimensat 88
439#define SYS_acct 89
440#define SYS_capget 90
441#define SYS_capset 91
442#define SYS_personality 92
443#define SYS_exit 93
444#define SYS_exit_group 94
445#define SYS_waitid 95
446#define SYS_set_tid_address 96
447#define SYS_unshare 97
448#define SYS_futex 98
449#define SYS_set_robust_list 99
450#define SYS_get_robust_list 100
451#define SYS_nanosleep 101
452#define SYS_getitimer 102
453#define SYS_setitimer 103
454#define SYS_kexec_load 104
455#define SYS_init_module 105
456#define SYS_delete_module 106
457#define SYS_timer_create 107
458#define SYS_timer_gettime 108
459#define SYS_timer_getoverrun 109
460#define SYS_timer_settime 110
461#define SYS_timer_delete 111
462#define SYS_clock_settime 112
463#define SYS_clock_gettime32 113
464#define SYS_clock_getres 114
465#define SYS_clock_nanosleep 115
466#define SYS_syslog 116
467#define SYS_ptrace 117
468#define SYS_sched_setparam 118
469#define SYS_sched_setscheduler 119
470#define SYS_sched_getscheduler 120
471#define SYS_sched_getparam 121
472#define SYS_sched_setaffinity 122
473#define SYS_sched_getaffinity 123
474#define SYS_sched_yield 124
475#define SYS_sched_get_priority_max 125
476#define SYS_sched_get_priority_min 126
477#define SYS_sched_rr_get_interval 127
478#define SYS_restart_syscall 128
479#define SYS_kill 129
480#define SYS_tkill 130
481#define SYS_tgkill 131
482#define SYS_sigaltstack 132
483#define SYS_rt_sigsuspend 133
484#define SYS_rt_sigaction 134
485#define SYS_rt_sigprocmask 135
486#define SYS_rt_sigpending 136
487#define SYS_rt_sigtimedwait 137
488#define SYS_rt_sigqueueinfo 138
489#define SYS_rt_sigreturn 139
490#define SYS_setpriority 140
491#define SYS_getpriority 141
492#define SYS_reboot 142
493#define SYS_setregid 143
494#define SYS_setgid 144
495#define SYS_setreuid 145
496#define SYS_setuid 146
497#define SYS_setresuid 147
498#define SYS_getresuid 148
499#define SYS_setresgid 149
500#define SYS_getresgid 150
501#define SYS_setfsuid 151
502#define SYS_setfsgid 152
503#define SYS_times 153
504#define SYS_setpgid 154
505#define SYS_getpgid 155
506#define SYS_getsid 156
507#define SYS_setsid 157
508#define SYS_getgroups 158
509#define SYS_setgroups 159
510#define SYS_uname 160
511#define SYS_sethostname 161
512#define SYS_setdomainname 162
513#define SYS_getrlimit 163
514#define SYS_setrlimit 164
515#define SYS_getrusage 165
516#define SYS_umask 166
517#define SYS_prctl 167
518#define SYS_getcpu 168
519#define SYS_gettimeofday_time32 169
520#define SYS_settimeofday 170
521#define SYS_adjtimex 171
522#define SYS_getpid 172
523#define SYS_getppid 173
524#define SYS_getuid 174
525#define SYS_geteuid 175
526#define SYS_getgid 176
527#define SYS_getegid 177
528#define SYS_gettid 178
529#define SYS_sysinfo 179
530#define SYS_mq_open 180
531#define SYS_mq_unlink 181
532#define SYS_mq_timedsend 182
533#define SYS_mq_timedreceive 183
534#define SYS_mq_notify 184
535#define SYS_mq_getsetattr 185
536#define SYS_msgget 186
537#define SYS_msgctl 187
538#define SYS_msgrcv 188
539#define SYS_msgsnd 189
540#define SYS_semget 190
541#define SYS_semctl 191
542#define SYS_semtimedop 192
543#define SYS_semop 193
544#define SYS_shmget 194
545#define SYS_shmctl 195
546#define SYS_shmat 196
547#define SYS_shmdt 197
548#define SYS_socket 198
549#define SYS_socketpair 199
550#define SYS_bind 200
551#define SYS_listen 201
552#define SYS_accept 202
553#define SYS_connect 203
554#define SYS_getsockname 204
555#define SYS_getpeername 205
556#define SYS_sendto 206
557#define SYS_recvfrom 207
558#define SYS_setsockopt 208
559#define SYS_getsockopt 209
560#define SYS_shutdown 210
561#define SYS_sendmsg 211
562#define SYS_recvmsg 212
563#define SYS_readahead 213
564#define SYS_brk 214
565#define SYS_munmap 215
566#define SYS_mremap 216
567#define SYS_add_key 217
568#define SYS_request_key 218
569#define SYS_keyctl 219
570#define SYS_clone 220
571#define SYS_execve 221
572#define SYS_mmap 222
573#define SYS_fadvise64 223
574#define SYS_swapon 224
575#define SYS_swapoff 225
576#define SYS_mprotect 226
577#define SYS_msync 227
578#define SYS_mlock 228
579#define SYS_munlock 229
580#define SYS_mlockall 230
581#define SYS_munlockall 231
582#define SYS_mincore 232
583#define SYS_madvise 233
584#define SYS_remap_file_pages 234
585#define SYS_mbind 235
586#define SYS_get_mempolicy 236
587#define SYS_set_mempolicy 237
588#define SYS_migrate_pages 238
589#define SYS_move_pages 239
590#define SYS_rt_tgsigqueueinfo 240
591#define SYS_perf_event_open 241
592#define SYS_accept4 242
593#define SYS_recvmmsg 243
594#define SYS_arch_specific_syscall 244
595#define SYS_wait4 260
596#define SYS_prlimit64 261
597#define SYS_fanotify_init 262
598#define SYS_fanotify_mark 263
599#define SYS_name_to_handle_at 264
600#define SYS_open_by_handle_at 265
601#define SYS_clock_adjtime 266
602#define SYS_syncfs 267
603#define SYS_setns 268
604#define SYS_sendmmsg 269
605#define SYS_process_vm_readv 270
606#define SYS_process_vm_writev 271
607#define SYS_kcmp 272
608#define SYS_finit_module 273
609#define SYS_sched_setattr 274
610#define SYS_sched_getattr 275
611#define SYS_renameat2 276
612#define SYS_seccomp 277
613#define SYS_getrandom 278
614#define SYS_memfd_create 279
615#define SYS_bpf 280
616#define SYS_execveat 281
617#define SYS_userfaultfd 282
618#define SYS_membarrier 283
619#define SYS_mlock2 284
620#define SYS_copy_file_range 285
621#define SYS_preadv2 286
622#define SYS_pwritev2 287
623#define SYS_pkey_mprotect 288
624#define SYS_pkey_alloc 289
625#define SYS_pkey_free 290
626#define SYS_statx 291
627#define SYS_clock_gettime64 403
628#define SYS_clock_settime64 404
629#define SYS_clock_adjtime64 405
630#define SYS_clock_getres_time64 406
631#define SYS_clock_nanosleep_time64 407
632#define SYS_timer_gettime64 408
633#define SYS_timer_settime64 409
634#define SYS_timerfd_gettime64 410
635#define SYS_timerfd_settime64 411
636#define SYS_utimensat_time64 412
637#define SYS_pselect6_time64 413
638#define SYS_ppoll_time64 414
639#define SYS_io_pgetevents_time64 416
640#define SYS_recvmmsg_time64 417
641#define SYS_mq_timedsend_time64 418
642#define SYS_mq_timedreceive_time64 419
643#define SYS_semtimedop_time64 420
644#define SYS_rt_sigtimedwait_time64 421
645#define SYS_futex_time64 422
646#define SYS_sched_rr_get_interval_time64 423
647#define SYS_pidfd_send_signal 424
648#define SYS_io_uring_setup 425
649#define SYS_io_uring_enter 426
650#define SYS_io_uring_register 427
651#define SYS_open_tree 428
652#define SYS_move_mount 429
653#define SYS_fsopen 430
654#define SYS_fsconfig 431
655#define SYS_fsmount 432
656#define SYS_fspick 433
657#define SYS_pidfd_open 434
658#define SYS_close_range 436
659#define SYS_openat2 437
660#define SYS_pidfd_getfd 438
661#define SYS_faccessat2 439
662#define SYS_process_madvise 440
663#define SYS_epoll_pwait2 441
664#define SYS_mount_setattr 442
665#define SYS_quotactl_fd 443
666#define SYS_landlock_create_ruleset 444
667#define SYS_landlock_add_rule 445
668#define SYS_landlock_restrict_self 446
669#define SYS_process_mrelease 448
670#define SYS_futex_waitv 449
671#define SYS_set_mempolicy_home_node 450
672#define SYS_cachestat 451
673#define SYS_fchmodat2 452
674#define SYS_map_shadow_stack 453
675#define SYS_futex_wake 454
676#define SYS_futex_wait 455
677#define SYS_futex_requeue 456
678#define SYS_statmount 457
679#define SYS_listmount 458
680#define SYS_lsm_get_self_attr 459
681#define SYS_lsm_set_self_attr 460
682#define SYS_lsm_list_modules 461
683#define SYS_syscalls (__NR_lsm_list_modules+1)
684#define SYS_newfstatat __NR_fstatat
685#define SYS_fcntl64 __NR_fcntl
686#define SYS_statfs64 __NR_statfs
687#define SYS_fstatfs64 __NR_fstatfs
688#define SYS_truncate64 __NR_truncate
689#define SYS_ftruncate64 __NR_ftruncate
690#define SYS__llseek __NR_lseek
691#define SYS_sendfile64 __NR_sendfile
692#define SYS_fstatat64 __NR_fstatat
693#define SYS_fstat64 __NR_fstat
694#define SYS_mmap2 __NR_mmap
695#define SYS_fadvise64_64 __NR_fadvise64
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/bits/user.h created+60
......@@ -0,0 +1,60 @@
1#ifndef HEXAGON_ASM_USER_H
2#define HEXAGON_ASM_USER_H
3
4struct user_regs_struct {
5 unsigned long r0;
6 unsigned long r1;
7 unsigned long r2;
8 unsigned long r3;
9 unsigned long r4;
10 unsigned long r5;
11 unsigned long r6;
12 unsigned long r7;
13 unsigned long r8;
14 unsigned long r9;
15 unsigned long r10;
16 unsigned long r11;
17 unsigned long r12;
18 unsigned long r13;
19 unsigned long r14;
20 unsigned long r15;
21 unsigned long r16;
22 unsigned long r17;
23 unsigned long r18;
24 unsigned long r19;
25 unsigned long r20;
26 unsigned long r21;
27 unsigned long r22;
28 unsigned long r23;
29 unsigned long r24;
30 unsigned long r25;
31 unsigned long r26;
32 unsigned long r27;
33 unsigned long r28;
34 unsigned long r29;
35 unsigned long r30;
36 unsigned long r31;
37 unsigned long sa0;
38 unsigned long lc0;
39 unsigned long sa1;
40 unsigned long lc1;
41 unsigned long m0;
42 unsigned long m1;
43 unsigned long usr;
44 unsigned long p3_0;
45 unsigned long gp;
46 unsigned long ugp;
47 unsigned long pc;
48 unsigned long cause;
49 unsigned long badva;
50 unsigned long cs0;
51 unsigned long cs1;
52 unsigned long pad1;
53};
54
55#define ELF_NGREG 48
56typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
57
58typedef unsigned long elf_fpregset_t;
59
60#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/dirent.h created+87
......@@ -0,0 +1,87 @@
1#ifndef _DIRENT_H
2#define _DIRENT_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <features.h>
9
10#define __NEED_ino_t
11#define __NEED_off_t
12#define __NEED_size_t
13#define __NEED_ssize_t
14
15#include <bits/alltypes.h>
16
17#include <bits/dirent.h>
18
19typedef unsigned short reclen_t;
20
21struct posix_dent {
22 ino_t d_ino;
23 off_t d_off;
24 reclen_t d_reclen;
25 unsigned char d_type;
26 char d_name[];
27};
28
29typedef struct __dirstream DIR;
30
31#define d_fileno d_ino
32
33int closedir(DIR *);
34DIR *fdopendir(int);
35DIR *opendir(const char *);
36struct dirent *readdir(DIR *);
37int readdir_r(DIR *__restrict, struct dirent *__restrict, struct dirent **__restrict);
38void rewinddir(DIR *);
39int dirfd(DIR *);
40
41ssize_t posix_getdents(int, void *, size_t, int);
42
43int alphasort(const struct dirent **, const struct dirent **);
44int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **));
45
46#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
47void seekdir(DIR *, long);
48long telldir(DIR *);
49#endif
50
51#define DT_UNKNOWN 0
52#define DT_FIFO 1
53#define DT_CHR 2
54#define DT_DIR 4
55#define DT_BLK 6
56#define DT_REG 8
57#define DT_LNK 10
58#define DT_SOCK 12
59#define DT_WHT 14
60
61#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
62#define IFTODT(x) ((x)>>12 & 017)
63#define DTTOIF(x) ((x)<<12)
64int getdents(int, struct dirent *, size_t);
65#endif
66
67#ifdef _GNU_SOURCE
68int versionsort(const struct dirent **, const struct dirent **);
69#endif
70
71#if defined(_LARGEFILE64_SOURCE)
72#define dirent64 dirent
73#define readdir64 readdir
74#define readdir64_r readdir_r
75#define scandir64 scandir
76#define alphasort64 alphasort
77#define versionsort64 versionsort
78#define off64_t off_t
79#define ino64_t ino_t
80#define getdents64 getdents
81#endif
82
83#ifdef __cplusplus
84}
85#endif
86
87#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/elf.h created+3516
......@@ -0,0 +1,3516 @@
1#ifndef _ELF_H
2#define _ELF_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <stdint.h>
9
10typedef uint16_t Elf32_Half;
11typedef uint16_t Elf64_Half;
12
13typedef uint32_t Elf32_Word;
14typedef int32_t Elf32_Sword;
15typedef uint32_t Elf64_Word;
16typedef int32_t Elf64_Sword;
17
18typedef uint64_t Elf32_Xword;
19typedef int64_t Elf32_Sxword;
20typedef uint64_t Elf64_Xword;
21typedef int64_t Elf64_Sxword;
22
23typedef uint32_t Elf32_Addr;
24typedef uint64_t Elf64_Addr;
25
26typedef uint32_t Elf32_Off;
27typedef uint64_t Elf64_Off;
28
29typedef uint16_t Elf32_Section;
30typedef uint16_t Elf64_Section;
31
32typedef Elf32_Half Elf32_Versym;
33typedef Elf64_Half Elf64_Versym;
34
35#define EI_NIDENT (16)
36
37typedef struct {
38 unsigned char e_ident[EI_NIDENT];
39 Elf32_Half e_type;
40 Elf32_Half e_machine;
41 Elf32_Word e_version;
42 Elf32_Addr e_entry;
43 Elf32_Off e_phoff;
44 Elf32_Off e_shoff;
45 Elf32_Word e_flags;
46 Elf32_Half e_ehsize;
47 Elf32_Half e_phentsize;
48 Elf32_Half e_phnum;
49 Elf32_Half e_shentsize;
50 Elf32_Half e_shnum;
51 Elf32_Half e_shstrndx;
52} Elf32_Ehdr;
53
54typedef struct {
55 unsigned char e_ident[EI_NIDENT];
56 Elf64_Half e_type;
57 Elf64_Half e_machine;
58 Elf64_Word e_version;
59 Elf64_Addr e_entry;
60 Elf64_Off e_phoff;
61 Elf64_Off e_shoff;
62 Elf64_Word e_flags;
63 Elf64_Half e_ehsize;
64 Elf64_Half e_phentsize;
65 Elf64_Half e_phnum;
66 Elf64_Half e_shentsize;
67 Elf64_Half e_shnum;
68 Elf64_Half e_shstrndx;
69} Elf64_Ehdr;
70
71#define EI_MAG0 0
72#define ELFMAG0 0x7f
73
74#define EI_MAG1 1
75#define ELFMAG1 'E'
76
77#define EI_MAG2 2
78#define ELFMAG2 'L'
79
80#define EI_MAG3 3
81#define ELFMAG3 'F'
82
83
84#define ELFMAG "\177ELF"
85#define SELFMAG 4
86
87#define EI_CLASS 4
88#define ELFCLASSNONE 0
89#define ELFCLASS32 1
90#define ELFCLASS64 2
91#define ELFCLASSNUM 3
92
93#define EI_DATA 5
94#define ELFDATANONE 0
95#define ELFDATA2LSB 1
96#define ELFDATA2MSB 2
97#define ELFDATANUM 3
98
99#define EI_VERSION 6
100
101
102#define EI_OSABI 7
103#define ELFOSABI_NONE 0
104#define ELFOSABI_SYSV 0
105#define ELFOSABI_HPUX 1
106#define ELFOSABI_NETBSD 2
107#define ELFOSABI_LINUX 3
108#define ELFOSABI_GNU 3
109#define ELFOSABI_SOLARIS 6
110#define ELFOSABI_AIX 7
111#define ELFOSABI_IRIX 8
112#define ELFOSABI_FREEBSD 9
113#define ELFOSABI_TRU64 10
114#define ELFOSABI_MODESTO 11
115#define ELFOSABI_OPENBSD 12
116#define ELFOSABI_ARM 97
117#define ELFOSABI_STANDALONE 255
118
119#define EI_ABIVERSION 8
120
121#define EI_PAD 9
122
123
124
125#define ET_NONE 0
126#define ET_REL 1
127#define ET_EXEC 2
128#define ET_DYN 3
129#define ET_CORE 4
130#define ET_NUM 5
131#define ET_LOOS 0xfe00
132#define ET_HIOS 0xfeff
133#define ET_LOPROC 0xff00
134#define ET_HIPROC 0xffff
135
136
137
138#define EM_NONE 0
139#define EM_M32 1
140#define EM_SPARC 2
141#define EM_386 3
142#define EM_68K 4
143#define EM_88K 5
144#define EM_860 7
145#define EM_MIPS 8
146#define EM_S370 9
147#define EM_MIPS_RS3_LE 10
148
149#define EM_PARISC 15
150#define EM_VPP500 17
151#define EM_SPARC32PLUS 18
152#define EM_960 19
153#define EM_PPC 20
154#define EM_PPC64 21
155#define EM_S390 22
156
157#define EM_V800 36
158#define EM_FR20 37
159#define EM_RH32 38
160#define EM_RCE 39
161#define EM_ARM 40
162#define EM_FAKE_ALPHA 41
163#define EM_SH 42
164#define EM_SPARCV9 43
165#define EM_TRICORE 44
166#define EM_ARC 45
167#define EM_H8_300 46
168#define EM_H8_300H 47
169#define EM_H8S 48
170#define EM_H8_500 49
171#define EM_IA_64 50
172#define EM_MIPS_X 51
173#define EM_COLDFIRE 52
174#define EM_68HC12 53
175#define EM_MMA 54
176#define EM_PCP 55
177#define EM_NCPU 56
178#define EM_NDR1 57
179#define EM_STARCORE 58
180#define EM_ME16 59
181#define EM_ST100 60
182#define EM_TINYJ 61
183#define EM_X86_64 62
184#define EM_PDSP 63
185
186#define EM_FX66 66
187#define EM_ST9PLUS 67
188#define EM_ST7 68
189#define EM_68HC16 69
190#define EM_68HC11 70
191#define EM_68HC08 71
192#define EM_68HC05 72
193#define EM_SVX 73
194#define EM_ST19 74
195#define EM_VAX 75
196#define EM_CRIS 76
197#define EM_JAVELIN 77
198#define EM_FIREPATH 78
199#define EM_ZSP 79
200#define EM_MMIX 80
201#define EM_HUANY 81
202#define EM_PRISM 82
203#define EM_AVR 83
204#define EM_FR30 84
205#define EM_D10V 85
206#define EM_D30V 86
207#define EM_V850 87
208#define EM_M32R 88
209#define EM_MN10300 89
210#define EM_MN10200 90
211#define EM_PJ 91
212#define EM_OR1K 92
213#define EM_OPENRISC 92
214#define EM_ARC_A5 93
215#define EM_ARC_COMPACT 93
216#define EM_XTENSA 94
217#define EM_VIDEOCORE 95
218#define EM_TMM_GPP 96
219#define EM_NS32K 97
220#define EM_TPC 98
221#define EM_SNP1K 99
222#define EM_ST200 100
223#define EM_IP2K 101
224#define EM_MAX 102
225#define EM_CR 103
226#define EM_F2MC16 104
227#define EM_MSP430 105
228#define EM_BLACKFIN 106
229#define EM_SE_C33 107
230#define EM_SEP 108
231#define EM_ARCA 109
232#define EM_UNICORE 110
233#define EM_EXCESS 111
234#define EM_DXP 112
235#define EM_ALTERA_NIOS2 113
236#define EM_CRX 114
237#define EM_XGATE 115
238#define EM_C166 116
239#define EM_M16C 117
240#define EM_DSPIC30F 118
241#define EM_CE 119
242#define EM_M32C 120
243#define EM_TSK3000 131
244#define EM_RS08 132
245#define EM_SHARC 133
246#define EM_ECOG2 134
247#define EM_SCORE7 135
248#define EM_DSP24 136
249#define EM_VIDEOCORE3 137
250#define EM_LATTICEMICO32 138
251#define EM_SE_C17 139
252#define EM_TI_C6000 140
253#define EM_TI_C2000 141
254#define EM_TI_C5500 142
255#define EM_TI_ARP32 143
256#define EM_TI_PRU 144
257#define EM_MMDSP_PLUS 160
258#define EM_CYPRESS_M8C 161
259#define EM_R32C 162
260#define EM_TRIMEDIA 163
261#define EM_QDSP6 164
262#define EM_8051 165
263#define EM_STXP7X 166
264#define EM_NDS32 167
265#define EM_ECOG1X 168
266#define EM_MAXQ30 169
267#define EM_XIMO16 170
268#define EM_MANIK 171
269#define EM_CRAYNV2 172
270#define EM_RX 173
271#define EM_METAG 174
272#define EM_MCST_ELBRUS 175
273#define EM_ECOG16 176
274#define EM_CR16 177
275#define EM_ETPU 178
276#define EM_SLE9X 179
277#define EM_L10M 180
278#define EM_K10M 181
279#define EM_AARCH64 183
280#define EM_AVR32 185
281#define EM_STM8 186
282#define EM_TILE64 187
283#define EM_TILEPRO 188
284#define EM_MICROBLAZE 189
285#define EM_CUDA 190
286#define EM_TILEGX 191
287#define EM_CLOUDSHIELD 192
288#define EM_COREA_1ST 193
289#define EM_COREA_2ND 194
290#define EM_ARC_COMPACT2 195
291#define EM_OPEN8 196
292#define EM_RL78 197
293#define EM_VIDEOCORE5 198
294#define EM_78KOR 199
295#define EM_56800EX 200
296#define EM_BA1 201
297#define EM_BA2 202
298#define EM_XCORE 203
299#define EM_MCHP_PIC 204
300#define EM_KM32 210
301#define EM_KMX32 211
302#define EM_EMX16 212
303#define EM_EMX8 213
304#define EM_KVARC 214
305#define EM_CDP 215
306#define EM_COGE 216
307#define EM_COOL 217
308#define EM_NORC 218
309#define EM_CSR_KALIMBA 219
310#define EM_Z80 220
311#define EM_VISIUM 221
312#define EM_FT32 222
313#define EM_MOXIE 223
314#define EM_AMDGPU 224
315#define EM_RISCV 243
316#define EM_BPF 247
317#define EM_CSKY 252
318#define EM_LOONGARCH 258
319#define EM_NUM 259
320
321#define EM_ALPHA 0x9026
322
323#define EV_NONE 0
324#define EV_CURRENT 1
325#define EV_NUM 2
326
327typedef struct {
328 Elf32_Word sh_name;
329 Elf32_Word sh_type;
330 Elf32_Word sh_flags;
331 Elf32_Addr sh_addr;
332 Elf32_Off sh_offset;
333 Elf32_Word sh_size;
334 Elf32_Word sh_link;
335 Elf32_Word sh_info;
336 Elf32_Word sh_addralign;
337 Elf32_Word sh_entsize;
338} Elf32_Shdr;
339
340typedef struct {
341 Elf64_Word sh_name;
342 Elf64_Word sh_type;
343 Elf64_Xword sh_flags;
344 Elf64_Addr sh_addr;
345 Elf64_Off sh_offset;
346 Elf64_Xword sh_size;
347 Elf64_Word sh_link;
348 Elf64_Word sh_info;
349 Elf64_Xword sh_addralign;
350 Elf64_Xword sh_entsize;
351} Elf64_Shdr;
352
353
354
355#define SHN_UNDEF 0
356#define SHN_LORESERVE 0xff00
357#define SHN_LOPROC 0xff00
358#define SHN_BEFORE 0xff00
359
360#define SHN_AFTER 0xff01
361
362#define SHN_HIPROC 0xff1f
363#define SHN_LOOS 0xff20
364#define SHN_HIOS 0xff3f
365#define SHN_ABS 0xfff1
366#define SHN_COMMON 0xfff2
367#define SHN_XINDEX 0xffff
368#define SHN_HIRESERVE 0xffff
369
370
371
372#define SHT_NULL 0
373#define SHT_PROGBITS 1
374#define SHT_SYMTAB 2
375#define SHT_STRTAB 3
376#define SHT_RELA 4
377#define SHT_HASH 5
378#define SHT_DYNAMIC 6
379#define SHT_NOTE 7
380#define SHT_NOBITS 8
381#define SHT_REL 9
382#define SHT_SHLIB 10
383#define SHT_DYNSYM 11
384#define SHT_INIT_ARRAY 14
385#define SHT_FINI_ARRAY 15
386#define SHT_PREINIT_ARRAY 16
387#define SHT_GROUP 17
388#define SHT_SYMTAB_SHNDX 18
389#define SHT_RELR 19
390#define SHT_NUM 20
391#define SHT_LOOS 0x60000000
392#define SHT_GNU_ATTRIBUTES 0x6ffffff5
393#define SHT_GNU_HASH 0x6ffffff6
394#define SHT_GNU_LIBLIST 0x6ffffff7
395#define SHT_CHECKSUM 0x6ffffff8
396#define SHT_LOSUNW 0x6ffffffa
397#define SHT_SUNW_move 0x6ffffffa
398#define SHT_SUNW_COMDAT 0x6ffffffb
399#define SHT_SUNW_syminfo 0x6ffffffc
400#define SHT_GNU_verdef 0x6ffffffd
401#define SHT_GNU_verneed 0x6ffffffe
402#define SHT_GNU_versym 0x6fffffff
403#define SHT_HISUNW 0x6fffffff
404#define SHT_HIOS 0x6fffffff
405#define SHT_LOPROC 0x70000000
406#define SHT_HIPROC 0x7fffffff
407#define SHT_LOUSER 0x80000000
408#define SHT_HIUSER 0x8fffffff
409
410#define SHF_WRITE (1 << 0)
411#define SHF_ALLOC (1 << 1)
412#define SHF_EXECINSTR (1 << 2)
413#define SHF_MERGE (1 << 4)
414#define SHF_STRINGS (1 << 5)
415#define SHF_INFO_LINK (1 << 6)
416#define SHF_LINK_ORDER (1 << 7)
417#define SHF_OS_NONCONFORMING (1 << 8)
418
419#define SHF_GROUP (1 << 9)
420#define SHF_TLS (1 << 10)
421#define SHF_COMPRESSED (1 << 11)
422#define SHF_MASKOS 0x0ff00000
423#define SHF_MASKPROC 0xf0000000
424#define SHF_ORDERED (1 << 30)
425#define SHF_EXCLUDE (1U << 31)
426
427typedef struct {
428 Elf32_Word ch_type;
429 Elf32_Word ch_size;
430 Elf32_Word ch_addralign;
431} Elf32_Chdr;
432
433typedef struct {
434 Elf64_Word ch_type;
435 Elf64_Word ch_reserved;
436 Elf64_Xword ch_size;
437 Elf64_Xword ch_addralign;
438} Elf64_Chdr;
439
440#define ELFCOMPRESS_ZLIB 1
441#define ELFCOMPRESS_ZSTD 2
442#define ELFCOMPRESS_LOOS 0x60000000
443#define ELFCOMPRESS_HIOS 0x6fffffff
444#define ELFCOMPRESS_LOPROC 0x70000000
445#define ELFCOMPRESS_HIPROC 0x7fffffff
446
447
448#define GRP_COMDAT 0x1
449
450typedef struct {
451 Elf32_Word st_name;
452 Elf32_Addr st_value;
453 Elf32_Word st_size;
454 unsigned char st_info;
455 unsigned char st_other;
456 Elf32_Section st_shndx;
457} Elf32_Sym;
458
459typedef struct {
460 Elf64_Word st_name;
461 unsigned char st_info;
462 unsigned char st_other;
463 Elf64_Section st_shndx;
464 Elf64_Addr st_value;
465 Elf64_Xword st_size;
466} Elf64_Sym;
467
468typedef struct {
469 Elf32_Half si_boundto;
470 Elf32_Half si_flags;
471} Elf32_Syminfo;
472
473typedef struct {
474 Elf64_Half si_boundto;
475 Elf64_Half si_flags;
476} Elf64_Syminfo;
477
478#define SYMINFO_BT_SELF 0xffff
479#define SYMINFO_BT_PARENT 0xfffe
480#define SYMINFO_BT_LOWRESERVE 0xff00
481
482#define SYMINFO_FLG_DIRECT 0x0001
483#define SYMINFO_FLG_PASSTHRU 0x0002
484#define SYMINFO_FLG_COPY 0x0004
485#define SYMINFO_FLG_LAZYLOAD 0x0008
486
487#define SYMINFO_NONE 0
488#define SYMINFO_CURRENT 1
489#define SYMINFO_NUM 2
490
491#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
492#define ELF32_ST_TYPE(val) ((val) & 0xf)
493#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
494
495#define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
496#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
497#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type))
498
499#define STB_LOCAL 0
500#define STB_GLOBAL 1
501#define STB_WEAK 2
502#define STB_NUM 3
503#define STB_LOOS 10
504#define STB_GNU_UNIQUE 10
505#define STB_HIOS 12
506#define STB_LOPROC 13
507#define STB_HIPROC 15
508
509#define STT_NOTYPE 0
510#define STT_OBJECT 1
511#define STT_FUNC 2
512#define STT_SECTION 3
513#define STT_FILE 4
514#define STT_COMMON 5
515#define STT_TLS 6
516#define STT_NUM 7
517#define STT_LOOS 10
518#define STT_GNU_IFUNC 10
519#define STT_HIOS 12
520#define STT_LOPROC 13
521#define STT_HIPROC 15
522
523#define STN_UNDEF 0
524
525#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
526#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
527
528#define STV_DEFAULT 0
529#define STV_INTERNAL 1
530#define STV_HIDDEN 2
531#define STV_PROTECTED 3
532
533
534
535
536typedef struct {
537 Elf32_Addr r_offset;
538 Elf32_Word r_info;
539} Elf32_Rel;
540
541typedef struct {
542 Elf64_Addr r_offset;
543 Elf64_Xword r_info;
544} Elf64_Rel;
545
546
547
548typedef struct {
549 Elf32_Addr r_offset;
550 Elf32_Word r_info;
551 Elf32_Sword r_addend;
552} Elf32_Rela;
553
554typedef struct {
555 Elf64_Addr r_offset;
556 Elf64_Xword r_info;
557 Elf64_Sxword r_addend;
558} Elf64_Rela;
559
560
561
562typedef Elf32_Word Elf32_Relr;
563typedef Elf64_Xword Elf64_Relr;
564
565
566
567#define ELF32_R_SYM(val) ((val) >> 8)
568#define ELF32_R_TYPE(val) ((val) & 0xff)
569#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
570
571#define ELF64_R_SYM(i) ((i) >> 32)
572#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
573#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
574
575
576
577typedef struct {
578 Elf32_Word p_type;
579 Elf32_Off p_offset;
580 Elf32_Addr p_vaddr;
581 Elf32_Addr p_paddr;
582 Elf32_Word p_filesz;
583 Elf32_Word p_memsz;
584 Elf32_Word p_flags;
585 Elf32_Word p_align;
586} Elf32_Phdr;
587
588typedef struct {
589 Elf64_Word p_type;
590 Elf64_Word p_flags;
591 Elf64_Off p_offset;
592 Elf64_Addr p_vaddr;
593 Elf64_Addr p_paddr;
594 Elf64_Xword p_filesz;
595 Elf64_Xword p_memsz;
596 Elf64_Xword p_align;
597} Elf64_Phdr;
598
599
600
601#define PT_NULL 0
602#define PT_LOAD 1
603#define PT_DYNAMIC 2
604#define PT_INTERP 3
605#define PT_NOTE 4
606#define PT_SHLIB 5
607#define PT_PHDR 6
608#define PT_TLS 7
609#define PT_NUM 8
610#define PT_LOOS 0x60000000
611#define PT_GNU_EH_FRAME 0x6474e550
612#define PT_GNU_STACK 0x6474e551
613#define PT_GNU_RELRO 0x6474e552
614#define PT_GNU_PROPERTY 0x6474e553
615#define PT_LOSUNW 0x6ffffffa
616#define PT_SUNWBSS 0x6ffffffa
617#define PT_SUNWSTACK 0x6ffffffb
618#define PT_HISUNW 0x6fffffff
619#define PT_HIOS 0x6fffffff
620#define PT_LOPROC 0x70000000
621#define PT_HIPROC 0x7fffffff
622
623
624#define PN_XNUM 0xffff
625
626
627#define PF_X (1 << 0)
628#define PF_W (1 << 1)
629#define PF_R (1 << 2)
630#define PF_MASKOS 0x0ff00000
631#define PF_MASKPROC 0xf0000000
632
633
634
635#define NT_PRSTATUS 1
636#define NT_PRFPREG 2
637#define NT_FPREGSET 2
638#define NT_PRPSINFO 3
639#define NT_PRXREG 4
640#define NT_TASKSTRUCT 4
641#define NT_PLATFORM 5
642#define NT_AUXV 6
643#define NT_GWINDOWS 7
644#define NT_ASRS 8
645#define NT_PSTATUS 10
646#define NT_PSINFO 13
647#define NT_PRCRED 14
648#define NT_UTSNAME 15
649#define NT_LWPSTATUS 16
650#define NT_LWPSINFO 17
651#define NT_PRFPXREG 20
652#define NT_SIGINFO 0x53494749
653#define NT_FILE 0x46494c45
654#define NT_PRXFPREG 0x46e62b7f
655#define NT_PPC_VMX 0x100
656#define NT_PPC_SPE 0x101
657#define NT_PPC_VSX 0x102
658#define NT_PPC_TAR 0x103
659#define NT_PPC_PPR 0x104
660#define NT_PPC_DSCR 0x105
661#define NT_PPC_EBB 0x106
662#define NT_PPC_PMU 0x107
663#define NT_PPC_TM_CGPR 0x108
664#define NT_PPC_TM_CFPR 0x109
665#define NT_PPC_TM_CVMX 0x10a
666#define NT_PPC_TM_CVSX 0x10b
667#define NT_PPC_TM_SPR 0x10c
668#define NT_PPC_TM_CTAR 0x10d
669#define NT_PPC_TM_CPPR 0x10e
670#define NT_PPC_TM_CDSCR 0x10f
671#define NT_386_TLS 0x200
672#define NT_386_IOPERM 0x201
673#define NT_X86_XSTATE 0x202
674#define NT_S390_HIGH_GPRS 0x300
675#define NT_S390_TIMER 0x301
676#define NT_S390_TODCMP 0x302
677#define NT_S390_TODPREG 0x303
678#define NT_S390_CTRS 0x304
679#define NT_S390_PREFIX 0x305
680#define NT_S390_LAST_BREAK 0x306
681#define NT_S390_SYSTEM_CALL 0x307
682#define NT_S390_TDB 0x308
683#define NT_S390_VXRS_LOW 0x309
684#define NT_S390_VXRS_HIGH 0x30a
685#define NT_S390_GS_CB 0x30b
686#define NT_S390_GS_BC 0x30c
687#define NT_S390_RI_CB 0x30d
688#define NT_ARM_VFP 0x400
689#define NT_ARM_TLS 0x401
690#define NT_ARM_HW_BREAK 0x402
691#define NT_ARM_HW_WATCH 0x403
692#define NT_ARM_SYSTEM_CALL 0x404
693#define NT_ARM_SVE 0x405
694#define NT_ARM_PAC_MASK 0x406
695#define NT_ARM_PACA_KEYS 0x407
696#define NT_ARM_PACG_KEYS 0x408
697#define NT_ARM_TAGGED_ADDR_CTRL 0x409
698#define NT_ARM_PAC_ENABLED_KEYS 0x40a
699#define NT_METAG_CBUF 0x500
700#define NT_METAG_RPIPE 0x501
701#define NT_METAG_TLS 0x502
702#define NT_ARC_V2 0x600
703#define NT_VMCOREDD 0x700
704#define NT_MIPS_DSP 0x800
705#define NT_MIPS_FP_MODE 0x801
706#define NT_MIPS_MSA 0x802
707#define NT_RISCV_CSR 0x900
708#define NT_RISCV_VECTOR 0x901
709#define NT_VERSION 1
710#define NT_LOONGARCH_CPUCFG 0xa00
711#define NT_LOONGARCH_CSR 0xa01
712#define NT_LOONGARCH_LSX 0xa02
713#define NT_LOONGARCH_LASX 0xa03
714#define NT_LOONGARCH_LBT 0xa04
715
716
717
718
719typedef struct {
720 Elf32_Sword d_tag;
721 union {
722 Elf32_Word d_val;
723 Elf32_Addr d_ptr;
724 } d_un;
725} Elf32_Dyn;
726
727typedef struct {
728 Elf64_Sxword d_tag;
729 union {
730 Elf64_Xword d_val;
731 Elf64_Addr d_ptr;
732 } d_un;
733} Elf64_Dyn;
734
735
736
737#define DT_NULL 0
738#define DT_NEEDED 1
739#define DT_PLTRELSZ 2
740#define DT_PLTGOT 3
741#define DT_HASH 4
742#define DT_STRTAB 5
743#define DT_SYMTAB 6
744#define DT_RELA 7
745#define DT_RELASZ 8
746#define DT_RELAENT 9
747#define DT_STRSZ 10
748#define DT_SYMENT 11
749#define DT_INIT 12
750#define DT_FINI 13
751#define DT_SONAME 14
752#define DT_RPATH 15
753#define DT_SYMBOLIC 16
754#define DT_REL 17
755#define DT_RELSZ 18
756#define DT_RELENT 19
757#define DT_PLTREL 20
758#define DT_DEBUG 21
759#define DT_TEXTREL 22
760#define DT_JMPREL 23
761#define DT_BIND_NOW 24
762#define DT_INIT_ARRAY 25
763#define DT_FINI_ARRAY 26
764#define DT_INIT_ARRAYSZ 27
765#define DT_FINI_ARRAYSZ 28
766#define DT_RUNPATH 29
767#define DT_FLAGS 30
768#define DT_ENCODING 32
769#define DT_PREINIT_ARRAY 32
770#define DT_PREINIT_ARRAYSZ 33
771#define DT_SYMTAB_SHNDX 34
772#define DT_RELRSZ 35
773#define DT_RELR 36
774#define DT_RELRENT 37
775#define DT_NUM 38
776#define DT_LOOS 0x6000000d
777#define DT_HIOS 0x6ffff000
778#define DT_LOPROC 0x70000000
779#define DT_HIPROC 0x7fffffff
780#define DT_PROCNUM DT_MIPS_NUM
781
782#define DT_VALRNGLO 0x6ffffd00
783#define DT_GNU_PRELINKED 0x6ffffdf5
784#define DT_GNU_CONFLICTSZ 0x6ffffdf6
785#define DT_GNU_LIBLISTSZ 0x6ffffdf7
786#define DT_CHECKSUM 0x6ffffdf8
787#define DT_PLTPADSZ 0x6ffffdf9
788#define DT_MOVEENT 0x6ffffdfa
789#define DT_MOVESZ 0x6ffffdfb
790#define DT_FEATURE_1 0x6ffffdfc
791#define DT_POSFLAG_1 0x6ffffdfd
792
793#define DT_SYMINSZ 0x6ffffdfe
794#define DT_SYMINENT 0x6ffffdff
795#define DT_VALRNGHI 0x6ffffdff
796#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag))
797#define DT_VALNUM 12
798
799#define DT_ADDRRNGLO 0x6ffffe00
800#define DT_GNU_HASH 0x6ffffef5
801#define DT_TLSDESC_PLT 0x6ffffef6
802#define DT_TLSDESC_GOT 0x6ffffef7
803#define DT_GNU_CONFLICT 0x6ffffef8
804#define DT_GNU_LIBLIST 0x6ffffef9
805#define DT_CONFIG 0x6ffffefa
806#define DT_DEPAUDIT 0x6ffffefb
807#define DT_AUDIT 0x6ffffefc
808#define DT_PLTPAD 0x6ffffefd
809#define DT_MOVETAB 0x6ffffefe
810#define DT_SYMINFO 0x6ffffeff
811#define DT_ADDRRNGHI 0x6ffffeff
812#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag))
813#define DT_ADDRNUM 11
814
815
816
817#define DT_VERSYM 0x6ffffff0
818
819#define DT_RELACOUNT 0x6ffffff9
820#define DT_RELCOUNT 0x6ffffffa
821
822
823#define DT_FLAGS_1 0x6ffffffb
824#define DT_VERDEF 0x6ffffffc
825
826#define DT_VERDEFNUM 0x6ffffffd
827#define DT_VERNEED 0x6ffffffe
828
829#define DT_VERNEEDNUM 0x6fffffff
830#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag))
831#define DT_VERSIONTAGNUM 16
832
833
834
835#define DT_AUXILIARY 0x7ffffffd
836#define DT_FILTER 0x7fffffff
837#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
838#define DT_EXTRANUM 3
839
840
841#define DF_ORIGIN 0x00000001
842#define DF_SYMBOLIC 0x00000002
843#define DF_TEXTREL 0x00000004
844#define DF_BIND_NOW 0x00000008
845#define DF_STATIC_TLS 0x00000010
846
847
848
849#define DF_1_NOW 0x00000001
850#define DF_1_GLOBAL 0x00000002
851#define DF_1_GROUP 0x00000004
852#define DF_1_NODELETE 0x00000008
853#define DF_1_LOADFLTR 0x00000010
854#define DF_1_INITFIRST 0x00000020
855#define DF_1_NOOPEN 0x00000040
856#define DF_1_ORIGIN 0x00000080
857#define DF_1_DIRECT 0x00000100
858#define DF_1_TRANS 0x00000200
859#define DF_1_INTERPOSE 0x00000400
860#define DF_1_NODEFLIB 0x00000800
861#define DF_1_NODUMP 0x00001000
862#define DF_1_CONFALT 0x00002000
863#define DF_1_ENDFILTEE 0x00004000
864#define DF_1_DISPRELDNE 0x00008000
865#define DF_1_DISPRELPND 0x00010000
866#define DF_1_NODIRECT 0x00020000
867#define DF_1_IGNMULDEF 0x00040000
868#define DF_1_NOKSYMS 0x00080000
869#define DF_1_NOHDR 0x00100000
870#define DF_1_EDITED 0x00200000
871#define DF_1_NORELOC 0x00400000
872#define DF_1_SYMINTPOSE 0x00800000
873#define DF_1_GLOBAUDIT 0x01000000
874#define DF_1_SINGLETON 0x02000000
875#define DF_1_STUB 0x04000000
876#define DF_1_PIE 0x08000000
877
878#define DTF_1_PARINIT 0x00000001
879#define DTF_1_CONFEXP 0x00000002
880
881
882#define DF_P1_LAZYLOAD 0x00000001
883#define DF_P1_GROUPPERM 0x00000002
884
885
886
887
888typedef struct {
889 Elf32_Half vd_version;
890 Elf32_Half vd_flags;
891 Elf32_Half vd_ndx;
892 Elf32_Half vd_cnt;
893 Elf32_Word vd_hash;
894 Elf32_Word vd_aux;
895 Elf32_Word vd_next;
896} Elf32_Verdef;
897
898typedef struct {
899 Elf64_Half vd_version;
900 Elf64_Half vd_flags;
901 Elf64_Half vd_ndx;
902 Elf64_Half vd_cnt;
903 Elf64_Word vd_hash;
904 Elf64_Word vd_aux;
905 Elf64_Word vd_next;
906} Elf64_Verdef;
907
908
909
910#define VER_DEF_NONE 0
911#define VER_DEF_CURRENT 1
912#define VER_DEF_NUM 2
913
914
915#define VER_FLG_BASE 0x1
916#define VER_FLG_WEAK 0x2
917
918
919#define VER_NDX_LOCAL 0
920#define VER_NDX_GLOBAL 1
921#define VER_NDX_LORESERVE 0xff00
922#define VER_NDX_ELIMINATE 0xff01
923
924
925
926typedef struct {
927 Elf32_Word vda_name;
928 Elf32_Word vda_next;
929} Elf32_Verdaux;
930
931typedef struct {
932 Elf64_Word vda_name;
933 Elf64_Word vda_next;
934} Elf64_Verdaux;
935
936
937
938
939typedef struct {
940 Elf32_Half vn_version;
941 Elf32_Half vn_cnt;
942 Elf32_Word vn_file;
943 Elf32_Word vn_aux;
944 Elf32_Word vn_next;
945} Elf32_Verneed;
946
947typedef struct {
948 Elf64_Half vn_version;
949 Elf64_Half vn_cnt;
950 Elf64_Word vn_file;
951 Elf64_Word vn_aux;
952 Elf64_Word vn_next;
953} Elf64_Verneed;
954
955
956
957#define VER_NEED_NONE 0
958#define VER_NEED_CURRENT 1
959#define VER_NEED_NUM 2
960
961
962
963typedef struct {
964 Elf32_Word vna_hash;
965 Elf32_Half vna_flags;
966 Elf32_Half vna_other;
967 Elf32_Word vna_name;
968 Elf32_Word vna_next;
969} Elf32_Vernaux;
970
971typedef struct {
972 Elf64_Word vna_hash;
973 Elf64_Half vna_flags;
974 Elf64_Half vna_other;
975 Elf64_Word vna_name;
976 Elf64_Word vna_next;
977} Elf64_Vernaux;
978
979
980
981#define VER_FLG_WEAK 0x2
982
983
984
985typedef struct {
986 uint32_t a_type;
987 union {
988 uint32_t a_val;
989 } a_un;
990} Elf32_auxv_t;
991
992typedef struct {
993 uint64_t a_type;
994 union {
995 uint64_t a_val;
996 } a_un;
997} Elf64_auxv_t;
998
999
1000
1001#define AT_NULL 0
1002#define AT_IGNORE 1
1003#define AT_EXECFD 2
1004#define AT_PHDR 3
1005#define AT_PHENT 4
1006#define AT_PHNUM 5
1007#define AT_PAGESZ 6
1008#define AT_BASE 7
1009#define AT_FLAGS 8
1010#define AT_ENTRY 9
1011#define AT_NOTELF 10
1012#define AT_UID 11
1013#define AT_EUID 12
1014#define AT_GID 13
1015#define AT_EGID 14
1016#define AT_CLKTCK 17
1017
1018
1019#define AT_PLATFORM 15
1020#define AT_HWCAP 16
1021
1022
1023
1024
1025#define AT_FPUCW 18
1026
1027
1028#define AT_DCACHEBSIZE 19
1029#define AT_ICACHEBSIZE 20
1030#define AT_UCACHEBSIZE 21
1031
1032
1033
1034#define AT_IGNOREPPC 22
1035
1036#define AT_SECURE 23
1037
1038#define AT_BASE_PLATFORM 24
1039
1040#define AT_RANDOM 25
1041
1042#define AT_HWCAP2 26
1043
1044#define AT_EXECFN 31
1045
1046
1047
1048#define AT_SYSINFO 32
1049#define AT_SYSINFO_EHDR 33
1050
1051
1052
1053#define AT_L1I_CACHESHAPE 34
1054#define AT_L1D_CACHESHAPE 35
1055#define AT_L2_CACHESHAPE 36
1056#define AT_L3_CACHESHAPE 37
1057
1058#define AT_L1I_CACHESIZE 40
1059#define AT_L1I_CACHEGEOMETRY 41
1060#define AT_L1D_CACHESIZE 42
1061#define AT_L1D_CACHEGEOMETRY 43
1062#define AT_L2_CACHESIZE 44
1063#define AT_L2_CACHEGEOMETRY 45
1064#define AT_L3_CACHESIZE 46
1065#define AT_L3_CACHEGEOMETRY 47
1066
1067#define AT_MINSIGSTKSZ 51
1068
1069
1070typedef struct {
1071 Elf32_Word n_namesz;
1072 Elf32_Word n_descsz;
1073 Elf32_Word n_type;
1074} Elf32_Nhdr;
1075
1076typedef struct {
1077 Elf64_Word n_namesz;
1078 Elf64_Word n_descsz;
1079 Elf64_Word n_type;
1080} Elf64_Nhdr;
1081
1082
1083
1084
1085#define ELF_NOTE_SOLARIS "SUNW Solaris"
1086
1087
1088#define ELF_NOTE_GNU "GNU"
1089
1090
1091
1092
1093
1094#define ELF_NOTE_PAGESIZE_HINT 1
1095
1096
1097#define NT_GNU_ABI_TAG 1
1098#define ELF_NOTE_ABI NT_GNU_ABI_TAG
1099
1100
1101
1102#define ELF_NOTE_OS_LINUX 0
1103#define ELF_NOTE_OS_GNU 1
1104#define ELF_NOTE_OS_SOLARIS2 2
1105#define ELF_NOTE_OS_FREEBSD 3
1106
1107#define NT_GNU_BUILD_ID 3
1108#define NT_GNU_GOLD_VERSION 4
1109#define NT_GNU_PROPERTY_TYPE_0 5
1110
1111
1112
1113typedef struct {
1114 Elf32_Xword m_value;
1115 Elf32_Word m_info;
1116 Elf32_Word m_poffset;
1117 Elf32_Half m_repeat;
1118 Elf32_Half m_stride;
1119} Elf32_Move;
1120
1121typedef struct {
1122 Elf64_Xword m_value;
1123 Elf64_Xword m_info;
1124 Elf64_Xword m_poffset;
1125 Elf64_Half m_repeat;
1126 Elf64_Half m_stride;
1127} Elf64_Move;
1128
1129
1130#define ELF32_M_SYM(info) ((info) >> 8)
1131#define ELF32_M_SIZE(info) ((unsigned char) (info))
1132#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size))
1133
1134#define ELF64_M_SYM(info) ELF32_M_SYM (info)
1135#define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
1136#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
1137
1138#define EF_CPU32 0x00810000
1139
1140#define R_68K_NONE 0
1141#define R_68K_32 1
1142#define R_68K_16 2
1143#define R_68K_8 3
1144#define R_68K_PC32 4
1145#define R_68K_PC16 5
1146#define R_68K_PC8 6
1147#define R_68K_GOT32 7
1148#define R_68K_GOT16 8
1149#define R_68K_GOT8 9
1150#define R_68K_GOT32O 10
1151#define R_68K_GOT16O 11
1152#define R_68K_GOT8O 12
1153#define R_68K_PLT32 13
1154#define R_68K_PLT16 14
1155#define R_68K_PLT8 15
1156#define R_68K_PLT32O 16
1157#define R_68K_PLT16O 17
1158#define R_68K_PLT8O 18
1159#define R_68K_COPY 19
1160#define R_68K_GLOB_DAT 20
1161#define R_68K_JMP_SLOT 21
1162#define R_68K_RELATIVE 22
1163#define R_68K_TLS_GD32 25
1164#define R_68K_TLS_GD16 26
1165#define R_68K_TLS_GD8 27
1166#define R_68K_TLS_LDM32 28
1167#define R_68K_TLS_LDM16 29
1168#define R_68K_TLS_LDM8 30
1169#define R_68K_TLS_LDO32 31
1170#define R_68K_TLS_LDO16 32
1171#define R_68K_TLS_LDO8 33
1172#define R_68K_TLS_IE32 34
1173#define R_68K_TLS_IE16 35
1174#define R_68K_TLS_IE8 36
1175#define R_68K_TLS_LE32 37
1176#define R_68K_TLS_LE16 38
1177#define R_68K_TLS_LE8 39
1178#define R_68K_TLS_DTPMOD32 40
1179#define R_68K_TLS_DTPREL32 41
1180#define R_68K_TLS_TPREL32 42
1181#define R_68K_NUM 43
1182
1183#define R_386_NONE 0
1184#define R_386_32 1
1185#define R_386_PC32 2
1186#define R_386_GOT32 3
1187#define R_386_PLT32 4
1188#define R_386_COPY 5
1189#define R_386_GLOB_DAT 6
1190#define R_386_JMP_SLOT 7
1191#define R_386_RELATIVE 8
1192#define R_386_GOTOFF 9
1193#define R_386_GOTPC 10
1194#define R_386_32PLT 11
1195#define R_386_TLS_TPOFF 14
1196#define R_386_TLS_IE 15
1197#define R_386_TLS_GOTIE 16
1198#define R_386_TLS_LE 17
1199#define R_386_TLS_GD 18
1200#define R_386_TLS_LDM 19
1201#define R_386_16 20
1202#define R_386_PC16 21
1203#define R_386_8 22
1204#define R_386_PC8 23
1205#define R_386_TLS_GD_32 24
1206#define R_386_TLS_GD_PUSH 25
1207#define R_386_TLS_GD_CALL 26
1208#define R_386_TLS_GD_POP 27
1209#define R_386_TLS_LDM_32 28
1210#define R_386_TLS_LDM_PUSH 29
1211#define R_386_TLS_LDM_CALL 30
1212#define R_386_TLS_LDM_POP 31
1213#define R_386_TLS_LDO_32 32
1214#define R_386_TLS_IE_32 33
1215#define R_386_TLS_LE_32 34
1216#define R_386_TLS_DTPMOD32 35
1217#define R_386_TLS_DTPOFF32 36
1218#define R_386_TLS_TPOFF32 37
1219#define R_386_SIZE32 38
1220#define R_386_TLS_GOTDESC 39
1221#define R_386_TLS_DESC_CALL 40
1222#define R_386_TLS_DESC 41
1223#define R_386_IRELATIVE 42
1224#define R_386_GOT32X 43
1225#define R_386_NUM 44
1226
1227
1228
1229
1230
1231#define STT_SPARC_REGISTER 13
1232
1233
1234
1235#define EF_SPARCV9_MM 3
1236#define EF_SPARCV9_TSO 0
1237#define EF_SPARCV9_PSO 1
1238#define EF_SPARCV9_RMO 2
1239#define EF_SPARC_LEDATA 0x800000
1240#define EF_SPARC_EXT_MASK 0xFFFF00
1241#define EF_SPARC_32PLUS 0x000100
1242#define EF_SPARC_SUN_US1 0x000200
1243#define EF_SPARC_HAL_R1 0x000400
1244#define EF_SPARC_SUN_US3 0x000800
1245
1246
1247
1248#define R_SPARC_NONE 0
1249#define R_SPARC_8 1
1250#define R_SPARC_16 2
1251#define R_SPARC_32 3
1252#define R_SPARC_DISP8 4
1253#define R_SPARC_DISP16 5
1254#define R_SPARC_DISP32 6
1255#define R_SPARC_WDISP30 7
1256#define R_SPARC_WDISP22 8
1257#define R_SPARC_HI22 9
1258#define R_SPARC_22 10
1259#define R_SPARC_13 11
1260#define R_SPARC_LO10 12
1261#define R_SPARC_GOT10 13
1262#define R_SPARC_GOT13 14
1263#define R_SPARC_GOT22 15
1264#define R_SPARC_PC10 16
1265#define R_SPARC_PC22 17
1266#define R_SPARC_WPLT30 18
1267#define R_SPARC_COPY 19
1268#define R_SPARC_GLOB_DAT 20
1269#define R_SPARC_JMP_SLOT 21
1270#define R_SPARC_RELATIVE 22
1271#define R_SPARC_UA32 23
1272
1273
1274
1275#define R_SPARC_PLT32 24
1276#define R_SPARC_HIPLT22 25
1277#define R_SPARC_LOPLT10 26
1278#define R_SPARC_PCPLT32 27
1279#define R_SPARC_PCPLT22 28
1280#define R_SPARC_PCPLT10 29
1281#define R_SPARC_10 30
1282#define R_SPARC_11 31
1283#define R_SPARC_64 32
1284#define R_SPARC_OLO10 33
1285#define R_SPARC_HH22 34
1286#define R_SPARC_HM10 35
1287#define R_SPARC_LM22 36
1288#define R_SPARC_PC_HH22 37
1289#define R_SPARC_PC_HM10 38
1290#define R_SPARC_PC_LM22 39
1291#define R_SPARC_WDISP16 40
1292#define R_SPARC_WDISP19 41
1293#define R_SPARC_GLOB_JMP 42
1294#define R_SPARC_7 43
1295#define R_SPARC_5 44
1296#define R_SPARC_6 45
1297#define R_SPARC_DISP64 46
1298#define R_SPARC_PLT64 47
1299#define R_SPARC_HIX22 48
1300#define R_SPARC_LOX10 49
1301#define R_SPARC_H44 50
1302#define R_SPARC_M44 51
1303#define R_SPARC_L44 52
1304#define R_SPARC_REGISTER 53
1305#define R_SPARC_UA64 54
1306#define R_SPARC_UA16 55
1307#define R_SPARC_TLS_GD_HI22 56
1308#define R_SPARC_TLS_GD_LO10 57
1309#define R_SPARC_TLS_GD_ADD 58
1310#define R_SPARC_TLS_GD_CALL 59
1311#define R_SPARC_TLS_LDM_HI22 60
1312#define R_SPARC_TLS_LDM_LO10 61
1313#define R_SPARC_TLS_LDM_ADD 62
1314#define R_SPARC_TLS_LDM_CALL 63
1315#define R_SPARC_TLS_LDO_HIX22 64
1316#define R_SPARC_TLS_LDO_LOX10 65
1317#define R_SPARC_TLS_LDO_ADD 66
1318#define R_SPARC_TLS_IE_HI22 67
1319#define R_SPARC_TLS_IE_LO10 68
1320#define R_SPARC_TLS_IE_LD 69
1321#define R_SPARC_TLS_IE_LDX 70
1322#define R_SPARC_TLS_IE_ADD 71
1323#define R_SPARC_TLS_LE_HIX22 72
1324#define R_SPARC_TLS_LE_LOX10 73
1325#define R_SPARC_TLS_DTPMOD32 74
1326#define R_SPARC_TLS_DTPMOD64 75
1327#define R_SPARC_TLS_DTPOFF32 76
1328#define R_SPARC_TLS_DTPOFF64 77
1329#define R_SPARC_TLS_TPOFF32 78
1330#define R_SPARC_TLS_TPOFF64 79
1331#define R_SPARC_GOTDATA_HIX22 80
1332#define R_SPARC_GOTDATA_LOX10 81
1333#define R_SPARC_GOTDATA_OP_HIX22 82
1334#define R_SPARC_GOTDATA_OP_LOX10 83
1335#define R_SPARC_GOTDATA_OP 84
1336#define R_SPARC_H34 85
1337#define R_SPARC_SIZE32 86
1338#define R_SPARC_SIZE64 87
1339#define R_SPARC_GNU_VTINHERIT 250
1340#define R_SPARC_GNU_VTENTRY 251
1341#define R_SPARC_REV32 252
1342
1343#define R_SPARC_NUM 253
1344
1345
1346
1347#define DT_SPARC_REGISTER 0x70000001
1348#define DT_SPARC_NUM 2
1349
1350
1351#define EF_MIPS_NOREORDER 1
1352#define EF_MIPS_PIC 2
1353#define EF_MIPS_CPIC 4
1354#define EF_MIPS_XGOT 8
1355#define EF_MIPS_64BIT_WHIRL 16
1356#define EF_MIPS_ABI2 32
1357#define EF_MIPS_ABI_ON32 64
1358#define EF_MIPS_FP64 512
1359#define EF_MIPS_NAN2008 1024
1360#define EF_MIPS_ARCH 0xf0000000
1361
1362
1363
1364#define EF_MIPS_ARCH_1 0x00000000
1365#define EF_MIPS_ARCH_2 0x10000000
1366#define EF_MIPS_ARCH_3 0x20000000
1367#define EF_MIPS_ARCH_4 0x30000000
1368#define EF_MIPS_ARCH_5 0x40000000
1369#define EF_MIPS_ARCH_32 0x50000000
1370#define EF_MIPS_ARCH_64 0x60000000
1371#define EF_MIPS_ARCH_32R2 0x70000000
1372#define EF_MIPS_ARCH_64R2 0x80000000
1373
1374
1375#define E_MIPS_ARCH_1 0x00000000
1376#define E_MIPS_ARCH_2 0x10000000
1377#define E_MIPS_ARCH_3 0x20000000
1378#define E_MIPS_ARCH_4 0x30000000
1379#define E_MIPS_ARCH_5 0x40000000
1380#define E_MIPS_ARCH_32 0x50000000
1381#define E_MIPS_ARCH_64 0x60000000
1382
1383
1384
1385#define SHN_MIPS_ACOMMON 0xff00
1386#define SHN_MIPS_TEXT 0xff01
1387#define SHN_MIPS_DATA 0xff02
1388#define SHN_MIPS_SCOMMON 0xff03
1389#define SHN_MIPS_SUNDEFINED 0xff04
1390
1391
1392
1393#define SHT_MIPS_LIBLIST 0x70000000
1394#define SHT_MIPS_MSYM 0x70000001
1395#define SHT_MIPS_CONFLICT 0x70000002
1396#define SHT_MIPS_GPTAB 0x70000003
1397#define SHT_MIPS_UCODE 0x70000004
1398#define SHT_MIPS_DEBUG 0x70000005
1399#define SHT_MIPS_REGINFO 0x70000006
1400#define SHT_MIPS_PACKAGE 0x70000007
1401#define SHT_MIPS_PACKSYM 0x70000008
1402#define SHT_MIPS_RELD 0x70000009
1403#define SHT_MIPS_IFACE 0x7000000b
1404#define SHT_MIPS_CONTENT 0x7000000c
1405#define SHT_MIPS_OPTIONS 0x7000000d
1406#define SHT_MIPS_SHDR 0x70000010
1407#define SHT_MIPS_FDESC 0x70000011
1408#define SHT_MIPS_EXTSYM 0x70000012
1409#define SHT_MIPS_DENSE 0x70000013
1410#define SHT_MIPS_PDESC 0x70000014
1411#define SHT_MIPS_LOCSYM 0x70000015
1412#define SHT_MIPS_AUXSYM 0x70000016
1413#define SHT_MIPS_OPTSYM 0x70000017
1414#define SHT_MIPS_LOCSTR 0x70000018
1415#define SHT_MIPS_LINE 0x70000019
1416#define SHT_MIPS_RFDESC 0x7000001a
1417#define SHT_MIPS_DELTASYM 0x7000001b
1418#define SHT_MIPS_DELTAINST 0x7000001c
1419#define SHT_MIPS_DELTACLASS 0x7000001d
1420#define SHT_MIPS_DWARF 0x7000001e
1421#define SHT_MIPS_DELTADECL 0x7000001f
1422#define SHT_MIPS_SYMBOL_LIB 0x70000020
1423#define SHT_MIPS_EVENTS 0x70000021
1424#define SHT_MIPS_TRANSLATE 0x70000022
1425#define SHT_MIPS_PIXIE 0x70000023
1426#define SHT_MIPS_XLATE 0x70000024
1427#define SHT_MIPS_XLATE_DEBUG 0x70000025
1428#define SHT_MIPS_WHIRL 0x70000026
1429#define SHT_MIPS_EH_REGION 0x70000027
1430#define SHT_MIPS_XLATE_OLD 0x70000028
1431#define SHT_MIPS_PDR_EXCEPTION 0x70000029
1432
1433
1434
1435#define SHF_MIPS_GPREL 0x10000000
1436#define SHF_MIPS_MERGE 0x20000000
1437#define SHF_MIPS_ADDR 0x40000000
1438#define SHF_MIPS_STRINGS 0x80000000
1439#define SHF_MIPS_NOSTRIP 0x08000000
1440#define SHF_MIPS_LOCAL 0x04000000
1441#define SHF_MIPS_NAMES 0x02000000
1442#define SHF_MIPS_NODUPE 0x01000000
1443
1444
1445
1446
1447
1448#define STO_MIPS_DEFAULT 0x0
1449#define STO_MIPS_INTERNAL 0x1
1450#define STO_MIPS_HIDDEN 0x2
1451#define STO_MIPS_PROTECTED 0x3
1452#define STO_MIPS_PLT 0x8
1453#define STO_MIPS_SC_ALIGN_UNUSED 0xff
1454
1455
1456#define STB_MIPS_SPLIT_COMMON 13
1457
1458
1459
1460typedef union {
1461 struct {
1462 Elf32_Word gt_current_g_value;
1463 Elf32_Word gt_unused;
1464 } gt_header;
1465 struct {
1466 Elf32_Word gt_g_value;
1467 Elf32_Word gt_bytes;
1468 } gt_entry;
1469} Elf32_gptab;
1470
1471
1472
1473typedef struct {
1474 Elf32_Word ri_gprmask;
1475 Elf32_Word ri_cprmask[4];
1476 Elf32_Sword ri_gp_value;
1477} Elf32_RegInfo;
1478
1479
1480
1481typedef struct {
1482 unsigned char kind;
1483
1484 unsigned char size;
1485 Elf32_Section section;
1486
1487 Elf32_Word info;
1488} Elf_Options;
1489
1490
1491
1492#define ODK_NULL 0
1493#define ODK_REGINFO 1
1494#define ODK_EXCEPTIONS 2
1495#define ODK_PAD 3
1496#define ODK_HWPATCH 4
1497#define ODK_FILL 5
1498#define ODK_TAGS 6
1499#define ODK_HWAND 7
1500#define ODK_HWOR 8
1501
1502
1503
1504#define OEX_FPU_MIN 0x1f
1505#define OEX_FPU_MAX 0x1f00
1506#define OEX_PAGE0 0x10000
1507#define OEX_SMM 0x20000
1508#define OEX_FPDBUG 0x40000
1509#define OEX_PRECISEFP OEX_FPDBUG
1510#define OEX_DISMISS 0x80000
1511
1512#define OEX_FPU_INVAL 0x10
1513#define OEX_FPU_DIV0 0x08
1514#define OEX_FPU_OFLO 0x04
1515#define OEX_FPU_UFLO 0x02
1516#define OEX_FPU_INEX 0x01
1517
1518
1519
1520#define OHW_R4KEOP 0x1
1521#define OHW_R8KPFETCH 0x2
1522#define OHW_R5KEOP 0x4
1523#define OHW_R5KCVTL 0x8
1524
1525#define OPAD_PREFIX 0x1
1526#define OPAD_POSTFIX 0x2
1527#define OPAD_SYMBOL 0x4
1528
1529
1530
1531typedef struct {
1532 Elf32_Word hwp_flags1;
1533 Elf32_Word hwp_flags2;
1534} Elf_Options_Hw;
1535
1536
1537
1538#define OHWA0_R4KEOP_CHECKED 0x00000001
1539#define OHWA1_R4KEOP_CLEAN 0x00000002
1540
1541
1542
1543#define R_MIPS_NONE 0
1544#define R_MIPS_16 1
1545#define R_MIPS_32 2
1546#define R_MIPS_REL32 3
1547#define R_MIPS_26 4
1548#define R_MIPS_HI16 5
1549#define R_MIPS_LO16 6
1550#define R_MIPS_GPREL16 7
1551#define R_MIPS_LITERAL 8
1552#define R_MIPS_GOT16 9
1553#define R_MIPS_PC16 10
1554#define R_MIPS_CALL16 11
1555#define R_MIPS_GPREL32 12
1556
1557#define R_MIPS_SHIFT5 16
1558#define R_MIPS_SHIFT6 17
1559#define R_MIPS_64 18
1560#define R_MIPS_GOT_DISP 19
1561#define R_MIPS_GOT_PAGE 20
1562#define R_MIPS_GOT_OFST 21
1563#define R_MIPS_GOT_HI16 22
1564#define R_MIPS_GOT_LO16 23
1565#define R_MIPS_SUB 24
1566#define R_MIPS_INSERT_A 25
1567#define R_MIPS_INSERT_B 26
1568#define R_MIPS_DELETE 27
1569#define R_MIPS_HIGHER 28
1570#define R_MIPS_HIGHEST 29
1571#define R_MIPS_CALL_HI16 30
1572#define R_MIPS_CALL_LO16 31
1573#define R_MIPS_SCN_DISP 32
1574#define R_MIPS_REL16 33
1575#define R_MIPS_ADD_IMMEDIATE 34
1576#define R_MIPS_PJUMP 35
1577#define R_MIPS_RELGOT 36
1578#define R_MIPS_JALR 37
1579#define R_MIPS_TLS_DTPMOD32 38
1580#define R_MIPS_TLS_DTPREL32 39
1581#define R_MIPS_TLS_DTPMOD64 40
1582#define R_MIPS_TLS_DTPREL64 41
1583#define R_MIPS_TLS_GD 42
1584#define R_MIPS_TLS_LDM 43
1585#define R_MIPS_TLS_DTPREL_HI16 44
1586#define R_MIPS_TLS_DTPREL_LO16 45
1587#define R_MIPS_TLS_GOTTPREL 46
1588#define R_MIPS_TLS_TPREL32 47
1589#define R_MIPS_TLS_TPREL64 48
1590#define R_MIPS_TLS_TPREL_HI16 49
1591#define R_MIPS_TLS_TPREL_LO16 50
1592#define R_MIPS_GLOB_DAT 51
1593#define R_MIPS_COPY 126
1594#define R_MIPS_JUMP_SLOT 127
1595
1596#define R_MIPS_NUM 128
1597
1598
1599
1600#define PT_MIPS_REGINFO 0x70000000
1601#define PT_MIPS_RTPROC 0x70000001
1602#define PT_MIPS_OPTIONS 0x70000002
1603#define PT_MIPS_ABIFLAGS 0x70000003
1604
1605
1606
1607#define PF_MIPS_LOCAL 0x10000000
1608
1609
1610
1611#define DT_MIPS_RLD_VERSION 0x70000001
1612#define DT_MIPS_TIME_STAMP 0x70000002
1613#define DT_MIPS_ICHECKSUM 0x70000003
1614#define DT_MIPS_IVERSION 0x70000004
1615#define DT_MIPS_FLAGS 0x70000005
1616#define DT_MIPS_BASE_ADDRESS 0x70000006
1617#define DT_MIPS_MSYM 0x70000007
1618#define DT_MIPS_CONFLICT 0x70000008
1619#define DT_MIPS_LIBLIST 0x70000009
1620#define DT_MIPS_LOCAL_GOTNO 0x7000000a
1621#define DT_MIPS_CONFLICTNO 0x7000000b
1622#define DT_MIPS_LIBLISTNO 0x70000010
1623#define DT_MIPS_SYMTABNO 0x70000011
1624#define DT_MIPS_UNREFEXTNO 0x70000012
1625#define DT_MIPS_GOTSYM 0x70000013
1626#define DT_MIPS_HIPAGENO 0x70000014
1627#define DT_MIPS_RLD_MAP 0x70000016
1628#define DT_MIPS_DELTA_CLASS 0x70000017
1629#define DT_MIPS_DELTA_CLASS_NO 0x70000018
1630
1631#define DT_MIPS_DELTA_INSTANCE 0x70000019
1632#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a
1633
1634#define DT_MIPS_DELTA_RELOC 0x7000001b
1635#define DT_MIPS_DELTA_RELOC_NO 0x7000001c
1636
1637#define DT_MIPS_DELTA_SYM 0x7000001d
1638
1639#define DT_MIPS_DELTA_SYM_NO 0x7000001e
1640
1641#define DT_MIPS_DELTA_CLASSSYM 0x70000020
1642
1643#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021
1644
1645#define DT_MIPS_CXX_FLAGS 0x70000022
1646#define DT_MIPS_PIXIE_INIT 0x70000023
1647#define DT_MIPS_SYMBOL_LIB 0x70000024
1648#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025
1649#define DT_MIPS_LOCAL_GOTIDX 0x70000026
1650#define DT_MIPS_HIDDEN_GOTIDX 0x70000027
1651#define DT_MIPS_PROTECTED_GOTIDX 0x70000028
1652#define DT_MIPS_OPTIONS 0x70000029
1653#define DT_MIPS_INTERFACE 0x7000002a
1654#define DT_MIPS_DYNSTR_ALIGN 0x7000002b
1655#define DT_MIPS_INTERFACE_SIZE 0x7000002c
1656#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d
1657
1658#define DT_MIPS_PERF_SUFFIX 0x7000002e
1659
1660#define DT_MIPS_COMPACT_SIZE 0x7000002f
1661#define DT_MIPS_GP_VALUE 0x70000030
1662#define DT_MIPS_AUX_DYNAMIC 0x70000031
1663
1664#define DT_MIPS_PLTGOT 0x70000032
1665
1666#define DT_MIPS_RWPLT 0x70000034
1667#define DT_MIPS_RLD_MAP_REL 0x70000035
1668#define DT_MIPS_NUM 0x36
1669
1670
1671
1672#define RHF_NONE 0
1673#define RHF_QUICKSTART (1 << 0)
1674#define RHF_NOTPOT (1 << 1)
1675#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2)
1676#define RHF_NO_MOVE (1 << 3)
1677#define RHF_SGI_ONLY (1 << 4)
1678#define RHF_GUARANTEE_INIT (1 << 5)
1679#define RHF_DELTA_C_PLUS_PLUS (1 << 6)
1680#define RHF_GUARANTEE_START_INIT (1 << 7)
1681#define RHF_PIXIE (1 << 8)
1682#define RHF_DEFAULT_DELAY_LOAD (1 << 9)
1683#define RHF_REQUICKSTART (1 << 10)
1684#define RHF_REQUICKSTARTED (1 << 11)
1685#define RHF_CORD (1 << 12)
1686#define RHF_NO_UNRES_UNDEF (1 << 13)
1687#define RHF_RLD_ORDER_SAFE (1 << 14)
1688
1689
1690
1691typedef struct {
1692 Elf32_Word l_name;
1693 Elf32_Word l_time_stamp;
1694 Elf32_Word l_checksum;
1695 Elf32_Word l_version;
1696 Elf32_Word l_flags;
1697} Elf32_Lib;
1698
1699typedef struct {
1700 Elf64_Word l_name;
1701 Elf64_Word l_time_stamp;
1702 Elf64_Word l_checksum;
1703 Elf64_Word l_version;
1704 Elf64_Word l_flags;
1705} Elf64_Lib;
1706
1707
1708
1709
1710#define LL_NONE 0
1711#define LL_EXACT_MATCH (1 << 0)
1712#define LL_IGNORE_INT_VER (1 << 1)
1713#define LL_REQUIRE_MINOR (1 << 2)
1714#define LL_EXPORTS (1 << 3)
1715#define LL_DELAY_LOAD (1 << 4)
1716#define LL_DELTA (1 << 5)
1717
1718
1719
1720typedef Elf32_Addr Elf32_Conflict;
1721
1722typedef struct {
1723 Elf32_Half version;
1724 unsigned char isa_level;
1725 unsigned char isa_rev;
1726 unsigned char gpr_size;
1727 unsigned char cpr1_size;
1728 unsigned char cpr2_size;
1729 unsigned char fp_abi;
1730 Elf32_Word isa_ext;
1731 Elf32_Word ases;
1732 Elf32_Word flags1;
1733 Elf32_Word flags2;
1734} Elf_MIPS_ABIFlags_v0;
1735
1736#define MIPS_AFL_REG_NONE 0x00
1737#define MIPS_AFL_REG_32 0x01
1738#define MIPS_AFL_REG_64 0x02
1739#define MIPS_AFL_REG_128 0x03
1740
1741#define MIPS_AFL_ASE_DSP 0x00000001
1742#define MIPS_AFL_ASE_DSPR2 0x00000002
1743#define MIPS_AFL_ASE_EVA 0x00000004
1744#define MIPS_AFL_ASE_MCU 0x00000008
1745#define MIPS_AFL_ASE_MDMX 0x00000010
1746#define MIPS_AFL_ASE_MIPS3D 0x00000020
1747#define MIPS_AFL_ASE_MT 0x00000040
1748#define MIPS_AFL_ASE_SMARTMIPS 0x00000080
1749#define MIPS_AFL_ASE_VIRT 0x00000100
1750#define MIPS_AFL_ASE_MSA 0x00000200
1751#define MIPS_AFL_ASE_MIPS16 0x00000400
1752#define MIPS_AFL_ASE_MICROMIPS 0x00000800
1753#define MIPS_AFL_ASE_XPA 0x00001000
1754#define MIPS_AFL_ASE_MASK 0x00001fff
1755
1756#define MIPS_AFL_EXT_XLR 1
1757#define MIPS_AFL_EXT_OCTEON2 2
1758#define MIPS_AFL_EXT_OCTEONP 3
1759#define MIPS_AFL_EXT_LOONGSON_3A 4
1760#define MIPS_AFL_EXT_OCTEON 5
1761#define MIPS_AFL_EXT_5900 6
1762#define MIPS_AFL_EXT_4650 7
1763#define MIPS_AFL_EXT_4010 8
1764#define MIPS_AFL_EXT_4100 9
1765#define MIPS_AFL_EXT_3900 10
1766#define MIPS_AFL_EXT_10000 11
1767#define MIPS_AFL_EXT_SB1 12
1768#define MIPS_AFL_EXT_4111 13
1769#define MIPS_AFL_EXT_4120 14
1770#define MIPS_AFL_EXT_5400 15
1771#define MIPS_AFL_EXT_5500 16
1772#define MIPS_AFL_EXT_LOONGSON_2E 17
1773#define MIPS_AFL_EXT_LOONGSON_2F 18
1774
1775#define MIPS_AFL_FLAGS1_ODDSPREG 1
1776
1777enum
1778{
1779 Val_GNU_MIPS_ABI_FP_ANY = 0,
1780 Val_GNU_MIPS_ABI_FP_DOUBLE = 1,
1781 Val_GNU_MIPS_ABI_FP_SINGLE = 2,
1782 Val_GNU_MIPS_ABI_FP_SOFT = 3,
1783 Val_GNU_MIPS_ABI_FP_OLD_64 = 4,
1784 Val_GNU_MIPS_ABI_FP_XX = 5,
1785 Val_GNU_MIPS_ABI_FP_64 = 6,
1786 Val_GNU_MIPS_ABI_FP_64A = 7,
1787 Val_GNU_MIPS_ABI_FP_MAX = 7
1788};
1789
1790
1791
1792
1793#define EF_PARISC_TRAPNIL 0x00010000
1794#define EF_PARISC_EXT 0x00020000
1795#define EF_PARISC_LSB 0x00040000
1796#define EF_PARISC_WIDE 0x00080000
1797#define EF_PARISC_NO_KABP 0x00100000
1798
1799#define EF_PARISC_LAZYSWAP 0x00400000
1800#define EF_PARISC_ARCH 0x0000ffff
1801
1802
1803
1804#define EFA_PARISC_1_0 0x020b
1805#define EFA_PARISC_1_1 0x0210
1806#define EFA_PARISC_2_0 0x0214
1807
1808
1809
1810#define SHN_PARISC_ANSI_COMMON 0xff00
1811
1812#define SHN_PARISC_HUGE_COMMON 0xff01
1813
1814
1815
1816#define SHT_PARISC_EXT 0x70000000
1817#define SHT_PARISC_UNWIND 0x70000001
1818#define SHT_PARISC_DOC 0x70000002
1819
1820
1821
1822#define SHF_PARISC_SHORT 0x20000000
1823#define SHF_PARISC_HUGE 0x40000000
1824#define SHF_PARISC_SBP 0x80000000
1825
1826
1827
1828#define STT_PARISC_MILLICODE 13
1829
1830#define STT_HP_OPAQUE (STT_LOOS + 0x1)
1831#define STT_HP_STUB (STT_LOOS + 0x2)
1832
1833
1834
1835#define R_PARISC_NONE 0
1836#define R_PARISC_DIR32 1
1837#define R_PARISC_DIR21L 2
1838#define R_PARISC_DIR17R 3
1839#define R_PARISC_DIR17F 4
1840#define R_PARISC_DIR14R 6
1841#define R_PARISC_PCREL32 9
1842#define R_PARISC_PCREL21L 10
1843#define R_PARISC_PCREL17R 11
1844#define R_PARISC_PCREL17F 12
1845#define R_PARISC_PCREL14R 14
1846#define R_PARISC_DPREL21L 18
1847#define R_PARISC_DPREL14R 22
1848#define R_PARISC_GPREL21L 26
1849#define R_PARISC_GPREL14R 30
1850#define R_PARISC_LTOFF21L 34
1851#define R_PARISC_LTOFF14R 38
1852#define R_PARISC_SECREL32 41
1853#define R_PARISC_SEGBASE 48
1854#define R_PARISC_SEGREL32 49
1855#define R_PARISC_PLTOFF21L 50
1856#define R_PARISC_PLTOFF14R 54
1857#define R_PARISC_LTOFF_FPTR32 57
1858#define R_PARISC_LTOFF_FPTR21L 58
1859#define R_PARISC_LTOFF_FPTR14R 62
1860#define R_PARISC_FPTR64 64
1861#define R_PARISC_PLABEL32 65
1862#define R_PARISC_PLABEL21L 66
1863#define R_PARISC_PLABEL14R 70
1864#define R_PARISC_PCREL64 72
1865#define R_PARISC_PCREL22F 74
1866#define R_PARISC_PCREL14WR 75
1867#define R_PARISC_PCREL14DR 76
1868#define R_PARISC_PCREL16F 77
1869#define R_PARISC_PCREL16WF 78
1870#define R_PARISC_PCREL16DF 79
1871#define R_PARISC_DIR64 80
1872#define R_PARISC_DIR14WR 83
1873#define R_PARISC_DIR14DR 84
1874#define R_PARISC_DIR16F 85
1875#define R_PARISC_DIR16WF 86
1876#define R_PARISC_DIR16DF 87
1877#define R_PARISC_GPREL64 88
1878#define R_PARISC_GPREL14WR 91
1879#define R_PARISC_GPREL14DR 92
1880#define R_PARISC_GPREL16F 93
1881#define R_PARISC_GPREL16WF 94
1882#define R_PARISC_GPREL16DF 95
1883#define R_PARISC_LTOFF64 96
1884#define R_PARISC_LTOFF14WR 99
1885#define R_PARISC_LTOFF14DR 100
1886#define R_PARISC_LTOFF16F 101
1887#define R_PARISC_LTOFF16WF 102
1888#define R_PARISC_LTOFF16DF 103
1889#define R_PARISC_SECREL64 104
1890#define R_PARISC_SEGREL64 112
1891#define R_PARISC_PLTOFF14WR 115
1892#define R_PARISC_PLTOFF14DR 116
1893#define R_PARISC_PLTOFF16F 117
1894#define R_PARISC_PLTOFF16WF 118
1895#define R_PARISC_PLTOFF16DF 119
1896#define R_PARISC_LTOFF_FPTR64 120
1897#define R_PARISC_LTOFF_FPTR14WR 123
1898#define R_PARISC_LTOFF_FPTR14DR 124
1899#define R_PARISC_LTOFF_FPTR16F 125
1900#define R_PARISC_LTOFF_FPTR16WF 126
1901#define R_PARISC_LTOFF_FPTR16DF 127
1902#define R_PARISC_LORESERVE 128
1903#define R_PARISC_COPY 128
1904#define R_PARISC_IPLT 129
1905#define R_PARISC_EPLT 130
1906#define R_PARISC_TPREL32 153
1907#define R_PARISC_TPREL21L 154
1908#define R_PARISC_TPREL14R 158
1909#define R_PARISC_LTOFF_TP21L 162
1910#define R_PARISC_LTOFF_TP14R 166
1911#define R_PARISC_LTOFF_TP14F 167
1912#define R_PARISC_TPREL64 216
1913#define R_PARISC_TPREL14WR 219
1914#define R_PARISC_TPREL14DR 220
1915#define R_PARISC_TPREL16F 221
1916#define R_PARISC_TPREL16WF 222
1917#define R_PARISC_TPREL16DF 223
1918#define R_PARISC_LTOFF_TP64 224
1919#define R_PARISC_LTOFF_TP14WR 227
1920#define R_PARISC_LTOFF_TP14DR 228
1921#define R_PARISC_LTOFF_TP16F 229
1922#define R_PARISC_LTOFF_TP16WF 230
1923#define R_PARISC_LTOFF_TP16DF 231
1924#define R_PARISC_GNU_VTENTRY 232
1925#define R_PARISC_GNU_VTINHERIT 233
1926#define R_PARISC_TLS_GD21L 234
1927#define R_PARISC_TLS_GD14R 235
1928#define R_PARISC_TLS_GDCALL 236
1929#define R_PARISC_TLS_LDM21L 237
1930#define R_PARISC_TLS_LDM14R 238
1931#define R_PARISC_TLS_LDMCALL 239
1932#define R_PARISC_TLS_LDO21L 240
1933#define R_PARISC_TLS_LDO14R 241
1934#define R_PARISC_TLS_DTPMOD32 242
1935#define R_PARISC_TLS_DTPMOD64 243
1936#define R_PARISC_TLS_DTPOFF32 244
1937#define R_PARISC_TLS_DTPOFF64 245
1938#define R_PARISC_TLS_LE21L R_PARISC_TPREL21L
1939#define R_PARISC_TLS_LE14R R_PARISC_TPREL14R
1940#define R_PARISC_TLS_IE21L R_PARISC_LTOFF_TP21L
1941#define R_PARISC_TLS_IE14R R_PARISC_LTOFF_TP14R
1942#define R_PARISC_TLS_TPREL32 R_PARISC_TPREL32
1943#define R_PARISC_TLS_TPREL64 R_PARISC_TPREL64
1944#define R_PARISC_HIRESERVE 255
1945
1946
1947
1948#define PT_HP_TLS (PT_LOOS + 0x0)
1949#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
1950#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
1951#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
1952#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
1953#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
1954#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
1955#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
1956#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
1957#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
1958#define PT_HP_PARALLEL (PT_LOOS + 0x10)
1959#define PT_HP_FASTBIND (PT_LOOS + 0x11)
1960#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
1961#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
1962#define PT_HP_STACK (PT_LOOS + 0x14)
1963
1964#define PT_PARISC_ARCHEXT 0x70000000
1965#define PT_PARISC_UNWIND 0x70000001
1966
1967
1968
1969#define PF_PARISC_SBP 0x08000000
1970
1971#define PF_HP_PAGE_SIZE 0x00100000
1972#define PF_HP_FAR_SHARED 0x00200000
1973#define PF_HP_NEAR_SHARED 0x00400000
1974#define PF_HP_CODE 0x01000000
1975#define PF_HP_MODIFY 0x02000000
1976#define PF_HP_LAZYSWAP 0x04000000
1977#define PF_HP_SBP 0x08000000
1978
1979
1980
1981
1982
1983
1984#define EF_ALPHA_32BIT 1
1985#define EF_ALPHA_CANRELAX 2
1986
1987
1988
1989
1990#define SHT_ALPHA_DEBUG 0x70000001
1991#define SHT_ALPHA_REGINFO 0x70000002
1992
1993
1994
1995#define SHF_ALPHA_GPREL 0x10000000
1996
1997
1998#define STO_ALPHA_NOPV 0x80
1999#define STO_ALPHA_STD_GPLOAD 0x88
2000
2001
2002
2003#define R_ALPHA_NONE 0
2004#define R_ALPHA_REFLONG 1
2005#define R_ALPHA_REFQUAD 2
2006#define R_ALPHA_GPREL32 3
2007#define R_ALPHA_LITERAL 4
2008#define R_ALPHA_LITUSE 5
2009#define R_ALPHA_GPDISP 6
2010#define R_ALPHA_BRADDR 7
2011#define R_ALPHA_HINT 8
2012#define R_ALPHA_SREL16 9
2013#define R_ALPHA_SREL32 10
2014#define R_ALPHA_SREL64 11
2015#define R_ALPHA_GPRELHIGH 17
2016#define R_ALPHA_GPRELLOW 18
2017#define R_ALPHA_GPREL16 19
2018#define R_ALPHA_COPY 24
2019#define R_ALPHA_GLOB_DAT 25
2020#define R_ALPHA_JMP_SLOT 26
2021#define R_ALPHA_RELATIVE 27
2022#define R_ALPHA_TLS_GD_HI 28
2023#define R_ALPHA_TLSGD 29
2024#define R_ALPHA_TLS_LDM 30
2025#define R_ALPHA_DTPMOD64 31
2026#define R_ALPHA_GOTDTPREL 32
2027#define R_ALPHA_DTPREL64 33
2028#define R_ALPHA_DTPRELHI 34
2029#define R_ALPHA_DTPRELLO 35
2030#define R_ALPHA_DTPREL16 36
2031#define R_ALPHA_GOTTPREL 37
2032#define R_ALPHA_TPREL64 38
2033#define R_ALPHA_TPRELHI 39
2034#define R_ALPHA_TPRELLO 40
2035#define R_ALPHA_TPREL16 41
2036
2037#define R_ALPHA_NUM 46
2038
2039
2040#define LITUSE_ALPHA_ADDR 0
2041#define LITUSE_ALPHA_BASE 1
2042#define LITUSE_ALPHA_BYTOFF 2
2043#define LITUSE_ALPHA_JSR 3
2044#define LITUSE_ALPHA_TLS_GD 4
2045#define LITUSE_ALPHA_TLS_LDM 5
2046
2047
2048#define DT_ALPHA_PLTRO (DT_LOPROC + 0)
2049#define DT_ALPHA_NUM 1
2050
2051
2052
2053
2054#define EF_PPC_EMB 0x80000000
2055
2056
2057#define EF_PPC_RELOCATABLE 0x00010000
2058#define EF_PPC_RELOCATABLE_LIB 0x00008000
2059
2060
2061
2062#define R_PPC_NONE 0
2063#define R_PPC_ADDR32 1
2064#define R_PPC_ADDR24 2
2065#define R_PPC_ADDR16 3
2066#define R_PPC_ADDR16_LO 4
2067#define R_PPC_ADDR16_HI 5
2068#define R_PPC_ADDR16_HA 6
2069#define R_PPC_ADDR14 7
2070#define R_PPC_ADDR14_BRTAKEN 8
2071#define R_PPC_ADDR14_BRNTAKEN 9
2072#define R_PPC_REL24 10
2073#define R_PPC_REL14 11
2074#define R_PPC_REL14_BRTAKEN 12
2075#define R_PPC_REL14_BRNTAKEN 13
2076#define R_PPC_GOT16 14
2077#define R_PPC_GOT16_LO 15
2078#define R_PPC_GOT16_HI 16
2079#define R_PPC_GOT16_HA 17
2080#define R_PPC_PLTREL24 18
2081#define R_PPC_COPY 19
2082#define R_PPC_GLOB_DAT 20
2083#define R_PPC_JMP_SLOT 21
2084#define R_PPC_RELATIVE 22
2085#define R_PPC_LOCAL24PC 23
2086#define R_PPC_UADDR32 24
2087#define R_PPC_UADDR16 25
2088#define R_PPC_REL32 26
2089#define R_PPC_PLT32 27
2090#define R_PPC_PLTREL32 28
2091#define R_PPC_PLT16_LO 29
2092#define R_PPC_PLT16_HI 30
2093#define R_PPC_PLT16_HA 31
2094#define R_PPC_SDAREL16 32
2095#define R_PPC_SECTOFF 33
2096#define R_PPC_SECTOFF_LO 34
2097#define R_PPC_SECTOFF_HI 35
2098#define R_PPC_SECTOFF_HA 36
2099
2100
2101#define R_PPC_TLS 67
2102#define R_PPC_DTPMOD32 68
2103#define R_PPC_TPREL16 69
2104#define R_PPC_TPREL16_LO 70
2105#define R_PPC_TPREL16_HI 71
2106#define R_PPC_TPREL16_HA 72
2107#define R_PPC_TPREL32 73
2108#define R_PPC_DTPREL16 74
2109#define R_PPC_DTPREL16_LO 75
2110#define R_PPC_DTPREL16_HI 76
2111#define R_PPC_DTPREL16_HA 77
2112#define R_PPC_DTPREL32 78
2113#define R_PPC_GOT_TLSGD16 79
2114#define R_PPC_GOT_TLSGD16_LO 80
2115#define R_PPC_GOT_TLSGD16_HI 81
2116#define R_PPC_GOT_TLSGD16_HA 82
2117#define R_PPC_GOT_TLSLD16 83
2118#define R_PPC_GOT_TLSLD16_LO 84
2119#define R_PPC_GOT_TLSLD16_HI 85
2120#define R_PPC_GOT_TLSLD16_HA 86
2121#define R_PPC_GOT_TPREL16 87
2122#define R_PPC_GOT_TPREL16_LO 88
2123#define R_PPC_GOT_TPREL16_HI 89
2124#define R_PPC_GOT_TPREL16_HA 90
2125#define R_PPC_GOT_DTPREL16 91
2126#define R_PPC_GOT_DTPREL16_LO 92
2127#define R_PPC_GOT_DTPREL16_HI 93
2128#define R_PPC_GOT_DTPREL16_HA 94
2129#define R_PPC_TLSGD 95
2130#define R_PPC_TLSLD 96
2131
2132
2133#define R_PPC_EMB_NADDR32 101
2134#define R_PPC_EMB_NADDR16 102
2135#define R_PPC_EMB_NADDR16_LO 103
2136#define R_PPC_EMB_NADDR16_HI 104
2137#define R_PPC_EMB_NADDR16_HA 105
2138#define R_PPC_EMB_SDAI16 106
2139#define R_PPC_EMB_SDA2I16 107
2140#define R_PPC_EMB_SDA2REL 108
2141#define R_PPC_EMB_SDA21 109
2142#define R_PPC_EMB_MRKREF 110
2143#define R_PPC_EMB_RELSEC16 111
2144#define R_PPC_EMB_RELST_LO 112
2145#define R_PPC_EMB_RELST_HI 113
2146#define R_PPC_EMB_RELST_HA 114
2147#define R_PPC_EMB_BIT_FLD 115
2148#define R_PPC_EMB_RELSDA 116
2149
2150
2151#define R_PPC_DIAB_SDA21_LO 180
2152#define R_PPC_DIAB_SDA21_HI 181
2153#define R_PPC_DIAB_SDA21_HA 182
2154#define R_PPC_DIAB_RELSDA_LO 183
2155#define R_PPC_DIAB_RELSDA_HI 184
2156#define R_PPC_DIAB_RELSDA_HA 185
2157
2158
2159#define R_PPC_IRELATIVE 248
2160
2161
2162#define R_PPC_REL16 249
2163#define R_PPC_REL16_LO 250
2164#define R_PPC_REL16_HI 251
2165#define R_PPC_REL16_HA 252
2166
2167
2168
2169#define R_PPC_TOC16 255
2170
2171
2172#define DT_PPC_GOT (DT_LOPROC + 0)
2173#define DT_PPC_OPT (DT_LOPROC + 1)
2174#define DT_PPC_NUM 2
2175
2176#define PPC_OPT_TLS 1
2177
2178
2179#define R_PPC64_NONE R_PPC_NONE
2180#define R_PPC64_ADDR32 R_PPC_ADDR32
2181#define R_PPC64_ADDR24 R_PPC_ADDR24
2182#define R_PPC64_ADDR16 R_PPC_ADDR16
2183#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO
2184#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI
2185#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA
2186#define R_PPC64_ADDR14 R_PPC_ADDR14
2187#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN
2188#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN
2189#define R_PPC64_REL24 R_PPC_REL24
2190#define R_PPC64_REL14 R_PPC_REL14
2191#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN
2192#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN
2193#define R_PPC64_GOT16 R_PPC_GOT16
2194#define R_PPC64_GOT16_LO R_PPC_GOT16_LO
2195#define R_PPC64_GOT16_HI R_PPC_GOT16_HI
2196#define R_PPC64_GOT16_HA R_PPC_GOT16_HA
2197
2198#define R_PPC64_COPY R_PPC_COPY
2199#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT
2200#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT
2201#define R_PPC64_RELATIVE R_PPC_RELATIVE
2202
2203#define R_PPC64_UADDR32 R_PPC_UADDR32
2204#define R_PPC64_UADDR16 R_PPC_UADDR16
2205#define R_PPC64_REL32 R_PPC_REL32
2206#define R_PPC64_PLT32 R_PPC_PLT32
2207#define R_PPC64_PLTREL32 R_PPC_PLTREL32
2208#define R_PPC64_PLT16_LO R_PPC_PLT16_LO
2209#define R_PPC64_PLT16_HI R_PPC_PLT16_HI
2210#define R_PPC64_PLT16_HA R_PPC_PLT16_HA
2211
2212#define R_PPC64_SECTOFF R_PPC_SECTOFF
2213#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO
2214#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI
2215#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA
2216#define R_PPC64_ADDR30 37
2217#define R_PPC64_ADDR64 38
2218#define R_PPC64_ADDR16_HIGHER 39
2219#define R_PPC64_ADDR16_HIGHERA 40
2220#define R_PPC64_ADDR16_HIGHEST 41
2221#define R_PPC64_ADDR16_HIGHESTA 42
2222#define R_PPC64_UADDR64 43
2223#define R_PPC64_REL64 44
2224#define R_PPC64_PLT64 45
2225#define R_PPC64_PLTREL64 46
2226#define R_PPC64_TOC16 47
2227#define R_PPC64_TOC16_LO 48
2228#define R_PPC64_TOC16_HI 49
2229#define R_PPC64_TOC16_HA 50
2230#define R_PPC64_TOC 51
2231#define R_PPC64_PLTGOT16 52
2232#define R_PPC64_PLTGOT16_LO 53
2233#define R_PPC64_PLTGOT16_HI 54
2234#define R_PPC64_PLTGOT16_HA 55
2235
2236#define R_PPC64_ADDR16_DS 56
2237#define R_PPC64_ADDR16_LO_DS 57
2238#define R_PPC64_GOT16_DS 58
2239#define R_PPC64_GOT16_LO_DS 59
2240#define R_PPC64_PLT16_LO_DS 60
2241#define R_PPC64_SECTOFF_DS 61
2242#define R_PPC64_SECTOFF_LO_DS 62
2243#define R_PPC64_TOC16_DS 63
2244#define R_PPC64_TOC16_LO_DS 64
2245#define R_PPC64_PLTGOT16_DS 65
2246#define R_PPC64_PLTGOT16_LO_DS 66
2247
2248
2249#define R_PPC64_TLS 67
2250#define R_PPC64_DTPMOD64 68
2251#define R_PPC64_TPREL16 69
2252#define R_PPC64_TPREL16_LO 70
2253#define R_PPC64_TPREL16_HI 71
2254#define R_PPC64_TPREL16_HA 72
2255#define R_PPC64_TPREL64 73
2256#define R_PPC64_DTPREL16 74
2257#define R_PPC64_DTPREL16_LO 75
2258#define R_PPC64_DTPREL16_HI 76
2259#define R_PPC64_DTPREL16_HA 77
2260#define R_PPC64_DTPREL64 78
2261#define R_PPC64_GOT_TLSGD16 79
2262#define R_PPC64_GOT_TLSGD16_LO 80
2263#define R_PPC64_GOT_TLSGD16_HI 81
2264#define R_PPC64_GOT_TLSGD16_HA 82
2265#define R_PPC64_GOT_TLSLD16 83
2266#define R_PPC64_GOT_TLSLD16_LO 84
2267#define R_PPC64_GOT_TLSLD16_HI 85
2268#define R_PPC64_GOT_TLSLD16_HA 86
2269#define R_PPC64_GOT_TPREL16_DS 87
2270#define R_PPC64_GOT_TPREL16_LO_DS 88
2271#define R_PPC64_GOT_TPREL16_HI 89
2272#define R_PPC64_GOT_TPREL16_HA 90
2273#define R_PPC64_GOT_DTPREL16_DS 91
2274#define R_PPC64_GOT_DTPREL16_LO_DS 92
2275#define R_PPC64_GOT_DTPREL16_HI 93
2276#define R_PPC64_GOT_DTPREL16_HA 94
2277#define R_PPC64_TPREL16_DS 95
2278#define R_PPC64_TPREL16_LO_DS 96
2279#define R_PPC64_TPREL16_HIGHER 97
2280#define R_PPC64_TPREL16_HIGHERA 98
2281#define R_PPC64_TPREL16_HIGHEST 99
2282#define R_PPC64_TPREL16_HIGHESTA 100
2283#define R_PPC64_DTPREL16_DS 101
2284#define R_PPC64_DTPREL16_LO_DS 102
2285#define R_PPC64_DTPREL16_HIGHER 103
2286#define R_PPC64_DTPREL16_HIGHERA 104
2287#define R_PPC64_DTPREL16_HIGHEST 105
2288#define R_PPC64_DTPREL16_HIGHESTA 106
2289#define R_PPC64_TLSGD 107
2290#define R_PPC64_TLSLD 108
2291#define R_PPC64_TOCSAVE 109
2292#define R_PPC64_ADDR16_HIGH 110
2293#define R_PPC64_ADDR16_HIGHA 111
2294#define R_PPC64_TPREL16_HIGH 112
2295#define R_PPC64_TPREL16_HIGHA 113
2296#define R_PPC64_DTPREL16_HIGH 114
2297#define R_PPC64_DTPREL16_HIGHA 115
2298
2299
2300#define R_PPC64_JMP_IREL 247
2301#define R_PPC64_IRELATIVE 248
2302#define R_PPC64_REL16 249
2303#define R_PPC64_REL16_LO 250
2304#define R_PPC64_REL16_HI 251
2305#define R_PPC64_REL16_HA 252
2306
2307#define EF_PPC64_ABI 3
2308
2309#define DT_PPC64_GLINK (DT_LOPROC + 0)
2310#define DT_PPC64_OPD (DT_LOPROC + 1)
2311#define DT_PPC64_OPDSZ (DT_LOPROC + 2)
2312#define DT_PPC64_OPT (DT_LOPROC + 3)
2313#define DT_PPC64_NUM 4
2314
2315#define PPC64_OPT_TLS 1
2316#define PPC64_OPT_MULTI_TOC 2
2317#define PPC64_OPT_LOCALENTRY 4
2318
2319#define STO_PPC64_LOCAL_BIT 5
2320#define STO_PPC64_LOCAL_MASK 0xe0
2321#define PPC64_LOCAL_ENTRY_OFFSET(x) (1 << (((x)&0xe0)>>5) & 0xfc)
2322
2323
2324#define EF_ARM_RELEXEC 0x01
2325#define EF_ARM_HASENTRY 0x02
2326#define EF_ARM_INTERWORK 0x04
2327#define EF_ARM_APCS_26 0x08
2328#define EF_ARM_APCS_FLOAT 0x10
2329#define EF_ARM_PIC 0x20
2330#define EF_ARM_ALIGN8 0x40
2331#define EF_ARM_NEW_ABI 0x80
2332#define EF_ARM_OLD_ABI 0x100
2333#define EF_ARM_SOFT_FLOAT 0x200
2334#define EF_ARM_VFP_FLOAT 0x400
2335#define EF_ARM_MAVERICK_FLOAT 0x800
2336
2337#define EF_ARM_ABI_FLOAT_SOFT 0x200
2338#define EF_ARM_ABI_FLOAT_HARD 0x400
2339
2340
2341#define EF_ARM_SYMSARESORTED 0x04
2342#define EF_ARM_DYNSYMSUSESEGIDX 0x08
2343#define EF_ARM_MAPSYMSFIRST 0x10
2344#define EF_ARM_EABIMASK 0XFF000000
2345
2346
2347#define EF_ARM_BE8 0x00800000
2348#define EF_ARM_LE8 0x00400000
2349
2350#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
2351#define EF_ARM_EABI_UNKNOWN 0x00000000
2352#define EF_ARM_EABI_VER1 0x01000000
2353#define EF_ARM_EABI_VER2 0x02000000
2354#define EF_ARM_EABI_VER3 0x03000000
2355#define EF_ARM_EABI_VER4 0x04000000
2356#define EF_ARM_EABI_VER5 0x05000000
2357
2358
2359#define STT_ARM_TFUNC STT_LOPROC
2360#define STT_ARM_16BIT STT_HIPROC
2361
2362
2363#define SHF_ARM_ENTRYSECT 0x10000000
2364#define SHF_ARM_COMDEF 0x80000000
2365
2366
2367
2368#define PF_ARM_SB 0x10000000
2369
2370#define PF_ARM_PI 0x20000000
2371#define PF_ARM_ABS 0x40000000
2372
2373
2374#define PT_ARM_EXIDX (PT_LOPROC + 1)
2375
2376
2377#define SHT_ARM_EXIDX (SHT_LOPROC + 1)
2378#define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2)
2379#define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3)
2380
2381#define R_AARCH64_NONE 0
2382#define R_AARCH64_P32_ABS32 1
2383#define R_AARCH64_P32_COPY 180
2384#define R_AARCH64_P32_GLOB_DAT 181
2385#define R_AARCH64_P32_JUMP_SLOT 182
2386#define R_AARCH64_P32_RELATIVE 183
2387#define R_AARCH64_P32_TLS_DTPMOD 184
2388#define R_AARCH64_P32_TLS_DTPREL 185
2389#define R_AARCH64_P32_TLS_TPREL 186
2390#define R_AARCH64_P32_TLSDESC 187
2391#define R_AARCH64_P32_IRELATIVE 188
2392#define R_AARCH64_ABS64 257
2393#define R_AARCH64_ABS32 258
2394#define R_AARCH64_ABS16 259
2395#define R_AARCH64_PREL64 260
2396#define R_AARCH64_PREL32 261
2397#define R_AARCH64_PREL16 262
2398#define R_AARCH64_MOVW_UABS_G0 263
2399#define R_AARCH64_MOVW_UABS_G0_NC 264
2400#define R_AARCH64_MOVW_UABS_G1 265
2401#define R_AARCH64_MOVW_UABS_G1_NC 266
2402#define R_AARCH64_MOVW_UABS_G2 267
2403#define R_AARCH64_MOVW_UABS_G2_NC 268
2404#define R_AARCH64_MOVW_UABS_G3 269
2405#define R_AARCH64_MOVW_SABS_G0 270
2406#define R_AARCH64_MOVW_SABS_G1 271
2407#define R_AARCH64_MOVW_SABS_G2 272
2408#define R_AARCH64_LD_PREL_LO19 273
2409#define R_AARCH64_ADR_PREL_LO21 274
2410#define R_AARCH64_ADR_PREL_PG_HI21 275
2411#define R_AARCH64_ADR_PREL_PG_HI21_NC 276
2412#define R_AARCH64_ADD_ABS_LO12_NC 277
2413#define R_AARCH64_LDST8_ABS_LO12_NC 278
2414#define R_AARCH64_TSTBR14 279
2415#define R_AARCH64_CONDBR19 280
2416#define R_AARCH64_JUMP26 282
2417#define R_AARCH64_CALL26 283
2418#define R_AARCH64_LDST16_ABS_LO12_NC 284
2419#define R_AARCH64_LDST32_ABS_LO12_NC 285
2420#define R_AARCH64_LDST64_ABS_LO12_NC 286
2421#define R_AARCH64_MOVW_PREL_G0 287
2422#define R_AARCH64_MOVW_PREL_G0_NC 288
2423#define R_AARCH64_MOVW_PREL_G1 289
2424#define R_AARCH64_MOVW_PREL_G1_NC 290
2425#define R_AARCH64_MOVW_PREL_G2 291
2426#define R_AARCH64_MOVW_PREL_G2_NC 292
2427#define R_AARCH64_MOVW_PREL_G3 293
2428#define R_AARCH64_LDST128_ABS_LO12_NC 299
2429#define R_AARCH64_MOVW_GOTOFF_G0 300
2430#define R_AARCH64_MOVW_GOTOFF_G0_NC 301
2431#define R_AARCH64_MOVW_GOTOFF_G1 302
2432#define R_AARCH64_MOVW_GOTOFF_G1_NC 303
2433#define R_AARCH64_MOVW_GOTOFF_G2 304
2434#define R_AARCH64_MOVW_GOTOFF_G2_NC 305
2435#define R_AARCH64_MOVW_GOTOFF_G3 306
2436#define R_AARCH64_GOTREL64 307
2437#define R_AARCH64_GOTREL32 308
2438#define R_AARCH64_GOT_LD_PREL19 309
2439#define R_AARCH64_LD64_GOTOFF_LO15 310
2440#define R_AARCH64_ADR_GOT_PAGE 311
2441#define R_AARCH64_LD64_GOT_LO12_NC 312
2442#define R_AARCH64_LD64_GOTPAGE_LO15 313
2443#define R_AARCH64_TLSGD_ADR_PREL21 512
2444#define R_AARCH64_TLSGD_ADR_PAGE21 513
2445#define R_AARCH64_TLSGD_ADD_LO12_NC 514
2446#define R_AARCH64_TLSGD_MOVW_G1 515
2447#define R_AARCH64_TLSGD_MOVW_G0_NC 516
2448#define R_AARCH64_TLSLD_ADR_PREL21 517
2449#define R_AARCH64_TLSLD_ADR_PAGE21 518
2450#define R_AARCH64_TLSLD_ADD_LO12_NC 519
2451#define R_AARCH64_TLSLD_MOVW_G1 520
2452#define R_AARCH64_TLSLD_MOVW_G0_NC 521
2453#define R_AARCH64_TLSLD_LD_PREL19 522
2454#define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523
2455#define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524
2456#define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525
2457#define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526
2458#define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527
2459#define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528
2460#define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529
2461#define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530
2462#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531
2463#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532
2464#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533
2465#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534
2466#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535
2467#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536
2468#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537
2469#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538
2470#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539
2471#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540
2472#define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541
2473#define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542
2474#define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543
2475#define R_AARCH64_TLSLE_MOVW_TPREL_G2 544
2476#define R_AARCH64_TLSLE_MOVW_TPREL_G1 545
2477#define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546
2478#define R_AARCH64_TLSLE_MOVW_TPREL_G0 547
2479#define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548
2480#define R_AARCH64_TLSLE_ADD_TPREL_HI12 549
2481#define R_AARCH64_TLSLE_ADD_TPREL_LO12 550
2482#define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551
2483#define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552
2484#define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553
2485#define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554
2486#define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555
2487#define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556
2488#define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557
2489#define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558
2490#define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559
2491#define R_AARCH64_TLSDESC_LD_PREL19 560
2492#define R_AARCH64_TLSDESC_ADR_PREL21 561
2493#define R_AARCH64_TLSDESC_ADR_PAGE21 562
2494#define R_AARCH64_TLSDESC_LD64_LO12 563
2495#define R_AARCH64_TLSDESC_ADD_LO12 564
2496#define R_AARCH64_TLSDESC_OFF_G1 565
2497#define R_AARCH64_TLSDESC_OFF_G0_NC 566
2498#define R_AARCH64_TLSDESC_LDR 567
2499#define R_AARCH64_TLSDESC_ADD 568
2500#define R_AARCH64_TLSDESC_CALL 569
2501#define R_AARCH64_TLSLE_LDST128_TPREL_LO12 570
2502#define R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC 571
2503#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12 572
2504#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC 573
2505#define R_AARCH64_COPY 1024
2506#define R_AARCH64_GLOB_DAT 1025
2507#define R_AARCH64_JUMP_SLOT 1026
2508#define R_AARCH64_RELATIVE 1027
2509#define R_AARCH64_TLS_DTPMOD 1028
2510#define R_AARCH64_TLS_DTPMOD64 1028
2511#define R_AARCH64_TLS_DTPREL 1029
2512#define R_AARCH64_TLS_DTPREL64 1029
2513#define R_AARCH64_TLS_TPREL 1030
2514#define R_AARCH64_TLS_TPREL64 1030
2515#define R_AARCH64_TLSDESC 1031
2516
2517
2518#define R_ARM_NONE 0
2519#define R_ARM_PC24 1
2520#define R_ARM_ABS32 2
2521#define R_ARM_REL32 3
2522#define R_ARM_PC13 4
2523#define R_ARM_ABS16 5
2524#define R_ARM_ABS12 6
2525#define R_ARM_THM_ABS5 7
2526#define R_ARM_ABS8 8
2527#define R_ARM_SBREL32 9
2528#define R_ARM_THM_PC22 10
2529#define R_ARM_THM_PC8 11
2530#define R_ARM_AMP_VCALL9 12
2531#define R_ARM_TLS_DESC 13
2532#define R_ARM_THM_SWI8 14
2533#define R_ARM_XPC25 15
2534#define R_ARM_THM_XPC22 16
2535#define R_ARM_TLS_DTPMOD32 17
2536#define R_ARM_TLS_DTPOFF32 18
2537#define R_ARM_TLS_TPOFF32 19
2538#define R_ARM_COPY 20
2539#define R_ARM_GLOB_DAT 21
2540#define R_ARM_JUMP_SLOT 22
2541#define R_ARM_RELATIVE 23
2542#define R_ARM_GOTOFF 24
2543#define R_ARM_GOTPC 25
2544#define R_ARM_GOT32 26
2545#define R_ARM_PLT32 27
2546#define R_ARM_CALL 28
2547#define R_ARM_JUMP24 29
2548#define R_ARM_THM_JUMP24 30
2549#define R_ARM_BASE_ABS 31
2550#define R_ARM_ALU_PCREL_7_0 32
2551#define R_ARM_ALU_PCREL_15_8 33
2552#define R_ARM_ALU_PCREL_23_15 34
2553#define R_ARM_LDR_SBREL_11_0 35
2554#define R_ARM_ALU_SBREL_19_12 36
2555#define R_ARM_ALU_SBREL_27_20 37
2556#define R_ARM_TARGET1 38
2557#define R_ARM_SBREL31 39
2558#define R_ARM_V4BX 40
2559#define R_ARM_TARGET2 41
2560#define R_ARM_PREL31 42
2561#define R_ARM_MOVW_ABS_NC 43
2562#define R_ARM_MOVT_ABS 44
2563#define R_ARM_MOVW_PREL_NC 45
2564#define R_ARM_MOVT_PREL 46
2565#define R_ARM_THM_MOVW_ABS_NC 47
2566#define R_ARM_THM_MOVT_ABS 48
2567#define R_ARM_THM_MOVW_PREL_NC 49
2568#define R_ARM_THM_MOVT_PREL 50
2569#define R_ARM_THM_JUMP19 51
2570#define R_ARM_THM_JUMP6 52
2571#define R_ARM_THM_ALU_PREL_11_0 53
2572#define R_ARM_THM_PC12 54
2573#define R_ARM_ABS32_NOI 55
2574#define R_ARM_REL32_NOI 56
2575#define R_ARM_ALU_PC_G0_NC 57
2576#define R_ARM_ALU_PC_G0 58
2577#define R_ARM_ALU_PC_G1_NC 59
2578#define R_ARM_ALU_PC_G1 60
2579#define R_ARM_ALU_PC_G2 61
2580#define R_ARM_LDR_PC_G1 62
2581#define R_ARM_LDR_PC_G2 63
2582#define R_ARM_LDRS_PC_G0 64
2583#define R_ARM_LDRS_PC_G1 65
2584#define R_ARM_LDRS_PC_G2 66
2585#define R_ARM_LDC_PC_G0 67
2586#define R_ARM_LDC_PC_G1 68
2587#define R_ARM_LDC_PC_G2 69
2588#define R_ARM_ALU_SB_G0_NC 70
2589#define R_ARM_ALU_SB_G0 71
2590#define R_ARM_ALU_SB_G1_NC 72
2591#define R_ARM_ALU_SB_G1 73
2592#define R_ARM_ALU_SB_G2 74
2593#define R_ARM_LDR_SB_G0 75
2594#define R_ARM_LDR_SB_G1 76
2595#define R_ARM_LDR_SB_G2 77
2596#define R_ARM_LDRS_SB_G0 78
2597#define R_ARM_LDRS_SB_G1 79
2598#define R_ARM_LDRS_SB_G2 80
2599#define R_ARM_LDC_SB_G0 81
2600#define R_ARM_LDC_SB_G1 82
2601#define R_ARM_LDC_SB_G2 83
2602#define R_ARM_MOVW_BREL_NC 84
2603#define R_ARM_MOVT_BREL 85
2604#define R_ARM_MOVW_BREL 86
2605#define R_ARM_THM_MOVW_BREL_NC 87
2606#define R_ARM_THM_MOVT_BREL 88
2607#define R_ARM_THM_MOVW_BREL 89
2608#define R_ARM_TLS_GOTDESC 90
2609#define R_ARM_TLS_CALL 91
2610#define R_ARM_TLS_DESCSEQ 92
2611#define R_ARM_THM_TLS_CALL 93
2612#define R_ARM_PLT32_ABS 94
2613#define R_ARM_GOT_ABS 95
2614#define R_ARM_GOT_PREL 96
2615#define R_ARM_GOT_BREL12 97
2616#define R_ARM_GOTOFF12 98
2617#define R_ARM_GOTRELAX 99
2618#define R_ARM_GNU_VTENTRY 100
2619#define R_ARM_GNU_VTINHERIT 101
2620#define R_ARM_THM_PC11 102
2621#define R_ARM_THM_PC9 103
2622#define R_ARM_TLS_GD32 104
2623
2624#define R_ARM_TLS_LDM32 105
2625
2626#define R_ARM_TLS_LDO32 106
2627
2628#define R_ARM_TLS_IE32 107
2629
2630#define R_ARM_TLS_LE32 108
2631#define R_ARM_TLS_LDO12 109
2632#define R_ARM_TLS_LE12 110
2633#define R_ARM_TLS_IE12GP 111
2634#define R_ARM_ME_TOO 128
2635#define R_ARM_THM_TLS_DESCSEQ 129
2636#define R_ARM_THM_TLS_DESCSEQ16 129
2637#define R_ARM_THM_TLS_DESCSEQ32 130
2638#define R_ARM_THM_GOT_BREL12 131
2639#define R_ARM_IRELATIVE 160
2640#define R_ARM_RXPC25 249
2641#define R_ARM_RSBREL32 250
2642#define R_ARM_THM_RPC22 251
2643#define R_ARM_RREL32 252
2644#define R_ARM_RABS22 253
2645#define R_ARM_RPC24 254
2646#define R_ARM_RBASE 255
2647
2648#define R_ARM_NUM 256
2649
2650
2651#define R_CKCORE_NONE 0
2652#define R_CKCORE_ADDR32 1
2653#define R_CKCORE_PCRELIMM8BY4 2
2654#define R_CKCORE_PCRELIMM11BY2 3
2655#define R_CKCORE_PCREL32 5
2656#define R_CKCORE_PCRELJSR_IMM11BY2 6
2657#define R_CKCORE_RELATIVE 9
2658#define R_CKCORE_COPY 10
2659#define R_CKCORE_GLOB_DAT 11
2660#define R_CKCORE_JUMP_SLOT 12
2661#define R_CKCORE_GOTOFF 13
2662#define R_CKCORE_GOTPC 14
2663#define R_CKCORE_GOT32 15
2664#define R_CKCORE_PLT32 16
2665#define R_CKCORE_ADDRGOT 17
2666#define R_CKCORE_ADDRPLT 18
2667#define R_CKCORE_PCREL_IMM26BY2 19
2668#define R_CKCORE_PCREL_IMM16BY2 20
2669#define R_CKCORE_PCREL_IMM16BY4 21
2670#define R_CKCORE_PCREL_IMM10BY2 22
2671#define R_CKCORE_PCREL_IMM10BY4 23
2672#define R_CKCORE_ADDR_HI16 24
2673#define R_CKCORE_ADDR_LO16 25
2674#define R_CKCORE_GOTPC_HI16 26
2675#define R_CKCORE_GOTPC_LO16 27
2676#define R_CKCORE_GOTOFF_HI16 28
2677#define R_CKCORE_GOTOFF_LO16 29
2678#define R_CKCORE_GOT12 30
2679#define R_CKCORE_GOT_HI16 31
2680#define R_CKCORE_GOT_LO16 32
2681#define R_CKCORE_PLT12 33
2682#define R_CKCORE_PLT_HI16 34
2683#define R_CKCORE_PLT_LO16 35
2684#define R_CKCORE_ADDRGOT_HI16 36
2685#define R_CKCORE_ADDRGOT_LO16 37
2686#define R_CKCORE_ADDRPLT_HI16 38
2687#define R_CKCORE_ADDRPLT_LO16 39
2688#define R_CKCORE_PCREL_JSR_IMM26BY2 40
2689#define R_CKCORE_TOFFSET_LO16 41
2690#define R_CKCORE_DOFFSET_LO16 42
2691#define R_CKCORE_PCREL_IMM18BY2 43
2692#define R_CKCORE_DOFFSET_IMM18 44
2693#define R_CKCORE_DOFFSET_IMM18BY2 45
2694#define R_CKCORE_DOFFSET_IMM18BY4 46
2695#define R_CKCORE_GOT_IMM18BY4 48
2696#define R_CKCORE_PLT_IMM18BY4 49
2697#define R_CKCORE_PCREL_IMM7BY4 50
2698#define R_CKCORE_TLS_LE32 51
2699#define R_CKCORE_TLS_IE32 52
2700#define R_CKCORE_TLS_GD32 53
2701#define R_CKCORE_TLS_LDM32 54
2702#define R_CKCORE_TLS_LDO32 55
2703#define R_CKCORE_TLS_DTPMOD32 56
2704#define R_CKCORE_TLS_DTPOFF32 57
2705#define R_CKCORE_TLS_TPOFF32 58
2706
2707
2708#define EF_IA_64_MASKOS 0x0000000f
2709#define EF_IA_64_ABI64 0x00000010
2710#define EF_IA_64_ARCH 0xff000000
2711
2712
2713#define PT_IA_64_ARCHEXT (PT_LOPROC + 0)
2714#define PT_IA_64_UNWIND (PT_LOPROC + 1)
2715#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12)
2716#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13)
2717#define PT_IA_64_HP_STACK (PT_LOOS + 0x14)
2718
2719
2720#define PF_IA_64_NORECOV 0x80000000
2721
2722
2723#define SHT_IA_64_EXT (SHT_LOPROC + 0)
2724#define SHT_IA_64_UNWIND (SHT_LOPROC + 1)
2725
2726
2727#define SHF_IA_64_SHORT 0x10000000
2728#define SHF_IA_64_NORECOV 0x20000000
2729
2730
2731#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0)
2732#define DT_IA_64_NUM 1
2733
2734
2735#define R_IA64_NONE 0x00
2736#define R_IA64_IMM14 0x21
2737#define R_IA64_IMM22 0x22
2738#define R_IA64_IMM64 0x23
2739#define R_IA64_DIR32MSB 0x24
2740#define R_IA64_DIR32LSB 0x25
2741#define R_IA64_DIR64MSB 0x26
2742#define R_IA64_DIR64LSB 0x27
2743#define R_IA64_GPREL22 0x2a
2744#define R_IA64_GPREL64I 0x2b
2745#define R_IA64_GPREL32MSB 0x2c
2746#define R_IA64_GPREL32LSB 0x2d
2747#define R_IA64_GPREL64MSB 0x2e
2748#define R_IA64_GPREL64LSB 0x2f
2749#define R_IA64_LTOFF22 0x32
2750#define R_IA64_LTOFF64I 0x33
2751#define R_IA64_PLTOFF22 0x3a
2752#define R_IA64_PLTOFF64I 0x3b
2753#define R_IA64_PLTOFF64MSB 0x3e
2754#define R_IA64_PLTOFF64LSB 0x3f
2755#define R_IA64_FPTR64I 0x43
2756#define R_IA64_FPTR32MSB 0x44
2757#define R_IA64_FPTR32LSB 0x45
2758#define R_IA64_FPTR64MSB 0x46
2759#define R_IA64_FPTR64LSB 0x47
2760#define R_IA64_PCREL60B 0x48
2761#define R_IA64_PCREL21B 0x49
2762#define R_IA64_PCREL21M 0x4a
2763#define R_IA64_PCREL21F 0x4b
2764#define R_IA64_PCREL32MSB 0x4c
2765#define R_IA64_PCREL32LSB 0x4d
2766#define R_IA64_PCREL64MSB 0x4e
2767#define R_IA64_PCREL64LSB 0x4f
2768#define R_IA64_LTOFF_FPTR22 0x52
2769#define R_IA64_LTOFF_FPTR64I 0x53
2770#define R_IA64_LTOFF_FPTR32MSB 0x54
2771#define R_IA64_LTOFF_FPTR32LSB 0x55
2772#define R_IA64_LTOFF_FPTR64MSB 0x56
2773#define R_IA64_LTOFF_FPTR64LSB 0x57
2774#define R_IA64_SEGREL32MSB 0x5c
2775#define R_IA64_SEGREL32LSB 0x5d
2776#define R_IA64_SEGREL64MSB 0x5e
2777#define R_IA64_SEGREL64LSB 0x5f
2778#define R_IA64_SECREL32MSB 0x64
2779#define R_IA64_SECREL32LSB 0x65
2780#define R_IA64_SECREL64MSB 0x66
2781#define R_IA64_SECREL64LSB 0x67
2782#define R_IA64_REL32MSB 0x6c
2783#define R_IA64_REL32LSB 0x6d
2784#define R_IA64_REL64MSB 0x6e
2785#define R_IA64_REL64LSB 0x6f
2786#define R_IA64_LTV32MSB 0x74
2787#define R_IA64_LTV32LSB 0x75
2788#define R_IA64_LTV64MSB 0x76
2789#define R_IA64_LTV64LSB 0x77
2790#define R_IA64_PCREL21BI 0x79
2791#define R_IA64_PCREL22 0x7a
2792#define R_IA64_PCREL64I 0x7b
2793#define R_IA64_IPLTMSB 0x80
2794#define R_IA64_IPLTLSB 0x81
2795#define R_IA64_COPY 0x84
2796#define R_IA64_SUB 0x85
2797#define R_IA64_LTOFF22X 0x86
2798#define R_IA64_LDXMOV 0x87
2799#define R_IA64_TPREL14 0x91
2800#define R_IA64_TPREL22 0x92
2801#define R_IA64_TPREL64I 0x93
2802#define R_IA64_TPREL64MSB 0x96
2803#define R_IA64_TPREL64LSB 0x97
2804#define R_IA64_LTOFF_TPREL22 0x9a
2805#define R_IA64_DTPMOD64MSB 0xa6
2806#define R_IA64_DTPMOD64LSB 0xa7
2807#define R_IA64_LTOFF_DTPMOD22 0xaa
2808#define R_IA64_DTPREL14 0xb1
2809#define R_IA64_DTPREL22 0xb2
2810#define R_IA64_DTPREL64I 0xb3
2811#define R_IA64_DTPREL32MSB 0xb4
2812#define R_IA64_DTPREL32LSB 0xb5
2813#define R_IA64_DTPREL64MSB 0xb6
2814#define R_IA64_DTPREL64LSB 0xb7
2815#define R_IA64_LTOFF_DTPREL22 0xba
2816
2817
2818#define EF_SH_MACH_MASK 0x1f
2819#define EF_SH_UNKNOWN 0x0
2820#define EF_SH1 0x1
2821#define EF_SH2 0x2
2822#define EF_SH3 0x3
2823#define EF_SH_DSP 0x4
2824#define EF_SH3_DSP 0x5
2825#define EF_SH4AL_DSP 0x6
2826#define EF_SH3E 0x8
2827#define EF_SH4 0x9
2828#define EF_SH2E 0xb
2829#define EF_SH4A 0xc
2830#define EF_SH2A 0xd
2831#define EF_SH4_NOFPU 0x10
2832#define EF_SH4A_NOFPU 0x11
2833#define EF_SH4_NOMMU_NOFPU 0x12
2834#define EF_SH2A_NOFPU 0x13
2835#define EF_SH3_NOMMU 0x14
2836#define EF_SH2A_SH4_NOFPU 0x15
2837#define EF_SH2A_SH3_NOFPU 0x16
2838#define EF_SH2A_SH4 0x17
2839#define EF_SH2A_SH3E 0x18
2840
2841#define R_SH_NONE 0
2842#define R_SH_DIR32 1
2843#define R_SH_REL32 2
2844#define R_SH_DIR8WPN 3
2845#define R_SH_IND12W 4
2846#define R_SH_DIR8WPL 5
2847#define R_SH_DIR8WPZ 6
2848#define R_SH_DIR8BP 7
2849#define R_SH_DIR8W 8
2850#define R_SH_DIR8L 9
2851#define R_SH_SWITCH16 25
2852#define R_SH_SWITCH32 26
2853#define R_SH_USES 27
2854#define R_SH_COUNT 28
2855#define R_SH_ALIGN 29
2856#define R_SH_CODE 30
2857#define R_SH_DATA 31
2858#define R_SH_LABEL 32
2859#define R_SH_SWITCH8 33
2860#define R_SH_GNU_VTINHERIT 34
2861#define R_SH_GNU_VTENTRY 35
2862#define R_SH_TLS_GD_32 144
2863#define R_SH_TLS_LD_32 145
2864#define R_SH_TLS_LDO_32 146
2865#define R_SH_TLS_IE_32 147
2866#define R_SH_TLS_LE_32 148
2867#define R_SH_TLS_DTPMOD32 149
2868#define R_SH_TLS_DTPOFF32 150
2869#define R_SH_TLS_TPOFF32 151
2870#define R_SH_GOT32 160
2871#define R_SH_PLT32 161
2872#define R_SH_COPY 162
2873#define R_SH_GLOB_DAT 163
2874#define R_SH_JMP_SLOT 164
2875#define R_SH_RELATIVE 165
2876#define R_SH_GOTOFF 166
2877#define R_SH_GOTPC 167
2878#define R_SH_GOT20 201
2879#define R_SH_GOTOFF20 202
2880#define R_SH_GOTFUNCDESC 203
2881#define R_SH_GOTFUNCDEST20 204
2882#define R_SH_GOTOFFFUNCDESC 205
2883#define R_SH_GOTOFFFUNCDEST20 206
2884#define R_SH_FUNCDESC 207
2885#define R_SH_FUNCDESC_VALUE 208
2886
2887#define R_SH_NUM 256
2888
2889
2890
2891#define R_390_NONE 0
2892#define R_390_8 1
2893#define R_390_12 2
2894#define R_390_16 3
2895#define R_390_32 4
2896#define R_390_PC32 5
2897#define R_390_GOT12 6
2898#define R_390_GOT32 7
2899#define R_390_PLT32 8
2900#define R_390_COPY 9
2901#define R_390_GLOB_DAT 10
2902#define R_390_JMP_SLOT 11
2903#define R_390_RELATIVE 12
2904#define R_390_GOTOFF32 13
2905#define R_390_GOTPC 14
2906#define R_390_GOT16 15
2907#define R_390_PC16 16
2908#define R_390_PC16DBL 17
2909#define R_390_PLT16DBL 18
2910#define R_390_PC32DBL 19
2911#define R_390_PLT32DBL 20
2912#define R_390_GOTPCDBL 21
2913#define R_390_64 22
2914#define R_390_PC64 23
2915#define R_390_GOT64 24
2916#define R_390_PLT64 25
2917#define R_390_GOTENT 26
2918#define R_390_GOTOFF16 27
2919#define R_390_GOTOFF64 28
2920#define R_390_GOTPLT12 29
2921#define R_390_GOTPLT16 30
2922#define R_390_GOTPLT32 31
2923#define R_390_GOTPLT64 32
2924#define R_390_GOTPLTENT 33
2925#define R_390_PLTOFF16 34
2926#define R_390_PLTOFF32 35
2927#define R_390_PLTOFF64 36
2928#define R_390_TLS_LOAD 37
2929#define R_390_TLS_GDCALL 38
2930
2931#define R_390_TLS_LDCALL 39
2932
2933#define R_390_TLS_GD32 40
2934
2935#define R_390_TLS_GD64 41
2936
2937#define R_390_TLS_GOTIE12 42
2938
2939#define R_390_TLS_GOTIE32 43
2940
2941#define R_390_TLS_GOTIE64 44
2942
2943#define R_390_TLS_LDM32 45
2944
2945#define R_390_TLS_LDM64 46
2946
2947#define R_390_TLS_IE32 47
2948
2949#define R_390_TLS_IE64 48
2950
2951#define R_390_TLS_IEENT 49
2952
2953#define R_390_TLS_LE32 50
2954
2955#define R_390_TLS_LE64 51
2956
2957#define R_390_TLS_LDO32 52
2958
2959#define R_390_TLS_LDO64 53
2960
2961#define R_390_TLS_DTPMOD 54
2962#define R_390_TLS_DTPOFF 55
2963#define R_390_TLS_TPOFF 56
2964
2965#define R_390_20 57
2966#define R_390_GOT20 58
2967#define R_390_GOTPLT20 59
2968#define R_390_TLS_GOTIE20 60
2969
2970
2971#define R_390_NUM 61
2972
2973
2974
2975#define R_CRIS_NONE 0
2976#define R_CRIS_8 1
2977#define R_CRIS_16 2
2978#define R_CRIS_32 3
2979#define R_CRIS_8_PCREL 4
2980#define R_CRIS_16_PCREL 5
2981#define R_CRIS_32_PCREL 6
2982#define R_CRIS_GNU_VTINHERIT 7
2983#define R_CRIS_GNU_VTENTRY 8
2984#define R_CRIS_COPY 9
2985#define R_CRIS_GLOB_DAT 10
2986#define R_CRIS_JUMP_SLOT 11
2987#define R_CRIS_RELATIVE 12
2988#define R_CRIS_16_GOT 13
2989#define R_CRIS_32_GOT 14
2990#define R_CRIS_16_GOTPLT 15
2991#define R_CRIS_32_GOTPLT 16
2992#define R_CRIS_32_GOTREL 17
2993#define R_CRIS_32_PLT_GOTREL 18
2994#define R_CRIS_32_PLT_PCREL 19
2995
2996#define R_CRIS_NUM 20
2997
2998
2999
3000#define R_X86_64_NONE 0
3001#define R_X86_64_64 1
3002#define R_X86_64_PC32 2
3003#define R_X86_64_GOT32 3
3004#define R_X86_64_PLT32 4
3005#define R_X86_64_COPY 5
3006#define R_X86_64_GLOB_DAT 6
3007#define R_X86_64_JUMP_SLOT 7
3008#define R_X86_64_RELATIVE 8
3009#define R_X86_64_GOTPCREL 9
3010
3011#define R_X86_64_32 10
3012#define R_X86_64_32S 11
3013#define R_X86_64_16 12
3014#define R_X86_64_PC16 13
3015#define R_X86_64_8 14
3016#define R_X86_64_PC8 15
3017#define R_X86_64_DTPMOD64 16
3018#define R_X86_64_DTPOFF64 17
3019#define R_X86_64_TPOFF64 18
3020#define R_X86_64_TLSGD 19
3021
3022#define R_X86_64_TLSLD 20
3023
3024#define R_X86_64_DTPOFF32 21
3025#define R_X86_64_GOTTPOFF 22
3026
3027#define R_X86_64_TPOFF32 23
3028#define R_X86_64_PC64 24
3029#define R_X86_64_GOTOFF64 25
3030#define R_X86_64_GOTPC32 26
3031#define R_X86_64_GOT64 27
3032#define R_X86_64_GOTPCREL64 28
3033#define R_X86_64_GOTPC64 29
3034#define R_X86_64_GOTPLT64 30
3035#define R_X86_64_PLTOFF64 31
3036#define R_X86_64_SIZE32 32
3037#define R_X86_64_SIZE64 33
3038
3039#define R_X86_64_GOTPC32_TLSDESC 34
3040#define R_X86_64_TLSDESC_CALL 35
3041
3042#define R_X86_64_TLSDESC 36
3043#define R_X86_64_IRELATIVE 37
3044#define R_X86_64_RELATIVE64 38
3045#define R_X86_64_GOTPCRELX 41
3046#define R_X86_64_REX_GOTPCRELX 42
3047#define R_X86_64_NUM 43
3048
3049
3050
3051#define R_MN10300_NONE 0
3052#define R_MN10300_32 1
3053#define R_MN10300_16 2
3054#define R_MN10300_8 3
3055#define R_MN10300_PCREL32 4
3056#define R_MN10300_PCREL16 5
3057#define R_MN10300_PCREL8 6
3058#define R_MN10300_GNU_VTINHERIT 7
3059#define R_MN10300_GNU_VTENTRY 8
3060#define R_MN10300_24 9
3061#define R_MN10300_GOTPC32 10
3062#define R_MN10300_GOTPC16 11
3063#define R_MN10300_GOTOFF32 12
3064#define R_MN10300_GOTOFF24 13
3065#define R_MN10300_GOTOFF16 14
3066#define R_MN10300_PLT32 15
3067#define R_MN10300_PLT16 16
3068#define R_MN10300_GOT32 17
3069#define R_MN10300_GOT24 18
3070#define R_MN10300_GOT16 19
3071#define R_MN10300_COPY 20
3072#define R_MN10300_GLOB_DAT 21
3073#define R_MN10300_JMP_SLOT 22
3074#define R_MN10300_RELATIVE 23
3075
3076#define R_MN10300_NUM 24
3077
3078
3079
3080#define R_M32R_NONE 0
3081#define R_M32R_16 1
3082#define R_M32R_32 2
3083#define R_M32R_24 3
3084#define R_M32R_10_PCREL 4
3085#define R_M32R_18_PCREL 5
3086#define R_M32R_26_PCREL 6
3087#define R_M32R_HI16_ULO 7
3088#define R_M32R_HI16_SLO 8
3089#define R_M32R_LO16 9
3090#define R_M32R_SDA16 10
3091#define R_M32R_GNU_VTINHERIT 11
3092#define R_M32R_GNU_VTENTRY 12
3093
3094#define R_M32R_16_RELA 33
3095#define R_M32R_32_RELA 34
3096#define R_M32R_24_RELA 35
3097#define R_M32R_10_PCREL_RELA 36
3098#define R_M32R_18_PCREL_RELA 37
3099#define R_M32R_26_PCREL_RELA 38
3100#define R_M32R_HI16_ULO_RELA 39
3101#define R_M32R_HI16_SLO_RELA 40
3102#define R_M32R_LO16_RELA 41
3103#define R_M32R_SDA16_RELA 42
3104#define R_M32R_RELA_GNU_VTINHERIT 43
3105#define R_M32R_RELA_GNU_VTENTRY 44
3106#define R_M32R_REL32 45
3107
3108#define R_M32R_GOT24 48
3109#define R_M32R_26_PLTREL 49
3110#define R_M32R_COPY 50
3111#define R_M32R_GLOB_DAT 51
3112#define R_M32R_JMP_SLOT 52
3113#define R_M32R_RELATIVE 53
3114#define R_M32R_GOTOFF 54
3115#define R_M32R_GOTPC24 55
3116#define R_M32R_GOT16_HI_ULO 56
3117
3118#define R_M32R_GOT16_HI_SLO 57
3119
3120#define R_M32R_GOT16_LO 58
3121#define R_M32R_GOTPC_HI_ULO 59
3122
3123#define R_M32R_GOTPC_HI_SLO 60
3124
3125#define R_M32R_GOTPC_LO 61
3126
3127#define R_M32R_GOTOFF_HI_ULO 62
3128
3129#define R_M32R_GOTOFF_HI_SLO 63
3130
3131#define R_M32R_GOTOFF_LO 64
3132#define R_M32R_NUM 256
3133
3134#define R_MICROBLAZE_NONE 0
3135#define R_MICROBLAZE_32 1
3136#define R_MICROBLAZE_32_PCREL 2
3137#define R_MICROBLAZE_64_PCREL 3
3138#define R_MICROBLAZE_32_PCREL_LO 4
3139#define R_MICROBLAZE_64 5
3140#define R_MICROBLAZE_32_LO 6
3141#define R_MICROBLAZE_SRO32 7
3142#define R_MICROBLAZE_SRW32 8
3143#define R_MICROBLAZE_64_NONE 9
3144#define R_MICROBLAZE_32_SYM_OP_SYM 10
3145#define R_MICROBLAZE_GNU_VTINHERIT 11
3146#define R_MICROBLAZE_GNU_VTENTRY 12
3147#define R_MICROBLAZE_GOTPC_64 13
3148#define R_MICROBLAZE_GOT_64 14
3149#define R_MICROBLAZE_PLT_64 15
3150#define R_MICROBLAZE_REL 16
3151#define R_MICROBLAZE_JUMP_SLOT 17
3152#define R_MICROBLAZE_GLOB_DAT 18
3153#define R_MICROBLAZE_GOTOFF_64 19
3154#define R_MICROBLAZE_GOTOFF_32 20
3155#define R_MICROBLAZE_COPY 21
3156#define R_MICROBLAZE_TLS 22
3157#define R_MICROBLAZE_TLSGD 23
3158#define R_MICROBLAZE_TLSLD 24
3159#define R_MICROBLAZE_TLSDTPMOD32 25
3160#define R_MICROBLAZE_TLSDTPREL32 26
3161#define R_MICROBLAZE_TLSDTPREL64 27
3162#define R_MICROBLAZE_TLSGOTTPREL32 28
3163#define R_MICROBLAZE_TLSTPREL32 29
3164
3165#define DT_NIOS2_GP 0x70000002
3166
3167#define R_NIOS2_NONE 0
3168#define R_NIOS2_S16 1
3169#define R_NIOS2_U16 2
3170#define R_NIOS2_PCREL16 3
3171#define R_NIOS2_CALL26 4
3172#define R_NIOS2_IMM5 5
3173#define R_NIOS2_CACHE_OPX 6
3174#define R_NIOS2_IMM6 7
3175#define R_NIOS2_IMM8 8
3176#define R_NIOS2_HI16 9
3177#define R_NIOS2_LO16 10
3178#define R_NIOS2_HIADJ16 11
3179#define R_NIOS2_BFD_RELOC_32 12
3180#define R_NIOS2_BFD_RELOC_16 13
3181#define R_NIOS2_BFD_RELOC_8 14
3182#define R_NIOS2_GPREL 15
3183#define R_NIOS2_GNU_VTINHERIT 16
3184#define R_NIOS2_GNU_VTENTRY 17
3185#define R_NIOS2_UJMP 18
3186#define R_NIOS2_CJMP 19
3187#define R_NIOS2_CALLR 20
3188#define R_NIOS2_ALIGN 21
3189#define R_NIOS2_GOT16 22
3190#define R_NIOS2_CALL16 23
3191#define R_NIOS2_GOTOFF_LO 24
3192#define R_NIOS2_GOTOFF_HA 25
3193#define R_NIOS2_PCREL_LO 26
3194#define R_NIOS2_PCREL_HA 27
3195#define R_NIOS2_TLS_GD16 28
3196#define R_NIOS2_TLS_LDM16 29
3197#define R_NIOS2_TLS_LDO16 30
3198#define R_NIOS2_TLS_IE16 31
3199#define R_NIOS2_TLS_LE16 32
3200#define R_NIOS2_TLS_DTPMOD 33
3201#define R_NIOS2_TLS_DTPREL 34
3202#define R_NIOS2_TLS_TPREL 35
3203#define R_NIOS2_COPY 36
3204#define R_NIOS2_GLOB_DAT 37
3205#define R_NIOS2_JUMP_SLOT 38
3206#define R_NIOS2_RELATIVE 39
3207#define R_NIOS2_GOTOFF 40
3208#define R_NIOS2_CALL26_NOAT 41
3209#define R_NIOS2_GOT_LO 42
3210#define R_NIOS2_GOT_HA 43
3211#define R_NIOS2_CALL_LO 44
3212#define R_NIOS2_CALL_HA 45
3213
3214#define R_OR1K_NONE 0
3215#define R_OR1K_32 1
3216#define R_OR1K_16 2
3217#define R_OR1K_8 3
3218#define R_OR1K_LO_16_IN_INSN 4
3219#define R_OR1K_HI_16_IN_INSN 5
3220#define R_OR1K_INSN_REL_26 6
3221#define R_OR1K_GNU_VTENTRY 7
3222#define R_OR1K_GNU_VTINHERIT 8
3223#define R_OR1K_32_PCREL 9
3224#define R_OR1K_16_PCREL 10
3225#define R_OR1K_8_PCREL 11
3226#define R_OR1K_GOTPC_HI16 12
3227#define R_OR1K_GOTPC_LO16 13
3228#define R_OR1K_GOT16 14
3229#define R_OR1K_PLT26 15
3230#define R_OR1K_GOTOFF_HI16 16
3231#define R_OR1K_GOTOFF_LO16 17
3232#define R_OR1K_COPY 18
3233#define R_OR1K_GLOB_DAT 19
3234#define R_OR1K_JMP_SLOT 20
3235#define R_OR1K_RELATIVE 21
3236#define R_OR1K_TLS_GD_HI16 22
3237#define R_OR1K_TLS_GD_LO16 23
3238#define R_OR1K_TLS_LDM_HI16 24
3239#define R_OR1K_TLS_LDM_LO16 25
3240#define R_OR1K_TLS_LDO_HI16 26
3241#define R_OR1K_TLS_LDO_LO16 27
3242#define R_OR1K_TLS_IE_HI16 28
3243#define R_OR1K_TLS_IE_LO16 29
3244#define R_OR1K_TLS_LE_HI16 30
3245#define R_OR1K_TLS_LE_LO16 31
3246#define R_OR1K_TLS_TPOFF 32
3247#define R_OR1K_TLS_DTPOFF 33
3248#define R_OR1K_TLS_DTPMOD 34
3249
3250#define R_BPF_NONE 0
3251#define R_BPF_MAP_FD 1
3252
3253#define R_RISCV_NONE 0
3254#define R_RISCV_32 1
3255#define R_RISCV_64 2
3256#define R_RISCV_RELATIVE 3
3257#define R_RISCV_COPY 4
3258#define R_RISCV_JUMP_SLOT 5
3259#define R_RISCV_TLS_DTPMOD32 6
3260#define R_RISCV_TLS_DTPMOD64 7
3261#define R_RISCV_TLS_DTPREL32 8
3262#define R_RISCV_TLS_DTPREL64 9
3263#define R_RISCV_TLS_TPREL32 10
3264#define R_RISCV_TLS_TPREL64 11
3265#define R_RISCV_TLSDESC 12
3266
3267#define R_RISCV_BRANCH 16
3268#define R_RISCV_JAL 17
3269#define R_RISCV_CALL 18
3270#define R_RISCV_CALL_PLT 19
3271#define R_RISCV_GOT_HI20 20
3272#define R_RISCV_TLS_GOT_HI20 21
3273#define R_RISCV_TLS_GD_HI20 22
3274#define R_RISCV_PCREL_HI20 23
3275#define R_RISCV_PCREL_LO12_I 24
3276#define R_RISCV_PCREL_LO12_S 25
3277#define R_RISCV_HI20 26
3278#define R_RISCV_LO12_I 27
3279#define R_RISCV_LO12_S 28
3280#define R_RISCV_TPREL_HI20 29
3281#define R_RISCV_TPREL_LO12_I 30
3282#define R_RISCV_TPREL_LO12_S 31
3283#define R_RISCV_TPREL_ADD 32
3284#define R_RISCV_ADD8 33
3285#define R_RISCV_ADD16 34
3286#define R_RISCV_ADD32 35
3287#define R_RISCV_ADD64 36
3288#define R_RISCV_SUB8 37
3289#define R_RISCV_SUB16 38
3290#define R_RISCV_SUB32 39
3291#define R_RISCV_SUB64 40
3292#define R_RISCV_GOT32_PCREL 41
3293#define R_RISCV_ALIGN 43
3294#define R_RISCV_RVC_BRANCH 44
3295#define R_RISCV_RVC_JUMP 45
3296#define R_RISCV_RVC_LUI 46
3297#define R_RISCV_RELAX 51
3298#define R_RISCV_SUB6 52
3299#define R_RISCV_SET6 53
3300#define R_RISCV_SET8 54
3301#define R_RISCV_SET16 55
3302#define R_RISCV_SET32 56
3303#define R_RISCV_32_PCREL 57
3304#define R_RISCV_IRELATIVE 58
3305#define R_RISCV_PLT32 59
3306#define R_RISCV_SET_ULEB128 60
3307#define R_RISCV_SUB_ULEB128 61
3308#define R_RISCV_TLSDESC_HI20 62
3309#define R_RISCV_TLSDESC_LOAD_LO12 63
3310#define R_RISCV_TLSDESC_ADD_LO12 64
3311#define R_RISCV_TLSDESC_CALL 65
3312
3313#define EF_LARCH_ABI_MODIFIER_MASK 0x07
3314#define EF_LARCH_ABI_SOFT_FLOAT 0x01
3315#define EF_LARCH_ABI_SINGLE_FLOAT 0x02
3316#define EF_LARCH_ABI_DOUBLE_FLOAT 0x03
3317#define EF_LARCH_OBJABI_V1 0x40
3318
3319#define R_LARCH_NONE 0
3320#define R_LARCH_32 1
3321#define R_LARCH_64 2
3322#define R_LARCH_RELATIVE 3
3323#define R_LARCH_COPY 4
3324#define R_LARCH_JUMP_SLOT 5
3325#define R_LARCH_TLS_DTPMOD32 6
3326#define R_LARCH_TLS_DTPMOD64 7
3327#define R_LARCH_TLS_DTPREL32 8
3328#define R_LARCH_TLS_DTPREL64 9
3329#define R_LARCH_TLS_TPREL32 10
3330#define R_LARCH_TLS_TPREL64 11
3331#define R_LARCH_IRELATIVE 12
3332#define R_LARCH_TLS_DESC64 14
3333#define R_LARCH_MARK_LA 20
3334#define R_LARCH_MARK_PCREL 21
3335#define R_LARCH_SOP_PUSH_PCREL 22
3336#define R_LARCH_SOP_PUSH_ABSOLUTE 23
3337#define R_LARCH_SOP_PUSH_DUP 24
3338#define R_LARCH_SOP_PUSH_GPREL 25
3339#define R_LARCH_SOP_PUSH_TLS_TPREL 26
3340#define R_LARCH_SOP_PUSH_TLS_GOT 27
3341#define R_LARCH_SOP_PUSH_TLS_GD 28
3342#define R_LARCH_SOP_PUSH_PLT_PCREL 29
3343#define R_LARCH_SOP_ASSERT 30
3344#define R_LARCH_SOP_NOT 31
3345#define R_LARCH_SOP_SUB 32
3346#define R_LARCH_SOP_SL 33
3347#define R_LARCH_SOP_SR 34
3348#define R_LARCH_SOP_ADD 35
3349#define R_LARCH_SOP_AND 36
3350#define R_LARCH_SOP_IF_ELSE 37
3351#define R_LARCH_SOP_POP_32_S_10_5 38
3352#define R_LARCH_SOP_POP_32_U_10_12 39
3353#define R_LARCH_SOP_POP_32_S_10_12 40
3354#define R_LARCH_SOP_POP_32_S_10_16 41
3355#define R_LARCH_SOP_POP_32_S_10_16_S2 42
3356#define R_LARCH_SOP_POP_32_S_5_20 43
3357#define R_LARCH_SOP_POP_32_S_0_5_10_16_S2 44
3358#define R_LARCH_SOP_POP_32_S_0_10_10_16_S2 45
3359#define R_LARCH_SOP_POP_32_U 46
3360#define R_LARCH_ADD8 47
3361#define R_LARCH_ADD16 48
3362#define R_LARCH_ADD24 49
3363#define R_LARCH_ADD32 50
3364#define R_LARCH_ADD64 51
3365#define R_LARCH_SUB8 52
3366#define R_LARCH_SUB16 53
3367#define R_LARCH_SUB24 54
3368#define R_LARCH_SUB32 55
3369#define R_LARCH_SUB64 56
3370#define R_LARCH_GNU_VTINHERIT 57
3371#define R_LARCH_GNU_VTENTRY 58
3372#define R_LARCH_B16 64
3373#define R_LARCH_B21 65
3374#define R_LARCH_B26 66
3375#define R_LARCH_ABS_HI20 67
3376#define R_LARCH_ABS_LO12 68
3377#define R_LARCH_ABS64_LO20 69
3378#define R_LARCH_ABS64_HI12 70
3379#define R_LARCH_PCALA_HI20 71
3380#define R_LARCH_PCALA_LO12 72
3381#define R_LARCH_PCALA64_LO20 73
3382#define R_LARCH_PCALA64_HI12 74
3383#define R_LARCH_GOT_PC_HI20 75
3384#define R_LARCH_GOT_PC_LO12 76
3385#define R_LARCH_GOT64_PC_LO20 77
3386#define R_LARCH_GOT64_PC_HI12 78
3387#define R_LARCH_GOT_HI20 79
3388#define R_LARCH_GOT_LO12 80
3389#define R_LARCH_GOT64_LO20 81
3390#define R_LARCH_GOT64_HI12 82
3391#define R_LARCH_TLS_LE_HI20 83
3392#define R_LARCH_TLS_LE_LO12 84
3393#define R_LARCH_TLS_LE64_LO20 85
3394#define R_LARCH_TLS_LE64_HI12 86
3395#define R_LARCH_TLS_IE_PC_HI20 87
3396#define R_LARCH_TLS_IE_PC_LO12 88
3397#define R_LARCH_TLS_IE64_PC_LO20 89
3398#define R_LARCH_TLS_IE64_PC_HI12 90
3399#define R_LARCH_TLS_IE_HI20 91
3400#define R_LARCH_TLS_IE_LO12 92
3401#define R_LARCH_TLS_IE64_LO20 93
3402#define R_LARCH_TLS_IE64_HI12 94
3403#define R_LARCH_TLS_LD_PC_HI20 95
3404#define R_LARCH_TLS_LD_HI20 96
3405#define R_LARCH_TLS_GD_PC_HI20 97
3406#define R_LARCH_TLS_GD_HI20 98
3407#define R_LARCH_32_PCREL 99
3408#define R_LARCH_RELAX 100
3409
3410#define R_HEX_NONE 0
3411#define R_HEX_B22_PCREL 1
3412#define R_HEX_B15_PCREL 2
3413#define R_HEX_B7_PCREL 3
3414#define R_HEX_LO16 4
3415#define R_HEX_HI16 5
3416#define R_HEX_32 6
3417#define R_HEX_16 7
3418#define R_HEX_8 8
3419#define R_HEX_GPREL16_0 9
3420#define R_HEX_GPREL16_1 10
3421#define R_HEX_GPREL16_2 11
3422#define R_HEX_GPREL16_3 12
3423#define R_HEX_HL16 13
3424#define R_HEX_B13_PCREL 14
3425#define R_HEX_B9_PCREL 15
3426#define R_HEX_B32_PCREL_X 16
3427#define R_HEX_32_6_X 17
3428#define R_HEX_B22_PCREL_X 18
3429#define R_HEX_B15_PCREL_X 19
3430#define R_HEX_B13_PCREL_X 20
3431#define R_HEX_B9_PCREL_X 21
3432#define R_HEX_B7_PCREL_X 22
3433#define R_HEX_16_X 23
3434#define R_HEX_12_X 24
3435#define R_HEX_11_X 25
3436#define R_HEX_10_X 26
3437#define R_HEX_9_X 27
3438#define R_HEX_8_X 28
3439#define R_HEX_7_X 29
3440#define R_HEX_6_X 30
3441#define R_HEX_32_PCREL 31
3442#define R_HEX_COPY 32
3443#define R_HEX_GLOB_DAT 33
3444#define R_HEX_JMP_SLOT 34
3445#define R_HEX_RELATIVE 35
3446#define R_HEX_PLT_B22_PCREL 36
3447#define R_HEX_GOTOFF_LO16 37
3448#define R_HEX_GOTOFF_HI16 38
3449#define R_HEX_GOTOFF_32 39
3450#define R_HEX_GOT_LO16 40
3451#define R_HEX_GOT_HI16 41
3452#define R_HEX_GOT_32 42
3453#define R_HEX_GOT_16 43
3454#define R_HEX_DTPMOD_32 44
3455#define R_HEX_DTPREL_LO16 45
3456#define R_HEX_DTPREL_HI16 46
3457#define R_HEX_DTPREL_32 47
3458#define R_HEX_DTPREL_16 48
3459#define R_HEX_GD_PLT_B22_PCREL 49
3460#define R_HEX_GD_GOT_LO16 50
3461#define R_HEX_GD_GOT_HI16 51
3462#define R_HEX_GD_GOT_32 52
3463#define R_HEX_GD_GOT_16 53
3464#define R_HEX_IE_LO16 54
3465#define R_HEX_IE_HI16 55
3466#define R_HEX_IE_32 56
3467#define R_HEX_IE_GOT_LO16 57
3468#define R_HEX_IE_GOT_HI16 58
3469#define R_HEX_IE_GOT_32 59
3470#define R_HEX_IE_GOT_16 60
3471#define R_HEX_TPREL_LO16 61
3472#define R_HEX_TPREL_HI16 62
3473#define R_HEX_TPREL_32 63
3474#define R_HEX_TPREL_16 64
3475#define R_HEX_6_PCREL_X 65
3476#define R_HEX_GOTREL_32_6_X 66
3477#define R_HEX_GOTREL_16_X 67
3478#define R_HEX_GOTREL_11_X 68
3479#define R_HEX_GOT_32_6_X 69
3480#define R_HEX_GOT_16_X 70
3481#define R_HEX_GOT_11_X 71
3482#define R_HEX_DTPREL_32_6_X 72
3483#define R_HEX_DTPREL_16_X 73
3484#define R_HEX_DTPREL_11_X 74
3485#define R_HEX_GD_GOT_32_6_X 75
3486#define R_HEX_GD_GOT_16_X 76
3487#define R_HEX_GD_GOT_11_X 77
3488#define R_HEX_IE_32_6_X 78
3489#define R_HEX_IE_16_X 79
3490#define R_HEX_IE_GOT_32_6_X 80
3491#define R_HEX_IE_GOT_16_X 81
3492#define R_HEX_IE_GOT_11_X 82
3493#define R_HEX_TPREL_32_6_X 83
3494#define R_HEX_TPREL_16_X 84
3495#define R_HEX_TPREL_11_X 85
3496#define R_HEX_LD_PLT_B22_PCREL 86
3497#define R_HEX_LD_GOT_LO16 87
3498#define R_HEX_LD_GOT_HI16 88
3499#define R_HEX_LD_GOT_32 89
3500#define R_HEX_LD_GOT_16 90
3501#define R_HEX_LD_GOT_32_6_X 91
3502#define R_HEX_LD_GOT_16_X 92
3503#define R_HEX_LD_GOT_11_X 93
3504#define R_HEX_23_REG 94
3505#define R_HEX_GD_PLT_B22_PCREL_X 95
3506#define R_HEX_GD_PLT_B32_PCREL_X 96
3507#define R_HEX_LD_PLT_B22_PCREL_X 97
3508#define R_HEX_LD_PLT_B32_PCREL_X 98
3509
3510
3511#ifdef __cplusplus
3512}
3513#endif
3514
3515
3516#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/sched.h created+147
......@@ -0,0 +1,147 @@
1#ifndef _SCHED_H
2#define _SCHED_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7#include <features.h>
8
9#define __NEED_struct_timespec
10#define __NEED_pid_t
11#define __NEED_time_t
12
13#ifdef _GNU_SOURCE
14#define __NEED_size_t
15#endif
16
17#include <bits/alltypes.h>
18
19struct sched_param {
20 int sched_priority;
21 int __reserved1;
22#if _REDIR_TIME64
23 long __reserved2[4];
24#else
25 struct {
26 time_t __reserved1;
27 long __reserved2;
28 } __reserved2[2];
29#endif
30 int __reserved3;
31};
32
33int sched_get_priority_max(int);
34int sched_get_priority_min(int);
35int sched_getparam(pid_t, struct sched_param *);
36int sched_getscheduler(pid_t);
37int sched_rr_get_interval(pid_t, struct timespec *);
38int sched_setparam(pid_t, const struct sched_param *);
39int sched_setscheduler(pid_t, int, const struct sched_param *);
40int sched_yield(void);
41
42#define SCHED_OTHER 0
43#define SCHED_FIFO 1
44#define SCHED_RR 2
45#define SCHED_BATCH 3
46#define SCHED_IDLE 5
47#define SCHED_DEADLINE 6
48#define SCHED_RESET_ON_FORK 0x40000000
49
50#ifdef _GNU_SOURCE
51#define CSIGNAL 0x000000ff
52#define CLONE_NEWTIME 0x00000080
53#define CLONE_VM 0x00000100
54#define CLONE_FS 0x00000200
55#define CLONE_FILES 0x00000400
56#define CLONE_SIGHAND 0x00000800
57#define CLONE_PIDFD 0x00001000
58#define CLONE_PTRACE 0x00002000
59#define CLONE_VFORK 0x00004000
60#define CLONE_PARENT 0x00008000
61#define CLONE_THREAD 0x00010000
62#define CLONE_NEWNS 0x00020000
63#define CLONE_SYSVSEM 0x00040000
64#define CLONE_SETTLS 0x00080000
65#define CLONE_PARENT_SETTID 0x00100000
66#define CLONE_CHILD_CLEARTID 0x00200000
67#define CLONE_DETACHED 0x00400000
68#define CLONE_UNTRACED 0x00800000
69#define CLONE_CHILD_SETTID 0x01000000
70#define CLONE_NEWCGROUP 0x02000000
71#define CLONE_NEWUTS 0x04000000
72#define CLONE_NEWIPC 0x08000000
73#define CLONE_NEWUSER 0x10000000
74#define CLONE_NEWPID 0x20000000
75#define CLONE_NEWNET 0x40000000
76#define CLONE_IO 0x80000000
77int clone (int (*)(void *), void *, int, void *, ...);
78int unshare(int);
79int setns(int, int);
80
81int (memcmp)(const void *, const void *, size_t);
82void *(memset)(void *, int, size_t);
83void *(calloc)(size_t, size_t);
84void (free)(void *);
85
86typedef struct cpu_set_t { unsigned long __bits[128/sizeof(long)]; } cpu_set_t;
87int __sched_cpucount(size_t, const cpu_set_t *);
88int sched_getcpu(void);
89int sched_getaffinity(pid_t, size_t, cpu_set_t *);
90int sched_setaffinity(pid_t, size_t, const cpu_set_t *);
91
92#define __CPU_op_S(i, size, set, op) ( (i)/8U >= (size) ? 0 : \
93 (((unsigned long *)(set))[(i)/8/sizeof(long)] op (1UL<<((i)%(8*sizeof(long))))) )
94
95#define CPU_SET_S(i, size, set) __CPU_op_S(i, size, set, |=)
96#define CPU_CLR_S(i, size, set) __CPU_op_S(i, size, set, &=~)
97#define CPU_ISSET_S(i, size, set) __CPU_op_S(i, size, set, &)
98
99#define __CPU_op_func_S(func, op) \
100static __inline void __CPU_##func##_S(size_t __size, cpu_set_t *__dest, \
101 const cpu_set_t *__src1, const cpu_set_t *__src2) \
102{ \
103 size_t __i; \
104 for (__i=0; __i<__size/sizeof(long); __i++) \
105 ((unsigned long *)__dest)[__i] = ((unsigned long *)__src1)[__i] \
106 op ((unsigned long *)__src2)[__i] ; \
107}
108
109__CPU_op_func_S(AND, &)
110__CPU_op_func_S(OR, |)
111__CPU_op_func_S(XOR, ^)
112
113#define CPU_AND_S(a,b,c,d) __CPU_AND_S(a,b,c,d)
114#define CPU_OR_S(a,b,c,d) __CPU_OR_S(a,b,c,d)
115#define CPU_XOR_S(a,b,c,d) __CPU_XOR_S(a,b,c,d)
116
117#define CPU_COUNT_S(size,set) __sched_cpucount(size,set)
118#define CPU_ZERO_S(size,set) (memset)(set,0,size)
119#define CPU_EQUAL_S(size,set1,set2) (!(memcmp)(set1,set2,size))
120
121#define CPU_ALLOC_SIZE(n) (sizeof(long) * ( (n)/(8*sizeof(long)) \
122 + ((n)%(8*sizeof(long)) + 8*sizeof(long)-1)/(8*sizeof(long)) ) )
123#define CPU_ALLOC(n) ((cpu_set_t *)(calloc)(1,CPU_ALLOC_SIZE(n)))
124#define CPU_FREE(set) (free)(set)
125
126#define CPU_SETSIZE 1024
127
128#define CPU_SET(i, set) CPU_SET_S(i,sizeof(cpu_set_t),set)
129#define CPU_CLR(i, set) CPU_CLR_S(i,sizeof(cpu_set_t),set)
130#define CPU_ISSET(i, set) CPU_ISSET_S(i,sizeof(cpu_set_t),set)
131#define CPU_AND(d,s1,s2) CPU_AND_S(sizeof(cpu_set_t),d,s1,s2)
132#define CPU_OR(d,s1,s2) CPU_OR_S(sizeof(cpu_set_t),d,s1,s2)
133#define CPU_XOR(d,s1,s2) CPU_XOR_S(sizeof(cpu_set_t),d,s1,s2)
134#define CPU_COUNT(set) CPU_COUNT_S(sizeof(cpu_set_t),set)
135#define CPU_ZERO(set) CPU_ZERO_S(sizeof(cpu_set_t),set)
136#define CPU_EQUAL(s1,s2) CPU_EQUAL_S(sizeof(cpu_set_t),s1,s2)
137
138#endif
139
140#if _REDIR_TIME64
141__REDIR(sched_rr_get_interval, __sched_rr_get_interval_time64);
142#endif
143
144#ifdef __cplusplus
145}
146#endif
147#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/stdio.h created+231
......@@ -0,0 +1,231 @@
1#ifndef _STDIO_H
2#define _STDIO_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <features.h>
9
10#define __NEED_FILE
11#define __NEED___isoc_va_list
12#define __NEED_size_t
13
14#if __STDC_VERSION__ < 201112L
15#define __NEED_struct__IO_FILE
16#endif
17
18#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
19 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
20 || defined(_BSD_SOURCE)
21#define __NEED_ssize_t
22#define __NEED_off_t
23#define __NEED_va_list
24#endif
25
26#include <bits/alltypes.h>
27
28#if __cplusplus >= 201103L
29#define NULL nullptr
30#elif defined(__cplusplus)
31#define NULL 0L
32#else
33#define NULL ((void*)0)
34#endif
35
36#undef EOF
37#define EOF (-1)
38
39#undef SEEK_SET
40#undef SEEK_CUR
41#undef SEEK_END
42#define SEEK_SET 0
43#define SEEK_CUR 1
44#define SEEK_END 2
45
46#define _IOFBF 0
47#define _IOLBF 1
48#define _IONBF 2
49
50#define BUFSIZ 1024
51#define FILENAME_MAX 4096
52#define FOPEN_MAX 1000
53#define TMP_MAX 10000
54#define L_tmpnam 20
55
56typedef union _G_fpos64_t {
57 char __opaque[16];
58 long long __lldata;
59 double __align;
60} fpos_t;
61
62extern FILE *const stdin;
63extern FILE *const stdout;
64extern FILE *const stderr;
65
66#define stdin (stdin)
67#define stdout (stdout)
68#define stderr (stderr)
69
70FILE *fopen(const char *__restrict, const char *__restrict);
71FILE *freopen(const char *__restrict, const char *__restrict, FILE *__restrict);
72int fclose(FILE *);
73
74int remove(const char *);
75int rename(const char *, const char *);
76
77int feof(FILE *);
78int ferror(FILE *);
79int fflush(FILE *);
80void clearerr(FILE *);
81
82int fseek(FILE *, long, int);
83long ftell(FILE *);
84void rewind(FILE *);
85
86int fgetpos(FILE *__restrict, fpos_t *__restrict);
87int fsetpos(FILE *, const fpos_t *);
88
89size_t fread(void *__restrict, size_t, size_t, FILE *__restrict);
90size_t fwrite(const void *__restrict, size_t, size_t, FILE *__restrict);
91
92int fgetc(FILE *);
93int getc(FILE *);
94int getchar(void);
95int ungetc(int, FILE *);
96
97int fputc(int, FILE *);
98int putc(int, FILE *);
99int putchar(int);
100
101char *fgets(char *__restrict, int, FILE *__restrict);
102#if __STDC_VERSION__ < 201112L
103char *gets(char *);
104#endif
105
106int fputs(const char *__restrict, FILE *__restrict);
107int puts(const char *);
108
109int printf(const char *__restrict, ...);
110int fprintf(FILE *__restrict, const char *__restrict, ...);
111int sprintf(char *__restrict, const char *__restrict, ...);
112int snprintf(char *__restrict, size_t, const char *__restrict, ...);
113
114int vprintf(const char *__restrict, __isoc_va_list);
115int vfprintf(FILE *__restrict, const char *__restrict, __isoc_va_list);
116int vsprintf(char *__restrict, const char *__restrict, __isoc_va_list);
117int vsnprintf(char *__restrict, size_t, const char *__restrict, __isoc_va_list);
118
119int scanf(const char *__restrict, ...);
120int fscanf(FILE *__restrict, const char *__restrict, ...);
121int sscanf(const char *__restrict, const char *__restrict, ...);
122int vscanf(const char *__restrict, __isoc_va_list);
123int vfscanf(FILE *__restrict, const char *__restrict, __isoc_va_list);
124int vsscanf(const char *__restrict, const char *__restrict, __isoc_va_list);
125
126void perror(const char *);
127
128int setvbuf(FILE *__restrict, char *__restrict, int, size_t);
129void setbuf(FILE *__restrict, char *__restrict);
130
131char *tmpnam(char *);
132FILE *tmpfile(void);
133
134#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
135 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
136 || defined(_BSD_SOURCE)
137FILE *fmemopen(void *__restrict, size_t, const char *__restrict);
138FILE *open_memstream(char **, size_t *);
139FILE *fdopen(int, const char *);
140FILE *popen(const char *, const char *);
141int pclose(FILE *);
142int fileno(FILE *);
143int fseeko(FILE *, off_t, int);
144off_t ftello(FILE *);
145int dprintf(int, const char *__restrict, ...);
146int vdprintf(int, const char *__restrict, __isoc_va_list);
147void flockfile(FILE *);
148int ftrylockfile(FILE *);
149void funlockfile(FILE *);
150int getc_unlocked(FILE *);
151int getchar_unlocked(void);
152int putc_unlocked(int, FILE *);
153int putchar_unlocked(int);
154ssize_t getdelim(char **__restrict, size_t *__restrict, int, FILE *__restrict);
155ssize_t getline(char **__restrict, size_t *__restrict, FILE *__restrict);
156int renameat(int, const char *, int, const char *);
157char *ctermid(char *);
158#define L_ctermid 20
159#endif
160
161#if defined(_GNU_SOURCE)
162#define RENAME_NOREPLACE (1 << 0)
163#define RENAME_EXCHANGE (1 << 1)
164#define RENAME_WHITEOUT (1 << 2)
165
166int renameat2(int, const char *, int, const char *, unsigned);
167#endif
168
169#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
170 || defined(_BSD_SOURCE)
171#define P_tmpdir "/tmp"
172char *tempnam(const char *, const char *);
173#endif
174
175#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
176#define L_cuserid 20
177char *cuserid(char *);
178void setlinebuf(FILE *);
179void setbuffer(FILE *, char *, size_t);
180int fgetc_unlocked(FILE *);
181int fputc_unlocked(int, FILE *);
182int fflush_unlocked(FILE *);
183size_t fread_unlocked(void *, size_t, size_t, FILE *);
184size_t fwrite_unlocked(const void *, size_t, size_t, FILE *);
185void clearerr_unlocked(FILE *);
186int feof_unlocked(FILE *);
187int ferror_unlocked(FILE *);
188int fileno_unlocked(FILE *);
189int getw(FILE *);
190int putw(int, FILE *);
191char *fgetln(FILE *, size_t *);
192int asprintf(char **, const char *, ...);
193int vasprintf(char **, const char *, __isoc_va_list);
194#endif
195
196#ifdef _GNU_SOURCE
197char *fgets_unlocked(char *, int, FILE *);
198int fputs_unlocked(const char *, FILE *);
199
200typedef ssize_t (cookie_read_function_t)(void *, char *, size_t);
201typedef ssize_t (cookie_write_function_t)(void *, const char *, size_t);
202typedef int (cookie_seek_function_t)(void *, off_t *, int);
203typedef int (cookie_close_function_t)(void *);
204
205typedef struct _IO_cookie_io_functions_t {
206 cookie_read_function_t *read;
207 cookie_write_function_t *write;
208 cookie_seek_function_t *seek;
209 cookie_close_function_t *close;
210} cookie_io_functions_t;
211
212FILE *fopencookie(void *, const char *, cookie_io_functions_t);
213#endif
214
215#if defined(_LARGEFILE64_SOURCE)
216#define tmpfile64 tmpfile
217#define fopen64 fopen
218#define freopen64 freopen
219#define fseeko64 fseeko
220#define ftello64 ftello
221#define fgetpos64 fgetpos
222#define fsetpos64 fsetpos
223#define fpos64_t fpos_t
224#define off64_t off_t
225#endif
226
227#ifdef __cplusplus
228}
229#endif
230
231#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/sys/epoll.h created+81
......@@ -0,0 +1,81 @@
1#ifndef _SYS_EPOLL_H
2#define _SYS_EPOLL_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <stdint.h>
9#include <sys/types.h>
10#include <sys/ioctl.h>
11#include <fcntl.h>
12
13#define __NEED_sigset_t
14
15#include <bits/alltypes.h>
16
17#define EPOLL_CLOEXEC O_CLOEXEC
18#define EPOLL_NONBLOCK O_NONBLOCK
19
20enum EPOLL_EVENTS { __EPOLL_DUMMY };
21#define EPOLLIN 0x001
22#define EPOLLPRI 0x002
23#define EPOLLOUT 0x004
24#define EPOLLRDNORM 0x040
25#define EPOLLNVAL 0x020
26#define EPOLLRDBAND 0x080
27#define EPOLLWRNORM 0x100
28#define EPOLLWRBAND 0x200
29#define EPOLLMSG 0x400
30#define EPOLLERR 0x008
31#define EPOLLHUP 0x010
32#define EPOLLRDHUP 0x2000
33#define EPOLLEXCLUSIVE (1U<<28)
34#define EPOLLWAKEUP (1U<<29)
35#define EPOLLONESHOT (1U<<30)
36#define EPOLLET (1U<<31)
37
38#define EPOLL_CTL_ADD 1
39#define EPOLL_CTL_DEL 2
40#define EPOLL_CTL_MOD 3
41
42typedef union epoll_data {
43 void *ptr;
44 int fd;
45 uint32_t u32;
46 uint64_t u64;
47} epoll_data_t;
48
49struct epoll_event {
50 uint32_t events;
51 epoll_data_t data;
52}
53#ifdef __x86_64__
54__attribute__ ((__packed__))
55#endif
56;
57
58struct epoll_params {
59 uint32_t busy_poll_usecs;
60 uint16_t busy_poll_budget;
61 uint8_t prefer_busy_poll;
62
63 uint8_t __pad;
64};
65
66#define EPOLL_IOC_TYPE 0x8A
67#define EPIOCSPARAMS _IOW(EPOLL_IOC_TYPE, 0x01, struct epoll_params)
68#define EPIOCGPARAMS _IOR(EPOLL_IOC_TYPE, 0x02, struct epoll_params)
69
70int epoll_create(int);
71int epoll_create1(int);
72int epoll_ctl(int, int, int, struct epoll_event *);
73int epoll_wait(int, struct epoll_event *, int, int);
74int epoll_pwait(int, struct epoll_event *, int, int, const sigset_t *);
75
76
77#ifdef __cplusplus
78}
79#endif
80
81#endif /* sys/epoll.h */
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/sys/reg.h created+18
......@@ -0,0 +1,18 @@
1#ifndef _SYS_REG_H
2#define _SYS_REG_H
3
4#include <limits.h>
5#include <unistd.h>
6
7#include <bits/alltypes.h>
8
9#undef __WORDSIZE
10#if __LONG_MAX == 0x7fffffffL
11#define __WORDSIZE 32
12#else
13#define __WORDSIZE 64
14#endif
15
16#include <bits/reg.h>
17
18#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/sys/stat.h created+197
......@@ -0,0 +1,197 @@
1#ifndef _SYS_STAT_H
2#define _SYS_STAT_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7#include <features.h>
8
9#define __NEED_dev_t
10#define __NEED_ino_t
11#define __NEED_mode_t
12#define __NEED_nlink_t
13#define __NEED_uid_t
14#define __NEED_gid_t
15#define __NEED_off_t
16#define __NEED_time_t
17#define __NEED_blksize_t
18#define __NEED_blkcnt_t
19#define __NEED_struct_timespec
20
21#ifdef _GNU_SOURCE
22#define __NEED_int64_t
23#define __NEED_uint64_t
24#define __NEED_uint32_t
25#define __NEED_uint16_t
26#endif
27
28#include <bits/alltypes.h>
29
30#include <bits/stat.h>
31
32#define st_atime st_atim.tv_sec
33#define st_mtime st_mtim.tv_sec
34#define st_ctime st_ctim.tv_sec
35
36#define S_IFMT 0170000
37
38#define S_IFDIR 0040000
39#define S_IFCHR 0020000
40#define S_IFBLK 0060000
41#define S_IFREG 0100000
42#define S_IFIFO 0010000
43#define S_IFLNK 0120000
44#define S_IFSOCK 0140000
45
46#define S_TYPEISMQ(buf) 0
47#define S_TYPEISSEM(buf) 0
48#define S_TYPEISSHM(buf) 0
49#define S_TYPEISTMO(buf) 0
50
51#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
52#define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR)
53#define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
54#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
55#define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
56#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
57#define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
58
59#ifndef S_IRUSR
60#define S_ISUID 04000
61#define S_ISGID 02000
62#define S_ISVTX 01000
63#define S_IRUSR 0400
64#define S_IWUSR 0200
65#define S_IXUSR 0100
66#define S_IRWXU 0700
67#define S_IRGRP 0040
68#define S_IWGRP 0020
69#define S_IXGRP 0010
70#define S_IRWXG 0070
71#define S_IROTH 0004
72#define S_IWOTH 0002
73#define S_IXOTH 0001
74#define S_IRWXO 0007
75#endif
76
77#define UTIME_NOW 0x3fffffff
78#define UTIME_OMIT 0x3ffffffe
79
80int stat(const char *__restrict, struct stat *__restrict);
81int fstat(int, struct stat *);
82int lstat(const char *__restrict, struct stat *__restrict);
83int fstatat(int, const char *__restrict, struct stat *__restrict, int);
84int chmod(const char *, mode_t);
85int fchmod(int, mode_t);
86int fchmodat(int, const char *, mode_t, int);
87mode_t umask(mode_t);
88int mkdir(const char *, mode_t);
89int mkfifo(const char *, mode_t);
90int mkdirat(int, const char *, mode_t);
91int mkfifoat(int, const char *, mode_t);
92
93#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
94int mknod(const char *, mode_t, dev_t);
95int mknodat(int, const char *, mode_t, dev_t);
96#endif
97
98int futimens(int, const struct timespec [2]);
99int utimensat(int, const char *, const struct timespec [2], int);
100
101#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
102int lchmod(const char *, mode_t);
103#define S_IREAD S_IRUSR
104#define S_IWRITE S_IWUSR
105#define S_IEXEC S_IXUSR
106#endif
107
108#if defined(_GNU_SOURCE)
109#define STATX_TYPE 1U
110#define STATX_MODE 2U
111#define STATX_NLINK 4U
112#define STATX_UID 8U
113#define STATX_GID 0x10U
114#define STATX_ATIME 0x20U
115#define STATX_MTIME 0x40U
116#define STATX_CTIME 0x80U
117#define STATX_INO 0x100U
118#define STATX_SIZE 0x200U
119#define STATX_BLOCKS 0x400U
120#define STATX_BASIC_STATS 0x7ffU
121#define STATX_BTIME 0x800U
122#define STATX_ALL 0xfffU
123#define STATX_MNT_ID 0x1000U
124#define STATX_DIOALIGN 0x2000U
125#define STATX_MNT_ID_UNIQUE 0x4000U
126
127#define STATX_ATTR_COMPRESSED 0x4
128#define STATX_ATTR_IMMUTABLE 0x10
129#define STATX_ATTR_APPEND 0x20
130#define STATX_ATTR_NODUMP 0x40
131#define STATX_ATTR_ENCRYPTED 0x800
132#define STATX_ATTR_AUTOMOUNT 0x1000
133#define STATX_ATTR_MOUNT_ROOT 0x2000
134#define STATX_ATTR_VERITY 0x100000
135#define STATX_ATTR_DAX 0x200000
136
137struct statx_timestamp {
138 int64_t tv_sec;
139 uint32_t tv_nsec, __pad;
140};
141
142struct statx {
143 uint32_t stx_mask;
144 uint32_t stx_blksize;
145 uint64_t stx_attributes;
146 uint32_t stx_nlink;
147 uint32_t stx_uid;
148 uint32_t stx_gid;
149 uint16_t stx_mode;
150 uint16_t __pad0[1];
151 uint64_t stx_ino;
152 uint64_t stx_size;
153 uint64_t stx_blocks;
154 uint64_t stx_attributes_mask;
155 struct statx_timestamp stx_atime;
156 struct statx_timestamp stx_btime;
157 struct statx_timestamp stx_ctime;
158 struct statx_timestamp stx_mtime;
159 uint32_t stx_rdev_major;
160 uint32_t stx_rdev_minor;
161 uint32_t stx_dev_major;
162 uint32_t stx_dev_minor;
163 uint64_t stx_mnt_id;
164 uint32_t stx_dio_mem_align;
165 uint32_t stx_dio_offset_align;
166 uint64_t stx_subvol;
167 uint64_t __pad1[11];
168};
169
170int statx(int, const char *__restrict, int, unsigned, struct statx *__restrict);
171#endif
172
173#if defined(_LARGEFILE64_SOURCE)
174#define stat64 stat
175#define fstat64 fstat
176#define lstat64 lstat
177#define fstatat64 fstatat
178#define blkcnt64_t blkcnt_t
179#define fsblkcnt64_t fsblkcnt_t
180#define fsfilcnt64_t fsfilcnt_t
181#define ino64_t ino_t
182#define off64_t off_t
183#endif
184
185#if _REDIR_TIME64
186__REDIR(stat, __stat_time64);
187__REDIR(fstat, __fstat_time64);
188__REDIR(lstat, __lstat_time64);
189__REDIR(fstatat, __fstatat_time64);
190__REDIR(futimens, __futimens_time64);
191__REDIR(utimensat, __utimensat_time64);
192#endif
193
194#ifdef __cplusplus
195}
196#endif
197#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/sys/uio.h created+56
......@@ -0,0 +1,56 @@
1#ifndef _SYS_UIO_H
2#define _SYS_UIO_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <features.h>
9
10#define __NEED_size_t
11#define __NEED_ssize_t
12#define __NEED_struct_iovec
13
14#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
15#define __NEED_off_t
16#endif
17
18#ifdef _GNU_SOURCE
19#define __NEED_pid_t
20#endif
21
22#include <bits/alltypes.h>
23
24#define UIO_MAXIOV 1024
25
26ssize_t readv (int, const struct iovec *, int);
27ssize_t writev (int, const struct iovec *, int);
28
29#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
30ssize_t preadv (int, const struct iovec *, int, off_t);
31ssize_t pwritev (int, const struct iovec *, int, off_t);
32#if defined(_LARGEFILE64_SOURCE)
33#define preadv64 preadv
34#define pwritev64 pwritev
35#define off64_t off_t
36#endif
37#endif
38
39#ifdef _GNU_SOURCE
40ssize_t process_vm_writev(pid_t, const struct iovec *, unsigned long, const struct iovec *, unsigned long, unsigned long);
41ssize_t process_vm_readv(pid_t, const struct iovec *, unsigned long, const struct iovec *, unsigned long, unsigned long);
42ssize_t preadv2 (int, const struct iovec *, int, off_t, int);
43ssize_t pwritev2 (int, const struct iovec *, int, off_t, int);
44#define RWF_HIPRI 0x00000001
45#define RWF_DSYNC 0x00000002
46#define RWF_SYNC 0x00000004
47#define RWF_NOWAIT 0x00000008
48#define RWF_APPEND 0x00000010
49#define RWF_NOAPPEND 0x00000020
50#endif
51
52#ifdef __cplusplus
53}
54#endif
55
56#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/sys/user.h created+25
......@@ -0,0 +1,25 @@
1#ifndef _SYS_USER_H
2#define _SYS_USER_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7#include <limits.h>
8#include <stdint.h>
9#include <unistd.h>
10
11#include <bits/alltypes.h>
12
13#undef __WORDSIZE
14#if __LONG_MAX == 0x7fffffffL
15#define __WORDSIZE 32
16#else
17#define __WORDSIZE 64
18#endif
19
20#include <bits/user.h>
21
22#ifdef __cplusplus
23}
24#endif
25#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/syslog.h created+100
......@@ -0,0 +1,100 @@
1#ifndef _SYSLOG_H
2#define _SYSLOG_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <features.h>
9
10#define LOG_EMERG 0
11#define LOG_ALERT 1
12#define LOG_CRIT 2
13#define LOG_ERR 3
14#define LOG_WARNING 4
15#define LOG_NOTICE 5
16#define LOG_INFO 6
17#define LOG_DEBUG 7
18
19#define LOG_PRIMASK 7
20#define LOG_PRI(p) ((p)&LOG_PRIMASK)
21#define LOG_MAKEPRI(f, p) ((f)|(p))
22
23#define LOG_MASK(p) (1<<(p))
24#define LOG_UPTO(p) ((1<<((p)+1))-1)
25
26#define LOG_KERN (0<<3)
27#define LOG_USER (1<<3)
28#define LOG_MAIL (2<<3)
29#define LOG_DAEMON (3<<3)
30#define LOG_AUTH (4<<3)
31#define LOG_SYSLOG (5<<3)
32#define LOG_LPR (6<<3)
33#define LOG_NEWS (7<<3)
34#define LOG_UUCP (8<<3)
35#define LOG_CRON (9<<3)
36#define LOG_AUTHPRIV (10<<3)
37#define LOG_FTP (11<<3)
38
39#define LOG_LOCAL0 (16<<3)
40#define LOG_LOCAL1 (17<<3)
41#define LOG_LOCAL2 (18<<3)
42#define LOG_LOCAL3 (19<<3)
43#define LOG_LOCAL4 (20<<3)
44#define LOG_LOCAL5 (21<<3)
45#define LOG_LOCAL6 (22<<3)
46#define LOG_LOCAL7 (23<<3)
47
48#define LOG_NFACILITIES 24
49#define LOG_FACMASK 0x3f8
50#define LOG_FAC(p) (((p)&LOG_FACMASK)>>3)
51
52#define LOG_PID 0x01
53#define LOG_CONS 0x02
54#define LOG_ODELAY 0x04
55#define LOG_NDELAY 0x08
56#define LOG_NOWAIT 0x10
57#define LOG_PERROR 0x20
58
59void closelog (void);
60void openlog (const char *, int, int);
61int setlogmask (int);
62void syslog (int, const char *, ...);
63
64#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
65#define _PATH_LOG "/dev/log"
66#define __NEED_va_list
67#include <bits/alltypes.h>
68void vsyslog (int, const char *, va_list);
69#if defined(SYSLOG_NAMES)
70#define INTERNAL_NOPRI 0x10
71#define INTERNAL_MARK (LOG_NFACILITIES<<3)
72typedef struct {
73 char *c_name;
74 int c_val;
75} CODE;
76#define prioritynames ((CODE *)(const CODE []){ \
77 { "alert", LOG_ALERT }, { "crit", LOG_CRIT }, { "debug", LOG_DEBUG }, \
78 { "emerg", LOG_EMERG }, { "err", LOG_ERR }, { "error", LOG_ERR }, \
79 { "info", LOG_INFO }, { "none", INTERNAL_NOPRI }, \
80 { "notice", LOG_NOTICE }, { "panic", LOG_EMERG }, \
81 { "warn", LOG_WARNING }, { "warning", LOG_WARNING }, { 0, -1 } })
82#define facilitynames ((CODE *)(const CODE []){ \
83 { "auth", LOG_AUTH }, { "authpriv", LOG_AUTHPRIV }, \
84 { "cron", LOG_CRON }, { "daemon", LOG_DAEMON }, { "ftp", LOG_FTP }, \
85 { "kern", LOG_KERN }, { "lpr", LOG_LPR }, { "mail", LOG_MAIL }, \
86 { "mark", INTERNAL_MARK }, { "news", LOG_NEWS }, \
87 { "security", LOG_AUTH }, { "syslog", LOG_SYSLOG }, \
88 { "user", LOG_USER }, { "uucp", LOG_UUCP }, \
89 { "local0", LOG_LOCAL0 }, { "local1", LOG_LOCAL1 }, \
90 { "local2", LOG_LOCAL2 }, { "local3", LOG_LOCAL3 }, \
91 { "local4", LOG_LOCAL4 }, { "local5", LOG_LOCAL5 }, \
92 { "local6", LOG_LOCAL6 }, { "local7", LOG_LOCAL7 }, { 0, -1 } })
93#endif
94#endif
95
96#ifdef __cplusplus
97}
98#endif
99
100#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-musl/unistd.h created+485
......@@ -0,0 +1,485 @@
1#ifndef _UNISTD_H
2#define _UNISTD_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <features.h>
9
10#define STDIN_FILENO 0
11#define STDOUT_FILENO 1
12#define STDERR_FILENO 2
13
14#define SEEK_SET 0
15#define SEEK_CUR 1
16#define SEEK_END 2
17#define SEEK_DATA 3
18#define SEEK_HOLE 4
19
20#if __cplusplus >= 201103L
21#define NULL nullptr
22#elif defined(__cplusplus)
23#define NULL 0L
24#else
25#define NULL ((void*)0)
26#endif
27
28#define __NEED_size_t
29#define __NEED_ssize_t
30#define __NEED_uid_t
31#define __NEED_gid_t
32#define __NEED_off_t
33#define __NEED_pid_t
34#define __NEED_intptr_t
35#define __NEED_useconds_t
36
37#include <bits/alltypes.h>
38
39int pipe(int [2]);
40int pipe2(int [2], int);
41int close(int);
42int posix_close(int, int);
43int dup(int);
44int dup2(int, int);
45int dup3(int, int, int);
46off_t lseek(int, off_t, int);
47int fsync(int);
48int fdatasync(int);
49
50ssize_t read(int, void *, size_t);
51ssize_t write(int, const void *, size_t);
52ssize_t pread(int, void *, size_t, off_t);
53ssize_t pwrite(int, const void *, size_t, off_t);
54
55int chown(const char *, uid_t, gid_t);
56int fchown(int, uid_t, gid_t);
57int lchown(const char *, uid_t, gid_t);
58int fchownat(int, const char *, uid_t, gid_t, int);
59
60int link(const char *, const char *);
61int linkat(int, const char *, int, const char *, int);
62int symlink(const char *, const char *);
63int symlinkat(const char *, int, const char *);
64ssize_t readlink(const char *__restrict, char *__restrict, size_t);
65ssize_t readlinkat(int, const char *__restrict, char *__restrict, size_t);
66int unlink(const char *);
67int unlinkat(int, const char *, int);
68int rmdir(const char *);
69int truncate(const char *, off_t);
70int ftruncate(int, off_t);
71
72#define F_OK 0
73#define R_OK 4
74#define W_OK 2
75#define X_OK 1
76
77int access(const char *, int);
78int faccessat(int, const char *, int, int);
79
80int chdir(const char *);
81int fchdir(int);
82char *getcwd(char *, size_t);
83
84unsigned alarm(unsigned);
85unsigned sleep(unsigned);
86int pause(void);
87
88pid_t fork(void);
89pid_t _Fork(void);
90int execve(const char *, char *const [], char *const []);
91int execv(const char *, char *const []);
92int execle(const char *, const char *, ...);
93int execl(const char *, const char *, ...);
94int execvp(const char *, char *const []);
95int execlp(const char *, const char *, ...);
96int fexecve(int, char *const [], char *const []);
97_Noreturn void _exit(int);
98
99pid_t getpid(void);
100pid_t getppid(void);
101pid_t getpgrp(void);
102pid_t getpgid(pid_t);
103int setpgid(pid_t, pid_t);
104pid_t setsid(void);
105pid_t getsid(pid_t);
106char *ttyname(int);
107int ttyname_r(int, char *, size_t);
108int isatty(int);
109pid_t tcgetpgrp(int);
110int tcsetpgrp(int, pid_t);
111
112uid_t getuid(void);
113uid_t geteuid(void);
114gid_t getgid(void);
115gid_t getegid(void);
116int getgroups(int, gid_t []);
117int setuid(uid_t);
118int seteuid(uid_t);
119int setgid(gid_t);
120int setegid(gid_t);
121
122char *getlogin(void);
123int getlogin_r(char *, size_t);
124int gethostname(char *, size_t);
125char *ctermid(char *);
126
127int getopt(int, char * const [], const char *);
128extern char *optarg;
129extern int optind, opterr, optopt;
130
131long pathconf(const char *, int);
132long fpathconf(int, int);
133long sysconf(int);
134size_t confstr(int, char *, size_t);
135
136#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
137#define F_ULOCK 0
138#define F_LOCK 1
139#define F_TLOCK 2
140#define F_TEST 3
141int setreuid(uid_t, uid_t);
142int setregid(gid_t, gid_t);
143int lockf(int, int, off_t);
144long gethostid(void);
145int nice(int);
146void sync(void);
147pid_t setpgrp(void);
148char *crypt(const char *, const char *);
149void encrypt(char *, int);
150void swab(const void *__restrict, void *__restrict, ssize_t);
151#endif
152
153#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) \
154 || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700)
155int usleep(unsigned);
156unsigned ualarm(unsigned, unsigned);
157#endif
158
159#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
160#define L_SET 0
161#define L_INCR 1
162#define L_XTND 2
163int brk(void *);
164void *sbrk(intptr_t);
165pid_t vfork(void);
166int vhangup(void);
167int chroot(const char *);
168int getpagesize(void);
169int getdtablesize(void);
170int sethostname(const char *, size_t);
171int getdomainname(char *, size_t);
172int setdomainname(const char *, size_t);
173int setgroups(size_t, const gid_t *);
174char *getpass(const char *);
175int daemon(int, int);
176void setusershell(void);
177void endusershell(void);
178char *getusershell(void);
179int acct(const char *);
180long syscall(long, ...);
181int execvpe(const char *, char *const [], char *const []);
182int issetugid(void);
183int getentropy(void *, size_t);
184extern int optreset;
185#endif
186
187#ifdef _GNU_SOURCE
188extern char **environ;
189int setresuid(uid_t, uid_t, uid_t);
190int setresgid(gid_t, gid_t, gid_t);
191int getresuid(uid_t *, uid_t *, uid_t *);
192int getresgid(gid_t *, gid_t *, gid_t *);
193char *get_current_dir_name(void);
194int syncfs(int);
195int euidaccess(const char *, int);
196int eaccess(const char *, int);
197ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
198pid_t gettid(void);
199#endif
200
201#if defined(_LARGEFILE64_SOURCE)
202#define lseek64 lseek
203#define pread64 pread
204#define pwrite64 pwrite
205#define truncate64 truncate
206#define ftruncate64 ftruncate
207#define lockf64 lockf
208#define off64_t off_t
209#endif
210
211#define POSIX_CLOSE_RESTART 0
212
213#define _XOPEN_VERSION 700
214#define _XOPEN_UNIX 1
215#define _XOPEN_ENH_I18N 1
216
217#define _POSIX_VERSION 200809L
218#define _POSIX2_VERSION _POSIX_VERSION
219
220#define _POSIX_ADVISORY_INFO _POSIX_VERSION
221#define _POSIX_CHOWN_RESTRICTED 1
222#define _POSIX_IPV6 _POSIX_VERSION
223#define _POSIX_JOB_CONTROL 1
224#define _POSIX_MAPPED_FILES _POSIX_VERSION
225#define _POSIX_MEMLOCK _POSIX_VERSION
226#define _POSIX_MEMLOCK_RANGE _POSIX_VERSION
227#define _POSIX_MEMORY_PROTECTION _POSIX_VERSION
228#define _POSIX_MESSAGE_PASSING _POSIX_VERSION
229#define _POSIX_FSYNC _POSIX_VERSION
230#define _POSIX_NO_TRUNC 1
231#define _POSIX_RAW_SOCKETS _POSIX_VERSION
232#define _POSIX_REALTIME_SIGNALS _POSIX_VERSION
233#define _POSIX_REGEXP 1
234#define _POSIX_SAVED_IDS 1
235#define _POSIX_SHELL 1
236#define _POSIX_SPAWN _POSIX_VERSION
237#define _POSIX_VDISABLE 0
238
239#define _POSIX_THREADS _POSIX_VERSION
240#define _POSIX_THREAD_PROCESS_SHARED _POSIX_VERSION
241#define _POSIX_THREAD_SAFE_FUNCTIONS _POSIX_VERSION
242#define _POSIX_THREAD_ATTR_STACKADDR _POSIX_VERSION
243#define _POSIX_THREAD_ATTR_STACKSIZE _POSIX_VERSION
244#define _POSIX_THREAD_PRIORITY_SCHEDULING _POSIX_VERSION
245#define _POSIX_THREAD_CPUTIME _POSIX_VERSION
246#define _POSIX_TIMERS _POSIX_VERSION
247#define _POSIX_TIMEOUTS _POSIX_VERSION
248#define _POSIX_MONOTONIC_CLOCK _POSIX_VERSION
249#define _POSIX_CPUTIME _POSIX_VERSION
250#define _POSIX_CLOCK_SELECTION _POSIX_VERSION
251#define _POSIX_BARRIERS _POSIX_VERSION
252#define _POSIX_SPIN_LOCKS _POSIX_VERSION
253#define _POSIX_READER_WRITER_LOCKS _POSIX_VERSION
254#define _POSIX_ASYNCHRONOUS_IO _POSIX_VERSION
255#define _POSIX_SEMAPHORES _POSIX_VERSION
256#define _POSIX_SHARED_MEMORY_OBJECTS _POSIX_VERSION
257
258#define _POSIX2_C_BIND _POSIX_VERSION
259
260#if __LONG_MAX == 0x7fffffffL
261#define _POSIX_V6_ILP32_OFFBIG 1
262#define _POSIX_V7_ILP32_OFFBIG 1
263#else
264#define _POSIX_V6_LP64_OFF64 1
265#define _POSIX_V7_LP64_OFF64 1
266#endif
267
268
269
270#define _PC_LINK_MAX 0
271#define _PC_MAX_CANON 1
272#define _PC_MAX_INPUT 2
273#define _PC_NAME_MAX 3
274#define _PC_PATH_MAX 4
275#define _PC_PIPE_BUF 5
276#define _PC_CHOWN_RESTRICTED 6
277#define _PC_NO_TRUNC 7
278#define _PC_VDISABLE 8
279#define _PC_SYNC_IO 9
280#define _PC_ASYNC_IO 10
281#define _PC_PRIO_IO 11
282#define _PC_SOCK_MAXBUF 12
283#define _PC_FILESIZEBITS 13
284#define _PC_REC_INCR_XFER_SIZE 14
285#define _PC_REC_MAX_XFER_SIZE 15
286#define _PC_REC_MIN_XFER_SIZE 16
287#define _PC_REC_XFER_ALIGN 17
288#define _PC_ALLOC_SIZE_MIN 18
289#define _PC_SYMLINK_MAX 19
290#define _PC_2_SYMLINKS 20
291
292#define _SC_ARG_MAX 0
293#define _SC_CHILD_MAX 1
294#define _SC_CLK_TCK 2
295#define _SC_NGROUPS_MAX 3
296#define _SC_OPEN_MAX 4
297#define _SC_STREAM_MAX 5
298#define _SC_TZNAME_MAX 6
299#define _SC_JOB_CONTROL 7
300#define _SC_SAVED_IDS 8
301#define _SC_REALTIME_SIGNALS 9
302#define _SC_PRIORITY_SCHEDULING 10
303#define _SC_TIMERS 11
304#define _SC_ASYNCHRONOUS_IO 12
305#define _SC_PRIORITIZED_IO 13
306#define _SC_SYNCHRONIZED_IO 14
307#define _SC_FSYNC 15
308#define _SC_MAPPED_FILES 16
309#define _SC_MEMLOCK 17
310#define _SC_MEMLOCK_RANGE 18
311#define _SC_MEMORY_PROTECTION 19
312#define _SC_MESSAGE_PASSING 20
313#define _SC_SEMAPHORES 21
314#define _SC_SHARED_MEMORY_OBJECTS 22
315#define _SC_AIO_LISTIO_MAX 23
316#define _SC_AIO_MAX 24
317#define _SC_AIO_PRIO_DELTA_MAX 25
318#define _SC_DELAYTIMER_MAX 26
319#define _SC_MQ_OPEN_MAX 27
320#define _SC_MQ_PRIO_MAX 28
321#define _SC_VERSION 29
322#define _SC_PAGE_SIZE 30
323#define _SC_PAGESIZE 30 /* !! */
324#define _SC_RTSIG_MAX 31
325#define _SC_SEM_NSEMS_MAX 32
326#define _SC_SEM_VALUE_MAX 33
327#define _SC_SIGQUEUE_MAX 34
328#define _SC_TIMER_MAX 35
329#define _SC_BC_BASE_MAX 36
330#define _SC_BC_DIM_MAX 37
331#define _SC_BC_SCALE_MAX 38
332#define _SC_BC_STRING_MAX 39
333#define _SC_COLL_WEIGHTS_MAX 40
334#define _SC_EXPR_NEST_MAX 42
335#define _SC_LINE_MAX 43
336#define _SC_RE_DUP_MAX 44
337#define _SC_2_VERSION 46
338#define _SC_2_C_BIND 47
339#define _SC_2_C_DEV 48
340#define _SC_2_FORT_DEV 49
341#define _SC_2_FORT_RUN 50
342#define _SC_2_SW_DEV 51
343#define _SC_2_LOCALEDEF 52
344#define _SC_UIO_MAXIOV 60 /* !! */
345#define _SC_IOV_MAX 60
346#define _SC_THREADS 67
347#define _SC_THREAD_SAFE_FUNCTIONS 68
348#define _SC_GETGR_R_SIZE_MAX 69
349#define _SC_GETPW_R_SIZE_MAX 70
350#define _SC_LOGIN_NAME_MAX 71
351#define _SC_TTY_NAME_MAX 72
352#define _SC_THREAD_DESTRUCTOR_ITERATIONS 73
353#define _SC_THREAD_KEYS_MAX 74
354#define _SC_THREAD_STACK_MIN 75
355#define _SC_THREAD_THREADS_MAX 76
356#define _SC_THREAD_ATTR_STACKADDR 77
357#define _SC_THREAD_ATTR_STACKSIZE 78
358#define _SC_THREAD_PRIORITY_SCHEDULING 79
359#define _SC_THREAD_PRIO_INHERIT 80
360#define _SC_THREAD_PRIO_PROTECT 81
361#define _SC_THREAD_PROCESS_SHARED 82
362#define _SC_NPROCESSORS_CONF 83
363#define _SC_NPROCESSORS_ONLN 84
364#define _SC_PHYS_PAGES 85
365#define _SC_AVPHYS_PAGES 86
366#define _SC_ATEXIT_MAX 87
367#define _SC_PASS_MAX 88
368#define _SC_XOPEN_VERSION 89
369#define _SC_XOPEN_XCU_VERSION 90
370#define _SC_XOPEN_UNIX 91
371#define _SC_XOPEN_CRYPT 92
372#define _SC_XOPEN_ENH_I18N 93
373#define _SC_XOPEN_SHM 94
374#define _SC_2_CHAR_TERM 95
375#define _SC_2_UPE 97
376#define _SC_XOPEN_XPG2 98
377#define _SC_XOPEN_XPG3 99
378#define _SC_XOPEN_XPG4 100
379#define _SC_NZERO 109
380#define _SC_XBS5_ILP32_OFF32 125
381#define _SC_XBS5_ILP32_OFFBIG 126
382#define _SC_XBS5_LP64_OFF64 127
383#define _SC_XBS5_LPBIG_OFFBIG 128
384#define _SC_XOPEN_LEGACY 129
385#define _SC_XOPEN_REALTIME 130
386#define _SC_XOPEN_REALTIME_THREADS 131
387#define _SC_ADVISORY_INFO 132
388#define _SC_BARRIERS 133
389#define _SC_CLOCK_SELECTION 137
390#define _SC_CPUTIME 138
391#define _SC_THREAD_CPUTIME 139
392#define _SC_MONOTONIC_CLOCK 149
393#define _SC_READER_WRITER_LOCKS 153
394#define _SC_SPIN_LOCKS 154
395#define _SC_REGEXP 155
396#define _SC_SHELL 157
397#define _SC_SPAWN 159
398#define _SC_SPORADIC_SERVER 160
399#define _SC_THREAD_SPORADIC_SERVER 161
400#define _SC_TIMEOUTS 164
401#define _SC_TYPED_MEMORY_OBJECTS 165
402#define _SC_2_PBS 168
403#define _SC_2_PBS_ACCOUNTING 169
404#define _SC_2_PBS_LOCATE 170
405#define _SC_2_PBS_MESSAGE 171
406#define _SC_2_PBS_TRACK 172
407#define _SC_SYMLOOP_MAX 173
408#define _SC_STREAMS 174
409#define _SC_2_PBS_CHECKPOINT 175
410#define _SC_V6_ILP32_OFF32 176
411#define _SC_V6_ILP32_OFFBIG 177
412#define _SC_V6_LP64_OFF64 178
413#define _SC_V6_LPBIG_OFFBIG 179
414#define _SC_HOST_NAME_MAX 180
415#define _SC_TRACE 181
416#define _SC_TRACE_EVENT_FILTER 182
417#define _SC_TRACE_INHERIT 183
418#define _SC_TRACE_LOG 184
419
420#define _SC_IPV6 235
421#define _SC_RAW_SOCKETS 236
422#define _SC_V7_ILP32_OFF32 237
423#define _SC_V7_ILP32_OFFBIG 238
424#define _SC_V7_LP64_OFF64 239
425#define _SC_V7_LPBIG_OFFBIG 240
426#define _SC_SS_REPL_MAX 241
427#define _SC_TRACE_EVENT_NAME_MAX 242
428#define _SC_TRACE_NAME_MAX 243
429#define _SC_TRACE_SYS_MAX 244
430#define _SC_TRACE_USER_EVENT_MAX 245
431#define _SC_XOPEN_STREAMS 246
432#define _SC_THREAD_ROBUST_PRIO_INHERIT 247
433#define _SC_THREAD_ROBUST_PRIO_PROTECT 248
434#define _SC_MINSIGSTKSZ 249
435#define _SC_SIGSTKSZ 250
436
437#define _CS_PATH 0
438#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 1
439#define _CS_GNU_LIBC_VERSION 2
440#define _CS_GNU_LIBPTHREAD_VERSION 3
441#define _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS 4
442#define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS 5
443
444#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 1116
445#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 1117
446#define _CS_POSIX_V6_ILP32_OFF32_LIBS 1118
447#define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS 1119
448#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 1120
449#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 1121
450#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 1122
451#define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS 1123
452#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 1124
453#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 1125
454#define _CS_POSIX_V6_LP64_OFF64_LIBS 1126
455#define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS 1127
456#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 1128
457#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 1129
458#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 1130
459#define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS 1131
460#define _CS_POSIX_V7_ILP32_OFF32_CFLAGS 1132
461#define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS 1133
462#define _CS_POSIX_V7_ILP32_OFF32_LIBS 1134
463#define _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS 1135
464#define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS 1136
465#define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS 1137
466#define _CS_POSIX_V7_ILP32_OFFBIG_LIBS 1138
467#define _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS 1139
468#define _CS_POSIX_V7_LP64_OFF64_CFLAGS 1140
469#define _CS_POSIX_V7_LP64_OFF64_LDFLAGS 1141
470#define _CS_POSIX_V7_LP64_OFF64_LIBS 1142
471#define _CS_POSIX_V7_LP64_OFF64_LINTFLAGS 1143
472#define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS 1144
473#define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS 1145
474#define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS 1146
475#define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS 1147
476#define _CS_V6_ENV 1148
477#define _CS_V7_ENV 1149
478#define _CS_POSIX_V7_THREADS_CFLAGS 1150
479#define _CS_POSIX_V7_THREADS_LDFLAGS 1151
480
481#ifdef __cplusplus
482}
483#endif
484
485#endif
\ No newline at end of file
lib/libc/musl/arch/hexagon/atomic_arch.h created+191
......@@ -0,0 +1,191 @@
1#define a_ctz_32 a_ctz_32
2static inline int a_ctz_32(unsigned long x)
3{
4 __asm__(
5 "%0 = ct0(%0)\n\t"
6 : "+r"(x));
7 return x;
8}
9
10#define a_ctz_64 a_ctz_64
11static inline int a_ctz_64(uint64_t x)
12{
13 int count;
14 __asm__(
15 "%0 = ct0(%1)\n\t"
16 : "=r"(count) : "r"(x));
17 return count;
18}
19#define a_clz_64 a_clz_64
20static inline int a_clz_64(uint64_t x)
21{
22 __asm__(
23 "%0 = brev(%0)\n\t"
24 : "+r"(x));
25 return a_ctz_64(x);
26}
27
28#define a_cas a_cas
29static inline int a_cas(volatile int *p, int t, int s)
30{
31 int dummy;
32 __asm__ __volatile__(
33 "1: %0 = memw_locked(%1)\n\t"
34 " { p0 = cmp.eq(%0, %2)\n\t"
35 " if (!p0.new) jump:nt 2f }\n\t"
36 " memw_locked(%1, p0) = %3\n\t"
37 " if (!p0) jump 1b\n\t"
38 "2: \n\t"
39 : "=&r"(dummy)
40 : "r"(p), "r"(t), "r"(s)
41 : "p0", "memory" );
42 return dummy;
43}
44
45#define a_cas_p a_cas_p
46static inline void *a_cas_p(volatile void *p, void *t, void *s)
47{
48 return (void *)a_cas(p, (int)t, (int)s);
49}
50
51#define a_swap a_swap
52static inline int a_swap(volatile int *x, int v)
53{
54 int old, dummy;
55 __asm__ __volatile__(
56 " %1 = %3\n\t"
57 "1: %0 = memw_locked(%2)\n\t"
58 " memw_locked(%2, p0) = %1\n\t"
59 " if (!p0) jump 1b\n\t"
60 : "=&r"(old), "=&r"(dummy)
61 : "r"(x), "r"(v)
62 : "p0", "memory" );
63 return old;
64}
65
66#define a_fetch_add a_fetch_add
67static inline int a_fetch_add(volatile int *x, int v)
68{
69 int old, dummy;
70 __asm__ __volatile__(
71 "1: %0 = memw_locked(%2)\n\t"
72 " %1 = add(%0, %3)\n\t"
73 " memw_locked(%2, p0) = %1\n\t"
74 " if (!p0) jump 1b\n\t"
75 : "=&r"(old), "=&r"(dummy)
76 : "r"(x), "r"(v)
77 : "p0", "memory" );
78 return old;
79}
80
81#define a_inc a_inc
82static inline void a_inc(volatile int *x)
83{
84 a_fetch_add(x, 1);
85}
86
87#define a_dec a_dec
88static inline void a_dec(volatile int *x)
89{
90 int dummy;
91 __asm__ __volatile__(
92 "1: %0 = memw_locked(%1)\n\t"
93 " %0 = add(%0, #-1)\n\t"
94 " memw_locked(%1, p0) = %0\n\t"
95 " if (!p0) jump 1b\n\t"
96 : "=&r"(dummy)
97 : "r"(x)
98 : "p0", "memory" );
99}
100
101#define a_store a_store
102static inline void a_store(volatile int *p, int x)
103{
104 int dummy;
105 __asm__ __volatile__(
106 "1: %0 = memw_locked(%1)\n\t"
107 " memw_locked(%1, p0) = %2\n\t"
108 " if (!p0) jump 1b\n\t"
109 : "=&r"(dummy)
110 : "r"(p), "r"(x)
111 : "p0", "memory" );
112}
113
114#define a_barrier a_barrier
115static inline void a_barrier()
116{
117 __asm__ __volatile__ ("barrier" ::: "memory");
118}
119#define a_spin a_spin
120static inline void a_spin()
121{
122 __asm__ __volatile__ ("pause(#255)" :::);
123}
124
125#define a_crash a_crash
126static inline void a_crash()
127{
128 *(volatile char *)0=0;
129}
130
131#define a_and a_and
132static inline void a_and(volatile int *p, int v)
133{
134 int dummy;
135 __asm__ __volatile__(
136 "1: %0 = memw_locked(%1)\n\t"
137 " %0 = and(%0, %2)\n\t"
138 " memw_locked(%1, p0) = %0\n\t"
139 " if (!p0) jump 1b\n\t"
140 : "=&r"(dummy)
141 : "r"(p), "r"(v)
142 : "p0", "memory" );
143}
144
145#define a_or a_or
146static inline void a_or(volatile int *p, int v)
147{
148 int dummy;
149 __asm__ __volatile__(
150 "1: %0 = memw_locked(%1)\n\t"
151 " %0 = or(%0, %2)\n\t"
152 " memw_locked(%1, p0) = %0\n\t"
153 " if (!p0) jump 1b\n\t"
154 : "=&r"(dummy)
155 : "r"(p), "r"(v)
156 : "p0", "memory" );
157}
158
159#define a_or_l a_or_l
160static inline void a_or_l(volatile void *p, long v)
161{
162 a_or(p, v);
163}
164
165#define a_and_64 a_and_64
166static inline void a_and_64(volatile uint64_t *p, uint64_t v)
167{
168 uint64_t dummy;
169 __asm__ __volatile__(
170 "1: %0 = memd_locked(%1)\n\t"
171 " %0 = and(%0, %2)\n\t"
172 " memd_locked(%1, p0) = %0\n\t"
173 " if (!p0) jump 1b\n\t"
174 : "=&r"(dummy)
175 : "r"(p), "r"(v)
176 : "p0", "memory" );
177}
178
179#define a_or_64 a_or_64
180static inline void a_or_64(volatile uint64_t *p, uint64_t v)
181{
182 uint64_t dummy;
183 __asm__ __volatile__(
184 "1: %0 = memd_locked(%1)\n\t"
185 " %0 = or(%0, %2)\n\t"
186 " memd_locked(%1, p0) = %0\n\t"
187 " if (!p0) jump 1b\n\t"
188 : "=&r"(dummy)
189 : "r"(p), "r"(v)
190 : "p0", "memory" );
191}
lib/libc/musl/arch/hexagon/bits/fenv.h created+20
......@@ -0,0 +1,20 @@
1#define FE_INVALID (1 << 1)
2#define FE_DIVBYZERO (1 << 2)
3#define FE_OVERFLOW (1 << 3)
4#define FE_UNDERFLOW (1 << 4)
5#define FE_INEXACT (1 << 5)
6#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \
7 FE_OVERFLOW | FE_UNDERFLOW)
8
9#define FE_TONEAREST 0x00
10#define FE_TOWARDZERO 0x01
11#define FE_DOWNWARD 0x02
12#define FE_UPWARD 0x03
13
14typedef unsigned long fexcept_t;
15
16typedef struct {
17 unsigned long __cw;
18} fenv_t;
19
20#define FE_DFL_ENV ((const fenv_t *) -1)
lib/libc/musl/arch/hexagon/bits/float.h created+16
......@@ -0,0 +1,16 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
4#define LDBL_MIN 2.22507385850720138309e-308L
5#define LDBL_MAX 1.79769313486231570815e+308L
6#define LDBL_EPSILON 2.22044604925031308085e-16L
7
8#define LDBL_MANT_DIG 53
9#define LDBL_MIN_EXP (-1021)
10#define LDBL_MAX_EXP 1024
11
12#define LDBL_DIG 15
13#define LDBL_MIN_10_EXP (-307)
14#define LDBL_MAX_10_EXP 308
15
16#define DECIMAL_DIG 17
lib/libc/musl/arch/hexagon/bits/ipcstat.h created+1
......@@ -0,0 +1 @@
1#define IPC_STAT 0x102
lib/libc/musl/arch/hexagon/bits/msg.h created+18
......@@ -0,0 +1,18 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 unsigned long __msg_stime_lo;
4 unsigned long __msg_stime_hi;
5 unsigned long __msg_rtime_lo;
6 unsigned long __msg_rtime_hi;
7 unsigned long __msg_ctime_lo;
8 unsigned long __msg_ctime_hi;
9 unsigned long msg_cbytes;
10 msgqnum_t msg_qnum;
11 msglen_t msg_qbytes;
12 pid_t msg_lspid;
13 pid_t msg_lrpid;
14 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
18};
lib/libc/musl/arch/hexagon/bits/posix.h created+2
......@@ -0,0 +1,2 @@
1#define _POSIX_V6_ILP32_OFFBIG 1
2#define _POSIX_V7_ILP32_OFFBIG 1
lib/libc/musl/arch/hexagon/bits/sem.h created+13
......@@ -0,0 +1,13 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_otime_hi;
5 unsigned long __sem_ctime_lo;
6 unsigned long __sem_ctime_hi;
7 unsigned short sem_nsems;
8 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
9 long __unused3;
10 long __unused4;
11 time_t sem_otime;
12 time_t sem_ctime;
13};
lib/libc/musl/arch/hexagon/bits/setjmp.h created+1
......@@ -0,0 +1 @@
1typedef long long __jmp_buf[8];
lib/libc/musl/arch/hexagon/bits/shm.h created+31
......@@ -0,0 +1,31 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_atime_hi;
8 unsigned long __shm_dtime_lo;
9 unsigned long __shm_dtime_hi;
10 unsigned long __shm_ctime_lo;
11 unsigned long __shm_ctime_hi;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17 unsigned long __pad3;
18 time_t shm_atime;
19 time_t shm_dtime;
20 time_t shm_ctime;
21};
22
23struct shminfo {
24 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
25};
26
27struct shm_info {
28 int __used_ids;
29 unsigned long shm_tot, shm_rss, shm_swp;
30 unsigned long __swap_attempts, __swap_successes;
31};
lib/libc/musl/arch/hexagon/bits/signal.h created+103
......@@ -0,0 +1,103 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10typedef int greg_t, gregset_t[18];
11typedef struct sigcontext
12{
13 unsigned long r0, r1, r2, r3;
14 unsigned long r4, r5, r6, r7;
15 unsigned long r8, r9, r10, r11;
16 unsigned long r12, r13, r14, r15;
17 unsigned long r16, r17, r18, r19;
18 unsigned long r20, r21, r22, r23;
19 unsigned long r24, r25, r26, r27;
20 unsigned long r28, r29, r30, r31;
21 unsigned long sa0;
22 unsigned long lc0;
23 unsigned long sa1;
24 unsigned long lc1;
25 unsigned long m0;
26 unsigned long m1;
27 unsigned long usr;
28 unsigned long p3_0;
29 unsigned long gp;
30 unsigned long ugp;
31 unsigned long pc;
32 unsigned long cause;
33 unsigned long badva;
34 unsigned long pad1;
35 unsigned long long pad2;
36} mcontext_t;
37#else
38typedef struct {
39 unsigned long __regs[48];
40} __attribute__((__aligned__(8))) mcontext_t;
41#endif
42
43struct sigaltstack {
44 void *ss_sp;
45 int ss_flags;
46 size_t ss_size;
47};
48
49typedef struct __ucontext {
50 unsigned long uc_flags;
51 struct __ucontext *uc_link;
52 stack_t uc_stack;
53 mcontext_t uc_mcontext;
54 sigset_t uc_sigmask;
55} ucontext_t;
56
57#define SA_NOCLDSTOP 1
58#define SA_NOCLDWAIT 2
59#define SA_SIGINFO 4
60#define SA_ONSTACK 0x08000000
61#define SA_RESTART 0x10000000
62#define SA_NODEFER 0x40000000
63#define SA_RESETHAND 0x80000000
64#define SA_RESTORER 0x04000000
65
66#endif
67
68#define SIGHUP 1
69#define SIGINT 2
70#define SIGQUIT 3
71#define SIGILL 4
72#define SIGTRAP 5
73#define SIGABRT 6
74#define SIGIOT SIGABRT
75#define SIGBUS 7
76#define SIGFPE 8
77#define SIGKILL 9
78#define SIGUSR1 10
79#define SIGSEGV 11
80#define SIGUSR2 12
81#define SIGPIPE 13
82#define SIGALRM 14
83#define SIGTERM 15
84#define SIGSTKFLT 16
85#define SIGCHLD 17
86#define SIGCONT 18
87#define SIGSTOP 19
88#define SIGTSTP 20
89#define SIGTTIN 21
90#define SIGTTOU 22
91#define SIGURG 23
92#define SIGXCPU 24
93#define SIGXFSZ 25
94#define SIGVTALRM 26
95#define SIGPROF 27
96#define SIGWINCH 28
97#define SIGIO 29
98#define SIGPOLL 29
99#define SIGPWR 30
100#define SIGSYS 31
101#define SIGUNUSED SIGSYS
102
103#define _NSIG 65
lib/libc/musl/arch/hexagon/bits/stat.h created+20
......@@ -0,0 +1,20 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3struct stat {
4 dev_t st_dev;
5 ino_t st_ino;
6 mode_t st_mode;
7 nlink_t st_nlink;
8 uid_t st_uid;
9 gid_t st_gid;
10 dev_t st_rdev;
11 unsigned long __pad;
12 off_t st_size;
13 blksize_t st_blksize;
14 int __pad2;
15 blkcnt_t st_blocks;
16 struct timespec st_atim;
17 struct timespec st_mtim;
18 struct timespec st_ctim;
19 unsigned __unused[2];
20};
lib/libc/musl/arch/hexagon/bits/stdint.h created+20
......@@ -0,0 +1,20 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT32_MIN
16#define INTPTR_MAX INT32_MAX
17#define UINTPTR_MAX UINT32_MAX
18#define PTRDIFF_MIN INT32_MIN
19#define PTRDIFF_MAX INT32_MAX
20#define SIZE_MAX UINT32_MAX
lib/libc/musl/arch/hexagon/bits/user.h created+60
......@@ -0,0 +1,60 @@
1#ifndef HEXAGON_ASM_USER_H
2#define HEXAGON_ASM_USER_H
3
4struct user_regs_struct {
5 unsigned long r0;
6 unsigned long r1;
7 unsigned long r2;
8 unsigned long r3;
9 unsigned long r4;
10 unsigned long r5;
11 unsigned long r6;
12 unsigned long r7;
13 unsigned long r8;
14 unsigned long r9;
15 unsigned long r10;
16 unsigned long r11;
17 unsigned long r12;
18 unsigned long r13;
19 unsigned long r14;
20 unsigned long r15;
21 unsigned long r16;
22 unsigned long r17;
23 unsigned long r18;
24 unsigned long r19;
25 unsigned long r20;
26 unsigned long r21;
27 unsigned long r22;
28 unsigned long r23;
29 unsigned long r24;
30 unsigned long r25;
31 unsigned long r26;
32 unsigned long r27;
33 unsigned long r28;
34 unsigned long r29;
35 unsigned long r30;
36 unsigned long r31;
37 unsigned long sa0;
38 unsigned long lc0;
39 unsigned long sa1;
40 unsigned long lc1;
41 unsigned long m0;
42 unsigned long m1;
43 unsigned long usr;
44 unsigned long p3_0;
45 unsigned long gp;
46 unsigned long ugp;
47 unsigned long pc;
48 unsigned long cause;
49 unsigned long badva;
50 unsigned long cs0;
51 unsigned long cs1;
52 unsigned long pad1;
53};
54
55#define ELF_NGREG 48
56typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
57
58typedef unsigned long elf_fpregset_t;
59
60#endif
lib/libc/musl/arch/hexagon/crt_arch.h created+22
......@@ -0,0 +1,22 @@
1__asm__(
2".weak _DYNAMIC \n"
3".hidden _DYNAMIC \n"
4".text \n"
5".global " START " \n"
6".type " START ", %function \n"
7START ": \n"
8" // Find _DYNAMIC\n"
9" jump 1f\n"
10".word _DYNAMIC - .\n"
11"1: r2 = pc\n"
12" r2 = add(r2, #-4)\n"
13" r1 = memw(r2)\n"
14" r1 = add(r2, r1)\n"
15" r30 = #0 // Signals the end of backtrace\n"
16" r0 = r29 // Pointer to argc/argv\n"
17" r29 = and(r29, #-16) // Align\n"
18" memw(r29+#-8) = r29\n"
19" r29 = add(r29, #-8)\n"
20" call " START "_c \n"
21".size " START ", .-" START "\n"
22);
lib/libc/musl/arch/hexagon/kstat.h created+21
......@@ -0,0 +1,21 @@
1struct kstat {
2 dev_t st_dev;
3 ino_t st_ino;
4 mode_t st_mode;
5 nlink_t st_nlink;
6 uid_t st_uid;
7 gid_t st_gid;
8 dev_t st_rdev;
9 unsigned long __pad;
10 off_t st_size;
11 blksize_t st_blksize;
12 int __pad2;
13 blkcnt_t st_blocks;
14 long st_atime_sec;
15 long st_atime_nsec;
16 long st_mtime_sec;
17 long st_mtime_nsec;
18 long st_ctime_sec;
19 long st_ctime_nsec;
20 unsigned __unused[2];
21};
lib/libc/musl/arch/hexagon/pthread_arch.h created+13
......@@ -0,0 +1,13 @@
1// Hexagon supports variant 2 TLS.
2static inline uintptr_t __get_tp()
3{
4 uintptr_t tp;
5 __asm__ ( "%0 = ugp" : "=r"(tp));
6 return tp;
7}
8
9#define TP_ADJ(p) (p)
10
11#define CANCEL_REG_IP 43
12
13#define MC_PC pc
lib/libc/musl/arch/hexagon/reloc.h created+16
......@@ -0,0 +1,16 @@
1#include <endian.h>
2
3#define LDSO_ARCH "hexagon"
4#define TPOFF_K 0
5
6#define REL_SYMBOLIC R_HEX_32
7#define REL_GOT R_HEX_GLOB_DAT
8#define REL_PLT R_HEX_JMP_SLOT
9#define REL_RELATIVE R_HEX_RELATIVE
10#define REL_COPY R_HEX_COPY
11#define REL_DTPMOD R_HEX_DTPMOD_32
12#define REL_TPOFF R_HEX_TPREL_32
13#define REL_DTPOFF R_HEX_DTPREL_32
14
15#define CRTJMP(pc,sp) __asm__ __volatile__( \
16 "r29 = %1 ; jumpr %0" : : "r"(pc), "r"(sp) : "memory" )
lib/libc/musl/arch/hexagon/syscall_arch.h created+78
......@@ -0,0 +1,78 @@
1
2#define __SYSCALL_LL_E(x) \
3((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
4((union { long long ll; long l[2]; }){ .ll = x }).l[1]
5#define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
6
7#define __asm_syscall(...) do { \
8 __asm__ __volatile__ ( "trap0(#1)" \
9 : "=r"(r0) : __VA_ARGS__ : "memory"); \
10 return r0; \
11 } while (0)
12
13static inline long __syscall0(long n)
14{
15 register long r6 __asm__("r6") = n;
16 register long r0 __asm__("r0");
17 __asm_syscall("r"(r6));
18}
19
20static inline long __syscall1(long n, long a)
21{
22 register long r6 __asm__("r6") = n;
23 register long r0 __asm__("r0") = a;
24 __asm_syscall("r"(r6), "0"(r0));
25}
26
27static inline long __syscall2(long n, long a, long b)
28{
29 register long r6 __asm__("r6") = n;
30 register long r0 __asm__("r0") = a;
31 register long r1 __asm__("r1") = b;
32 __asm_syscall("r"(r6), "0"(r0), "r"(r1));
33}
34
35static inline long __syscall3(long n, long a, long b, long c)
36{
37 register long r6 __asm__("r6") = n;
38 register long r0 __asm__("r0") = a;
39 register long r1 __asm__("r1") = b;
40 register long r2 __asm__("r2") = c;
41 __asm_syscall("r"(r6), "0"(r0), "r"(r1), "r"(r2));
42}
43
44static inline long __syscall4(long n, long a, long b, long c, long d)
45{
46 register long r6 __asm__("r6") = n;
47 register long r0 __asm__("r0") = a;
48 register long r1 __asm__("r1") = b;
49 register long r2 __asm__("r2") = c;
50 register long r3 __asm__("r3") = d;
51 __asm_syscall("r"(r6), "0"(r0), "r"(r1), "r"(r2), "r"(r3));
52}
53
54static inline long __syscall5(long n, long a, long b, long c, long d, long e)
55{
56 register long r6 __asm__("r6") = n;
57 register long r0 __asm__("r0") = a;
58 register long r1 __asm__("r1") = b;
59 register long r2 __asm__("r2") = c;
60 register long r3 __asm__("r3") = d;
61 register long r4 __asm__("r4") = e;
62 __asm_syscall("r"(r6), "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4));
63}
64
65static inline long __syscall6(long n, long a, long b, long c, long d, long e,
66 long f)
67{
68 register long r6 __asm__("r6") = n;
69 register long r0 __asm__("r0") = a;
70 register long r1 __asm__("r1") = b;
71 register long r2 __asm__("r2") = c;
72 register long r3 __asm__("r3") = d;
73 register long r4 __asm__("r4") = e;
74 register long r5 __asm__("r5") = f;
75 __asm_syscall("r"(r6), "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4), "r"(r5));
76}
77
78#define SYSCALL_FADVISE_6_ARG
lib/libc/musl/include/elf.h+101
......@@ -3406,6 +3406,107 @@ enum
34063406#define R_LARCH_32_PCREL 99
34073407#define R_LARCH_RELAX 100
34083408
3409#define R_HEX_NONE 0
3410#define R_HEX_B22_PCREL 1
3411#define R_HEX_B15_PCREL 2
3412#define R_HEX_B7_PCREL 3
3413#define R_HEX_LO16 4
3414#define R_HEX_HI16 5
3415#define R_HEX_32 6
3416#define R_HEX_16 7
3417#define R_HEX_8 8
3418#define R_HEX_GPREL16_0 9
3419#define R_HEX_GPREL16_1 10
3420#define R_HEX_GPREL16_2 11
3421#define R_HEX_GPREL16_3 12
3422#define R_HEX_HL16 13
3423#define R_HEX_B13_PCREL 14
3424#define R_HEX_B9_PCREL 15
3425#define R_HEX_B32_PCREL_X 16
3426#define R_HEX_32_6_X 17
3427#define R_HEX_B22_PCREL_X 18
3428#define R_HEX_B15_PCREL_X 19
3429#define R_HEX_B13_PCREL_X 20
3430#define R_HEX_B9_PCREL_X 21
3431#define R_HEX_B7_PCREL_X 22
3432#define R_HEX_16_X 23
3433#define R_HEX_12_X 24
3434#define R_HEX_11_X 25
3435#define R_HEX_10_X 26
3436#define R_HEX_9_X 27
3437#define R_HEX_8_X 28
3438#define R_HEX_7_X 29
3439#define R_HEX_6_X 30
3440#define R_HEX_32_PCREL 31
3441#define R_HEX_COPY 32
3442#define R_HEX_GLOB_DAT 33
3443#define R_HEX_JMP_SLOT 34
3444#define R_HEX_RELATIVE 35
3445#define R_HEX_PLT_B22_PCREL 36
3446#define R_HEX_GOTOFF_LO16 37
3447#define R_HEX_GOTOFF_HI16 38
3448#define R_HEX_GOTOFF_32 39
3449#define R_HEX_GOT_LO16 40
3450#define R_HEX_GOT_HI16 41
3451#define R_HEX_GOT_32 42
3452#define R_HEX_GOT_16 43
3453#define R_HEX_DTPMOD_32 44
3454#define R_HEX_DTPREL_LO16 45
3455#define R_HEX_DTPREL_HI16 46
3456#define R_HEX_DTPREL_32 47
3457#define R_HEX_DTPREL_16 48
3458#define R_HEX_GD_PLT_B22_PCREL 49
3459#define R_HEX_GD_GOT_LO16 50
3460#define R_HEX_GD_GOT_HI16 51
3461#define R_HEX_GD_GOT_32 52
3462#define R_HEX_GD_GOT_16 53
3463#define R_HEX_IE_LO16 54
3464#define R_HEX_IE_HI16 55
3465#define R_HEX_IE_32 56
3466#define R_HEX_IE_GOT_LO16 57
3467#define R_HEX_IE_GOT_HI16 58
3468#define R_HEX_IE_GOT_32 59
3469#define R_HEX_IE_GOT_16 60
3470#define R_HEX_TPREL_LO16 61
3471#define R_HEX_TPREL_HI16 62
3472#define R_HEX_TPREL_32 63
3473#define R_HEX_TPREL_16 64
3474#define R_HEX_6_PCREL_X 65
3475#define R_HEX_GOTREL_32_6_X 66
3476#define R_HEX_GOTREL_16_X 67
3477#define R_HEX_GOTREL_11_X 68
3478#define R_HEX_GOT_32_6_X 69
3479#define R_HEX_GOT_16_X 70
3480#define R_HEX_GOT_11_X 71
3481#define R_HEX_DTPREL_32_6_X 72
3482#define R_HEX_DTPREL_16_X 73
3483#define R_HEX_DTPREL_11_X 74
3484#define R_HEX_GD_GOT_32_6_X 75
3485#define R_HEX_GD_GOT_16_X 76
3486#define R_HEX_GD_GOT_11_X 77
3487#define R_HEX_IE_32_6_X 78
3488#define R_HEX_IE_16_X 79
3489#define R_HEX_IE_GOT_32_6_X 80
3490#define R_HEX_IE_GOT_16_X 81
3491#define R_HEX_IE_GOT_11_X 82
3492#define R_HEX_TPREL_32_6_X 83
3493#define R_HEX_TPREL_16_X 84
3494#define R_HEX_TPREL_11_X 85
3495#define R_HEX_LD_PLT_B22_PCREL 86
3496#define R_HEX_LD_GOT_LO16 87
3497#define R_HEX_LD_GOT_HI16 88
3498#define R_HEX_LD_GOT_32 89
3499#define R_HEX_LD_GOT_16 90
3500#define R_HEX_LD_GOT_32_6_X 91
3501#define R_HEX_LD_GOT_16_X 92
3502#define R_HEX_LD_GOT_11_X 93
3503#define R_HEX_23_REG 94
3504#define R_HEX_GD_PLT_B22_PCREL_X 95
3505#define R_HEX_GD_PLT_B32_PCREL_X 96
3506#define R_HEX_LD_PLT_B22_PCREL_X 97
3507#define R_HEX_LD_PLT_B32_PCREL_X 98
3508
3509
34093510#ifdef __cplusplus
34103511}
34113512#endif
lib/libc/musl/libc.S+2-2
......@@ -2607,12 +2607,12 @@ insque:
26072607.globl ioctl
26082608.type ioctl, %function;
26092609ioctl:
2610#if !defined(ARCH_aarch64) && !defined(ARCH_arm) && !defined(ARCH_loongarch64) && !defined(ARCH_mips64) && !defined(ARCH_mipsn32) && !defined(ARCH_riscv32) && !defined(ARCH_riscv64) && !defined(ARCH_s390x)
2610#if !defined(ARCH_aarch64) && !defined(ARCH_arm) && !defined(ARCH_hexagon) && !defined(ARCH_loongarch64) && !defined(ARCH_mips64) && !defined(ARCH_mipsn32) && !defined(ARCH_riscv32) && !defined(ARCH_riscv64) && !defined(ARCH_s390x)
26112611.globl ioperm
26122612.type ioperm, %function;
26132613ioperm:
26142614#endif
2615#if !defined(ARCH_aarch64) && !defined(ARCH_arm) && !defined(ARCH_loongarch64) && !defined(ARCH_mips64) && !defined(ARCH_mipsn32) && !defined(ARCH_riscv32) && !defined(ARCH_riscv64) && !defined(ARCH_s390x)
2615#if !defined(ARCH_aarch64) && !defined(ARCH_arm) && !defined(ARCH_hexagon) && !defined(ARCH_loongarch64) && !defined(ARCH_mips64) && !defined(ARCH_mipsn32) && !defined(ARCH_riscv32) && !defined(ARCH_riscv64) && !defined(ARCH_s390x)
26162616.globl iopl
26172617.type iopl, %function;
26182618iopl:
lib/libc/musl/src/fenv/hexagon/fenv.S created+144
......@@ -0,0 +1,144 @@
1/*
2 * The Hexagon user status register includes five status fields which work
3 * as sticky flags for the five IEEE-defined exception conditions:
4 * inexact, overflow, underflow, divide by zero, and invalid.
5 * A sticky flag is set when the corresponding exception occurs,
6 * and remains set until explicitly cleared.
7 *
8 * usr:23:22 - Rounding Mode
9 * 00: Round toward nearest
10 * 01: Round toward zero
11 * 10: Downward Round toward negative infinity
12 * 11: Upward Round toward positive infinity
13 *
14 * usr:5 - Floating-point IEEE Inexact Sticky Flag.
15 * usr:4 - Floating-point IEEE Underflow Sticky Flag.
16 * usr:3 - Floating-point IEEE Overflow Sticky Flag.
17 * usr:2 - Floating-point IEEE Divide-By-Zero Sticky Flag.
18 * usr:1 - Floating-point IEEE Invalid Sticky Flag.
19 * usr:0 - Sticky Saturation Overflow, when 1 saturation occurred.
20 */
21
22#define FE_ALL_EXCEPT 0x3f
23
24#define USR_FE_MASK 0x3fc0003f
25#define RND_MASK (0x3 << 22)
26#define RND_NEAR (0x0 << 22)
27#define RND_ZERO (0x1 << 22)
28#define RND_DOWN (0x2 << 22)
29#define RND_UP (0x3 << 22)
30
31/*
32 * int feclearexcept(int mask)
33 */
34.global feclearexcept
35.type feclearexcept,@function
36feclearexcept:
37 {
38 r0 = and(r0, #FE_ALL_EXCEPT) // Only touch the IEEE flag bits.
39 r1 = usr
40 }
41 r1 = and(r1, ~r0)
42 {
43 usr = r1
44 r0 = #0
45 jumpr r31
46 }
47
48/*
49 * int feraiseexcept(int mask)
50 */
51.global feraiseexcept
52.type feraiseexcept,@function
53feraiseexcept:
54 {
55 r0 = and(r0, #FE_ALL_EXCEPT) // Only touch the IEEE flag bits.
56 r1 = usr
57 }
58 r1 = or(r1, r0)
59 {
60 usr = r1
61 r0 = #0
62 jumpr r31
63 }
64
65
66/*
67 * int fetestexcept(int mask)
68 */
69.global fetestexcept
70.type fetestexcept,@function
71fetestexcept:
72 {
73 r0 = and(r0, #FE_ALL_EXCEPT) // Only touch the IEEE flag bits.
74 r1 = usr
75 }
76 {
77 r0 = and(r1, r0)
78 jumpr r31
79 }
80
81/*
82 *int fegetround(void)
83 */
84.global fegetround
85.type fegetround,@function
86fegetround:
87 r0 = usr
88 r0 = and(r0, ##RND_MASK)
89 r0 = lsr(r0, #22);
90 jumpr r31
91
92/*
93 * int __fesetround(int r)
94 */
95.global __fesetround
96.type __fesetround,@function
97__fesetround:
98 {
99 r0 = and(r0, #0x3) // Can only be 0,1,2, or 3
100 r1 = usr
101 r2 = ##RND_MASK
102 }
103 {
104 r1 = and (r1, ~r2) // Clear the current rounding bits.
105 r0 = asl (r0, #22)
106 }
107 r1 = or(r1, r0)
108 usr = r1
109 {
110 r0 = #0; jumpr r31
111 }
112
113/*
114 * int fegetenv(fenv_t *envp)
115 */
116.global fegetenv
117.type fegetenv,@function
118fegetenv:
119 r1 = usr
120 memw(r0) = r1
121 {
122 r0 = #0
123 jumpr r31
124 }
125
126/*
127 * int fesetenv(const fenv_t *envp)
128 */
129.global fesetenv
130.type fesetenv,@function
131fesetenv:
132 { p0 = cmp.eq(r0, #-1); if (p0.new) r1 = #0 } /* The default mode */
133 if (!p0) r1 = memw(r0) /* stored in fenv_t */
134
135 r2 = ##USR_FE_MASK // USR:FE bit mask
136 r1 = and(r1, r2) // MASK the input bits with the FE bits
137 r3 = usr
138 r3 = and(r3, ~r2) // Clear any currently set FE bits
139 r3 = or(r3, r1) // Set the newbits
140 usr = r3
141 {
142 r0 = #0
143 jumpr r31
144 }
lib/libc/musl/src/setjmp/hexagon/longjmp.s created+25
......@@ -0,0 +1,25 @@
1.text
2.global _longjmp
3.global longjmp
4.type _longjmp,%function
5.type longjmp,%function
6_longjmp:
7longjmp:
8 { r17:16=memd(r0+#0)
9 r19:18=memd(r0+#8) }
10 { r21:20=memd(r0+#16)
11 r23:22=memd(r0+#24) }
12 { r25:24=memd(r0+#32)
13 r27:26=memd(r0+#40) }
14 { r29:28=memd(r0+#48)
15 r31:30=memd(r0+#56) }
16
17 r0 = r1
18 r1 = #0
19 p0 = cmp.eq(r0,r1)
20 if (!p0) jumpr r31
21 r0 = #1
22
23 jumpr r31
24.size _longjmp, .-_longjmp
25.size longjmp, .-longjmp
lib/libc/musl/src/setjmp/hexagon/setjmp.s created+24
......@@ -0,0 +1,24 @@
1.text
2.global __setjmp
3.global _setjmp
4.global setjmp
5.type __setjmp,@function
6.type _setjmp,@function
7.type setjmp,@function
8__setjmp:
9_setjmp:
10setjmp:
11 { memd(r0+#0)=r17:16
12 memd(r0+#8)=r19:18 }
13 { memd(r0+#16)=r21:20
14 memd(r0+#24)=r23:22 }
15 { memd(r0+#32)=r25:24
16 memd(r0+#40)=r27:26 }
17 { memd(r0+#48)=r29:28
18 memd(r0+#56)=r31:30 }
19
20 r0 = #0
21 jumpr r31
22.size __setjmp, .-__setjmp
23.size _setjmp, .-_setjmp
24.size setjmp, .-setjmp
lib/libc/musl/src/signal/hexagon/restore.s created+11
......@@ -0,0 +1,11 @@
1// TODO - Test this if sa_restorer is ever supported in our kernel
2.global __restore
3.type __restore,%function
4.global __restore_rt
5.type __restore_rt,%function
6__restore:
7__restore_rt:
8 r6 = #139 // SYS_rt_sigreturn
9 trap0(#0)
10.size __restore, .-__restore
11.size __restore_rt, .-__restore_rt
lib/libc/musl/src/signal/hexagon/sigsetjmp.s created+28
......@@ -0,0 +1,28 @@
1.global sigsetjmp
2.global __sigsetjmp
3.type sigsetjmp,@function
4.type __sigsetjmp,@function
5.balign 4
6sigsetjmp:
7__sigsetjmp:
8 // if savemask is 0 sigsetjmp behaves like setjmp
9 {
10 p0 = cmp.eq(r1, #0)
11 if (p0.new) jump:t ##setjmp
12 }
13 {
14 memw(r0+#64+4+8) = r16 // save r16 in __ss[2]
15 memw(r0+#64) = r31 // save linkregister in __fl
16 r16 = r0
17 }
18 call ##setjmp
19 {
20 r1 = r0;
21 r0 = r16 // restore r0
22 r31 = memw(r16+#64) // restore linkregister
23 r16 = memw(r16+#64+4+8) // restore r16 from __ss[2]
24 }
25.hidden __sigsetjmp_tail
26 jump ##__sigsetjmp_tail
27
28.size sigsetjmp, .-sigsetjmp
lib/libc/musl/src/thread/hexagon/__set_thread_area.s created+7
......@@ -0,0 +1,7 @@
1.global __set_thread_area
2.type __set_thread_area,@function
3__set_thread_area:
4 { ugp = r0
5 r0 = #0
6 jumpr r31 }
7.size __set_thread_area, .-__set_thread_area
lib/libc/musl/src/thread/hexagon/__unmapself.s created+11
......@@ -0,0 +1,11 @@
1#include <syscall.h>
2
3.global __unmapself
4.type __unmapself,%function
5__unmapself:
6 r6 = #215 // SYS_munmap
7 trap0(#1)
8 r6 = #93 // SYS_exit
9 trap0(#1)
10 jumpr r31
11.size __unmapself, .-__unmapself
lib/libc/musl/src/thread/hexagon/clone.s created+37
......@@ -0,0 +1,37 @@
1// __clone(func, stack, flags, arg, ptid, tls, ctid)
2// r0, r1, r2, r3, r4, r5, stack
3
4// tid = syscall(SYS_clone, flags, stack, ptid, ctid, tls)
5// r6, r0, r1, r2, r3, r4
6// if (tid != 0) return
7// func(arg)
8// syscall(SYS_exit)
9
10.text
11.global __clone
12.type __clone,%function
13__clone:
14 allocframe(#8)
15 // Save pointers for later
16 { r11 = r0
17 r10 = r3 }
18
19 // Set up syscall args - The stack must be 8 byte aligned.
20 { r0 = r2
21 r1 = and(r1, ##0xfffffff8)
22 r2 = r4 }
23 {
24 r3 = memw(r30+#8)
25 r4 = r5 }
26 r6 = #220 // SYS_clone
27 trap0(#1)
28
29 p0 = cmp.eq(r0, #0)
30 if (!p0) dealloc_return
31
32 { r0 = r10
33 callr r11 }
34
35 r6 = #93 // SYS_exit
36 trap0(#1)
37.size __clone, .-__clone
lib/libc/musl/src/thread/hexagon/syscall_cp.s created+35
......@@ -0,0 +1,35 @@
1// __syscall_cp_asm(&self->cancel, nr, u, v, w, x, y, z)
2// r0 r1 r2 r3 r4 r5 stack stack
3
4// syscall(nr, u, v, w, x, y, z)
5// r6 r0 r1 r2 r3 r4 r5
6
7.text
8.global __cp_begin
9.hidden __cp_begin
10.global __cp_end
11.hidden __cp_end
12.global __cp_cancel
13.hidden __cp_cancel
14.hidden __cancel
15.global __syscall_cp_asm
16.hidden __syscall_cp_asm
17.type __syscall_cp_asm,%function
18__syscall_cp_asm:
19__cp_begin:
20 r0 = memw(r0+#0)
21 {
22 p0 = cmp.eq(r0, #0); if (!p0.new) jump:nt __cancel
23 }
24 { r6 = r1
25 r1:0 = combine(r3, r2)
26 r3:2 = combine(r5, r4) }
27 { r4 = memw(r29+#0)
28 r5 = memw(r29+#4) }
29 trap0(#1)
30__cp_end:
31 jumpr r31
32.size __syscall_cp_asm, .-__syscall_cp_asm
33__cp_cancel:
34 jump __cancel
35.size __cp_cancel, .-__cp_cancel
lib/libc/wasi/libc-top-half/musl/arch/wasm32/bits/alltypes.h.in deleted-58
......@@ -1,58 +0,0 @@
1#define _Addr long
2#define _Int64 long long
3#define _Reg long long
4
5#define __BYTE_ORDER __BYTE_ORDER__
6
7#define __LONG_MAX __LONG_MAX__
8
9/*
10 * Rather than define everything ourselves here in the musl layer, for
11 * WASI, reference the definitions in the lower layers.
12 */
13
14#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
15#define __need_wchar_t
16#include <stddef.h>
17#define __DEFINED_wchar_t
18#endif
19
20#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
21#define __need_wint_t
22#include <stddef.h>
23#define __DEFINED_wint_t
24#endif
25
26TYPEDEF float float_t;
27TYPEDEF double double_t;
28
29#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
30#define __need_max_align_t
31#include <stddef.h>
32#define __DEFINED_max_align_t
33#endif
34
35#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
36#include <__typedef_time_t.h>
37#define __DEFINED_time_t
38#endif
39
40#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
41#include <__typedef_suseconds_t.h>
42#define __DEFINED_suseconds_t
43#endif
44
45#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
46#include <__typedef_clockid_t.h>
47#define __DEFINED_clockid_t
48#endif
49
50#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
51#include <__typedef_sigset_t.h>
52#define __DEFINED_sigset_t
53#endif
54
55#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
56#include <__typedef_clock_t.h>
57#define __DEFINED_clock_t
58#endif
lib/std/mem.zig+3-1
......@@ -431,7 +431,9 @@ test zeroes {
431431 }
432432 try testing.expectEqual(@as(@TypeOf(b.vector_u32), @splat(0)), b.vector_u32);
433433 try testing.expectEqual(@as(@TypeOf(b.vector_f32), @splat(0.0)), b.vector_f32);
434 try testing.expectEqual(@as(@TypeOf(b.vector_bool), @splat(false)), b.vector_bool);
434 if (!(builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon)) {
435 try testing.expectEqual(@as(@TypeOf(b.vector_bool), @splat(false)), b.vector_bool);
436 }
435437 try testing.expectEqual(@as(?u8, null), b.optional_int);
436438 for (b.sentinel) |e| {
437439 try testing.expectEqual(@as(u8, 0), e);
lib/std/simd.zig+1
......@@ -464,6 +464,7 @@ test "vector prefix scan" {
464464 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
465465 if ((builtin.cpu.arch == .armeb or builtin.cpu.arch == .thumbeb) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060
466466 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21893
467 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
467468
468469 if (builtin.cpu.arch.isMIPS()) return error.SkipZigTest;
469470
lib/std/zig/target.zig+2
......@@ -34,6 +34,7 @@ pub const available_libcs = [_]ArchOsAbi{
3434 .{ .arch = .aarch64_be, .os = .linux, .abi = .musl, .os_ver = .{ .major = 3, .minor = 13, .patch = 0 } },
3535 .{ .arch = .csky, .os = .linux, .abi = .gnueabi, .os_ver = .{ .major = 4, .minor = 20, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 29, .patch = 0 }, .glibc_triple = "csky-linux-gnuabiv2-soft" },
3636 .{ .arch = .csky, .os = .linux, .abi = .gnueabihf, .os_ver = .{ .major = 4, .minor = 20, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 29, .patch = 0 }, .glibc_triple = "csky-linux-gnuabiv2" },
37 .{ .arch = .hexagon, .os = .linux, .abi = .musl, .os_ver = .{ .major = 3, .minor = 2, .patch = 102 } },
3738 .{ .arch = .loongarch64, .os = .linux, .abi = .gnu, .os_ver = .{ .major = 5, .minor = 19, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 36, .patch = 0 }, .glibc_triple = "loongarch64-linux-gnu-lp64d" },
3839 .{ .arch = .loongarch64, .os = .linux, .abi = .gnusf, .os_ver = .{ .major = 5, .minor = 19, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 36, .patch = 0 }, .glibc_triple = "loongarch64-linux-gnu-lp64s" },
3940 .{ .arch = .loongarch64, .os = .linux, .abi = .musl, .os_ver = .{ .major = 5, .minor = 19, .patch = 0 } },
......@@ -154,6 +155,7 @@ pub fn muslArchName(arch: std.Target.Cpu.Arch, abi: std.Target.Abi) [:0]const u8
154155 else => switch (arch) {
155156 .arm, .armeb, .thumb, .thumbeb => "arm",
156157 .aarch64, .aarch64_be => "aarch64",
158 .hexagon => "hexagon",
157159 .loongarch64 => "loongarch64",
158160 .m68k => "m68k",
159161 .mips, .mipsel => "mips",
src/musl.zig+11
......@@ -202,6 +202,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro
202202 const family_define = switch (target.cpu.arch) {
203203 .arm, .armeb, .thumb, .thumbeb => "-DFAMILY_arm",
204204 .aarch64, .aarch64_be => "-DFAMILY_aarch64",
205 .hexagon => "-DFAMILY_hexagon",
205206 .loongarch64 => "-DFAMILY_loongarch",
206207 .m68k => "-DFAMILY_m68k",
207208 .mips, .mipsel, .mips64, .mips64el => "-DFAMILY_mips",
......@@ -320,6 +321,7 @@ fn isArchName(name: []const u8) bool {
320321 "aarch64",
321322 "arm",
322323 "generic",
324 "hexagon",
323325 "i386",
324326 "loongarch64",
325327 "m68k",
......@@ -619,6 +621,7 @@ const src_files = [_][]const u8{
619621 "musl/src/fenv/fesetround.c",
620622 "musl/src/fenv/feupdateenv.c",
621623 "musl/src/fenv/__flt_rounds.c",
624 "musl/src/fenv/hexagon/fenv.S",
622625 "musl/src/fenv/i386/fenv.s",
623626 "musl/src/fenv/loongarch64/fenv.S",
624627 "musl/src/fenv/m68k/fenv.c",
......@@ -1577,6 +1580,8 @@ const src_files = [_][]const u8{
15771580 "musl/src/setjmp/aarch64/setjmp.s",
15781581 "musl/src/setjmp/arm/longjmp.S",
15791582 "musl/src/setjmp/arm/setjmp.S",
1583 "musl/src/setjmp/hexagon/longjmp.s",
1584 "musl/src/setjmp/hexagon/setjmp.s",
15801585 "musl/src/setjmp/i386/longjmp.s",
15811586 "musl/src/setjmp/i386/setjmp.s",
15821587 "musl/src/setjmp/longjmp.c",
......@@ -1611,6 +1616,8 @@ const src_files = [_][]const u8{
16111616 "musl/src/signal/arm/sigsetjmp.s",
16121617 "musl/src/signal/block.c",
16131618 "musl/src/signal/getitimer.c",
1619 "musl/src/signal/hexagon/restore.s",
1620 "musl/src/signal/hexagon/sigsetjmp.s",
16141621 "musl/src/signal/i386/restore.s",
16151622 "musl/src/signal/i386/sigsetjmp.s",
16161623 "musl/src/signal/kill.c",
......@@ -1943,6 +1950,10 @@ const src_files = [_][]const u8{
19431950 "musl/src/thread/cnd_timedwait.c",
19441951 "musl/src/thread/cnd_wait.c",
19451952 "musl/src/thread/default_attr.c",
1953 "musl/src/thread/hexagon/clone.s",
1954 "musl/src/thread/hexagon/__set_thread_area.s",
1955 "musl/src/thread/hexagon/syscall_cp.s",
1956 "musl/src/thread/hexagon/__unmapself.s",
19461957 "musl/src/thread/i386/clone.s",
19471958 "musl/src/thread/i386/__set_thread_area.s",
19481959 "musl/src/thread/i386/syscall_cp.s",
test/behavior.zig+5-1
......@@ -104,7 +104,11 @@ test {
104104 _ = @import("behavior/union_with_members.zig");
105105 _ = @import("behavior/usingnamespace.zig");
106106 _ = @import("behavior/var_args.zig");
107 _ = @import("behavior/vector.zig");
107 // https://github.com/llvm/llvm-project/issues/118879
108 // https://github.com/llvm/llvm-project/issues/134659
109 if (!(builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon)) {
110 _ = @import("behavior/vector.zig");
111 }
108112 _ = @import("behavior/void.zig");
109113 _ = @import("behavior/while.zig");
110114 _ = @import("behavior/widening.zig");
test/behavior/cast.zig+2
......@@ -621,6 +621,7 @@ test "@intCast on vector" {
621621 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
622622 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
623623 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
624 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
624625
625626 const S = struct {
626627 fn doTheTest() !void {
......@@ -2697,6 +2698,7 @@ test "@intCast vector of signed integer" {
26972698 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
26982699 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
26992700 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
2701 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
27002702
27012703 var x: @Vector(4, i32) = .{ 1, 2, 3, 4 };
27022704 _ = &x;
test/behavior/floatop.zig+4
......@@ -241,6 +241,7 @@ test "vector cmp f16" {
241241 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
242242 if (builtin.cpu.arch.isArm()) return error.SkipZigTest;
243243 if (builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest;
244 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
244245
245246 try testCmpVector(f16);
246247 try comptime testCmpVector(f16);
......@@ -254,6 +255,7 @@ test "vector cmp f32" {
254255 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
255256 if (builtin.cpu.arch.isArm()) return error.SkipZigTest;
256257 if (builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest;
258 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
257259
258260 try testCmpVector(f32);
259261 try comptime testCmpVector(f32);
......@@ -266,6 +268,7 @@ test "vector cmp f64" {
266268 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
267269 if (builtin.cpu.arch.isArm()) return error.SkipZigTest;
268270 if (builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest;
271 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
269272
270273 try testCmpVector(f64);
271274 try comptime testCmpVector(f64);
......@@ -281,6 +284,7 @@ test "vector cmp f128" {
281284 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
282285 if (builtin.cpu.arch.isArm()) return error.SkipZigTest;
283286 if (builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest;
287 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
284288
285289 try testCmpVector(f128);
286290 try comptime testCmpVector(f128);
test/behavior/math.zig+1
......@@ -1899,6 +1899,7 @@ test "partially-runtime integer vector division would be illegal if vector eleme
18991899 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
19001900 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
19011901 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1902 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
19021903
19031904 var lhs: @Vector(2, i8) = .{ -128, 5 };
19041905 const rhs: @Vector(2, i8) = .{ 1, -1 };
test/behavior/select.zig+1
......@@ -71,6 +71,7 @@ test "@select compare result" {
7171 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
7272 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
7373 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
74 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
7475
7576 const S = struct {
7677 fn min(comptime V: type, lhs: V, rhs: V) V {
test/tests.zig+20
......@@ -497,6 +497,26 @@ const test_targets = blk: {
497497 .pic = false, // Long calls don't work with PIC.
498498 },
499499
500 .{
501 .target = .{
502 .cpu_arch = .hexagon,
503 .os_tag = .linux,
504 .abi = .none,
505 },
506 // https://github.com/llvm/llvm-project/pull/111217
507 .skip_modules = &.{"std"},
508 },
509 .{
510 .target = .{
511 .cpu_arch = .hexagon,
512 .os_tag = .linux,
513 .abi = .musl,
514 },
515 .link_libc = true,
516 // https://github.com/llvm/llvm-project/pull/111217
517 .skip_modules = &.{"std"},
518 },
519
500520 .{
501521 .target = .{
502522 .cpu_arch = .loongarch64,
tools/gen_stubs.zig+7
......@@ -6,6 +6,7 @@
66//! * aarch64
77//! * arm
88//! * i386
9//! * hexagon
910//! * loongarch64
1011//! * mips
1112//! * mips64
......@@ -27,6 +28,7 @@
2728//! - `-DARCH_aarch64`
2829//! - `-DARCH_arm`
2930//! - `-DARCH_i386`
31//! - `-DARCH_hexagon`
3032//! - `-DARCH_loongarch64`
3133//! - `-DARCH_mips`
3234//! - `-DARCH_mips64`
......@@ -41,6 +43,7 @@
4143//! * One of the following, corresponding to the CPU architecture family:
4244//! - `-DFAMILY_aarch64`
4345//! - `-DFAMILY_arm`
46//! - `-DFAMILY_hexagon`
4447//! - `-DFAMILY_loongarch`
4548//! - `-DFAMILY_mips`
4649//! - `-DFAMILY_powerpc`
......@@ -63,6 +66,7 @@ const Arch = enum {
6366 aarch64,
6467 arm,
6568 i386,
69 hexagon,
6670 loongarch64,
6771 mips,
6872 mips64,
......@@ -77,6 +81,7 @@ const Arch = enum {
7781 pub fn ptrSize(arch: Arch) u16 {
7882 return switch (arch) {
7983 .arm,
84 .hexagon,
8085 .i386,
8186 .mips,
8287 .mipsn32,
......@@ -112,6 +117,7 @@ const Arch = enum {
112117 .aarch64 => .aarch64,
113118 .arm => .arm,
114119 .i386, .x86_64 => .x86,
120 .hexagon => .hexagon,
115121 .loongarch64 => .loongarch,
116122 .mips, .mips64, .mipsn32 => .mips,
117123 .powerpc, .powerpc64 => .powerpc,
......@@ -124,6 +130,7 @@ const Arch = enum {
124130const Family = enum {
125131 aarch64,
126132 arm,
133 hexagon,
127134 loongarch,
128135 mips,
129136 powerpc,
tools/process_headers.zig+1
......@@ -60,6 +60,7 @@ const glibc_targets = [_]LibCTarget{
6060const musl_targets = [_]LibCTarget{
6161 .{ .arch = .arm, .abi = .musl },
6262 .{ .arch = .aarch64, .abi = .musl },
63 .{ .arch = .hexagon, .abi = .musl },
6364 .{ .arch = .loongarch64, .abi = .musl },
6465 .{ .arch = .m68k, .abi = .musl },
6566 .{ .arch = .mips, .abi = .musl },